[
  {
    "path": ".gitignore",
    "content": ".DS_Store\n\nnode_modules\nnpm-debug.log\n\n/test/core.out.js\n"
  },
  {
    "path": "Gruntfile.js",
    "content": "module.exports = function(grunt) {\n  grunt.initConfig({\n    mochaTest: {\n      test: {\n        options: {\n          reporter: 'spec'\n        },\n        src: 'test/**/*.out.js'\n      }\n    }\n  });\n\n  grunt.registerTask('build', function() {\n    //var macro = '';\n    //var files = ['ki.sjs','react.sjs','core.sjs'];\n    //files.forEach(function(f) { macro += grunt.file.read('./src/' + f) + '\\n'; });\n    // TODO: add filenames of macro files as arguments\n    var macro = grunt.file.read('./src/ki.sjs');\n    grunt.file.write('./macros/index.js', macro);\n    grunt.file.write('./editor/scripts/ki.sjs', macro);\n    var lib = grunt.file.read('./lib/ki.js');\n    grunt.file.write('./editor/scripts/ki.js', lib);\n  });\n\n  grunt.registerTask('build-test', function() {\n    var path = require('path');\n    var files = ['./test/core.js'];\n    files.forEach(function(f) {\n      grunt.file.write(f.replace('.js', '.out.js'), compileFile(f, true));\n    });\n  });\n\n  //grunt.registerTask('compile', function(fileName) {\n  //  console.log(this.data);\n  //  grunt.log.write(compileFile(fileName));\n  //});\n\n  var moduleCtx;\n\n  function compileFile(fileName, isTest) {\n    var macro = grunt.file.read('./macros/index.js');\n    var file  = grunt.file.read(fileName);\n    var sweet = require('sweet.js');\n\n    if (!moduleCtx) moduleCtx = sweet.loadModule(macro);\n\n    return sweet.compile(file, {\n      modules: [moduleCtx]\n    }).code;\n  }\n\n  var parseMacros = function(code) {\n    var re = /ki *macro/\n    \n    var current = code;\n    var start = current.search(re);\n    var ret;\n    var macros = [];\n    while (start != -1) {\n      current = current.substr(start);\n      ret = getNSExprs(current,2);\n      macros.push(ret.matches);\n      current = current.substr(ret.end);\n      start = current.search(re);\n    }\n    \n    var rules = macros.map(function(macro) { \n      return 'rule { ' + macro[0] + ' } => { _sexpr ' + macro[1] + ' }' \n    });\n\n    return rules.join('\\n');\n  }\n\n  grunt.registerTask('compile', function() {\n  \n    var path = require('path');\n    var sweet = require('sweet.js');\n    var uglify = require('uglify-js');\n\n    var infile    = grunt.option('in');\n    var outfile   = grunt.option('out');\n    var sourcemap = grunt.option('sourcemap') || false;\n    var minify    = grunt.option('minify') || false;\n    var compress  = grunt.option('compress') || false;\n  \n    var file;\n    if (infile) {\n      file = grunt.file.read(infile);\n    } \n    else if (argv._.length === 0) {\n      console.log(require(\"optimist\").help());\n      return;\n    }\n  \n    var ki_core = grunt.file.read('./macros/index.js');    \n\n    var include = grunt.option('include');\n    var includes = typeof include === 'string' ? [include] : include;\n    var includeFiles = (includes || []).map(function(path) {\n      return grunt.file.read(path);\n    });\n  \n    var rules = includeFiles.map(function(includeFile) {\n      return parseMacros(includeFile);\n    });\n    rules.push(parseMacros(file));\n  \n    var module = ki_core.replace('/*__macros__*/',rules.join('\\n'));\n  \n    var options = {\n      filename: infile,\n      modules: [sweet.loadModule(module)]\n    };\n  \n    var compile = function(file) {\n      var file = includeFiles.join('\\n') + file;\n      if (sourcemap && outfile) {\n        options.sourceMap = true;\n        var result = sweet.compile(file, options);\n        var mapfile = path.basename(outfile) + '.map';\n        var code = result.code + '\\n//# sourceMappingURL=' + mapfile;\n        var sourceMap = result.sourceMap;\n        var mapfile = outfile + '.map';\n        var tmpfile = outfile + '.tmp';\n        if (minify) {\n          grunt.file.write(tmpfile, sourceMap);\n          result = uglify.minify(code, {\n            fromString: true,\n            inSourceMap: tmpfile,\n            outSourceMap: mapfile,\n            compress: compress\n          });\n          code = result.code;\n          sourceMap = result.map;\n          grunt.file.delete(tmpfile);\n        }\n        grunt.file.write(outfile, code);\n        grunt.file.write(mapfile, sourceMap);\n      }\n      else if (outfile) {\n        var code = sweet.compile(file, options).code;\n        if (minify) {\n          code = uglify.minify(code, {fromString: true, compress: compress}).code;\n        }\n        grunt.file.write(outfile, code);\n      }\n      else {\n        var code = sweet.compile(file, options).code;\n        if (minify) {\n          code = uglify.minify(code, {fromString: true, compress: compress}).code;\n        }\n        console.log(code);\n      }\n    }\n  \n    try {\n      compile(file);\n    }\n    catch (e) {\n      console.log(e);\n    }\n  });\n\n  grunt.registerTask('default', ['build']);\n  grunt.registerTask('test', ['build', 'build-test', 'mochaTest']);\n  grunt.loadNpmTasks('grunt-mocha-test');\n};\n\n\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (C) 2014 Luca Antiga http://lantiga.github.io\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"
  },
  {
    "path": "README.md",
    "content": "\n# ki\n\n**lisp + mori, sweet.js**\n\n![ki](http://ki-lang.org/images/ki-color.svg)\n\nSee [ki-lang.org](http://ki-lang.org) for more information or [try ki](http://ki-lang.org/editor/editor.html) straight in your browser.\n\nki is a lisp with Clojure data structures and semantics that can be intermixed with Javascript code at any level.\n\nki is a thin macro layer on top of [mori](https://github.com/swannodette/mori) plus a few constructs.\n\nki is in flux, feel free to test it out but expect glitches.\n\n\n## Currently available functions / special forms\n\nAll of [mori](https://github.com/swannodette/mori).\n\nThe following list of functions / special forms\n```\n[] {} [$ ] {$ } add and apply atom bind catch chain cond def defmethod defmulti \ndefn deref div do doto eq falsey finally fn fnth geq gt if ifNot js leq letc \nlet lt loop mod mul neq nil not ns or prn recur reset str sub swap threadf \nthreadl truthy try use when whenNot while \n```\n\nPlus destructuring and source maps.\n\nTake a look at the [tests](https://github.com/lantiga/ki/blob/master/test/core.js) to keep up with the latest additions.\n\n## Examples\n\nRequire ki (this in turns expands into an appropriate require for mori)\n```\nki require core\n```\n\nMori's persistent data structures and Clojure(Script)-like api at your fingertips\n```js\nvar foo = ki (vector 1 2 3)\nki (conj foo 4)\n// => [1 2 3 4]\n```\n\nPlus lambdas\n```js\nki (map (fn [a] (inc a)) (range 5))\n// => (1 2 3 4 5)\n```\n\nInteroperability: write js in a ki form\n```js\nvar fn1 = ki (js function (a,b) { return a + b + 2; })\n```\nat any level - e.g. you can use infix where it makes sense\n```js\nvar fn2 = ki (fn [a b] (js a + b + 2))\n```\n\nand you can use ki wherever in js code\n```js\nfunction somefunc (a) {\n  ki (toJs (filter (fn [el] (isEven el)) (range a))).forEach(function(el) {\n      console.log(el);\n      });\n  return [0, 1, 2, 3, 4].filter(ki (fn [el] (isEven el)));\n}\nconsole.log(somefunc(5));\n// => 0 \n// => 2 \n// => 4 \n// [0 2 4]\n```\n\nLike a pro\n```js\nki (take 6 (map (fn [x] (js x * 2)) (range 1000)))\n// => (0 2 4 6 8 10)\n```\n\n\n## Get it\n\n    $ npm install -g ki\n\nAll set. Now to compile a JavaScript file containing ki code into a plain JavaScript file do\n\n    $ ki -o foo_build.js foo.js\n\nTo watch the file and have it automatically compiled whenever the file changes on disk\n\n    $ ki -w -o foo_build.js foo.js\n\n\n## License\n\nMIT license http://www.opensource.org/licenses/mit-license.php/\n\nCopyright (C) 2014-2015 Luca Antiga http://lantiga.github.io\n\n\n"
  },
  {
    "path": "bin/ki",
    "content": "#!/usr/bin/env node\n\nvar path = require('path');\nvar fs = require('fs');\nvar lib = path.join(path.dirname(fs.realpathSync(__filename)),'../lib');\n\nvar ret = require(lib + '/ki_run').run();\n\nif (ret != -1) {\n  process.exit(ret);\n}\n\n"
  },
  {
    "path": "editor/addon/runmode.js",
    "content": "CodeMirror.runMode = function(string, modespec, callback, options) {\n  var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);\n\n  if (callback.nodeType == 1) {\n    var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;\n    var node = callback, col = 0;\n    node.innerHTML = \"\";\n    callback = function(text, style) {\n      if (text == \"\\n\") {\n        node.appendChild(document.createElement(\"br\"));\n        col = 0;\n        return;\n      }\n      var content = \"\";\n      // replace tabs\n      for (var pos = 0;;) {\n        var idx = text.indexOf(\"\\t\", pos);\n        if (idx == -1) {\n          content += text.slice(pos);\n          col += text.length - pos;\n          break;\n        } else {\n          col += idx - pos;\n          content += text.slice(pos, idx);\n          var size = tabSize - col % tabSize;\n          col += size;\n          for (var i = 0; i < size; ++i) content += \" \";\n          pos = idx + 1;\n        }\n      }\n\n      if (style) {\n        var sp = node.appendChild(document.createElement(\"span\"));\n        sp.className = \"cm-\" + style.replace(/ +/g, \" cm-\");\n        sp.appendChild(document.createTextNode(content));\n      } else {\n        node.appendChild(document.createTextNode(content));\n      }\n    };\n  }\n\n  var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);\n  for (var i = 0, e = lines.length; i < e; ++i) {\n    if (i) callback(\"\\n\");\n    var stream = new CodeMirror.StringStream(lines[i]);\n    while (!stream.eol()) {\n      var style = mode.token(stream, state);\n      callback(stream.current(), style, i, stream.start);\n      stream.start = stream.pos;\n    }\n  }\n};\n"
  },
  {
    "path": "editor/codemirror.css",
    "content": "/* BASICS */\n\n.CodeMirror {\n  /* Set height, width, borders, and global font properties here */\n  font-family: monospace;\n  height: 300px;\n}\n.CodeMirror-scroll {\n  /* Set scrolling behaviour here */\n  overflow: auto;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n  padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre {\n  padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n  background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n  border-right: 1px solid #ddd;\n  background-color: #f7f7f7;\n  white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n  padding: 0 3px 0 5px;\n  min-width: 20px;\n  text-align: right;\n  color: #999;\n}\n\n/* CURSOR */\n\n.CodeMirror div.CodeMirror-cursor {\n  border-left: 1px solid black;\n  z-index: 3;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n  border-left: 1px solid silver;\n}\n.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {\n  width: auto;\n  border: 0;\n  background: #7e7;\n  z-index: 1;\n}\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}\n\n.cm-tab { display: inline-block; }\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable {color: black;}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3 {color: #085;}\n.cm-s-default .cm-property {color: black;}\n.cm-s-default .cm-operator {color: black;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-error {color: #f00;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n\n.cm-invalidchar {color: #f00;}\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n   the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n  line-height: 1;\n  position: relative;\n  overflow: hidden;\n  background: white;\n  color: black;\n}\n\n.CodeMirror-scroll {\n  /* 30px is the magic margin used to hide the element's real scrollbars */\n  /* See overflow: hidden in .CodeMirror */\n  margin-bottom: -30px; margin-right: -30px;\n  padding-bottom: 30px; padding-right: 30px;\n  height: 100%;\n  outline: none; /* Prevent dragging from highlighting the element */\n  position: relative;\n}\n.CodeMirror-sizer {\n  position: relative;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n   before actuall scrolling happens, thus preventing shaking and\n   flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n  position: absolute;\n  z-index: 6;\n  display: none;\n}\n.CodeMirror-vscrollbar {\n  right: 0; top: 0;\n  overflow-x: hidden;\n  overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n  bottom: 0; left: 0;\n  overflow-y: hidden;\n  overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n  right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n  left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n  position: absolute; left: 0; top: 0;\n  padding-bottom: 30px;\n  z-index: 3;\n}\n.CodeMirror-gutter {\n  white-space: normal;\n  height: 100%;\n  padding-bottom: 30px;\n  margin-bottom: -32px;\n  display: inline-block;\n  /* Hack to make IE7 behave */\n  *zoom:1;\n  *display:inline;\n}\n.CodeMirror-gutter-elt {\n  position: absolute;\n  cursor: default;\n  z-index: 4;\n}\n\n.CodeMirror-lines {\n  cursor: text;\n}\n.CodeMirror pre {\n  /* Reset some styles that the rest of the page might have set */\n  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n  border-width: 0;\n  background: transparent;\n  font-family: inherit;\n  font-size: inherit;\n  margin: 0;\n  white-space: pre;\n  word-wrap: normal;\n  line-height: inherit;\n  color: inherit;\n  z-index: 2;\n  position: relative;\n  overflow: visible;\n}\n.CodeMirror-wrap pre {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  word-break: normal;\n}\n.CodeMirror-linebackground {\n  position: absolute;\n  left: 0; right: 0; top: 0; bottom: 0;\n  z-index: 0;\n}\n\n.CodeMirror-linewidget {\n  position: relative;\n  z-index: 2;\n  overflow: auto;\n}\n\n.CodeMirror-widget {\n}\n\n.CodeMirror-wrap .CodeMirror-scroll {\n  overflow-x: hidden;\n}\n\n.CodeMirror-measure {\n  position: absolute;\n  width: 100%; height: 0px;\n  overflow: hidden;\n  visibility: hidden;\n}\n.CodeMirror-measure pre { position: static; }\n\n.CodeMirror div.CodeMirror-cursor {\n  position: absolute;\n  visibility: hidden;\n  border-right: none;\n  width: 0;\n}\n.CodeMirror-focused div.CodeMirror-cursor {\n  visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n\n.cm-searching {\n  background: #ffa;\n  background: rgba(255, 255, 0, .4);\n}\n\n/* IE7 hack to prevent it from returning funny offsetTops on the spans */\n.CodeMirror span { *vertical-align: text-bottom; }\n\n@media print {\n  /* Hide the cursor when printing */\n  .CodeMirror div.CodeMirror-cursor {\n    visibility: hidden;\n  }\n}\n"
  },
  {
    "path": "editor/editor.html",
    "content": "<html>\n<head>\n  <meta charset=\"utf-8\">\n  <title>Try ki</title>\n  <script src=\"scripts/jquery.js\"></script>\n  <script src=\"scripts/codemirror.js\"></script>\n  <link rel=\"stylesheet\" href=\"codemirror.css\">\n  <link rel=\"stylesheet\" href=\"theme/sweetprism.css\">\n  <script src=\"mode/javascript/javascript.js\"></script>\n  \n  <link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono|Open+Sans:400italic,400' rel='stylesheet' type='text/css'>\n  <link href='http://fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>\n  <script data-main=\"scripts/editor\" src=\"scripts/require.js\"></script>\n\n <style type=\"text/css\">\n body {\n  font-family: Droid Sans, Arial, sans-serif;\n  line-height: 1.5;\n  /*max-width: 64.3em;*/\n  }\n  .CodeMirror {\n    font-size: 14px;\n    height: 100%;\n  }\n\n  #options {\n    position: absolute;\n    font-size: 14px;\n    font-family: Droid Sans, Arial, sans-serif;\n    line-height: 1.5;\n    top: 10px;\n    right: 40px;\n    z-index: 1;\n  }\n\n  #header {\n    position: absolute;\n    top: 0;\n    right: 50%;\n    bottom: 0;\n    left: 0;\n\n    font-size: 150%;\n    color: rgb(68, 68, 68);\n    font-family: 'Droid Sans Mono',Helvetica Neue,Helvetica,Arial,sans-serif;\n    font-weight: 100;\n    padding-left: 20px;\n  }\n\n  #controls {\n    position: absolute;;\n    top: 5;\n    right: 0;\n    bottom: 0;\n    left: 50%;\n  }\n\n  #return {\n    color: blue;\n    position: absolute;\n    background-color: white;\n    /*right: 10;*/\n    z-index: 10;\n    bottom: 10;\n    /*left: 50%;*/\n    /*padding-top: 20px;*/\n    /*padding-left: 55px;*/\n    padding: 10px;\n  }\n\n  #errors {\n    color: red;\n    position: absolute;\n    background-color: white;\n    /*right: 10;*/\n    z-index: 10;\n    bottom: 10;\n    /*left: 50%;*/\n    /*padding-top: 20px;*/\n    /*padding-left: 55px;*/\n    padding: 10px;\n  }\n\n  #edit-box {\n    position: absolute;\n    top: 30px;\n    right: 50%;\n    bottom: 0;\n    left: 0;\n  }\n\n  #output-box {\n    position: absolute;\n    top: 30px;\n    right: 0;\n    bottom: 0;\n    left: 50%;\n  }\n\n  </style>\n</head>\n<body>\n\n  <div id='header'>\n     Try ki: a lisp for your JavaScript\n  </div>\n  \n  <div id=\"controls\">\n    <input id=\"btn-reload-macros\" type=\"button\" value=\"Reload macros\" />\n    <input id=\"btn-run\" type=\"button\" value=\"Run (Ctrl+Enter)\" />\n    <input id=\"ck-require\" type=\"checkbox\" value=\"require\" />Display require expansion\n  </div>\n\n  <pre id=\"errors\">\n  </pre>\n \n  <pre id=\"return\">\n  </pre>\n  \n  <div id='edit-box' style='visibility: hidden;'>\n    <textarea id=\"editor\">/*\nWelcome to ki! \n\nHere's some code to get you started\n*/\n\nki require core\n\nvar r = ki (range 1 10);\n\nreturn r;\n    \n    </textarea>\n  </div>\n  \n  <div id='output-box' style='visibility: hidden;'>\n    <textarea id=\"output\"></textarea>\n  </div>\n\n</body>\n</html>\n"
  },
  {
    "path": "editor/index.html",
    "content": "<html>\n  <head>\n    <script data-main=\"scripts/main\" src=\"scripts/require.js\"></script>\n  </head>\n  <body>\n  </body>\n</html>\n"
  },
  {
    "path": "editor/mode/javascript/javascript.js",
    "content": "// TODO actually recognize syntax of TypeScript constructs\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n  var indentUnit = config.indentUnit;\n  var jsonMode = parserConfig.json;\n  var isTS = parserConfig.typescript;\n\n  // Tokenizer\n\n  var keywords = function(){\n    function kw(type) {return {type: type, style: \"keyword\"};}\n    var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\");\n    var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n    \n    var jsKeywords = {\n      \"if\": A, \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n      \"return\": C, \"break\": C, \"continue\": C, \"new\": C, \"delete\": C, \"throw\": C,\n      \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n      \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n      \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n      \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n      \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom\n    };\n\n    // Extend the 'normal' keywords with the TypeScript language extensions\n    if (isTS) {\n      var type = {type: \"variable\", style: \"variable-3\"};\n      var tsKeywords = {\n        // object-like things\n        \"interface\": kw(\"interface\"),\n        \"class\": kw(\"class\"),\n        \"extends\": kw(\"extends\"),\n        \"constructor\": kw(\"constructor\"),\n\n        // scope modifiers\n        \"public\": kw(\"public\"),\n        \"private\": kw(\"private\"),\n        \"protected\": kw(\"protected\"),\n        \"static\": kw(\"static\"),\n\n        \"super\": kw(\"super\"),\n\n        // types\n        \"string\": type, \"number\": type, \"bool\": type, \"any\": type\n      };\n\n      for (var attr in tsKeywords) {\n        jsKeywords[attr] = tsKeywords[attr];\n      }\n    }\n\n    return jsKeywords;\n  }();\n\n  var isOperatorChar = /[+\\-*&%=<>!?|]/;\n\n  function chain(stream, state, f) {\n    state.tokenize = f;\n    return f(stream, state);\n  }\n\n  function nextUntilUnescaped(stream, end) {\n    var escaped = false, next;\n    while ((next = stream.next()) != null) {\n      if (next == end && !escaped)\n        return false;\n      escaped = !escaped && next == \"\\\\\";\n    }\n    return escaped;\n  }\n\n  // Used as scratch variables to communicate multiple values without\n  // consing up tons of objects.\n  var type, content;\n  function ret(tp, style, cont) {\n    type = tp; content = cont;\n    return style;\n  }\n\n  function jsTokenBase(stream, state) {\n    var ch = stream.next();\n    if (ch == '\"' || ch == \"'\")\n      return chain(stream, state, jsTokenString(ch));\n    else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch))\n      return ret(ch);\n    else if (ch == \"0\" && stream.eat(/x/i)) {\n      stream.eatWhile(/[\\da-f]/i);\n      return ret(\"number\", \"number\");\n    }      \n    else if (/\\d/.test(ch) || ch == \"-\" && stream.eat(/\\d/)) {\n      stream.match(/^\\d*(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/);\n      return ret(\"number\", \"number\");\n    }\n    else if (ch == \"/\") {\n      if (stream.eat(\"*\")) {\n        return chain(stream, state, jsTokenComment);\n      }\n      else if (stream.eat(\"/\")) {\n        stream.skipToEnd();\n        return ret(\"comment\", \"comment\");\n      }\n      else if (state.lastType == \"operator\" || state.lastType == \"keyword c\" ||\n               /^[\\[{}\\(,;:]$/.test(state.lastType)) {\n        nextUntilUnescaped(stream, \"/\");\n        stream.eatWhile(/[gimy]/); // 'y' is \"sticky\" option in Mozilla\n        return ret(\"regexp\", \"string-2\");\n      }\n      else {\n        stream.eatWhile(isOperatorChar);\n        return ret(\"operator\", null, stream.current());\n      }\n    }\n    else if (ch == \"#\") {\n        stream.skipToEnd();\n        return ret(\"error\", \"error\");\n    }\n    else if (isOperatorChar.test(ch)) {\n      stream.eatWhile(isOperatorChar);\n      return ret(\"operator\", null, stream.current());\n    }\n    else {\n      stream.eatWhile(/[\\w\\$_]/);\n      var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];\n      return (known && state.lastType != \".\") ? ret(known.type, known.style, word) :\n                     ret(\"variable\", \"variable\", word);\n    }\n  }\n\n  function jsTokenString(quote) {\n    return function(stream, state) {\n      if (!nextUntilUnescaped(stream, quote))\n        state.tokenize = jsTokenBase;\n      return ret(\"string\", \"string\");\n    };\n  }\n\n  function jsTokenComment(stream, state) {\n    var maybeEnd = false, ch;\n    while (ch = stream.next()) {\n      if (ch == \"/\" && maybeEnd) {\n        state.tokenize = jsTokenBase;\n        break;\n      }\n      maybeEnd = (ch == \"*\");\n    }\n    return ret(\"comment\", \"comment\");\n  }\n\n  // Parser\n\n  var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true, \"regexp\": true};\n\n  function JSLexical(indented, column, type, align, prev, info) {\n    this.indented = indented;\n    this.column = column;\n    this.type = type;\n    this.prev = prev;\n    this.info = info;\n    if (align != null) this.align = align;\n  }\n\n  function inScope(state, varname) {\n    for (var v = state.localVars; v; v = v.next)\n      if (v.name == varname) return true;\n  }\n\n  function parseJS(state, style, type, content, stream) {\n    var cc = state.cc;\n    // Communicate our context to the combinators.\n    // (Less wasteful than consing up a hundred closures on every call.)\n    cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;\n  \n    if (!state.lexical.hasOwnProperty(\"align\"))\n      state.lexical.align = true;\n\n    while(true) {\n      var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n      if (combinator(type, content)) {\n        while(cc.length && cc[cc.length - 1].lex)\n          cc.pop()();\n        if (cx.marked) return cx.marked;\n        if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n        return style;\n      }\n    }\n  }\n\n  // Combinator utils\n\n  var cx = {state: null, column: null, marked: null, cc: null};\n  function pass() {\n    for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n  }\n  function cont() {\n    pass.apply(null, arguments);\n    return true;\n  }\n  function register(varname) {\n    var state = cx.state;\n    if (state.context) {\n      cx.marked = \"def\";\n      for (var v = state.localVars; v; v = v.next)\n        if (v.name == varname) return;\n      state.localVars = {name: varname, next: state.localVars};\n    }\n  }\n\n  // Combinators\n\n  var defaultVars = {name: \"this\", next: {name: \"arguments\"}};\n  function pushcontext() {\n    cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};\n    cx.state.localVars = defaultVars;\n  }\n  function popcontext() {\n    cx.state.localVars = cx.state.context.vars;\n    cx.state.context = cx.state.context.prev;\n  }\n  function pushlex(type, info) {\n    var result = function() {\n      var state = cx.state;\n      state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);\n    };\n    result.lex = true;\n    return result;\n  }\n  function poplex() {\n    var state = cx.state;\n    if (state.lexical.prev) {\n      if (state.lexical.type == \")\")\n        state.indented = state.lexical.indented;\n      state.lexical = state.lexical.prev;\n    }\n  }\n  poplex.lex = true;\n\n  function expect(wanted) {\n    return function expecting(type) {\n      if (type == wanted) return cont();\n      else if (wanted == \";\") return pass();\n      else return cont(arguments.callee);\n    };\n  }\n\n  function statement(type) {\n    if (type == \"var\") return cont(pushlex(\"vardef\"), vardef1, expect(\";\"), poplex);\n    if (type == \"keyword a\") return cont(pushlex(\"form\"), expression, statement, poplex);\n    if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n    if (type == \"{\") return cont(pushlex(\"}\"), block, poplex);\n    if (type == \";\") return cont();\n    if (type == \"function\") return cont(functiondef);\n    if (type == \"for\") return cont(pushlex(\"form\"), expect(\"(\"), pushlex(\")\"), forspec1, expect(\")\"),\n                                      poplex, statement, poplex);\n    if (type == \"variable\") return cont(pushlex(\"stat\"), maybelabel);\n    if (type == \"switch\") return cont(pushlex(\"form\"), expression, pushlex(\"}\", \"switch\"), expect(\"{\"),\n                                         block, poplex, poplex);\n    if (type == \"case\") return cont(expression, expect(\":\"));\n    if (type == \"default\") return cont(expect(\":\"));\n    if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, expect(\"(\"), funarg, expect(\")\"),\n                                        statement, poplex, popcontext);\n    return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n  }\n  function expression(type) {\n    if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);\n    if (type == \"function\") return cont(functiondef);\n    if (type == \"keyword c\") return cont(maybeexpression);\n    if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeoperator);\n    if (type == \"operator\") return cont(expression);\n    if (type == \"[\") return cont(pushlex(\"]\"), commasep(expression, \"]\"), poplex, maybeoperator);\n    if (type == \"{\") return cont(pushlex(\"}\"), commasep(objprop, \"}\"), poplex, maybeoperator);\n    return cont();\n  }\n  function maybeexpression(type) {\n    if (type.match(/[;\\}\\)\\],]/)) return pass();\n    return pass(expression);\n  }\n    \n  function maybeoperator(type, value) {\n    if (type == \"operator\" && /\\+\\+|--/.test(value)) return cont(maybeoperator);\n    if (type == \"operator\" && value == \"?\") return cont(expression, expect(\":\"), expression);\n    if (type == \";\") return;\n    if (type == \"(\") return cont(pushlex(\")\"), commasep(expression, \")\"), poplex, maybeoperator);\n    if (type == \".\") return cont(property, maybeoperator);\n    if (type == \"[\") return cont(pushlex(\"]\"), expression, expect(\"]\"), poplex, maybeoperator);\n  }\n  function maybelabel(type) {\n    if (type == \":\") return cont(poplex, statement);\n    return pass(maybeoperator, expect(\";\"), poplex);\n  }\n  function property(type) {\n    if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n  }\n  function objprop(type) {\n    if (type == \"variable\") cx.marked = \"property\";\n    if (atomicTypes.hasOwnProperty(type)) return cont(expect(\":\"), expression);\n  }\n  function commasep(what, end) {\n    function proceed(type) {\n      if (type == \",\") return cont(what, proceed);\n      if (type == end) return cont();\n      return cont(expect(end));\n    }\n    return function commaSeparated(type) {\n      if (type == end) return cont();\n      else return pass(what, proceed);\n    };\n  }\n  function block(type) {\n    if (type == \"}\") return cont();\n    return pass(statement, block);\n  }\n  function maybetype(type) {\n    if (type == \":\") return cont(typedef);\n    return pass();\n  }\n  function typedef(type) {\n    if (type == \"variable\"){cx.marked = \"variable-3\"; return cont();}\n    return pass();\n  }\n  function vardef1(type, value) {\n    if (type == \"variable\") {\n      register(value);\n      return isTS ? cont(maybetype, vardef2) : cont(vardef2);\n    }\n    return pass();\n  }\n  function vardef2(type, value) {\n    if (value == \"=\") return cont(expression, vardef2);\n    if (type == \",\") return cont(vardef1);\n  }\n  function forspec1(type) {\n    if (type == \"var\") return cont(vardef1, expect(\";\"), forspec2);\n    if (type == \";\") return cont(forspec2);\n    if (type == \"variable\") return cont(formaybein);\n    return cont(forspec2);\n  }\n  function formaybein(_type, value) {\n    if (value == \"in\") return cont(expression);\n    return cont(maybeoperator, forspec2);\n  }\n  function forspec2(type, value) {\n    if (type == \";\") return cont(forspec3);\n    if (value == \"in\") return cont(expression);\n    return cont(expression, expect(\";\"), forspec3);\n  }\n  function forspec3(type) {\n    if (type != \")\") cont(expression);\n  }\n  function functiondef(type, value) {\n    if (type == \"variable\") {register(value); return cont(functiondef);}\n    if (type == \"(\") return cont(pushlex(\")\"), pushcontext, commasep(funarg, \")\"), poplex, statement, popcontext);\n  }\n  function funarg(type, value) {\n    if (type == \"variable\") {register(value); return isTS ? cont(maybetype) : cont();}\n  }\n\n  // Interface\n\n  return {\n    startState: function(basecolumn) {\n      return {\n        tokenize: jsTokenBase,\n        lastType: null,\n        cc: [],\n        lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n        localVars: parserConfig.localVars,\n        context: parserConfig.localVars && {vars: parserConfig.localVars},\n        indented: 0\n      };\n    },\n\n    token: function(stream, state) {\n      if (stream.sol()) {\n        if (!state.lexical.hasOwnProperty(\"align\"))\n          state.lexical.align = false;\n        state.indented = stream.indentation();\n      }\n      if (stream.eatSpace()) return null;\n      var style = state.tokenize(stream, state);\n      if (type == \"comment\") return style;\n      state.lastType = type;\n      return parseJS(state, style, type, content, stream);\n    },\n\n    indent: function(state, textAfter) {\n      if (state.tokenize == jsTokenComment) return CodeMirror.Pass;\n      if (state.tokenize != jsTokenBase) return 0;\n      var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;\n      if (lexical.type == \"stat\" && firstChar == \"}\") lexical = lexical.prev;\n      var type = lexical.type, closing = firstChar == type;\n      if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? 4 : 0);\n      else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n      else if (type == \"form\") return lexical.indented + indentUnit;\n      else if (type == \"stat\")\n        return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? indentUnit : 0);\n      else if (lexical.info == \"switch\" && !closing)\n        return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n      else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n      else return lexical.indented + (closing ? 0 : indentUnit);\n    },\n\n    electricChars: \":{}\",\n\n    jsonMode: jsonMode\n  };\n});\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", {name: \"javascript\", json: true});\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n"
  },
  {
    "path": "editor/mode/runmode.js",
    "content": "CodeMirror.runMode = function(string, modespec, callback, options) {\n  var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);\n\n  if (callback.nodeType == 1) {\n    var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;\n    var node = callback, col = 0;\n    node.innerHTML = \"\";\n    callback = function(text, style) {\n      if (text == \"\\n\") {\n        node.appendChild(document.createElement(\"br\"));\n        col = 0;\n        return;\n      }\n      var content = \"\";\n      // replace tabs\n      for (var pos = 0;;) {\n        var idx = text.indexOf(\"\\t\", pos);\n        if (idx == -1) {\n          content += text.slice(pos);\n          col += text.length - pos;\n          break;\n        } else {\n          col += idx - pos;\n          content += text.slice(pos, idx);\n          var size = tabSize - col % tabSize;\n          col += size;\n          for (var i = 0; i < size; ++i) content += \" \";\n          pos = idx + 1;\n        }\n      }\n\n      if (style) {\n        var sp = node.appendChild(document.createElement(\"span\"));\n        sp.className = \"cm-\" + style.replace(/ +/g, \" cm-\");\n        sp.appendChild(document.createTextNode(content));\n      } else {\n        node.appendChild(document.createTextNode(content));\n      }\n    };\n  }\n\n  var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);\n  for (var i = 0, e = lines.length; i < e; ++i) {\n    if (i) callback(\"\\n\");\n    var stream = new CodeMirror.StringStream(lines[i]);\n    while (!stream.eol()) {\n      var style = mode.token(stream, state);\n      callback(stream.current(), style, i, stream.start);\n      stream.start = stream.pos;\n    }\n  }\n};\n"
  },
  {
    "path": "editor/scripts/codemirror.js",
    "content": "// CodeMirror version 3.14\n//\n// CodeMirror is the only global var we claim\nwindow.CodeMirror = (function() {\n  \"use strict\";\n\n  // BROWSER SNIFFING\n\n  // Crude, but necessary to handle a number of hard-to-feature-detect\n  // bugs and behavior differences.\n  var gecko = /gecko\\/\\d/i.test(navigator.userAgent);\n  var ie = /MSIE \\d/.test(navigator.userAgent);\n  var ie_lt8 = ie && (document.documentMode == null || document.documentMode < 8);\n  var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);\n  var webkit = /WebKit\\//.test(navigator.userAgent);\n  var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(navigator.userAgent);\n  var chrome = /Chrome\\//.test(navigator.userAgent);\n  var opera = /Opera\\//.test(navigator.userAgent);\n  var safari = /Apple Computer/.test(navigator.vendor);\n  var khtml = /KHTML\\//.test(navigator.userAgent);\n  var mac_geLion = /Mac OS X 1\\d\\D([7-9]|\\d\\d)\\D/.test(navigator.userAgent);\n  var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(navigator.userAgent);\n  var phantom = /PhantomJS/.test(navigator.userAgent);\n\n  var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\\/\\w+/.test(navigator.userAgent);\n  // This is woefully incomplete. Suggestions for alternative methods welcome.\n  var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);\n  var mac = ios || /Mac/.test(navigator.platform);\n  var windows = /windows/i.test(navigator.platform);\n\n  var opera_version = opera && navigator.userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n  if (opera_version) opera_version = Number(opera_version[1]);\n  // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n  var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11));\n  var captureMiddleClick = gecko || (ie && !ie_lt9);\n\n  // Optimize some code when these features are not used\n  var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n  // CONSTRUCTOR\n\n  function CodeMirror(place, options) {\n    if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);\n\n    this.options = options = options || {};\n    // Determine effective options based on given values and defaults.\n    for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt))\n      options[opt] = defaults[opt];\n    setGuttersForLineNumbers(options);\n\n    var docStart = typeof options.value == \"string\" ? 0 : options.value.first;\n    var display = this.display = makeDisplay(place, docStart);\n    display.wrapper.CodeMirror = this;\n    updateGutters(this);\n    if (options.autofocus && !mobile) focusInput(this);\n\n    this.state = {keyMaps: [],\n                  overlays: [],\n                  modeGen: 0,\n                  overwrite: false, focused: false,\n                  suppressEdits: false, pasteIncoming: false,\n                  draggingText: false,\n                  highlight: new Delayed()};\n\n    themeChanged(this);\n    if (options.lineWrapping)\n      this.display.wrapper.className += \" CodeMirror-wrap\";\n\n    var doc = options.value;\n    if (typeof doc == \"string\") doc = new Doc(options.value, options.mode);\n    operation(this, attachDoc)(this, doc);\n\n    // Override magic textarea content restore that IE sometimes does\n    // on our hidden textarea on reload\n    if (ie) setTimeout(bind(resetInput, this, true), 20);\n\n    registerEventHandlers(this);\n    // IE throws unspecified error in certain cases, when\n    // trying to access activeElement before onload\n    var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { }\n    if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20);\n    else onBlur(this);\n\n    operation(this, function() {\n      for (var opt in optionHandlers)\n        if (optionHandlers.propertyIsEnumerable(opt))\n          optionHandlers[opt](this, options[opt], Init);\n      for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);\n    })();\n  }\n\n  // DISPLAY CONSTRUCTOR\n\n  function makeDisplay(place, docStart) {\n    var d = {};\n\n    var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;\");\n    if (webkit) input.style.width = \"1000px\";\n    else input.setAttribute(\"wrap\", \"off\");\n    // if border: 0; -- iOS fails to open keyboard (issue #1287)\n    if (ios) input.style.border = \"1px solid black\";\n    input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n    // Wraps and hides input textarea\n    d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n    // The actual fake scrollbars.\n    d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 1px\")], \"CodeMirror-hscrollbar\");\n    d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"width: 1px\")], \"CodeMirror-vscrollbar\");\n    d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n    d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n    // DIVs containing the selection and the actual code\n    d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n    d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n    // Blinky cursor, and element used to ensure cursor fits at the end of a line\n    d.cursor = elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\");\n    // Secondary cursor, shown when on a 'jump' in bi-directional text\n    d.otherCursor = elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\");\n    // Used to measure text size\n    d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n    // Wraps everything that needs to exist inside the vertically-padded coordinate system\n    d.lineSpace = elt(\"div\", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor],\n                         null, \"position: relative; outline: none\");\n    // Moved around its parent to cover visible view\n    d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n    // Set to the height of the text, causes scrolling\n    d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n    // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers\n    d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n    // Will contain the gutters, if any\n    d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n    d.lineGutter = null;\n    // Provides scrolling\n    d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n    d.scroller.setAttribute(\"tabIndex\", \"-1\");\n    // The element in which the editor lives.\n    d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n                            d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n    // Work around IE7 z-index bug\n    if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n    if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper);\n\n    // Needed to hide big blue blinking cursor on Mobile Safari\n    if (ios) input.style.width = \"0px\";\n    if (!webkit) d.scroller.draggable = true;\n    // Needed to handle Tab key in KHTML\n    if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n    // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n    else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = \"18px\";\n\n    // Current visible range (may be bigger than the view window).\n    d.viewOffset = d.lastSizeC = 0;\n    d.showingFrom = d.showingTo = docStart;\n\n    // Used to only resize the line number gutter when necessary (when\n    // the amount of lines crosses a boundary that makes its width change)\n    d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n    // See readInput and resetInput\n    d.prevInput = \"\";\n    // Set to true when a non-horizontal-scrolling widget is added. As\n    // an optimization, widget aligning is skipped when d is false.\n    d.alignWidgets = false;\n    // Flag that indicates whether we currently expect input to appear\n    // (after some event like 'keypress' or 'input') and are polling\n    // intensively.\n    d.pollingFast = false;\n    // Self-resetting timeout for the poller\n    d.poll = new Delayed();\n\n    d.cachedCharWidth = d.cachedTextHeight = null;\n    d.measureLineCache = [];\n    d.measureLineCachePos = 0;\n\n    // Tracks when resetInput has punted to just putting a short\n    // string instead of the (large) selection.\n    d.inaccurateSelection = false;\n\n    // Tracks the maximum line length so that the horizontal scrollbar\n    // can be kept static when scrolling.\n    d.maxLine = null;\n    d.maxLineLength = 0;\n    d.maxLineChanged = false;\n\n    // Used for measuring wheel scrolling granularity\n    d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n    return d;\n  }\n\n  // STATE UPDATES\n\n  // Used to get the editor into a consistent state again when options change.\n\n  function loadMode(cm) {\n    cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n    cm.doc.iter(function(line) {\n      if (line.stateAfter) line.stateAfter = null;\n      if (line.styles) line.styles = null;\n    });\n    cm.doc.frontier = cm.doc.first;\n    startWorker(cm, 100);\n    cm.state.modeGen++;\n    if (cm.curOp) regChange(cm);\n  }\n\n  function wrappingChanged(cm) {\n    if (cm.options.lineWrapping) {\n      cm.display.wrapper.className += \" CodeMirror-wrap\";\n      cm.display.sizer.style.minWidth = \"\";\n    } else {\n      cm.display.wrapper.className = cm.display.wrapper.className.replace(\" CodeMirror-wrap\", \"\");\n      computeMaxLength(cm);\n    }\n    estimateLineHeights(cm);\n    regChange(cm);\n    clearCaches(cm);\n    setTimeout(function(){updateScrollbars(cm);}, 100);\n  }\n\n  function estimateHeight(cm) {\n    var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n    var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n    return function(line) {\n      if (lineIsHidden(cm.doc, line))\n        return 0;\n      else if (wrapping)\n        return (Math.ceil(line.text.length / perLine) || 1) * th;\n      else\n        return th;\n    };\n  }\n\n  function estimateLineHeights(cm) {\n    var doc = cm.doc, est = estimateHeight(cm);\n    doc.iter(function(line) {\n      var estHeight = est(line);\n      if (estHeight != line.height) updateLineHeight(line, estHeight);\n    });\n  }\n\n  function keyMapChanged(cm) {\n    var map = keyMap[cm.options.keyMap], style = map.style;\n    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-keymap-\\S+/g, \"\") +\n      (style ? \" cm-keymap-\" + style : \"\");\n    cm.state.disableInput = map.disableInput;\n  }\n\n  function themeChanged(cm) {\n    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n      cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n    clearCaches(cm);\n  }\n\n  function guttersChanged(cm) {\n    updateGutters(cm);\n    regChange(cm);\n    setTimeout(function(){alignHorizontally(cm);}, 20);\n  }\n\n  function updateGutters(cm) {\n    var gutters = cm.display.gutters, specs = cm.options.gutters;\n    removeChildren(gutters);\n    for (var i = 0; i < specs.length; ++i) {\n      var gutterClass = specs[i];\n      var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n      if (gutterClass == \"CodeMirror-linenumbers\") {\n        cm.display.lineGutter = gElt;\n        gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n      }\n    }\n    gutters.style.display = i ? \"\" : \"none\";\n  }\n\n  function lineLength(doc, line) {\n    if (line.height == 0) return 0;\n    var len = line.text.length, merged, cur = line;\n    while (merged = collapsedSpanAtStart(cur)) {\n      var found = merged.find();\n      cur = getLine(doc, found.from.line);\n      len += found.from.ch - found.to.ch;\n    }\n    cur = line;\n    while (merged = collapsedSpanAtEnd(cur)) {\n      var found = merged.find();\n      len -= cur.text.length - found.from.ch;\n      cur = getLine(doc, found.to.line);\n      len += cur.text.length - found.to.ch;\n    }\n    return len;\n  }\n\n  function computeMaxLength(cm) {\n    var d = cm.display, doc = cm.doc;\n    d.maxLine = getLine(doc, doc.first);\n    d.maxLineLength = lineLength(doc, d.maxLine);\n    d.maxLineChanged = true;\n    doc.iter(function(line) {\n      var len = lineLength(doc, line);\n      if (len > d.maxLineLength) {\n        d.maxLineLength = len;\n        d.maxLine = line;\n      }\n    });\n  }\n\n  // Make sure the gutters options contains the element\n  // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n  function setGuttersForLineNumbers(options) {\n    var found = false;\n    for (var i = 0; i < options.gutters.length; ++i) {\n      if (options.gutters[i] == \"CodeMirror-linenumbers\") {\n        if (options.lineNumbers) found = true;\n        else options.gutters.splice(i--, 1);\n      }\n    }\n    if (!found && options.lineNumbers)\n      options.gutters.push(\"CodeMirror-linenumbers\");\n  }\n\n  // SCROLLBARS\n\n  // Re-synchronize the fake scrollbars with the actual size of the\n  // content. Optionally force a scrollTop.\n  function updateScrollbars(cm) {\n    var d = cm.display, docHeight = cm.doc.height;\n    var totalHeight = docHeight + paddingVert(d);\n    d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n    d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n    var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n    var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n    var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n    if (needsV) {\n      d.scrollbarV.style.display = \"block\";\n      d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n      d.scrollbarV.firstChild.style.height =\n        (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n    } else d.scrollbarV.style.display = \"\";\n    if (needsH) {\n      d.scrollbarH.style.display = \"block\";\n      d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n      d.scrollbarH.firstChild.style.width =\n        (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n    } else d.scrollbarH.style.display = \"\";\n    if (needsH && needsV) {\n      d.scrollbarFiller.style.display = \"block\";\n      d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n    } else d.scrollbarFiller.style.display = \"\";\n    if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n      d.gutterFiller.style.display = \"block\";\n      d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n      d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n    } else d.gutterFiller.style.display = \"\";\n\n    if (mac_geLion && scrollbarWidth(d.measure) === 0)\n      d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n  }\n\n  function visibleLines(display, doc, viewPort) {\n    var top = display.scroller.scrollTop, height = display.wrapper.clientHeight;\n    if (typeof viewPort == \"number\") top = viewPort;\n    else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;}\n    top = Math.floor(top - paddingTop(display));\n    var bottom = Math.ceil(top + height);\n    return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)};\n  }\n\n  // LINE NUMBERS\n\n  function alignHorizontally(cm) {\n    var display = cm.display;\n    if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n    var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n    var gutterW = display.gutters.offsetWidth, l = comp + \"px\";\n    for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) {\n      for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l;\n    }\n    if (cm.options.fixedGutter)\n      display.gutters.style.left = (comp + gutterW) + \"px\";\n  }\n\n  function maybeUpdateLineNumberWidth(cm) {\n    if (!cm.options.lineNumbers) return false;\n    var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n    if (last.length != display.lineNumChars) {\n      var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n                                                 \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n      var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n      display.lineGutter.style.width = \"\";\n      display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n      display.lineNumWidth = display.lineNumInnerWidth + padding;\n      display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n      display.lineGutter.style.width = display.lineNumWidth + \"px\";\n      return true;\n    }\n    return false;\n  }\n\n  function lineNumberFor(options, i) {\n    return String(options.lineNumberFormatter(i + options.firstLineNumber));\n  }\n  function compensateForHScroll(display) {\n    return getRect(display.scroller).left - getRect(display.sizer).left;\n  }\n\n  // DISPLAY DRAWING\n\n  function updateDisplay(cm, changes, viewPort) {\n    var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo, updated;\n    var visible = visibleLines(cm.display, cm.doc, viewPort);\n    for (;;) {\n      if (!updateDisplayInner(cm, changes, visible)) break;\n      updated = true;\n      updateSelection(cm);\n      updateScrollbars(cm);\n\n      // Clip forced viewport to actual scrollable area\n      if (viewPort)\n        viewPort = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight,\n                            typeof viewPort == \"number\" ? viewPort : viewPort.top);\n      visible = visibleLines(cm.display, cm.doc, viewPort);\n      if (visible.from >= cm.display.showingFrom && visible.to <= cm.display.showingTo)\n        break;\n      changes = [];\n    }\n\n    if (updated) {\n      signalLater(cm, \"update\", cm);\n      if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo)\n        signalLater(cm, \"viewportChange\", cm, cm.display.showingFrom, cm.display.showingTo);\n    }\n    return updated;\n  }\n\n  // Uses a set of changes plus the current scroll position to\n  // determine which DOM updates have to be made, and makes the\n  // updates.\n  function updateDisplayInner(cm, changes, visible) {\n    var display = cm.display, doc = cm.doc;\n    if (!display.wrapper.clientWidth) {\n      display.showingFrom = display.showingTo = doc.first;\n      display.viewOffset = 0;\n      return;\n    }\n\n    // Bail out if the visible area is already rendered and nothing changed.\n    if (changes.length == 0 &&\n        visible.from > display.showingFrom && visible.to < display.showingTo)\n      return;\n\n    if (maybeUpdateLineNumberWidth(cm))\n      changes = [{from: doc.first, to: doc.first + doc.size}];\n    var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + \"px\";\n    display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : \"0\";\n\n    // Used to determine which lines need their line numbers updated\n    var positionsChangedFrom = Infinity;\n    if (cm.options.lineNumbers)\n      for (var i = 0; i < changes.length; ++i)\n        if (changes[i].diff) { positionsChangedFrom = changes[i].from; break; }\n\n    var end = doc.first + doc.size;\n    var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);\n    var to = Math.min(end, visible.to + cm.options.viewportMargin);\n    if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);\n    if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);\n    if (sawCollapsedSpans) {\n      from = lineNo(visualLine(doc, getLine(doc, from)));\n      while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;\n    }\n\n    // Create a range of theoretically intact lines, and punch holes\n    // in that using the change info.\n    var intact = [{from: Math.max(display.showingFrom, doc.first),\n                   to: Math.min(display.showingTo, end)}];\n    if (intact[0].from >= intact[0].to) intact = [];\n    else intact = computeIntact(intact, changes);\n    // When merged lines are present, we might have to reduce the\n    // intact ranges because changes in continued fragments of the\n    // intact lines do require the lines to be redrawn.\n    if (sawCollapsedSpans)\n      for (var i = 0; i < intact.length; ++i) {\n        var range = intact[i], merged;\n        while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {\n          var newTo = merged.find().from.line;\n          if (newTo > range.from) range.to = newTo;\n          else { intact.splice(i--, 1); break; }\n        }\n      }\n\n    // Clip off the parts that won't be visible\n    var intactLines = 0;\n    for (var i = 0; i < intact.length; ++i) {\n      var range = intact[i];\n      if (range.from < from) range.from = from;\n      if (range.to > to) range.to = to;\n      if (range.from >= range.to) intact.splice(i--, 1);\n      else intactLines += range.to - range.from;\n    }\n    if (intactLines == to - from && from == display.showingFrom && to == display.showingTo) {\n      updateViewOffset(cm);\n      return;\n    }\n    intact.sort(function(a, b) {return a.from - b.from;});\n\n    // Avoid crashing on IE's \"unspecified error\" when in iframes\n    try {\n      var focused = document.activeElement;\n    } catch(e) {}\n    if (intactLines < (to - from) * .7) display.lineDiv.style.display = \"none\";\n    patchDisplay(cm, from, to, intact, positionsChangedFrom);\n    display.lineDiv.style.display = \"\";\n    if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();\n\n    var different = from != display.showingFrom || to != display.showingTo ||\n      display.lastSizeC != display.wrapper.clientHeight;\n    // This is just a bogus formula that detects when the editor is\n    // resized or the font size changes.\n    if (different) {\n      display.lastSizeC = display.wrapper.clientHeight;\n      startWorker(cm, 400);\n    }\n    display.showingFrom = from; display.showingTo = to;\n\n    var prevBottom = display.lineDiv.offsetTop;\n    for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) {\n      if (ie_lt8) {\n        var bot = node.offsetTop + node.offsetHeight;\n        height = bot - prevBottom;\n        prevBottom = bot;\n      } else {\n        var box = getRect(node);\n        height = box.bottom - box.top;\n      }\n      var diff = node.lineObj.height - height;\n      if (height < 2) height = textHeight(display);\n      if (diff > .001 || diff < -.001) {\n        updateLineHeight(node.lineObj, height);\n        var widgets = node.lineObj.widgets;\n        if (widgets) for (var i = 0; i < widgets.length; ++i)\n          widgets[i].height = widgets[i].node.offsetHeight;\n      }\n    }\n    updateViewOffset(cm);\n\n    return true;\n  }\n\n  function updateViewOffset(cm) {\n    var off = cm.display.viewOffset = heightAtLine(cm, getLine(cm.doc, cm.display.showingFrom));\n    // Position the mover div to align with the current virtual scroll position\n    cm.display.mover.style.top = off + \"px\";\n  }\n\n  function computeIntact(intact, changes) {\n    for (var i = 0, l = changes.length || 0; i < l; ++i) {\n      var change = changes[i], intact2 = [], diff = change.diff || 0;\n      for (var j = 0, l2 = intact.length; j < l2; ++j) {\n        var range = intact[j];\n        if (change.to <= range.from && change.diff) {\n          intact2.push({from: range.from + diff, to: range.to + diff});\n        } else if (change.to <= range.from || change.from >= range.to) {\n          intact2.push(range);\n        } else {\n          if (change.from > range.from)\n            intact2.push({from: range.from, to: change.from});\n          if (change.to < range.to)\n            intact2.push({from: change.to + diff, to: range.to + diff});\n        }\n      }\n      intact = intact2;\n    }\n    return intact;\n  }\n\n  function getDimensions(cm) {\n    var d = cm.display, left = {}, width = {};\n    for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n      left[cm.options.gutters[i]] = n.offsetLeft;\n      width[cm.options.gutters[i]] = n.offsetWidth;\n    }\n    return {fixedPos: compensateForHScroll(d),\n            gutterTotalWidth: d.gutters.offsetWidth,\n            gutterLeft: left,\n            gutterWidth: width,\n            wrapperWidth: d.wrapper.clientWidth};\n  }\n\n  function patchDisplay(cm, from, to, intact, updateNumbersFrom) {\n    var dims = getDimensions(cm);\n    var display = cm.display, lineNumbers = cm.options.lineNumbers;\n    if (!intact.length && (!webkit || !cm.display.currentWheelTarget))\n      removeChildren(display.lineDiv);\n    var container = display.lineDiv, cur = container.firstChild;\n\n    function rm(node) {\n      var next = node.nextSibling;\n      if (webkit && mac && cm.display.currentWheelTarget == node) {\n        node.style.display = \"none\";\n        node.lineObj = null;\n      } else {\n        node.parentNode.removeChild(node);\n      }\n      return next;\n    }\n\n    var nextIntact = intact.shift(), lineN = from;\n    cm.doc.iter(from, to, function(line) {\n      if (nextIntact && nextIntact.to == lineN) nextIntact = intact.shift();\n      if (lineIsHidden(cm.doc, line)) {\n        if (line.height != 0) updateLineHeight(line, 0);\n        if (line.widgets && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) {\n          var w = line.widgets[i];\n          if (w.showIfHidden) {\n            var prev = cur.previousSibling;\n            if (/pre/i.test(prev.nodeName)) {\n              var wrap = elt(\"div\", null, null, \"position: relative\");\n              prev.parentNode.replaceChild(wrap, prev);\n              wrap.appendChild(prev);\n              prev = wrap;\n            }\n            var wnode = prev.appendChild(elt(\"div\", [w.node], \"CodeMirror-linewidget\"));\n            if (!w.handleMouseEvents) wnode.ignoreEvents = true;\n            positionLineWidget(w, wnode, prev, dims);\n          }\n        }\n      } else if (nextIntact && nextIntact.from <= lineN && nextIntact.to > lineN) {\n        // This line is intact. Skip to the actual node. Update its\n        // line number if needed.\n        while (cur.lineObj != line) cur = rm(cur);\n        if (lineNumbers && updateNumbersFrom <= lineN && cur.lineNumber)\n          setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineN));\n        cur = cur.nextSibling;\n      } else {\n        // For lines with widgets, make an attempt to find and reuse\n        // the existing element, so that widgets aren't needlessly\n        // removed and re-inserted into the dom\n        if (line.widgets) for (var j = 0, search = cur, reuse; search && j < 20; ++j, search = search.nextSibling)\n          if (search.lineObj == line && /div/i.test(search.nodeName)) { reuse = search; break; }\n        // This line needs to be generated.\n        var lineNode = buildLineElement(cm, line, lineN, dims, reuse);\n        if (lineNode != reuse) {\n          container.insertBefore(lineNode, cur);\n        } else {\n          while (cur != reuse) cur = rm(cur);\n          cur = cur.nextSibling;\n        }\n\n        lineNode.lineObj = line;\n      }\n      ++lineN;\n    });\n    while (cur) cur = rm(cur);\n  }\n\n  function buildLineElement(cm, line, lineNo, dims, reuse) {\n    var lineElement = lineContent(cm, line);\n    var markers = line.gutterMarkers, display = cm.display, wrap;\n\n    if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass && !line.widgets)\n      return lineElement;\n\n    // Lines with gutter elements, widgets or a background class need\n    // to be wrapped again, and have the extra elements added to the\n    // wrapper div\n\n    if (reuse) {\n      reuse.alignable = null;\n      var isOk = true, widgetsSeen = 0, insertBefore = null;\n      for (var n = reuse.firstChild, next; n; n = next) {\n        next = n.nextSibling;\n        if (!/\\bCodeMirror-linewidget\\b/.test(n.className)) {\n          reuse.removeChild(n);\n        } else {\n          for (var i = 0, first = true; i < line.widgets.length; ++i) {\n            var widget = line.widgets[i];\n            if (!widget.above) { insertBefore = n; first = false; }\n            if (widget.node == n.firstChild) {\n              positionLineWidget(widget, n, reuse, dims);\n              ++widgetsSeen;\n              break;\n            }\n          }\n          if (i == line.widgets.length) { isOk = false; break; }\n        }\n      }\n      reuse.insertBefore(lineElement, insertBefore);\n      if (isOk && widgetsSeen == line.widgets.length) {\n        wrap = reuse;\n        reuse.className = line.wrapClass || \"\";\n      }\n    }\n    if (!wrap) {\n      wrap = elt(\"div\", null, line.wrapClass, \"position: relative\");\n      wrap.appendChild(lineElement);\n    }\n    // Kludge to make sure the styled element lies behind the selection (by z-index)\n    if (line.bgClass)\n      wrap.insertBefore(elt(\"div\", null, line.bgClass + \" CodeMirror-linebackground\"), wrap.firstChild);\n    if (cm.options.lineNumbers || markers) {\n      var gutterWrap = wrap.insertBefore(elt(\"div\", null, null, \"position: absolute; left: \" +\n                                             (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"),\n                                         wrap.firstChild);\n      if (cm.options.fixedGutter) (wrap.alignable || (wrap.alignable = [])).push(gutterWrap);\n      if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n        wrap.lineNumber = gutterWrap.appendChild(\n          elt(\"div\", lineNumberFor(cm.options, lineNo),\n              \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n              \"left: \" + dims.gutterLeft[\"CodeMirror-linenumbers\"] + \"px; width: \"\n              + display.lineNumInnerWidth + \"px\"));\n      if (markers)\n        for (var k = 0; k < cm.options.gutters.length; ++k) {\n          var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n          if (found)\n            gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\", \"left: \" +\n                                       dims.gutterLeft[id] + \"px; width: \" + dims.gutterWidth[id] + \"px\"));\n        }\n    }\n    if (ie_lt8) wrap.style.zIndex = 2;\n    if (line.widgets && wrap != reuse) for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n      var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n      if (!widget.handleMouseEvents) node.ignoreEvents = true;\n      positionLineWidget(widget, node, wrap, dims);\n      if (widget.above)\n        wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement);\n      else\n        wrap.appendChild(node);\n      signalLater(widget, \"redraw\");\n    }\n    return wrap;\n  }\n\n  function positionLineWidget(widget, node, wrap, dims) {\n    if (widget.noHScroll) {\n      (wrap.alignable || (wrap.alignable = [])).push(node);\n      var width = dims.wrapperWidth;\n      node.style.left = dims.fixedPos + \"px\";\n      if (!widget.coverGutter) {\n        width -= dims.gutterTotalWidth;\n        node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n      }\n      node.style.width = width + \"px\";\n    }\n    if (widget.coverGutter) {\n      node.style.zIndex = 5;\n      node.style.position = \"relative\";\n      if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + \"px\";\n    }\n  }\n\n  // SELECTION / CURSOR\n\n  function updateSelection(cm) {\n    var display = cm.display;\n    var collapsed = posEq(cm.doc.sel.from, cm.doc.sel.to);\n    if (collapsed || cm.options.showCursorWhenSelecting)\n      updateSelectionCursor(cm);\n    else\n      display.cursor.style.display = display.otherCursor.style.display = \"none\";\n    if (!collapsed)\n      updateSelectionRange(cm);\n    else\n      display.selectionDiv.style.display = \"none\";\n\n    // Move the hidden textarea near the cursor to prevent scrolling artifacts\n    if (cm.options.moveInputWithCursor) {\n      var headPos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n      var wrapOff = getRect(display.wrapper), lineOff = getRect(display.lineDiv);\n      display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n                                                        headPos.top + lineOff.top - wrapOff.top)) + \"px\";\n      display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n                                                         headPos.left + lineOff.left - wrapOff.left)) + \"px\";\n    }\n  }\n\n  // No selection, plain cursor\n  function updateSelectionCursor(cm) {\n    var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n    display.cursor.style.left = pos.left + \"px\";\n    display.cursor.style.top = pos.top + \"px\";\n    display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n    display.cursor.style.display = \"\";\n\n    if (pos.other) {\n      display.otherCursor.style.display = \"\";\n      display.otherCursor.style.left = pos.other.left + \"px\";\n      display.otherCursor.style.top = pos.other.top + \"px\";\n      display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n    } else { display.otherCursor.style.display = \"none\"; }\n  }\n\n  // Highlight selection\n  function updateSelectionRange(cm) {\n    var display = cm.display, doc = cm.doc, sel = cm.doc.sel;\n    var fragment = document.createDocumentFragment();\n    var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display);\n\n    function add(left, top, width, bottom) {\n      if (top < 0) top = 0;\n      fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n                               \"px; top: \" + top + \"px; width: \" + (width == null ? clientWidth - left : width) +\n                               \"px; height: \" + (bottom - top) + \"px\"));\n    }\n\n    function drawForLine(line, fromArg, toArg) {\n      var lineObj = getLine(doc, line);\n      var lineLen = lineObj.text.length;\n      var start, end;\n      function coords(ch, bias) {\n        return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n      }\n\n      iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n        var leftPos = coords(from, \"left\"), rightPos, left, right;\n        if (from == to) {\n          rightPos = leftPos;\n          left = right = leftPos.left;\n        } else {\n          rightPos = coords(to - 1, \"right\");\n          if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n          left = leftPos.left;\n          right = rightPos.right;\n        }\n        if (fromArg == null && from == 0) left = pl;\n        if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n          add(left, leftPos.top, null, leftPos.bottom);\n          left = pl;\n          if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n        }\n        if (toArg == null && to == lineLen) right = clientWidth;\n        if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n          start = leftPos;\n        if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n          end = rightPos;\n        if (left < pl + 1) left = pl;\n        add(left, rightPos.top, right - left, rightPos.bottom);\n      });\n      return {start: start, end: end};\n    }\n\n    if (sel.from.line == sel.to.line) {\n      drawForLine(sel.from.line, sel.from.ch, sel.to.ch);\n    } else {\n      var fromLine = getLine(doc, sel.from.line), toLine = getLine(doc, sel.to.line);\n      var singleVLine = visualLine(doc, fromLine) == visualLine(doc, toLine);\n      var leftEnd = drawForLine(sel.from.line, sel.from.ch, singleVLine ? fromLine.text.length : null).end;\n      var rightStart = drawForLine(sel.to.line, singleVLine ? 0 : null, sel.to.ch).start;\n      if (singleVLine) {\n        if (leftEnd.top < rightStart.top - 2) {\n          add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n          add(pl, rightStart.top, rightStart.left, rightStart.bottom);\n        } else {\n          add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n        }\n      }\n      if (leftEnd.bottom < rightStart.top)\n        add(pl, leftEnd.bottom, null, rightStart.top);\n    }\n\n    removeChildrenAndAdd(display.selectionDiv, fragment);\n    display.selectionDiv.style.display = \"\";\n  }\n\n  // Cursor-blinking\n  function restartBlink(cm) {\n    if (!cm.state.focused) return;\n    var display = cm.display;\n    clearInterval(display.blinker);\n    var on = true;\n    display.cursor.style.visibility = display.otherCursor.style.visibility = \"\";\n    display.blinker = setInterval(function() {\n      display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? \"\" : \"hidden\";\n    }, cm.options.cursorBlinkRate);\n  }\n\n  // HIGHLIGHT WORKER\n\n  function startWorker(cm, time) {\n    if (cm.doc.mode.startState && cm.doc.frontier < cm.display.showingTo)\n      cm.state.highlight.set(time, bind(highlightWorker, cm));\n  }\n\n  function highlightWorker(cm) {\n    var doc = cm.doc;\n    if (doc.frontier < doc.first) doc.frontier = doc.first;\n    if (doc.frontier >= cm.display.showingTo) return;\n    var end = +new Date + cm.options.workTime;\n    var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));\n    var changed = [], prevChange;\n    doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.showingTo + 500), function(line) {\n      if (doc.frontier >= cm.display.showingFrom) { // Visible\n        var oldStyles = line.styles;\n        line.styles = highlightLine(cm, line, state);\n        var ischange = !oldStyles || oldStyles.length != line.styles.length;\n        for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];\n        if (ischange) {\n          if (prevChange && prevChange.end == doc.frontier) prevChange.end++;\n          else changed.push(prevChange = {start: doc.frontier, end: doc.frontier + 1});\n        }\n        line.stateAfter = copyState(doc.mode, state);\n      } else {\n        processLine(cm, line, state);\n        line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;\n      }\n      ++doc.frontier;\n      if (+new Date > end) {\n        startWorker(cm, cm.options.workDelay);\n        return true;\n      }\n    });\n    if (changed.length)\n      operation(cm, function() {\n        for (var i = 0; i < changed.length; ++i)\n          regChange(this, changed[i].start, changed[i].end);\n      })();\n  }\n\n  // Finds the line to start with when starting a parse. Tries to\n  // find a line with a stateAfter, so that it can start with a\n  // valid state. If that fails, it returns the line with the\n  // smallest indentation, which tends to need the least context to\n  // parse correctly.\n  function findStartLine(cm, n, precise) {\n    var minindent, minline, doc = cm.doc;\n    for (var search = n, lim = n - 100; search > lim; --search) {\n      if (search <= doc.first) return doc.first;\n      var line = getLine(doc, search - 1);\n      if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n      var indented = countColumn(line.text, null, cm.options.tabSize);\n      if (minline == null || minindent > indented) {\n        minline = search - 1;\n        minindent = indented;\n      }\n    }\n    return minline;\n  }\n\n  function getStateBefore(cm, n, precise) {\n    var doc = cm.doc, display = cm.display;\n      if (!doc.mode.startState) return true;\n    var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;\n    if (!state) state = startState(doc.mode);\n    else state = copyState(doc.mode, state);\n    doc.iter(pos, n, function(line) {\n      processLine(cm, line, state);\n      var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo;\n      line.stateAfter = save ? copyState(doc.mode, state) : null;\n      ++pos;\n    });\n    return state;\n  }\n\n  // POSITION MEASUREMENT\n\n  function paddingTop(display) {return display.lineSpace.offsetTop;}\n  function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}\n  function paddingLeft(display) {\n    var e = removeChildrenAndAdd(display.measure, elt(\"pre\", null, null, \"text-align: left\")).appendChild(elt(\"span\", \"x\"));\n    return e.offsetLeft;\n  }\n\n  function measureChar(cm, line, ch, data, bias) {\n    var dir = -1;\n    data = data || measureLine(cm, line);\n\n    for (var pos = ch;; pos += dir) {\n      var r = data[pos];\n      if (r) break;\n      if (dir < 0 && pos == 0) dir = 1;\n    }\n    var rightV = (pos < ch || bias == \"right\") && r.topRight != null;\n    return {left: pos < ch ? r.right : r.left,\n            right: pos > ch ? r.left : r.right,\n            top: rightV ? r.topRight : r.top,\n            bottom: rightV ? r.bottomRight : r.bottom};\n  }\n\n  function findCachedMeasurement(cm, line) {\n    var cache = cm.display.measureLineCache;\n    for (var i = 0; i < cache.length; ++i) {\n      var memo = cache[i];\n      if (memo.text == line.text && memo.markedSpans == line.markedSpans &&\n          cm.display.scroller.clientWidth == memo.width &&\n          memo.classes == line.textClass + \"|\" + line.bgClass + \"|\" + line.wrapClass)\n        return memo;\n    }\n  }\n\n  function clearCachedMeasurement(cm, line) {\n    var exists = findCachedMeasurement(cm, line);\n    if (exists) exists.text = exists.measure = exists.markedSpans = null;\n  }\n\n  function measureLine(cm, line) {\n    // First look in the cache\n    var cached = findCachedMeasurement(cm, line);\n    if (cached) return cached.measure;\n\n    // Failing that, recompute and store result in cache\n    var measure = measureLineInner(cm, line);\n    var cache = cm.display.measureLineCache;\n    var memo = {text: line.text, width: cm.display.scroller.clientWidth,\n                markedSpans: line.markedSpans, measure: measure,\n                classes: line.textClass + \"|\" + line.bgClass + \"|\" + line.wrapClass};\n    if (cache.length == 16) cache[++cm.display.measureLineCachePos % 16] = memo;\n    else cache.push(memo);\n    return measure;\n  }\n\n  function measureLineInner(cm, line) {\n    var display = cm.display, measure = emptyArray(line.text.length);\n    var pre = lineContent(cm, line, measure);\n\n    // IE does not cache element positions of inline elements between\n    // calls to getBoundingClientRect. This makes the loop below,\n    // which gathers the positions of all the characters on the line,\n    // do an amount of layout work quadratic to the number of\n    // characters. When line wrapping is off, we try to improve things\n    // by first subdividing the line into a bunch of inline blocks, so\n    // that IE can reuse most of the layout information from caches\n    // for those blocks. This does interfere with line wrapping, so it\n    // doesn't work when wrapping is on, but in that case the\n    // situation is slightly better, since IE does cache line-wrapping\n    // information and only recomputes per-line.\n    if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) {\n      var fragment = document.createDocumentFragment();\n      var chunk = 10, n = pre.childNodes.length;\n      for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) {\n        var wrap = elt(\"div\", null, null, \"display: inline-block\");\n        for (var j = 0; j < chunk && n; ++j) {\n          wrap.appendChild(pre.firstChild);\n          --n;\n        }\n        fragment.appendChild(wrap);\n      }\n      pre.appendChild(fragment);\n    }\n\n    removeChildrenAndAdd(display.measure, pre);\n\n    var outer = getRect(display.lineDiv);\n    var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight;\n    // Work around an IE7/8 bug where it will sometimes have randomly\n    // replaced our pre with a clone at this point.\n    if (ie_lt9 && display.measure.first != pre)\n      removeChildrenAndAdd(display.measure, pre);\n\n    function categorizeVSpan(top, bot) {\n      if (bot > maxBot) bot = maxBot;\n      if (top < 0) top = 0;\n      for (var j = 0; j < vranges.length; j += 2) {\n        var rtop = vranges[j], rbot = vranges[j+1];\n        if (rtop > bot || rbot < top) continue;\n        if (rtop <= top && rbot >= bot ||\n            top <= rtop && bot >= rbot ||\n            Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) {\n          vranges[j] = Math.min(top, rtop);\n          vranges[j+1] = Math.max(bot, rbot);\n          return j;\n        }\n      }\n      vranges.push(top, bot);\n      return j;\n    }\n\n    for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) {\n      var size, node = cur;\n      // A widget might wrap, needs special care\n      if (/\\bCodeMirror-widget\\b/.test(cur.className) && cur.getClientRects) {\n        if (cur.firstChild.nodeType == 1) node = cur.firstChild;\n        var rects = node.getClientRects(), rLeft = rects[0], rRight = rects[rects.length - 1];\n        if (rects.length > 1) {\n          var vCatLeft = categorizeVSpan(rLeft.top - outer.top, rLeft.bottom - outer.top);\n          var vCatRight = categorizeVSpan(rRight.top - outer.top, rRight.bottom - outer.top);\n          data[i] = {left: rLeft.left - outer.left, right: rRight.right - outer.left,\n                     top: vCatLeft, topRight: vCatRight};\n          continue;\n        }\n      }\n      size = getRect(node);\n      var vCat = categorizeVSpan(size.top - outer.top, size.bottom - outer.top);\n      var right = size.right;\n      if (cur.measureRight) right = getRect(cur.measureRight).left;\n      data[i] = {left: size.left - outer.left, right: right - outer.left, top: vCat};\n    }\n    for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) {\n      var vr = cur.top, vrRight = cur.topRight;\n      cur.top = vranges[vr]; cur.bottom = vranges[vr+1];\n      if (vrRight != null) { cur.topRight = vranges[vrRight]; cur.bottomRight = vranges[vrRight+1]; }\n    }\n    return data;\n  }\n\n  function measureLineWidth(cm, line) {\n    var hasBadSpan = false;\n    if (line.markedSpans) for (var i = 0; i < line.markedSpans; ++i) {\n      var sp = line.markedSpans[i];\n      if (sp.collapsed && (sp.to == null || sp.to == line.text.length)) hasBadSpan = true;\n    }\n    var cached = !hasBadSpan && findCachedMeasurement(cm, line);\n    if (cached) return measureChar(cm, line, line.text.length, cached.measure, \"right\").right;\n\n    var pre = lineContent(cm, line);\n    var end = pre.appendChild(zeroWidthElement(cm.display.measure));\n    removeChildrenAndAdd(cm.display.measure, pre);\n    return getRect(end).right - getRect(cm.display.lineDiv).left;\n  }\n\n  function clearCaches(cm) {\n    cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0;\n    cm.display.cachedCharWidth = cm.display.cachedTextHeight = null;\n    if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;\n    cm.display.lineNumChars = null;\n  }\n\n  function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; }\n  function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; }\n\n  // Context is one of \"line\", \"div\" (display.lineDiv), \"local\"/null (editor), or \"page\"\n  function intoCoordSystem(cm, lineObj, rect, context) {\n    if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n      var size = widgetHeight(lineObj.widgets[i]);\n      rect.top += size; rect.bottom += size;\n    }\n    if (context == \"line\") return rect;\n    if (!context) context = \"local\";\n    var yOff = heightAtLine(cm, lineObj);\n    if (context == \"local\") yOff += paddingTop(cm.display);\n    else yOff -= cm.display.viewOffset;\n    if (context == \"page\" || context == \"window\") {\n      var lOff = getRect(cm.display.lineSpace);\n      yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n      var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n      rect.left += xOff; rect.right += xOff;\n    }\n    rect.top += yOff; rect.bottom += yOff;\n    return rect;\n  }\n\n  // Context may be \"window\", \"page\", \"div\", or \"local\"/null\n  // Result is in \"div\" coords\n  function fromCoordSystem(cm, coords, context) {\n    if (context == \"div\") return coords;\n    var left = coords.left, top = coords.top;\n    // First move into \"page\" coordinate system\n    if (context == \"page\") {\n      left -= pageScrollX();\n      top -= pageScrollY();\n    } else if (context == \"local\" || !context) {\n      var localBox = getRect(cm.display.sizer);\n      left += localBox.left;\n      top += localBox.top;\n    }\n\n    var lineSpaceBox = getRect(cm.display.lineSpace);\n    return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n  }\n\n  function charCoords(cm, pos, context, lineObj, bias) {\n    if (!lineObj) lineObj = getLine(cm.doc, pos.line);\n    return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, null, bias), context);\n  }\n\n  function cursorCoords(cm, pos, context, lineObj, measurement) {\n    lineObj = lineObj || getLine(cm.doc, pos.line);\n    if (!measurement) measurement = measureLine(cm, lineObj);\n    function get(ch, right) {\n      var m = measureChar(cm, lineObj, ch, measurement, right ? \"right\" : \"left\");\n      if (right) m.left = m.right; else m.right = m.left;\n      return intoCoordSystem(cm, lineObj, m, context);\n    }\n    function getBidi(ch, partPos) {\n      var part = order[partPos], right = part.level % 2;\n      if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n        part = order[--partPos];\n        ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n        right = true;\n      } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n        part = order[++partPos];\n        ch = bidiLeft(part) - part.level % 2;\n        right = false;\n      }\n      if (right && ch == part.to && ch > part.from) return get(ch - 1);\n      return get(ch, right);\n    }\n    var order = getOrder(lineObj), ch = pos.ch;\n    if (!order) return get(ch);\n    var partPos = getBidiPartAt(order, ch);\n    var val = getBidi(ch, partPos);\n    if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n    return val;\n  }\n\n  function PosWithInfo(line, ch, outside, xRel) {\n    var pos = new Pos(line, ch);\n    pos.xRel = xRel;\n    if (outside) pos.outside = true;\n    return pos;\n  }\n\n  // Coords must be lineSpace-local\n  function coordsChar(cm, x, y) {\n    var doc = cm.doc;\n    y += cm.display.viewOffset;\n    if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n    var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n    if (lineNo > last)\n      return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n    if (x < 0) x = 0;\n\n    for (;;) {\n      var lineObj = getLine(doc, lineNo);\n      var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n      var merged = collapsedSpanAtEnd(lineObj);\n      var mergedPos = merged && merged.find();\n      if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n        lineNo = mergedPos.to.line;\n      else\n        return found;\n    }\n  }\n\n  function coordsCharInner(cm, lineObj, lineNo, x, y) {\n    var innerOff = y - heightAtLine(cm, lineObj);\n    var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;\n    var measurement = measureLine(cm, lineObj);\n\n    function getX(ch) {\n      var sp = cursorCoords(cm, Pos(lineNo, ch), \"line\",\n                            lineObj, measurement);\n      wrongLine = true;\n      if (innerOff > sp.bottom) return sp.left - adjust;\n      else if (innerOff < sp.top) return sp.left + adjust;\n      else wrongLine = false;\n      return sp.left;\n    }\n\n    var bidi = getOrder(lineObj), dist = lineObj.text.length;\n    var from = lineLeft(lineObj), to = lineRight(lineObj);\n    var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine;\n\n    if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1);\n    // Do a binary search between these bounds.\n    for (;;) {\n      if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {\n        var ch = x < fromX || x - fromX <= toX - x ? from : to;\n        var xDiff = x - (ch == from ? fromX : toX);\n        while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch;\n        var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside,\n                              xDiff < 0 ? -1 : xDiff ? 1 : 0);\n        return pos;\n      }\n      var step = Math.ceil(dist / 2), middle = from + step;\n      if (bidi) {\n        middle = from;\n        for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);\n      }\n      var middleX = getX(middle);\n      if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;}\n      else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;}\n    }\n  }\n\n  var measureText;\n  function textHeight(display) {\n    if (display.cachedTextHeight != null) return display.cachedTextHeight;\n    if (measureText == null) {\n      measureText = elt(\"pre\");\n      // Measure a bunch of lines, for browsers that compute\n      // fractional heights.\n      for (var i = 0; i < 49; ++i) {\n        measureText.appendChild(document.createTextNode(\"x\"));\n        measureText.appendChild(elt(\"br\"));\n      }\n      measureText.appendChild(document.createTextNode(\"x\"));\n    }\n    removeChildrenAndAdd(display.measure, measureText);\n    var height = measureText.offsetHeight / 50;\n    if (height > 3) display.cachedTextHeight = height;\n    removeChildren(display.measure);\n    return height || 1;\n  }\n\n  function charWidth(display) {\n    if (display.cachedCharWidth != null) return display.cachedCharWidth;\n    var anchor = elt(\"span\", \"x\");\n    var pre = elt(\"pre\", [anchor]);\n    removeChildrenAndAdd(display.measure, pre);\n    var width = anchor.offsetWidth;\n    if (width > 2) display.cachedCharWidth = width;\n    return width || 10;\n  }\n\n  // OPERATIONS\n\n  // Operations are used to wrap changes in such a way that each\n  // change won't have to update the cursor and display (which would\n  // be awkward, slow, and error-prone), but instead updates are\n  // batched and then all combined and executed at once.\n\n  var nextOpId = 0;\n  function startOperation(cm) {\n    cm.curOp = {\n      // An array of ranges of lines that have to be updated. See\n      // updateDisplay.\n      changes: [],\n      updateInput: null,\n      userSelChange: null,\n      textChanged: null,\n      selectionChanged: false,\n      cursorActivity: false,\n      updateMaxLine: false,\n      updateScrollPos: false,\n      id: ++nextOpId\n    };\n    if (!delayedCallbackDepth++) delayedCallbacks = [];\n  }\n\n  function endOperation(cm) {\n    var op = cm.curOp, doc = cm.doc, display = cm.display;\n    cm.curOp = null;\n\n    if (op.updateMaxLine) computeMaxLength(cm);\n    if (display.maxLineChanged && !cm.options.lineWrapping && display.maxLine) {\n      var width = measureLineWidth(cm, display.maxLine);\n      display.sizer.style.minWidth = Math.max(0, width + 3 + scrollerCutOff) + \"px\";\n      display.maxLineChanged = false;\n      var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth);\n      if (maxScrollLeft < doc.scrollLeft && !op.updateScrollPos)\n        setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true);\n    }\n    var newScrollPos, updated;\n    if (op.updateScrollPos) {\n      newScrollPos = op.updateScrollPos;\n    } else if (op.selectionChanged && display.scroller.clientHeight) { // don't rescroll if not visible\n      var coords = cursorCoords(cm, doc.sel.head);\n      newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);\n    }\n    if (op.changes.length || newScrollPos && newScrollPos.scrollTop != null) {\n      updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop);\n      if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;\n    }\n    if (!updated && op.selectionChanged) updateSelection(cm);\n    if (op.updateScrollPos) {\n      display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = newScrollPos.scrollTop;\n      display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = newScrollPos.scrollLeft;\n      alignHorizontally(cm);\n      if (op.scrollToPos)\n        scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos), op.scrollToPosMargin);\n    } else if (newScrollPos) {\n      scrollCursorIntoView(cm);\n    }\n    if (op.selectionChanged) restartBlink(cm);\n\n    if (cm.state.focused && op.updateInput)\n      resetInput(cm, op.userSelChange);\n\n    var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n    if (hidden) for (var i = 0; i < hidden.length; ++i)\n      if (!hidden[i].lines.length) signal(hidden[i], \"hide\");\n    if (unhidden) for (var i = 0; i < unhidden.length; ++i)\n      if (unhidden[i].lines.length) signal(unhidden[i], \"unhide\");\n\n    var delayed;\n    if (!--delayedCallbackDepth) {\n      delayed = delayedCallbacks;\n      delayedCallbacks = null;\n    }\n    if (op.textChanged)\n      signal(cm, \"change\", cm, op.textChanged);\n    if (op.cursorActivity) signal(cm, \"cursorActivity\", cm);\n    if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();\n  }\n\n  // Wraps a function in an operation. Returns the wrapped function.\n  function operation(cm1, f) {\n    return function() {\n      var cm = cm1 || this, withOp = !cm.curOp;\n      if (withOp) startOperation(cm);\n      try { var result = f.apply(cm, arguments); }\n      finally { if (withOp) endOperation(cm); }\n      return result;\n    };\n  }\n  function docOperation(f) {\n    return function() {\n      var withOp = this.cm && !this.cm.curOp, result;\n      if (withOp) startOperation(this.cm);\n      try { result = f.apply(this, arguments); }\n      finally { if (withOp) endOperation(this.cm); }\n      return result;\n    };\n  }\n  function runInOp(cm, f) {\n    var withOp = !cm.curOp, result;\n    if (withOp) startOperation(cm);\n    try { result = f(); }\n    finally { if (withOp) endOperation(cm); }\n    return result;\n  }\n\n  function regChange(cm, from, to, lendiff) {\n    if (from == null) from = cm.doc.first;\n    if (to == null) to = cm.doc.first + cm.doc.size;\n    cm.curOp.changes.push({from: from, to: to, diff: lendiff});\n  }\n\n  // INPUT HANDLING\n\n  function slowPoll(cm) {\n    if (cm.display.pollingFast) return;\n    cm.display.poll.set(cm.options.pollInterval, function() {\n      readInput(cm);\n      if (cm.state.focused) slowPoll(cm);\n    });\n  }\n\n  function fastPoll(cm) {\n    var missed = false;\n    cm.display.pollingFast = true;\n    function p() {\n      var changed = readInput(cm);\n      if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n      else {cm.display.pollingFast = false; slowPoll(cm);}\n    }\n    cm.display.poll.set(20, p);\n  }\n\n  // prevInput is a hack to work with IME. If we reset the textarea\n  // on every change, that breaks IME. So we look for changes\n  // compared to the previous content instead. (Modern browsers have\n  // events that indicate IME taking place, but these are not widely\n  // supported or compatible enough yet to rely on.)\n  function readInput(cm) {\n    var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel;\n    if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.state.disableInput) return false;\n    var text = input.value;\n    if (text == prevInput && posEq(sel.from, sel.to)) return false;\n    if (ie && !ie_lt9 && cm.display.inputHasSelection === text) {\n      resetInput(cm, true);\n      return false;\n    }\n\n    var withOp = !cm.curOp;\n    if (withOp) startOperation(cm);\n    sel.shift = false;\n    var same = 0, l = Math.min(prevInput.length, text.length);\n    while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n    var from = sel.from, to = sel.to;\n    if (same < prevInput.length)\n      from = Pos(from.line, from.ch - (prevInput.length - same));\n    else if (cm.state.overwrite && posEq(from, to) && !cm.state.pasteIncoming)\n      to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + (text.length - same)));\n\n    var updateInput = cm.curOp.updateInput;\n    var changeEvent = {from: from, to: to, text: splitLines(text.slice(same)),\n                       origin: cm.state.pasteIncoming ? \"paste\" : \"+input\"};\n    makeChange(cm.doc, changeEvent, \"end\");\n    cm.curOp.updateInput = updateInput;\n    signalLater(cm, \"inputRead\", cm, changeEvent);\n\n    if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n    else cm.display.prevInput = text;\n    if (withOp) endOperation(cm);\n    cm.state.pasteIncoming = false;\n    return true;\n  }\n\n  function resetInput(cm, user) {\n    var minimal, selected, doc = cm.doc;\n    if (!posEq(doc.sel.from, doc.sel.to)) {\n      cm.display.prevInput = \"\";\n      minimal = hasCopyEvent &&\n        (doc.sel.to.line - doc.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000);\n      var content = minimal ? \"-\" : selected || cm.getSelection();\n      cm.display.input.value = content;\n      if (cm.state.focused) selectInput(cm.display.input);\n      if (ie && !ie_lt9) cm.display.inputHasSelection = content;\n    } else if (user) {\n      cm.display.prevInput = cm.display.input.value = \"\";\n      if (ie && !ie_lt9) cm.display.inputHasSelection = null;\n    }\n    cm.display.inaccurateSelection = minimal;\n  }\n\n  function focusInput(cm) {\n    if (cm.options.readOnly != \"nocursor\" && (!mobile || document.activeElement != cm.display.input))\n      cm.display.input.focus();\n  }\n\n  function isReadOnly(cm) {\n    return cm.options.readOnly || cm.doc.cantEdit;\n  }\n\n  // EVENT HANDLERS\n\n  function registerEventHandlers(cm) {\n    var d = cm.display;\n    on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n    if (ie)\n      on(d.scroller, \"dblclick\", operation(cm, function(e) {\n        if (signalDOMEvent(cm, e)) return;\n        var pos = posFromMouse(cm, e);\n        if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n        e_preventDefault(e);\n        var word = findWordAt(getLine(cm.doc, pos.line).text, pos);\n        extendSelection(cm.doc, word.from, word.to);\n      }));\n    else\n      on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n    on(d.lineSpace, \"selectstart\", function(e) {\n      if (!eventInWidget(d, e)) e_preventDefault(e);\n    });\n    // Gecko browsers fire contextmenu *after* opening the menu, at\n    // which point we can't mess with it anymore. Context menu is\n    // handled in onMouseDown for Gecko.\n    if (!captureMiddleClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n    on(d.scroller, \"scroll\", function() {\n      if (d.scroller.clientHeight) {\n        setScrollTop(cm, d.scroller.scrollTop);\n        setScrollLeft(cm, d.scroller.scrollLeft, true);\n        signal(cm, \"scroll\", cm);\n      }\n    });\n    on(d.scrollbarV, \"scroll\", function() {\n      if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop);\n    });\n    on(d.scrollbarH, \"scroll\", function() {\n      if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft);\n    });\n\n    on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n    on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n    function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }\n    on(d.scrollbarH, \"mousedown\", reFocus);\n    on(d.scrollbarV, \"mousedown\", reFocus);\n    // Prevent wrapper from ever scrolling\n    on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n    var resizeTimer;\n    function onResize() {\n      if (resizeTimer == null) resizeTimer = setTimeout(function() {\n        resizeTimer = null;\n        // Might be a text scaling operation, clear size caches.\n        d.cachedCharWidth = d.cachedTextHeight = knownScrollbarWidth = null;\n        clearCaches(cm);\n        runInOp(cm, bind(regChange, cm));\n      }, 100);\n    }\n    on(window, \"resize\", onResize);\n    // Above handler holds on to the editor and its data structures.\n    // Here we poll to unregister it when the editor is no longer in\n    // the document, so that it can be garbage-collected.\n    function unregister() {\n      for (var p = d.wrapper.parentNode; p && p != document.body; p = p.parentNode) {}\n      if (p) setTimeout(unregister, 5000);\n      else off(window, \"resize\", onResize);\n    }\n    setTimeout(unregister, 5000);\n\n    on(d.input, \"keyup\", operation(cm, function(e) {\n      if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;\n      if (e.keyCode == 16) cm.doc.sel.shift = false;\n    }));\n    on(d.input, \"input\", bind(fastPoll, cm));\n    on(d.input, \"keydown\", operation(cm, onKeyDown));\n    on(d.input, \"keypress\", operation(cm, onKeyPress));\n    on(d.input, \"focus\", bind(onFocus, cm));\n    on(d.input, \"blur\", bind(onBlur, cm));\n\n    function drag_(e) {\n      if (signalDOMEvent(cm, e) || cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return;\n      e_stop(e);\n    }\n    if (cm.options.dragDrop) {\n      on(d.scroller, \"dragstart\", function(e){onDragStart(cm, e);});\n      on(d.scroller, \"dragenter\", drag_);\n      on(d.scroller, \"dragover\", drag_);\n      on(d.scroller, \"drop\", operation(cm, onDrop));\n    }\n    on(d.scroller, \"paste\", function(e){\n      if (eventInWidget(d, e)) return;\n      focusInput(cm);\n      fastPoll(cm);\n    });\n    on(d.input, \"paste\", function() {\n      cm.state.pasteIncoming = true;\n      fastPoll(cm);\n    });\n\n    function prepareCopy() {\n      if (d.inaccurateSelection) {\n        d.prevInput = \"\";\n        d.inaccurateSelection = false;\n        d.input.value = cm.getSelection();\n        selectInput(d.input);\n      }\n    }\n    on(d.input, \"cut\", prepareCopy);\n    on(d.input, \"copy\", prepareCopy);\n\n    // Needed to handle Tab key in KHTML\n    if (khtml) on(d.sizer, \"mouseup\", function() {\n        if (document.activeElement == d.input) d.input.blur();\n        focusInput(cm);\n    });\n  }\n\n  function eventInWidget(display, e) {\n    for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n      if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n    }\n  }\n\n  function posFromMouse(cm, e, liberal) {\n    var display = cm.display;\n    if (!liberal) {\n      var target = e_target(e);\n      if (target == display.scrollbarH || target == display.scrollbarH.firstChild ||\n          target == display.scrollbarV || target == display.scrollbarV.firstChild ||\n          target == display.scrollbarFiller || target == display.gutterFiller) return null;\n    }\n    var x, y, space = getRect(display.lineSpace);\n    // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n    try { x = e.clientX; y = e.clientY; } catch (e) { return null; }\n    return coordsChar(cm, x - space.left, y - space.top);\n  }\n\n  var lastClick, lastDoubleClick;\n  function onMouseDown(e) {\n    if (signalDOMEvent(this, e)) return;\n    var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel;\n    sel.shift = e.shiftKey;\n\n    if (eventInWidget(display, e)) {\n      if (!webkit) {\n        display.scroller.draggable = false;\n        setTimeout(function(){display.scroller.draggable = true;}, 100);\n      }\n      return;\n    }\n    if (clickInGutter(cm, e)) return;\n    var start = posFromMouse(cm, e);\n\n    switch (e_button(e)) {\n    case 3:\n      if (captureMiddleClick) onContextMenu.call(cm, cm, e);\n      return;\n    case 2:\n      if (start) extendSelection(cm.doc, start);\n      setTimeout(bind(focusInput, cm), 20);\n      e_preventDefault(e);\n      return;\n    }\n    // For button 1, if it was clicked inside the editor\n    // (posFromMouse returning non-null), we have to adjust the\n    // selection.\n    if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;}\n\n    if (!cm.state.focused) onFocus(cm);\n\n    var now = +new Date, type = \"single\";\n    if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) {\n      type = \"triple\";\n      e_preventDefault(e);\n      setTimeout(bind(focusInput, cm), 20);\n      selectLine(cm, start.line);\n    } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) {\n      type = \"double\";\n      lastDoubleClick = {time: now, pos: start};\n      e_preventDefault(e);\n      var word = findWordAt(getLine(doc, start.line).text, start);\n      extendSelection(cm.doc, word.from, word.to);\n    } else { lastClick = {time: now, pos: start}; }\n\n    var last = start;\n    if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) &&\n        !posLess(start, sel.from) && !posLess(sel.to, start) && type == \"single\") {\n      var dragEnd = operation(cm, function(e2) {\n        if (webkit) display.scroller.draggable = false;\n        cm.state.draggingText = false;\n        off(document, \"mouseup\", dragEnd);\n        off(display.scroller, \"drop\", dragEnd);\n        if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {\n          e_preventDefault(e2);\n          extendSelection(cm.doc, start);\n          focusInput(cm);\n        }\n      });\n      // Let the drag handler handle this.\n      if (webkit) display.scroller.draggable = true;\n      cm.state.draggingText = dragEnd;\n      // IE's approach to draggable\n      if (display.scroller.dragDrop) display.scroller.dragDrop();\n      on(document, \"mouseup\", dragEnd);\n      on(display.scroller, \"drop\", dragEnd);\n      return;\n    }\n    e_preventDefault(e);\n    if (type == \"single\") extendSelection(cm.doc, clipPos(doc, start));\n\n    var startstart = sel.from, startend = sel.to, lastPos = start;\n\n    function doSelect(cur) {\n      if (posEq(lastPos, cur)) return;\n      lastPos = cur;\n\n      if (type == \"single\") {\n        extendSelection(cm.doc, clipPos(doc, start), cur);\n        return;\n      }\n\n      startstart = clipPos(doc, startstart);\n      startend = clipPos(doc, startend);\n      if (type == \"double\") {\n        var word = findWordAt(getLine(doc, cur.line).text, cur);\n        if (posLess(cur, startstart)) extendSelection(cm.doc, word.from, startend);\n        else extendSelection(cm.doc, startstart, word.to);\n      } else if (type == \"triple\") {\n        if (posLess(cur, startstart)) extendSelection(cm.doc, startend, clipPos(doc, Pos(cur.line, 0)));\n        else extendSelection(cm.doc, startstart, clipPos(doc, Pos(cur.line + 1, 0)));\n      }\n    }\n\n    var editorSize = getRect(display.wrapper);\n    // Used to ensure timeout re-tries don't fire when another extend\n    // happened in the meantime (clearTimeout isn't reliable -- at\n    // least on Chrome, the timeouts still happen even when cleared,\n    // if the clear happens after their scheduled firing time).\n    var counter = 0;\n\n    function extend(e) {\n      var curCount = ++counter;\n      var cur = posFromMouse(cm, e, true);\n      if (!cur) return;\n      if (!posEq(cur, last)) {\n        if (!cm.state.focused) onFocus(cm);\n        last = cur;\n        doSelect(cur);\n        var visible = visibleLines(display, doc);\n        if (cur.line >= visible.to || cur.line < visible.from)\n          setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n      } else {\n        var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n        if (outside) setTimeout(operation(cm, function() {\n          if (counter != curCount) return;\n          display.scroller.scrollTop += outside;\n          extend(e);\n        }), 50);\n      }\n    }\n\n    function done(e) {\n      counter = Infinity;\n      e_preventDefault(e);\n      focusInput(cm);\n      off(document, \"mousemove\", move);\n      off(document, \"mouseup\", up);\n    }\n\n    var move = operation(cm, function(e) {\n      if (!ie && !e_button(e)) done(e);\n      else extend(e);\n    });\n    var up = operation(cm, done);\n    on(document, \"mousemove\", move);\n    on(document, \"mouseup\", up);\n  }\n\n  function clickInGutter(cm, e) {\n    var display = cm.display;\n    try { var mX = e.clientX, mY = e.clientY; }\n    catch(e) { return false; }\n\n    if (mX >= Math.floor(getRect(display.gutters).right)) return false;\n    e_preventDefault(e);\n    if (!hasHandler(cm, \"gutterClick\")) return true;\n\n    var lineBox = getRect(display.lineDiv);\n    if (mY > lineBox.bottom) return true;\n    mY -= lineBox.top - display.viewOffset;\n\n    for (var i = 0; i < cm.options.gutters.length; ++i) {\n      var g = display.gutters.childNodes[i];\n      if (g && getRect(g).right >= mX) {\n        var line = lineAtHeight(cm.doc, mY);\n        var gutter = cm.options.gutters[i];\n        signalLater(cm, \"gutterClick\", cm, line, gutter, e);\n        break;\n      }\n    }\n    return true;\n  }\n\n  // Kludge to work around strange IE behavior where it'll sometimes\n  // re-fire a series of drag-related events right after the drop (#1551)\n  var lastDrop = 0;\n\n  function onDrop(e) {\n    var cm = this;\n    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))))\n      return;\n    e_preventDefault(e);\n    if (ie) lastDrop = +new Date;\n    var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n    if (!pos || isReadOnly(cm)) return;\n    if (files && files.length && window.FileReader && window.File) {\n      var n = files.length, text = Array(n), read = 0;\n      var loadFile = function(file, i) {\n        var reader = new FileReader;\n        reader.onload = function() {\n          text[i] = reader.result;\n          if (++read == n) {\n            pos = clipPos(cm.doc, pos);\n            makeChange(cm.doc, {from: pos, to: pos, text: splitLines(text.join(\"\\n\")), origin: \"paste\"}, \"around\");\n          }\n        };\n        reader.readAsText(file);\n      };\n      for (var i = 0; i < n; ++i) loadFile(files[i], i);\n    } else {\n      // Don't do a replace if the drop happened inside of the selected text.\n      if (cm.state.draggingText && !(posLess(pos, cm.doc.sel.from) || posLess(cm.doc.sel.to, pos))) {\n        cm.state.draggingText(e);\n        // Ensure the editor is re-focused\n        setTimeout(bind(focusInput, cm), 20);\n        return;\n      }\n      try {\n        var text = e.dataTransfer.getData(\"Text\");\n        if (text) {\n          var curFrom = cm.doc.sel.from, curTo = cm.doc.sel.to;\n          setSelection(cm.doc, pos, pos);\n          if (cm.state.draggingText) replaceRange(cm.doc, \"\", curFrom, curTo, \"paste\");\n          cm.replaceSelection(text, null, \"paste\");\n          focusInput(cm);\n          onFocus(cm);\n        }\n      }\n      catch(e){}\n    }\n  }\n\n  function onDragStart(cm, e) {\n    if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }\n    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;\n\n    var txt = cm.getSelection();\n    e.dataTransfer.setData(\"Text\", txt);\n\n    // Use dummy image instead of default browsers image.\n    // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n    if (e.dataTransfer.setDragImage && !safari) {\n      var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n      if (opera) {\n        img.width = img.height = 1;\n        cm.display.wrapper.appendChild(img);\n        // Force a relayout, or Opera won't use our image for some obscure reason\n        img._top = img.offsetTop;\n      }\n      e.dataTransfer.setDragImage(img, 0, 0);\n      if (opera) img.parentNode.removeChild(img);\n    }\n  }\n\n  function setScrollTop(cm, val) {\n    if (Math.abs(cm.doc.scrollTop - val) < 2) return;\n    cm.doc.scrollTop = val;\n    if (!gecko) updateDisplay(cm, [], val);\n    if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;\n    if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val;\n    if (gecko) updateDisplay(cm, []);\n    startWorker(cm, 100);\n  }\n  function setScrollLeft(cm, val, isScroller) {\n    if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;\n    val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n    cm.doc.scrollLeft = val;\n    alignHorizontally(cm);\n    if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;\n    if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val;\n  }\n\n  // Since the delta values reported on mouse wheel events are\n  // unstandardized between browsers and even browser versions, and\n  // generally horribly unpredictable, this code starts by measuring\n  // the scroll effect that the first few mouse wheel events have,\n  // and, from that, detects the way it can convert deltas to pixel\n  // offsets afterwards.\n  //\n  // The reason we want to know the amount a wheel event will scroll\n  // is that it gives us a chance to update the display before the\n  // actual scrolling happens, reducing flickering.\n\n  var wheelSamples = 0, wheelPixelsPerUnit = null;\n  // Fill in a browser-detected starting value on browsers where we\n  // know one. These don't have to be accurate -- the result of them\n  // being wrong would just be a slight flicker on the first wheel\n  // scroll (if it is large enough).\n  if (ie) wheelPixelsPerUnit = -.53;\n  else if (gecko) wheelPixelsPerUnit = 15;\n  else if (chrome) wheelPixelsPerUnit = -.7;\n  else if (safari) wheelPixelsPerUnit = -1/3;\n\n  function onScrollWheel(cm, e) {\n    var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n    if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;\n    if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;\n    else if (dy == null) dy = e.wheelDelta;\n\n    var display = cm.display, scroll = display.scroller;\n    // Quit if there's nothing to scroll here\n    if (!(dx && scroll.scrollWidth > scroll.clientWidth ||\n          dy && scroll.scrollHeight > scroll.clientHeight)) return;\n\n    // Webkit browsers on OS X abort momentum scrolls when the target\n    // of the scroll event is removed from the scrollable element.\n    // This hack (see related code in patchDisplay) makes sure the\n    // element is kept around.\n    if (dy && mac && webkit) {\n      for (var cur = e.target; cur != scroll; cur = cur.parentNode) {\n        if (cur.lineObj) {\n          cm.display.currentWheelTarget = cur;\n          break;\n        }\n      }\n    }\n\n    // On some browsers, horizontal scrolling will cause redraws to\n    // happen before the gutter has been realigned, causing it to\n    // wriggle around in a most unseemly way. When we have an\n    // estimated pixels/delta value, we just handle horizontal\n    // scrolling entirely here. It'll be slightly off from native, but\n    // better than glitching out.\n    if (dx && !gecko && !opera && wheelPixelsPerUnit != null) {\n      if (dy)\n        setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));\n      setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));\n      e_preventDefault(e);\n      display.wheelStartX = null; // Abort measurement, if in progress\n      return;\n    }\n\n    if (dy && wheelPixelsPerUnit != null) {\n      var pixels = dy * wheelPixelsPerUnit;\n      var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n      if (pixels < 0) top = Math.max(0, top + pixels - 50);\n      else bot = Math.min(cm.doc.height, bot + pixels + 50);\n      updateDisplay(cm, [], {top: top, bottom: bot});\n    }\n\n    if (wheelSamples < 20) {\n      if (display.wheelStartX == null) {\n        display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n        display.wheelDX = dx; display.wheelDY = dy;\n        setTimeout(function() {\n          if (display.wheelStartX == null) return;\n          var movedX = scroll.scrollLeft - display.wheelStartX;\n          var movedY = scroll.scrollTop - display.wheelStartY;\n          var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n            (movedX && display.wheelDX && movedX / display.wheelDX);\n          display.wheelStartX = display.wheelStartY = null;\n          if (!sample) return;\n          wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n          ++wheelSamples;\n        }, 200);\n      } else {\n        display.wheelDX += dx; display.wheelDY += dy;\n      }\n    }\n  }\n\n  function doHandleBinding(cm, bound, dropShift) {\n    if (typeof bound == \"string\") {\n      bound = commands[bound];\n      if (!bound) return false;\n    }\n    // Ensure previous input has been read, so that the handler sees a\n    // consistent view of the document\n    if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false;\n    var doc = cm.doc, prevShift = doc.sel.shift, done = false;\n    try {\n      if (isReadOnly(cm)) cm.state.suppressEdits = true;\n      if (dropShift) doc.sel.shift = false;\n      done = bound(cm) != Pass;\n    } finally {\n      doc.sel.shift = prevShift;\n      cm.state.suppressEdits = false;\n    }\n    return done;\n  }\n\n  function allKeyMaps(cm) {\n    var maps = cm.state.keyMaps.slice(0);\n    if (cm.options.extraKeys) maps.push(cm.options.extraKeys);\n    maps.push(cm.options.keyMap);\n    return maps;\n  }\n\n  var maybeTransition;\n  function handleKeyBinding(cm, e) {\n    // Handle auto keymap transitions\n    var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto;\n    clearTimeout(maybeTransition);\n    if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() {\n      if (getKeyMap(cm.options.keyMap) == startMap) {\n        cm.options.keyMap = (next.call ? next.call(null, cm) : next);\n        keyMapChanged(cm);\n      }\n    }, 50);\n\n    var name = keyName(e, true), handled = false;\n    if (!name) return false;\n    var keymaps = allKeyMaps(cm);\n\n    if (e.shiftKey) {\n      // First try to resolve full name (including 'Shift-'). Failing\n      // that, see if there is a cursor-motion command (starting with\n      // 'go') bound to the keyname without 'Shift-'.\n      handled = lookupKey(\"Shift-\" + name, keymaps, function(b) {return doHandleBinding(cm, b, true);})\n             || lookupKey(name, keymaps, function(b) {\n                  if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n                    return doHandleBinding(cm, b);\n                });\n    } else {\n      handled = lookupKey(name, keymaps, function(b) { return doHandleBinding(cm, b); });\n    }\n\n    if (handled) {\n      e_preventDefault(e);\n      restartBlink(cm);\n      if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; }\n      signalLater(cm, \"keyHandled\", cm, name, e);\n    }\n    return handled;\n  }\n\n  function handleCharBinding(cm, e, ch) {\n    var handled = lookupKey(\"'\" + ch + \"'\", allKeyMaps(cm),\n                            function(b) { return doHandleBinding(cm, b, true); });\n    if (handled) {\n      e_preventDefault(e);\n      restartBlink(cm);\n      signalLater(cm, \"keyHandled\", cm, \"'\" + ch + \"'\", e);\n    }\n    return handled;\n  }\n\n  var lastStoppedKey = null;\n  function onKeyDown(e) {\n    var cm = this;\n    if (!cm.state.focused) onFocus(cm);\n    if (ie && e.keyCode == 27) { e.returnValue = false; }\n    if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;\n    var code = e.keyCode;\n    // IE does strange things with escape.\n    cm.doc.sel.shift = code == 16 || e.shiftKey;\n    // First give onKeyEvent option a chance to handle this.\n    var handled = handleKeyBinding(cm, e);\n    if (opera) {\n      lastStoppedKey = handled ? code : null;\n      // Opera has no cut event... we try to at least catch the key combo\n      if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n        cm.replaceSelection(\"\");\n    }\n  }\n\n  function onKeyPress(e) {\n    var cm = this;\n    if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;\n    var keyCode = e.keyCode, charCode = e.charCode;\n    if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}\n    if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return;\n    var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n    if (this.options.electricChars && this.doc.mode.electricChars &&\n        this.options.smartIndent && !isReadOnly(this) &&\n        this.doc.mode.electricChars.indexOf(ch) > -1)\n      setTimeout(operation(cm, function() {indentLine(cm, cm.doc.sel.to.line, \"smart\");}), 75);\n    if (handleCharBinding(cm, e, ch)) return;\n    if (ie && !ie_lt9) cm.display.inputHasSelection = null;\n    fastPoll(cm);\n  }\n\n  function onFocus(cm) {\n    if (cm.options.readOnly == \"nocursor\") return;\n    if (!cm.state.focused) {\n      signal(cm, \"focus\", cm);\n      cm.state.focused = true;\n      if (cm.display.wrapper.className.search(/\\bCodeMirror-focused\\b/) == -1)\n        cm.display.wrapper.className += \" CodeMirror-focused\";\n      resetInput(cm, true);\n    }\n    slowPoll(cm);\n    restartBlink(cm);\n  }\n  function onBlur(cm) {\n    if (cm.state.focused) {\n      signal(cm, \"blur\", cm);\n      cm.state.focused = false;\n      cm.display.wrapper.className = cm.display.wrapper.className.replace(\" CodeMirror-focused\", \"\");\n    }\n    clearInterval(cm.display.blinker);\n    setTimeout(function() {if (!cm.state.focused) cm.doc.sel.shift = false;}, 150);\n  }\n\n  var detectingSelectAll;\n  function onContextMenu(cm, e) {\n    var display = cm.display, sel = cm.doc.sel;\n    if (eventInWidget(display, e)) return;\n\n    var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n    if (!pos || opera) return; // Opera is difficult.\n    if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))\n      operation(cm, setSelection)(cm.doc, pos, pos);\n\n    var oldCSS = display.input.style.cssText;\n    display.inputDiv.style.position = \"absolute\";\n    display.input.style.cssText = \"position: fixed; width: 30px; height: 30px; top: \" + (e.clientY - 5) +\n      \"px; left: \" + (e.clientX - 5) + \"px; z-index: 1000; background: white; outline: none;\" +\n      \"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);\";\n    focusInput(cm);\n    resetInput(cm, true);\n    // Adds \"Select all\" to context menu in FF\n    if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = \" \";\n\n    function prepareSelectAllHack() {\n      if (display.input.selectionStart != null) {\n        var extval = display.input.value = \" \" + (posEq(sel.from, sel.to) ? \"\" : display.input.value);\n        display.prevInput = \" \";\n        display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n      }\n    }\n    function rehide() {\n      display.inputDiv.style.position = \"relative\";\n      display.input.style.cssText = oldCSS;\n      if (ie_lt9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;\n      slowPoll(cm);\n\n      // Try to detect the user choosing select-all\n      if (display.input.selectionStart != null) {\n        if (!ie || ie_lt9) prepareSelectAllHack();\n        clearTimeout(detectingSelectAll);\n        var i = 0, poll = function(){\n          if (display.prevInput == \" \" && display.input.selectionStart == 0)\n            operation(cm, commands.selectAll)(cm);\n          else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500);\n          else resetInput(cm);\n        };\n        detectingSelectAll = setTimeout(poll, 200);\n      }\n    }\n\n    if (ie && !ie_lt9) prepareSelectAllHack();\n    if (captureMiddleClick) {\n      e_stop(e);\n      var mouseup = function() {\n        off(window, \"mouseup\", mouseup);\n        setTimeout(rehide, 20);\n      };\n      on(window, \"mouseup\", mouseup);\n    } else {\n      setTimeout(rehide, 50);\n    }\n  }\n\n  // UPDATING\n\n  var changeEnd = CodeMirror.changeEnd = function(change) {\n    if (!change.text) return change.to;\n    return Pos(change.from.line + change.text.length - 1,\n               lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0));\n  };\n\n  // Make sure a position will be valid after the given change.\n  function clipPostChange(doc, change, pos) {\n    if (!posLess(change.from, pos)) return clipPos(doc, pos);\n    var diff = (change.text.length - 1) - (change.to.line - change.from.line);\n    if (pos.line > change.to.line + diff) {\n      var preLine = pos.line - diff, lastLine = doc.first + doc.size - 1;\n      if (preLine > lastLine) return Pos(lastLine, getLine(doc, lastLine).text.length);\n      return clipToLen(pos, getLine(doc, preLine).text.length);\n    }\n    if (pos.line == change.to.line + diff)\n      return clipToLen(pos, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0) +\n                       getLine(doc, change.to.line).text.length - change.to.ch);\n    var inside = pos.line - change.from.line;\n    return clipToLen(pos, change.text[inside].length + (inside ? 0 : change.from.ch));\n  }\n\n  // Hint can be null|\"end\"|\"start\"|\"around\"|{anchor,head}\n  function computeSelAfterChange(doc, change, hint) {\n    if (hint && typeof hint == \"object\") // Assumed to be {anchor, head} object\n      return {anchor: clipPostChange(doc, change, hint.anchor),\n              head: clipPostChange(doc, change, hint.head)};\n\n    if (hint == \"start\") return {anchor: change.from, head: change.from};\n\n    var end = changeEnd(change);\n    if (hint == \"around\") return {anchor: change.from, head: end};\n    if (hint == \"end\") return {anchor: end, head: end};\n\n    // hint is null, leave the selection alone as much as possible\n    var adjustPos = function(pos) {\n      if (posLess(pos, change.from)) return pos;\n      if (!posLess(change.to, pos)) return end;\n\n      var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n      if (pos.line == change.to.line) ch += end.ch - change.to.ch;\n      return Pos(line, ch);\n    };\n    return {anchor: adjustPos(doc.sel.anchor), head: adjustPos(doc.sel.head)};\n  }\n\n  function filterChange(doc, change, update) {\n    var obj = {\n      canceled: false,\n      from: change.from,\n      to: change.to,\n      text: change.text,\n      origin: change.origin,\n      cancel: function() { this.canceled = true; }\n    };\n    if (update) obj.update = function(from, to, text, origin) {\n      if (from) this.from = clipPos(doc, from);\n      if (to) this.to = clipPos(doc, to);\n      if (text) this.text = text;\n      if (origin !== undefined) this.origin = origin;\n    };\n    signal(doc, \"beforeChange\", doc, obj);\n    if (doc.cm) signal(doc.cm, \"beforeChange\", doc.cm, obj);\n\n    if (obj.canceled) return null;\n    return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin};\n  }\n\n  // Replace the range from from to to by the strings in replacement.\n  // change is a {from, to, text [, origin]} object\n  function makeChange(doc, change, selUpdate, ignoreReadOnly) {\n    if (doc.cm) {\n      if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, selUpdate, ignoreReadOnly);\n      if (doc.cm.state.suppressEdits) return;\n    }\n\n    if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n      change = filterChange(doc, change, true);\n      if (!change) return;\n    }\n\n    // Possibly split or suppress the update based on the presence\n    // of read-only spans in its range.\n    var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n    if (split) {\n      for (var i = split.length - 1; i >= 1; --i)\n        makeChangeNoReadonly(doc, {from: split[i].from, to: split[i].to, text: [\"\"]});\n      if (split.length)\n        makeChangeNoReadonly(doc, {from: split[0].from, to: split[0].to, text: change.text}, selUpdate);\n    } else {\n      makeChangeNoReadonly(doc, change, selUpdate);\n    }\n  }\n\n  function makeChangeNoReadonly(doc, change, selUpdate) {\n    var selAfter = computeSelAfterChange(doc, change, selUpdate);\n    addToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n    makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n    var rebased = [];\n\n    linkedDocs(doc, function(doc, sharedHist) {\n      if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n        rebaseHist(doc.history, change);\n        rebased.push(doc.history);\n      }\n      makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n    });\n  }\n\n  function makeChangeFromHistory(doc, type) {\n    if (doc.cm && doc.cm.state.suppressEdits) return;\n\n    var hist = doc.history;\n    var event = (type == \"undo\" ? hist.done : hist.undone).pop();\n    if (!event) return;\n\n    var anti = {changes: [], anchorBefore: event.anchorAfter, headBefore: event.headAfter,\n                anchorAfter: event.anchorBefore, headAfter: event.headBefore,\n                generation: hist.generation};\n    (type == \"undo\" ? hist.undone : hist.done).push(anti);\n    hist.generation = event.generation || ++hist.maxGeneration;\n\n    var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n    for (var i = event.changes.length - 1; i >= 0; --i) {\n      var change = event.changes[i];\n      change.origin = type;\n      if (filter && !filterChange(doc, change, false)) {\n        (type == \"undo\" ? hist.done : hist.undone).length = 0;\n        return;\n      }\n\n      anti.changes.push(historyChangeFromChange(doc, change));\n\n      var after = i ? computeSelAfterChange(doc, change, null)\n                    : {anchor: event.anchorBefore, head: event.headBefore};\n      makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n      var rebased = [];\n\n      linkedDocs(doc, function(doc, sharedHist) {\n        if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n          rebaseHist(doc.history, change);\n          rebased.push(doc.history);\n        }\n        makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n      });\n    }\n  }\n\n  function shiftDoc(doc, distance) {\n    function shiftPos(pos) {return Pos(pos.line + distance, pos.ch);}\n    doc.first += distance;\n    if (doc.cm) regChange(doc.cm, doc.first, doc.first, distance);\n    doc.sel.head = shiftPos(doc.sel.head); doc.sel.anchor = shiftPos(doc.sel.anchor);\n    doc.sel.from = shiftPos(doc.sel.from); doc.sel.to = shiftPos(doc.sel.to);\n  }\n\n  function makeChangeSingleDoc(doc, change, selAfter, spans) {\n    if (doc.cm && !doc.cm.curOp)\n      return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans);\n\n    if (change.to.line < doc.first) {\n      shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n      return;\n    }\n    if (change.from.line > doc.lastLine()) return;\n\n    // Clip the change to the size of this doc\n    if (change.from.line < doc.first) {\n      var shift = change.text.length - 1 - (doc.first - change.from.line);\n      shiftDoc(doc, shift);\n      change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n                text: [lst(change.text)], origin: change.origin};\n    }\n    var last = doc.lastLine();\n    if (change.to.line > last) {\n      change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n                text: [change.text[0]], origin: change.origin};\n    }\n\n    change.removed = getBetween(doc, change.from, change.to);\n\n    if (!selAfter) selAfter = computeSelAfterChange(doc, change, null);\n    if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans, selAfter);\n    else updateDoc(doc, change, spans, selAfter);\n  }\n\n  function makeChangeSingleDocInEditor(cm, change, spans, selAfter) {\n    var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n    var recomputeMaxLength = false, checkWidthStart = from.line;\n    if (!cm.options.lineWrapping) {\n      checkWidthStart = lineNo(visualLine(doc, getLine(doc, from.line)));\n      doc.iter(checkWidthStart, to.line + 1, function(line) {\n        if (line == display.maxLine) {\n          recomputeMaxLength = true;\n          return true;\n        }\n      });\n    }\n\n    if (!posLess(doc.sel.head, change.from) && !posLess(change.to, doc.sel.head))\n      cm.curOp.cursorActivity = true;\n\n    updateDoc(doc, change, spans, selAfter, estimateHeight(cm));\n\n    if (!cm.options.lineWrapping) {\n      doc.iter(checkWidthStart, from.line + change.text.length, function(line) {\n        var len = lineLength(doc, line);\n        if (len > display.maxLineLength) {\n          display.maxLine = line;\n          display.maxLineLength = len;\n          display.maxLineChanged = true;\n          recomputeMaxLength = false;\n        }\n      });\n      if (recomputeMaxLength) cm.curOp.updateMaxLine = true;\n    }\n\n    // Adjust frontier, schedule worker\n    doc.frontier = Math.min(doc.frontier, from.line);\n    startWorker(cm, 400);\n\n    var lendiff = change.text.length - (to.line - from.line) - 1;\n    // Remember that these lines changed, for updating the display\n    regChange(cm, from.line, to.line + 1, lendiff);\n\n    if (hasHandler(cm, \"change\")) {\n      var changeObj = {from: from, to: to,\n                       text: change.text,\n                       removed: change.removed,\n                       origin: change.origin};\n      if (cm.curOp.textChanged) {\n        for (var cur = cm.curOp.textChanged; cur.next; cur = cur.next) {}\n        cur.next = changeObj;\n      } else cm.curOp.textChanged = changeObj;\n    }\n  }\n\n  function replaceRange(doc, code, from, to, origin) {\n    if (!to) to = from;\n    if (posLess(to, from)) { var tmp = to; to = from; from = tmp; }\n    if (typeof code == \"string\") code = splitLines(code);\n    makeChange(doc, {from: from, to: to, text: code, origin: origin}, null);\n  }\n\n  // POSITION OBJECT\n\n  function Pos(line, ch) {\n    if (!(this instanceof Pos)) return new Pos(line, ch);\n    this.line = line; this.ch = ch;\n  }\n  CodeMirror.Pos = Pos;\n\n  function posEq(a, b) {return a.line == b.line && a.ch == b.ch;}\n  function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);}\n  function copyPos(x) {return Pos(x.line, x.ch);}\n\n  // SELECTION\n\n  function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}\n  function clipPos(doc, pos) {\n    if (pos.line < doc.first) return Pos(doc.first, 0);\n    var last = doc.first + doc.size - 1;\n    if (pos.line > last) return Pos(last, getLine(doc, last).text.length);\n    return clipToLen(pos, getLine(doc, pos.line).text.length);\n  }\n  function clipToLen(pos, linelen) {\n    var ch = pos.ch;\n    if (ch == null || ch > linelen) return Pos(pos.line, linelen);\n    else if (ch < 0) return Pos(pos.line, 0);\n    else return pos;\n  }\n  function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;}\n\n  // If shift is held, this will move the selection anchor. Otherwise,\n  // it'll set the whole selection.\n  function extendSelection(doc, pos, other, bias) {\n    if (doc.sel.shift || doc.sel.extend) {\n      var anchor = doc.sel.anchor;\n      if (other) {\n        var posBefore = posLess(pos, anchor);\n        if (posBefore != posLess(other, anchor)) {\n          anchor = pos;\n          pos = other;\n        } else if (posBefore != posLess(pos, other)) {\n          pos = other;\n        }\n      }\n      setSelection(doc, anchor, pos, bias);\n    } else {\n      setSelection(doc, pos, other || pos, bias);\n    }\n    if (doc.cm) doc.cm.curOp.userSelChange = true;\n  }\n\n  function filterSelectionChange(doc, anchor, head) {\n    var obj = {anchor: anchor, head: head};\n    signal(doc, \"beforeSelectionChange\", doc, obj);\n    if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n    obj.anchor = clipPos(doc, obj.anchor); obj.head = clipPos(doc, obj.head);\n    return obj;\n  }\n\n  // Update the selection. Last two args are only used by\n  // updateDoc, since they have to be expressed in the line\n  // numbers before the update.\n  function setSelection(doc, anchor, head, bias, checkAtomic) {\n    if (!checkAtomic && hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\")) {\n      var filtered = filterSelectionChange(doc, anchor, head);\n      head = filtered.head;\n      anchor = filtered.anchor;\n    }\n\n    var sel = doc.sel;\n    sel.goalColumn = null;\n    // Skip over atomic spans.\n    if (checkAtomic || !posEq(anchor, sel.anchor))\n      anchor = skipAtomic(doc, anchor, bias, checkAtomic != \"push\");\n    if (checkAtomic || !posEq(head, sel.head))\n      head = skipAtomic(doc, head, bias, checkAtomic != \"push\");\n\n    if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return;\n\n    sel.anchor = anchor; sel.head = head;\n    var inv = posLess(head, anchor);\n    sel.from = inv ? head : anchor;\n    sel.to = inv ? anchor : head;\n\n    if (doc.cm)\n      doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged =\n        doc.cm.curOp.cursorActivity = true;\n\n    signalLater(doc, \"cursorActivity\", doc);\n  }\n\n  function reCheckSelection(cm) {\n    setSelection(cm.doc, cm.doc.sel.from, cm.doc.sel.to, null, \"push\");\n  }\n\n  function skipAtomic(doc, pos, bias, mayClear) {\n    var flipped = false, curPos = pos;\n    var dir = bias || 1;\n    doc.cantEdit = false;\n    search: for (;;) {\n      var line = getLine(doc, curPos.line);\n      if (line.markedSpans) {\n        for (var i = 0; i < line.markedSpans.length; ++i) {\n          var sp = line.markedSpans[i], m = sp.marker;\n          if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) &&\n              (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) {\n            if (mayClear) {\n              signal(m, \"beforeCursorEnter\");\n              if (m.explicitlyCleared) {\n                if (!line.markedSpans) break;\n                else {--i; continue;}\n              }\n            }\n            if (!m.atomic) continue;\n            var newPos = m.find()[dir < 0 ? \"from\" : \"to\"];\n            if (posEq(newPos, curPos)) {\n              newPos.ch += dir;\n              if (newPos.ch < 0) {\n                if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1));\n                else newPos = null;\n              } else if (newPos.ch > line.text.length) {\n                if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0);\n                else newPos = null;\n              }\n              if (!newPos) {\n                if (flipped) {\n                  // Driven in a corner -- no valid cursor position found at all\n                  // -- try again *with* clearing, if we didn't already\n                  if (!mayClear) return skipAtomic(doc, pos, bias, true);\n                  // Otherwise, turn off editing until further notice, and return the start of the doc\n                  doc.cantEdit = true;\n                  return Pos(doc.first, 0);\n                }\n                flipped = true; newPos = pos; dir = -dir;\n              }\n            }\n            curPos = newPos;\n            continue search;\n          }\n        }\n      }\n      return curPos;\n    }\n  }\n\n  // SCROLLING\n\n  function scrollCursorIntoView(cm) {\n    var coords = scrollPosIntoView(cm, cm.doc.sel.head, cm.options.cursorScrollMargin);\n    if (!cm.state.focused) return;\n    var display = cm.display, box = getRect(display.sizer), doScroll = null;\n    if (coords.top + box.top < 0) doScroll = true;\n    else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;\n    if (doScroll != null && !phantom) {\n      var hidden = display.cursor.style.display == \"none\";\n      if (hidden) {\n        display.cursor.style.display = \"\";\n        display.cursor.style.left = coords.left + \"px\";\n        display.cursor.style.top = (coords.top - display.viewOffset) + \"px\";\n      }\n      display.cursor.scrollIntoView(doScroll);\n      if (hidden) display.cursor.style.display = \"none\";\n    }\n  }\n\n  function scrollPosIntoView(cm, pos, margin) {\n    if (margin == null) margin = 0;\n    for (;;) {\n      var changed = false, coords = cursorCoords(cm, pos);\n      var scrollPos = calculateScrollPos(cm, coords.left, coords.top - margin, coords.left, coords.bottom + margin);\n      var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n      if (scrollPos.scrollTop != null) {\n        setScrollTop(cm, scrollPos.scrollTop);\n        if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n      }\n      if (scrollPos.scrollLeft != null) {\n        setScrollLeft(cm, scrollPos.scrollLeft);\n        if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n      }\n      if (!changed) return coords;\n    }\n  }\n\n  function scrollIntoView(cm, x1, y1, x2, y2) {\n    var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n    if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n    if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n  }\n\n  function calculateScrollPos(cm, x1, y1, x2, y2) {\n    var display = cm.display, snapMargin = textHeight(cm.display);\n    if (y1 < 0) y1 = 0;\n    var screen = display.scroller.clientHeight - scrollerCutOff, screentop = display.scroller.scrollTop, result = {};\n    var docBottom = cm.doc.height + paddingVert(display);\n    var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n    if (y1 < screentop) {\n      result.scrollTop = atTop ? 0 : y1;\n    } else if (y2 > screentop + screen) {\n      var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n      if (newTop != screentop) result.scrollTop = newTop;\n    }\n\n    var screenw = display.scroller.clientWidth - scrollerCutOff, screenleft = display.scroller.scrollLeft;\n    x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth;\n    var gutterw = display.gutters.offsetWidth;\n    var atLeft = x1 < gutterw + 10;\n    if (x1 < screenleft + gutterw || atLeft) {\n      if (atLeft) x1 = 0;\n      result.scrollLeft = Math.max(0, x1 - 10 - gutterw);\n    } else if (x2 > screenw + screenleft - 3) {\n      result.scrollLeft = x2 + 10 - screenw;\n    }\n    return result;\n  }\n\n  function updateScrollPos(cm, left, top) {\n    cm.curOp.updateScrollPos = {scrollLeft: left == null ? cm.doc.scrollLeft : left,\n                                scrollTop: top == null ? cm.doc.scrollTop : top};\n  }\n\n  function addToScrollPos(cm, left, top) {\n    var pos = cm.curOp.updateScrollPos || (cm.curOp.updateScrollPos = {scrollLeft: cm.doc.scrollLeft, scrollTop: cm.doc.scrollTop});\n    var scroll = cm.display.scroller;\n    pos.scrollTop = Math.max(0, Math.min(scroll.scrollHeight - scroll.clientHeight, pos.scrollTop + top));\n    pos.scrollLeft = Math.max(0, Math.min(scroll.scrollWidth - scroll.clientWidth, pos.scrollLeft + left));\n  }\n\n  // API UTILITIES\n\n  function indentLine(cm, n, how, aggressive) {\n    var doc = cm.doc;\n    if (how == null) how = \"add\";\n    if (how == \"smart\") {\n      if (!cm.doc.mode.indent) how = \"prev\";\n      else var state = getStateBefore(cm, n);\n    }\n\n    var tabSize = cm.options.tabSize;\n    var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n    var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n    if (how == \"smart\") {\n      indentation = cm.doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n      if (indentation == Pass) {\n        if (!aggressive) return;\n        how = \"prev\";\n      }\n    }\n    if (how == \"prev\") {\n      if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n      else indentation = 0;\n    } else if (how == \"add\") {\n      indentation = curSpace + cm.options.indentUnit;\n    } else if (how == \"subtract\") {\n      indentation = curSpace - cm.options.indentUnit;\n    } else if (typeof how == \"number\") {\n      indentation = curSpace + how;\n    }\n    indentation = Math.max(0, indentation);\n\n    var indentString = \"\", pos = 0;\n    if (cm.options.indentWithTabs)\n      for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n    if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n    if (indentString != curSpaceString)\n      replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n    line.stateAfter = null;\n  }\n\n  function changeLine(cm, handle, op) {\n    var no = handle, line = handle, doc = cm.doc;\n    if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n    else no = lineNo(handle);\n    if (no == null) return null;\n    if (op(line, no)) regChange(cm, no, no + 1);\n    else return null;\n    return line;\n  }\n\n  function findPosH(doc, pos, dir, unit, visually) {\n    var line = pos.line, ch = pos.ch, origDir = dir;\n    var lineObj = getLine(doc, line);\n    var possible = true;\n    function findNextLine() {\n      var l = line + dir;\n      if (l < doc.first || l >= doc.first + doc.size) return (possible = false);\n      line = l;\n      return lineObj = getLine(doc, l);\n    }\n    function moveOnce(boundToLine) {\n      var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);\n      if (next == null) {\n        if (!boundToLine && findNextLine()) {\n          if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);\n          else ch = dir < 0 ? lineObj.text.length : 0;\n        } else return (possible = false);\n      } else ch = next;\n      return true;\n    }\n\n    if (unit == \"char\") moveOnce();\n    else if (unit == \"column\") moveOnce(true);\n    else if (unit == \"word\" || unit == \"group\") {\n      var sawType = null, group = unit == \"group\";\n      for (var first = true;; first = false) {\n        if (dir < 0 && !moveOnce(!first)) break;\n        var cur = lineObj.text.charAt(ch) || \"\\n\";\n        var type = isWordChar(cur) ? \"w\"\n          : !group ? null\n          : /\\s/.test(cur) ? null\n          : \"p\";\n        if (sawType && sawType != type) {\n          if (dir < 0) {dir = 1; moveOnce();}\n          break;\n        }\n        if (type) sawType = type;\n        if (dir > 0 && !moveOnce(!first)) break;\n      }\n    }\n    var result = skipAtomic(doc, Pos(line, ch), origDir, true);\n    if (!possible) result.hitSide = true;\n    return result;\n  }\n\n  function findPosV(cm, pos, dir, unit) {\n    var doc = cm.doc, x = pos.left, y;\n    if (unit == \"page\") {\n      var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n      y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display));\n    } else if (unit == \"line\") {\n      y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n    }\n    for (;;) {\n      var target = coordsChar(cm, x, y);\n      if (!target.outside) break;\n      if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; }\n      y += dir * 5;\n    }\n    return target;\n  }\n\n  function findWordAt(line, pos) {\n    var start = pos.ch, end = pos.ch;\n    if (line) {\n      if (pos.xRel < 0 || end == line.length) --start; else ++end;\n      var startChar = line.charAt(start);\n      var check = isWordChar(startChar) ? isWordChar\n        : /\\s/.test(startChar) ? function(ch) {return /\\s/.test(ch);}\n        : function(ch) {return !/\\s/.test(ch) && !isWordChar(ch);};\n      while (start > 0 && check(line.charAt(start - 1))) --start;\n      while (end < line.length && check(line.charAt(end))) ++end;\n    }\n    return {from: Pos(pos.line, start), to: Pos(pos.line, end)};\n  }\n\n  function selectLine(cm, line) {\n    extendSelection(cm.doc, Pos(line, 0), clipPos(cm.doc, Pos(line + 1, 0)));\n  }\n\n  // PROTOTYPE\n\n  // The publicly visible API. Note that operation(null, f) means\n  // 'wrap f in an operation, performed on its `this` parameter'\n\n  CodeMirror.prototype = {\n    constructor: CodeMirror,\n    focus: function(){window.focus(); focusInput(this); onFocus(this); fastPoll(this);},\n\n    setOption: function(option, value) {\n      var options = this.options, old = options[option];\n      if (options[option] == value && option != \"mode\") return;\n      options[option] = value;\n      if (optionHandlers.hasOwnProperty(option))\n        operation(this, optionHandlers[option])(this, value, old);\n    },\n\n    getOption: function(option) {return this.options[option];},\n    getDoc: function() {return this.doc;},\n\n    addKeyMap: function(map, bottom) {\n      this.state.keyMaps[bottom ? \"push\" : \"unshift\"](map);\n    },\n    removeKeyMap: function(map) {\n      var maps = this.state.keyMaps;\n      for (var i = 0; i < maps.length; ++i)\n        if ((typeof map == \"string\" ? maps[i].name : maps[i]) == map) {\n          maps.splice(i, 1);\n          return true;\n        }\n    },\n\n    addOverlay: operation(null, function(spec, options) {\n      var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n      if (mode.startState) throw new Error(\"Overlays may not be stateful.\");\n      this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque});\n      this.state.modeGen++;\n      regChange(this);\n    }),\n    removeOverlay: operation(null, function(spec) {\n      var overlays = this.state.overlays;\n      for (var i = 0; i < overlays.length; ++i) {\n        var cur = overlays[i].modeSpec;\n        if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n          overlays.splice(i, 1);\n          this.state.modeGen++;\n          regChange(this);\n          return;\n        }\n      }\n    }),\n\n    indentLine: operation(null, function(n, dir, aggressive) {\n      if (typeof dir != \"string\" && typeof dir != \"number\") {\n        if (dir == null) dir = this.options.smartIndent ? \"smart\" : \"prev\";\n        else dir = dir ? \"add\" : \"subtract\";\n      }\n      if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive);\n    }),\n    indentSelection: operation(null, function(how) {\n      var sel = this.doc.sel;\n      if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how);\n      var e = sel.to.line - (sel.to.ch ? 0 : 1);\n      for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how);\n    }),\n\n    // Fetch the parser token for a given character. Useful for hacks\n    // that want to inspect the mode state (say, for completion).\n    getTokenAt: function(pos, precise) {\n      var doc = this.doc;\n      pos = clipPos(doc, pos);\n      var state = getStateBefore(this, pos.line, precise), mode = this.doc.mode;\n      var line = getLine(doc, pos.line);\n      var stream = new StringStream(line.text, this.options.tabSize);\n      while (stream.pos < pos.ch && !stream.eol()) {\n        stream.start = stream.pos;\n        var style = mode.token(stream, state);\n      }\n      return {start: stream.start,\n              end: stream.pos,\n              string: stream.current(),\n              className: style || null, // Deprecated, use 'type' instead\n              type: style || null,\n              state: state};\n    },\n\n    getTokenTypeAt: function(pos) {\n      pos = clipPos(this.doc, pos);\n      var styles = getLineStyles(this, getLine(this.doc, pos.line));\n      var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n      for (;;) {\n        var mid = (before + after) >> 1;\n        if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid;\n        else if (styles[mid * 2 + 1] < ch) before = mid + 1;\n        else return styles[mid * 2 + 2];\n      }\n    },\n\n    getStateAfter: function(line, precise) {\n      var doc = this.doc;\n      line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n      return getStateBefore(this, line + 1, precise);\n    },\n\n    cursorCoords: function(start, mode) {\n      var pos, sel = this.doc.sel;\n      if (start == null) pos = sel.head;\n      else if (typeof start == \"object\") pos = clipPos(this.doc, start);\n      else pos = start ? sel.from : sel.to;\n      return cursorCoords(this, pos, mode || \"page\");\n    },\n\n    charCoords: function(pos, mode) {\n      return charCoords(this, clipPos(this.doc, pos), mode || \"page\");\n    },\n\n    coordsChar: function(coords, mode) {\n      coords = fromCoordSystem(this, coords, mode || \"page\");\n      return coordsChar(this, coords.left, coords.top);\n    },\n\n    lineAtHeight: function(height, mode) {\n      height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n      return lineAtHeight(this.doc, height + this.display.viewOffset);\n    },\n    heightAtLine: function(line, mode) {\n      var end = false, last = this.doc.first + this.doc.size - 1;\n      if (line < this.doc.first) line = this.doc.first;\n      else if (line > last) { line = last; end = true; }\n      var lineObj = getLine(this.doc, line);\n      return intoCoordSystem(this, getLine(this.doc, line), {top: 0, left: 0}, mode || \"page\").top +\n        (end ? lineObj.height : 0);\n    },\n\n    defaultTextHeight: function() { return textHeight(this.display); },\n    defaultCharWidth: function() { return charWidth(this.display); },\n\n    setGutterMarker: operation(null, function(line, gutterID, value) {\n      return changeLine(this, line, function(line) {\n        var markers = line.gutterMarkers || (line.gutterMarkers = {});\n        markers[gutterID] = value;\n        if (!value && isEmpty(markers)) line.gutterMarkers = null;\n        return true;\n      });\n    }),\n\n    clearGutter: operation(null, function(gutterID) {\n      var cm = this, doc = cm.doc, i = doc.first;\n      doc.iter(function(line) {\n        if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n          line.gutterMarkers[gutterID] = null;\n          regChange(cm, i, i + 1);\n          if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null;\n        }\n        ++i;\n      });\n    }),\n\n    addLineClass: operation(null, function(handle, where, cls) {\n      return changeLine(this, handle, function(line) {\n        var prop = where == \"text\" ? \"textClass\" : where == \"background\" ? \"bgClass\" : \"wrapClass\";\n        if (!line[prop]) line[prop] = cls;\n        else if (new RegExp(\"(?:^|\\\\s)\" + cls + \"(?:$|\\\\s)\").test(line[prop])) return false;\n        else line[prop] += \" \" + cls;\n        return true;\n      });\n    }),\n\n    removeLineClass: operation(null, function(handle, where, cls) {\n      return changeLine(this, handle, function(line) {\n        var prop = where == \"text\" ? \"textClass\" : where == \"background\" ? \"bgClass\" : \"wrapClass\";\n        var cur = line[prop];\n        if (!cur) return false;\n        else if (cls == null) line[prop] = null;\n        else {\n          var found = cur.match(new RegExp(\"(?:^|\\\\s+)\" + cls + \"(?:$|\\\\s+)\"));\n          if (!found) return false;\n          var end = found.index + found[0].length;\n          line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n        }\n        return true;\n      });\n    }),\n\n    addLineWidget: operation(null, function(handle, node, options) {\n      return addLineWidget(this, handle, node, options);\n    }),\n\n    removeLineWidget: function(widget) { widget.clear(); },\n\n    lineInfo: function(line) {\n      if (typeof line == \"number\") {\n        if (!isLine(this.doc, line)) return null;\n        var n = line;\n        line = getLine(this.doc, line);\n        if (!line) return null;\n      } else {\n        var n = lineNo(line);\n        if (n == null) return null;\n      }\n      return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n              textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n              widgets: line.widgets};\n    },\n\n    getViewport: function() { return {from: this.display.showingFrom, to: this.display.showingTo};},\n\n    addWidget: function(pos, node, scroll, vert, horiz) {\n      var display = this.display;\n      pos = cursorCoords(this, clipPos(this.doc, pos));\n      var top = pos.bottom, left = pos.left;\n      node.style.position = \"absolute\";\n      display.sizer.appendChild(node);\n      if (vert == \"over\") {\n        top = pos.top;\n      } else if (vert == \"above\" || vert == \"near\") {\n        var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n        hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n        // Default to positioning above (if specified and possible); otherwise default to positioning below\n        if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n          top = pos.top - node.offsetHeight;\n        else if (pos.bottom + node.offsetHeight <= vspace)\n          top = pos.bottom;\n        if (left + node.offsetWidth > hspace)\n          left = hspace - node.offsetWidth;\n      }\n      node.style.top = top + \"px\";\n      node.style.left = node.style.right = \"\";\n      if (horiz == \"right\") {\n        left = display.sizer.clientWidth - node.offsetWidth;\n        node.style.right = \"0px\";\n      } else {\n        if (horiz == \"left\") left = 0;\n        else if (horiz == \"middle\") left = (display.sizer.clientWidth - node.offsetWidth) / 2;\n        node.style.left = left + \"px\";\n      }\n      if (scroll)\n        scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight);\n    },\n\n    triggerOnKeyDown: operation(null, onKeyDown),\n\n    execCommand: function(cmd) {return commands[cmd](this);},\n\n    findPosH: function(from, amount, unit, visually) {\n      var dir = 1;\n      if (amount < 0) { dir = -1; amount = -amount; }\n      for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {\n        cur = findPosH(this.doc, cur, dir, unit, visually);\n        if (cur.hitSide) break;\n      }\n      return cur;\n    },\n\n    moveH: operation(null, function(dir, unit) {\n      var sel = this.doc.sel, pos;\n      if (sel.shift || sel.extend || posEq(sel.from, sel.to))\n        pos = findPosH(this.doc, sel.head, dir, unit, this.options.rtlMoveVisually);\n      else\n        pos = dir < 0 ? sel.from : sel.to;\n      extendSelection(this.doc, pos, pos, dir);\n    }),\n\n    deleteH: operation(null, function(dir, unit) {\n      var sel = this.doc.sel;\n      if (!posEq(sel.from, sel.to)) replaceRange(this.doc, \"\", sel.from, sel.to, \"+delete\");\n      else replaceRange(this.doc, \"\", sel.from, findPosH(this.doc, sel.head, dir, unit, false), \"+delete\");\n      this.curOp.userSelChange = true;\n    }),\n\n    findPosV: function(from, amount, unit, goalColumn) {\n      var dir = 1, x = goalColumn;\n      if (amount < 0) { dir = -1; amount = -amount; }\n      for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {\n        var coords = cursorCoords(this, cur, \"div\");\n        if (x == null) x = coords.left;\n        else coords.left = x;\n        cur = findPosV(this, coords, dir, unit);\n        if (cur.hitSide) break;\n      }\n      return cur;\n    },\n\n    moveV: operation(null, function(dir, unit) {\n      var sel = this.doc.sel;\n      var pos = cursorCoords(this, sel.head, \"div\");\n      if (sel.goalColumn != null) pos.left = sel.goalColumn;\n      var target = findPosV(this, pos, dir, unit);\n\n      if (unit == \"page\") addToScrollPos(this, 0, charCoords(this, target, \"div\").top - pos.top);\n      extendSelection(this.doc, target, target, dir);\n      sel.goalColumn = pos.left;\n    }),\n\n    toggleOverwrite: function(value) {\n      if (value != null && value == this.state.overwrite) return;\n      if (this.state.overwrite = !this.state.overwrite)\n        this.display.cursor.className += \" CodeMirror-overwrite\";\n      else\n        this.display.cursor.className = this.display.cursor.className.replace(\" CodeMirror-overwrite\", \"\");\n    },\n    hasFocus: function() { return this.state.focused; },\n\n    scrollTo: operation(null, function(x, y) {\n      updateScrollPos(this, x, y);\n    }),\n    getScrollInfo: function() {\n      var scroller = this.display.scroller, co = scrollerCutOff;\n      return {left: scroller.scrollLeft, top: scroller.scrollTop,\n              height: scroller.scrollHeight - co, width: scroller.scrollWidth - co,\n              clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co};\n    },\n\n    scrollIntoView: operation(null, function(pos, margin) {\n      if (typeof pos == \"number\") pos = Pos(pos, 0);\n      if (!margin) margin = 0;\n      var coords = pos;\n\n      if (!pos || pos.line != null) {\n        this.curOp.scrollToPos = pos ? clipPos(this.doc, pos) : this.doc.sel.head;\n        this.curOp.scrollToPosMargin = margin;\n        coords = cursorCoords(this, this.curOp.scrollToPos);\n      }\n      var sPos = calculateScrollPos(this, coords.left, coords.top - margin, coords.right, coords.bottom + margin);\n      updateScrollPos(this, sPos.scrollLeft, sPos.scrollTop);\n    }),\n\n    setSize: function(width, height) {\n      function interpret(val) {\n        return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val;\n      }\n      if (width != null) this.display.wrapper.style.width = interpret(width);\n      if (height != null) this.display.wrapper.style.height = interpret(height);\n      this.refresh();\n    },\n\n    on: function(type, f) {on(this, type, f);},\n    off: function(type, f) {off(this, type, f);},\n\n    operation: function(f){return runInOp(this, f);},\n\n    refresh: operation(null, function() {\n      clearCaches(this);\n      updateScrollPos(this, this.doc.scrollLeft, this.doc.scrollTop);\n      regChange(this);\n    }),\n\n    swapDoc: operation(null, function(doc) {\n      var old = this.doc;\n      old.cm = null;\n      attachDoc(this, doc);\n      clearCaches(this);\n      resetInput(this, true);\n      updateScrollPos(this, doc.scrollLeft, doc.scrollTop);\n      return old;\n    }),\n\n    getInputField: function(){return this.display.input;},\n    getWrapperElement: function(){return this.display.wrapper;},\n    getScrollerElement: function(){return this.display.scroller;},\n    getGutterElement: function(){return this.display.gutters;}\n  };\n\n  // OPTION DEFAULTS\n\n  var optionHandlers = CodeMirror.optionHandlers = {};\n\n  // The default configuration options.\n  var defaults = CodeMirror.defaults = {};\n\n  function option(name, deflt, handle, notOnInit) {\n    CodeMirror.defaults[name] = deflt;\n    if (handle) optionHandlers[name] =\n      notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle;\n  }\n\n  var Init = CodeMirror.Init = {toString: function(){return \"CodeMirror.Init\";}};\n\n  // These two are, on init, called from the constructor because they\n  // have to be initialized before the editor can start at all.\n  option(\"value\", \"\", function(cm, val) {\n    cm.setValue(val);\n  }, true);\n  option(\"mode\", null, function(cm, val) {\n    cm.doc.modeOption = val;\n    loadMode(cm);\n  }, true);\n\n  option(\"indentUnit\", 2, loadMode, true);\n  option(\"indentWithTabs\", false);\n  option(\"smartIndent\", true);\n  option(\"tabSize\", 4, function(cm) {\n    loadMode(cm);\n    clearCaches(cm);\n    regChange(cm);\n  }, true);\n  option(\"electricChars\", true);\n  option(\"rtlMoveVisually\", !windows);\n\n  option(\"theme\", \"default\", function(cm) {\n    themeChanged(cm);\n    guttersChanged(cm);\n  }, true);\n  option(\"keyMap\", \"default\", keyMapChanged);\n  option(\"extraKeys\", null);\n\n  option(\"onKeyEvent\", null);\n  option(\"onDragEvent\", null);\n\n  option(\"lineWrapping\", false, wrappingChanged, true);\n  option(\"gutters\", [], function(cm) {\n    setGuttersForLineNumbers(cm.options);\n    guttersChanged(cm);\n  }, true);\n  option(\"fixedGutter\", true, function(cm, val) {\n    cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n    cm.refresh();\n  }, true);\n  option(\"coverGutterNextToScrollbar\", false, updateScrollbars, true);\n  option(\"lineNumbers\", false, function(cm) {\n    setGuttersForLineNumbers(cm.options);\n    guttersChanged(cm);\n  }, true);\n  option(\"firstLineNumber\", 1, guttersChanged, true);\n  option(\"lineNumberFormatter\", function(integer) {return integer;}, guttersChanged, true);\n  option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n  option(\"readOnly\", false, function(cm, val) {\n    if (val == \"nocursor\") {onBlur(cm); cm.display.input.blur();}\n    else if (!val) resetInput(cm, true);\n  });\n  option(\"dragDrop\", true);\n\n  option(\"cursorBlinkRate\", 530);\n  option(\"cursorScrollMargin\", 0);\n  option(\"cursorHeight\", 1);\n  option(\"workTime\", 100);\n  option(\"workDelay\", 100);\n  option(\"flattenSpans\", true);\n  option(\"pollInterval\", 100);\n  option(\"undoDepth\", 40, function(cm, val){cm.doc.history.undoDepth = val;});\n  option(\"historyEventDelay\", 500);\n  option(\"viewportMargin\", 10, function(cm){cm.refresh();}, true);\n  option(\"maxHighlightLength\", 10000, function(cm){loadMode(cm); cm.refresh();}, true);\n  option(\"moveInputWithCursor\", true, function(cm, val) {\n    if (!val) cm.display.inputDiv.style.top = cm.display.inputDiv.style.left = 0;\n  });\n\n  option(\"tabindex\", null, function(cm, val) {\n    cm.display.input.tabIndex = val || \"\";\n  });\n  option(\"autofocus\", null);\n\n  // MODE DEFINITION AND QUERYING\n\n  // Known modes, by name and by MIME\n  var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};\n\n  CodeMirror.defineMode = function(name, mode) {\n    if (!CodeMirror.defaults.mode && name != \"null\") CodeMirror.defaults.mode = name;\n    if (arguments.length > 2) {\n      mode.dependencies = [];\n      for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]);\n    }\n    modes[name] = mode;\n  };\n\n  CodeMirror.defineMIME = function(mime, spec) {\n    mimeModes[mime] = spec;\n  };\n\n  CodeMirror.resolveMode = function(spec) {\n    if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n      spec = mimeModes[spec];\n    } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n      var found = mimeModes[spec.name];\n      spec = createObj(found, spec);\n      spec.name = found.name;\n    } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n      return CodeMirror.resolveMode(\"application/xml\");\n    }\n    if (typeof spec == \"string\") return {name: spec};\n    else return spec || {name: \"null\"};\n  };\n\n  CodeMirror.getMode = function(options, spec) {\n    spec = CodeMirror.resolveMode(spec);\n    var mfactory = modes[spec.name];\n    if (!mfactory) return CodeMirror.getMode(options, \"text/plain\");\n    var modeObj = mfactory(options, spec);\n    if (modeExtensions.hasOwnProperty(spec.name)) {\n      var exts = modeExtensions[spec.name];\n      for (var prop in exts) {\n        if (!exts.hasOwnProperty(prop)) continue;\n        if (modeObj.hasOwnProperty(prop)) modeObj[\"_\" + prop] = modeObj[prop];\n        modeObj[prop] = exts[prop];\n      }\n    }\n    modeObj.name = spec.name;\n    return modeObj;\n  };\n\n  CodeMirror.defineMode(\"null\", function() {\n    return {token: function(stream) {stream.skipToEnd();}};\n  });\n  CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n  var modeExtensions = CodeMirror.modeExtensions = {};\n  CodeMirror.extendMode = function(mode, properties) {\n    var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n    copyObj(properties, exts);\n  };\n\n  // EXTENSIONS\n\n  CodeMirror.defineExtension = function(name, func) {\n    CodeMirror.prototype[name] = func;\n  };\n  CodeMirror.defineDocExtension = function(name, func) {\n    Doc.prototype[name] = func;\n  };\n  CodeMirror.defineOption = option;\n\n  var initHooks = [];\n  CodeMirror.defineInitHook = function(f) {initHooks.push(f);};\n\n  // MODE STATE HANDLING\n\n  // Utility functions for working with state. Exported because modes\n  // sometimes need to do this.\n  function copyState(mode, state) {\n    if (state === true) return state;\n    if (mode.copyState) return mode.copyState(state);\n    var nstate = {};\n    for (var n in state) {\n      var val = state[n];\n      if (val instanceof Array) val = val.concat([]);\n      nstate[n] = val;\n    }\n    return nstate;\n  }\n  CodeMirror.copyState = copyState;\n\n  function startState(mode, a1, a2) {\n    return mode.startState ? mode.startState(a1, a2) : true;\n  }\n  CodeMirror.startState = startState;\n\n  CodeMirror.innerMode = function(mode, state) {\n    while (mode.innerMode) {\n      var info = mode.innerMode(state);\n      state = info.state;\n      mode = info.mode;\n    }\n    return info || {mode: mode, state: state};\n  };\n\n  // STANDARD COMMANDS\n\n  var commands = CodeMirror.commands = {\n    selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()));},\n    killLine: function(cm) {\n      var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to);\n      if (!sel && cm.getLine(from.line).length == from.ch)\n        cm.replaceRange(\"\", from, Pos(from.line + 1, 0), \"+delete\");\n      else cm.replaceRange(\"\", from, sel ? to : Pos(from.line), \"+delete\");\n    },\n    deleteLine: function(cm) {\n      var l = cm.getCursor().line;\n      cm.replaceRange(\"\", Pos(l, 0), Pos(l), \"+delete\");\n    },\n    delLineLeft: function(cm) {\n      var cur = cm.getCursor();\n      cm.replaceRange(\"\", Pos(cur.line, 0), cur, \"+delete\");\n    },\n    undo: function(cm) {cm.undo();},\n    redo: function(cm) {cm.redo();},\n    goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));},\n    goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));},\n    goLineStart: function(cm) {\n      cm.extendSelection(lineStart(cm, cm.getCursor().line));\n    },\n    goLineStartSmart: function(cm) {\n      var cur = cm.getCursor(), start = lineStart(cm, cur.line);\n      var line = cm.getLineHandle(start.line);\n      var order = getOrder(line);\n      if (!order || order[0].level == 0) {\n        var firstNonWS = Math.max(0, line.text.search(/\\S/));\n        var inWS = cur.line == start.line && cur.ch <= firstNonWS && cur.ch;\n        cm.extendSelection(Pos(start.line, inWS ? 0 : firstNonWS));\n      } else cm.extendSelection(start);\n    },\n    goLineEnd: function(cm) {\n      cm.extendSelection(lineEnd(cm, cm.getCursor().line));\n    },\n    goLineRight: function(cm) {\n      var top = cm.charCoords(cm.getCursor(), \"div\").top + 5;\n      cm.extendSelection(cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\"));\n    },\n    goLineLeft: function(cm) {\n      var top = cm.charCoords(cm.getCursor(), \"div\").top + 5;\n      cm.extendSelection(cm.coordsChar({left: 0, top: top}, \"div\"));\n    },\n    goLineUp: function(cm) {cm.moveV(-1, \"line\");},\n    goLineDown: function(cm) {cm.moveV(1, \"line\");},\n    goPageUp: function(cm) {cm.moveV(-1, \"page\");},\n    goPageDown: function(cm) {cm.moveV(1, \"page\");},\n    goCharLeft: function(cm) {cm.moveH(-1, \"char\");},\n    goCharRight: function(cm) {cm.moveH(1, \"char\");},\n    goColumnLeft: function(cm) {cm.moveH(-1, \"column\");},\n    goColumnRight: function(cm) {cm.moveH(1, \"column\");},\n    goWordLeft: function(cm) {cm.moveH(-1, \"word\");},\n    goGroupRight: function(cm) {cm.moveH(1, \"group\");},\n    goGroupLeft: function(cm) {cm.moveH(-1, \"group\");},\n    goWordRight: function(cm) {cm.moveH(1, \"word\");},\n    delCharBefore: function(cm) {cm.deleteH(-1, \"char\");},\n    delCharAfter: function(cm) {cm.deleteH(1, \"char\");},\n    delWordBefore: function(cm) {cm.deleteH(-1, \"word\");},\n    delWordAfter: function(cm) {cm.deleteH(1, \"word\");},\n    delGroupBefore: function(cm) {cm.deleteH(-1, \"group\");},\n    delGroupAfter: function(cm) {cm.deleteH(1, \"group\");},\n    indentAuto: function(cm) {cm.indentSelection(\"smart\");},\n    indentMore: function(cm) {cm.indentSelection(\"add\");},\n    indentLess: function(cm) {cm.indentSelection(\"subtract\");},\n    insertTab: function(cm) {cm.replaceSelection(\"\\t\", \"end\", \"+input\");},\n    defaultTab: function(cm) {\n      if (cm.somethingSelected()) cm.indentSelection(\"add\");\n      else cm.replaceSelection(\"\\t\", \"end\", \"+input\");\n    },\n    transposeChars: function(cm) {\n      var cur = cm.getCursor(), line = cm.getLine(cur.line);\n      if (cur.ch > 0 && cur.ch < line.length - 1)\n        cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1),\n                        Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1));\n    },\n    newlineAndIndent: function(cm) {\n      operation(cm, function() {\n        cm.replaceSelection(\"\\n\", \"end\", \"+input\");\n        cm.indentLine(cm.getCursor().line, null, true);\n      })();\n    },\n    toggleOverwrite: function(cm) {cm.toggleOverwrite();}\n  };\n\n  // STANDARD KEYMAPS\n\n  var keyMap = CodeMirror.keyMap = {};\n  keyMap.basic = {\n    \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n    \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n    \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n    \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\"\n  };\n  // Note that the save and find-related commands aren't defined by\n  // default. Unknown commands are simply ignored.\n  keyMap.pcDefault = {\n    \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n    \"Ctrl-Home\": \"goDocStart\", \"Alt-Up\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Down\": \"goDocEnd\",\n    \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n    \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n    \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n    \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n    fallthrough: \"basic\"\n  };\n  keyMap.macDefault = {\n    \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n    \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n    \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineStart\", \"Cmd-Right\": \"goLineEnd\", \"Alt-Backspace\": \"delGroupBefore\",\n    \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n    \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n    \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delLineLeft\",\n    fallthrough: [\"basic\", \"emacsy\"]\n  };\n  keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n  keyMap.emacsy = {\n    \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n    \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n    \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n    \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\"\n  };\n\n  // KEYMAP DISPATCH\n\n  function getKeyMap(val) {\n    if (typeof val == \"string\") return keyMap[val];\n    else return val;\n  }\n\n  function lookupKey(name, maps, handle) {\n    function lookup(map) {\n      map = getKeyMap(map);\n      var found = map[name];\n      if (found === false) return \"stop\";\n      if (found != null && handle(found)) return true;\n      if (map.nofallthrough) return \"stop\";\n\n      var fallthrough = map.fallthrough;\n      if (fallthrough == null) return false;\n      if (Object.prototype.toString.call(fallthrough) != \"[object Array]\")\n        return lookup(fallthrough);\n      for (var i = 0, e = fallthrough.length; i < e; ++i) {\n        var done = lookup(fallthrough[i]);\n        if (done) return done;\n      }\n      return false;\n    }\n\n    for (var i = 0; i < maps.length; ++i) {\n      var done = lookup(maps[i]);\n      if (done) return done != \"stop\";\n    }\n  }\n  function isModifierKey(event) {\n    var name = keyNames[event.keyCode];\n    return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\";\n  }\n  function keyName(event, noShift) {\n    if (opera && event.keyCode == 34 && event[\"char\"]) return false;\n    var name = keyNames[event.keyCode];\n    if (name == null || event.altGraphKey) return false;\n    if (event.altKey) name = \"Alt-\" + name;\n    if (flipCtrlCmd ? event.metaKey : event.ctrlKey) name = \"Ctrl-\" + name;\n    if (flipCtrlCmd ? event.ctrlKey : event.metaKey) name = \"Cmd-\" + name;\n    if (!noShift && event.shiftKey) name = \"Shift-\" + name;\n    return name;\n  }\n  CodeMirror.lookupKey = lookupKey;\n  CodeMirror.isModifierKey = isModifierKey;\n  CodeMirror.keyName = keyName;\n\n  // FROMTEXTAREA\n\n  CodeMirror.fromTextArea = function(textarea, options) {\n    if (!options) options = {};\n    options.value = textarea.value;\n    if (!options.tabindex && textarea.tabindex)\n      options.tabindex = textarea.tabindex;\n    if (!options.placeholder && textarea.placeholder)\n      options.placeholder = textarea.placeholder;\n    // Set autofocus to true if this textarea is focused, or if it has\n    // autofocus and no other element is focused.\n    if (options.autofocus == null) {\n      var hasFocus = document.body;\n      // doc.activeElement occasionally throws on IE\n      try { hasFocus = document.activeElement; } catch(e) {}\n      options.autofocus = hasFocus == textarea ||\n        textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n    }\n\n    function save() {textarea.value = cm.getValue();}\n    if (textarea.form) {\n      on(textarea.form, \"submit\", save);\n      // Deplorable hack to make the submit method do the right thing.\n      if (!options.leaveSubmitMethodAlone) {\n        var form = textarea.form, realSubmit = form.submit;\n        try {\n          var wrappedSubmit = form.submit = function() {\n            save();\n            form.submit = realSubmit;\n            form.submit();\n            form.submit = wrappedSubmit;\n          };\n        } catch(e) {}\n      }\n    }\n\n    textarea.style.display = \"none\";\n    var cm = CodeMirror(function(node) {\n      textarea.parentNode.insertBefore(node, textarea.nextSibling);\n    }, options);\n    cm.save = save;\n    cm.getTextArea = function() { return textarea; };\n    cm.toTextArea = function() {\n      save();\n      textarea.parentNode.removeChild(cm.getWrapperElement());\n      textarea.style.display = \"\";\n      if (textarea.form) {\n        off(textarea.form, \"submit\", save);\n        if (typeof textarea.form.submit == \"function\")\n          textarea.form.submit = realSubmit;\n      }\n    };\n    return cm;\n  };\n\n  // STRING STREAM\n\n  // Fed to the mode parsers, provides helper functions to make\n  // parsers more succinct.\n\n  // The character stream used by a mode's parser.\n  function StringStream(string, tabSize) {\n    this.pos = this.start = 0;\n    this.string = string;\n    this.tabSize = tabSize || 8;\n    this.lastColumnPos = this.lastColumnValue = 0;\n  }\n\n  StringStream.prototype = {\n    eol: function() {return this.pos >= this.string.length;},\n    sol: function() {return this.pos == 0;},\n    peek: function() {return this.string.charAt(this.pos) || undefined;},\n    next: function() {\n      if (this.pos < this.string.length)\n        return this.string.charAt(this.pos++);\n    },\n    eat: function(match) {\n      var ch = this.string.charAt(this.pos);\n      if (typeof match == \"string\") var ok = ch == match;\n      else var ok = ch && (match.test ? match.test(ch) : match(ch));\n      if (ok) {++this.pos; return ch;}\n    },\n    eatWhile: function(match) {\n      var start = this.pos;\n      while (this.eat(match)){}\n      return this.pos > start;\n    },\n    eatSpace: function() {\n      var start = this.pos;\n      while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;\n      return this.pos > start;\n    },\n    skipToEnd: function() {this.pos = this.string.length;},\n    skipTo: function(ch) {\n      var found = this.string.indexOf(ch, this.pos);\n      if (found > -1) {this.pos = found; return true;}\n    },\n    backUp: function(n) {this.pos -= n;},\n    column: function() {\n      if (this.lastColumnPos < this.start) {\n        this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n        this.lastColumnPos = this.start;\n      }\n      return this.lastColumnValue;\n    },\n    indentation: function() {return countColumn(this.string, null, this.tabSize);},\n    match: function(pattern, consume, caseInsensitive) {\n      if (typeof pattern == \"string\") {\n        var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};\n        var substr = this.string.substr(this.pos, pattern.length);\n        if (cased(substr) == cased(pattern)) {\n          if (consume !== false) this.pos += pattern.length;\n          return true;\n        }\n      } else {\n        var match = this.string.slice(this.pos).match(pattern);\n        if (match && match.index > 0) return null;\n        if (match && consume !== false) this.pos += match[0].length;\n        return match;\n      }\n    },\n    current: function(){return this.string.slice(this.start, this.pos);}\n  };\n  CodeMirror.StringStream = StringStream;\n\n  // TEXTMARKERS\n\n  function TextMarker(doc, type) {\n    this.lines = [];\n    this.type = type;\n    this.doc = doc;\n  }\n  CodeMirror.TextMarker = TextMarker;\n\n  TextMarker.prototype.clear = function() {\n    if (this.explicitlyCleared) return;\n    var cm = this.doc.cm, withOp = cm && !cm.curOp;\n    if (withOp) startOperation(cm);\n    var min = null, max = null;\n    for (var i = 0; i < this.lines.length; ++i) {\n      var line = this.lines[i];\n      var span = getMarkedSpanFor(line.markedSpans, this);\n      if (span.to != null) max = lineNo(line);\n      line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n      if (span.from != null)\n        min = lineNo(line);\n      else if (this.collapsed && !lineIsHidden(this.doc, line) && cm)\n        updateLineHeight(line, textHeight(cm.display));\n    }\n    if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) {\n      var visual = visualLine(cm.doc, this.lines[i]), len = lineLength(cm.doc, visual);\n      if (len > cm.display.maxLineLength) {\n        cm.display.maxLine = visual;\n        cm.display.maxLineLength = len;\n        cm.display.maxLineChanged = true;\n      }\n    }\n\n    if (min != null && cm) regChange(cm, min, max + 1);\n    this.lines.length = 0;\n    this.explicitlyCleared = true;\n    if (this.atomic && this.doc.cantEdit) {\n      this.doc.cantEdit = false;\n      if (cm) reCheckSelection(cm);\n    }\n    if (withOp) endOperation(cm);\n    signalLater(this, \"clear\");\n  };\n\n  TextMarker.prototype.find = function() {\n    var from, to;\n    for (var i = 0; i < this.lines.length; ++i) {\n      var line = this.lines[i];\n      var span = getMarkedSpanFor(line.markedSpans, this);\n      if (span.from != null || span.to != null) {\n        var found = lineNo(line);\n        if (span.from != null) from = Pos(found, span.from);\n        if (span.to != null) to = Pos(found, span.to);\n      }\n    }\n    if (this.type == \"bookmark\") return from;\n    return from && {from: from, to: to};\n  };\n\n  TextMarker.prototype.changed = function() {\n    var pos = this.find(), cm = this.doc.cm;\n    if (!pos || !cm) return;\n    var line = getLine(this.doc, pos.from.line);\n    clearCachedMeasurement(cm, line);\n    if (pos.from.line >= cm.display.showingFrom && pos.from.line < cm.display.showingTo) {\n      for (var node = cm.display.lineDiv.firstChild; node; node = node.nextSibling) if (node.lineObj == line) {\n        if (node.offsetHeight != line.height) updateLineHeight(line, node.offsetHeight);\n        break;\n      }\n      runInOp(cm, function() { cm.curOp.selectionChanged = true; });\n    }\n  };\n\n  TextMarker.prototype.attachLine = function(line) {\n    if (!this.lines.length && this.doc.cm) {\n      var op = this.doc.cm.curOp;\n      if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n        (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this);\n    }\n    this.lines.push(line);\n  };\n  TextMarker.prototype.detachLine = function(line) {\n    this.lines.splice(indexOf(this.lines, line), 1);\n    if (!this.lines.length && this.doc.cm) {\n      var op = this.doc.cm.curOp;\n      (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n    }\n  };\n\n  function markText(doc, from, to, options, type) {\n    if (options && options.shared) return markTextShared(doc, from, to, options, type);\n    if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);\n\n    var marker = new TextMarker(doc, type);\n    if (type == \"range\" && !posLess(from, to)) return marker;\n    if (options) copyObj(options, marker);\n    if (marker.replacedWith) {\n      marker.collapsed = true;\n      marker.replacedWith = elt(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n      if (!options.handleMouseEvents) marker.replacedWith.ignoreEvents = true;\n    }\n    if (marker.collapsed) sawCollapsedSpans = true;\n\n    if (marker.addToHistory)\n      addToHistory(doc, {from: from, to: to, origin: \"markText\"},\n                   {head: doc.sel.head, anchor: doc.sel.anchor}, NaN);\n\n    var curLine = from.line, size = 0, collapsedAtStart, collapsedAtEnd, cm = doc.cm, updateMaxLine;\n    doc.iter(curLine, to.line + 1, function(line) {\n      if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(doc, line) == cm.display.maxLine)\n        updateMaxLine = true;\n      var span = {from: null, to: null, marker: marker};\n      size += line.text.length;\n      if (curLine == from.line) {span.from = from.ch; size -= from.ch;}\n      if (curLine == to.line) {span.to = to.ch; size -= line.text.length - to.ch;}\n      if (marker.collapsed) {\n        if (curLine == to.line) collapsedAtEnd = collapsedSpanAt(line, to.ch);\n        if (curLine == from.line) collapsedAtStart = collapsedSpanAt(line, from.ch);\n        else updateLineHeight(line, 0);\n      }\n      addMarkedSpan(line, span);\n      ++curLine;\n    });\n    if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) {\n      if (lineIsHidden(doc, line)) updateLineHeight(line, 0);\n    });\n\n    if (marker.clearOnEnter) on(marker, \"beforeCursorEnter\", function() { marker.clear(); });\n\n    if (marker.readOnly) {\n      sawReadOnlySpans = true;\n      if (doc.history.done.length || doc.history.undone.length)\n        doc.clearHistory();\n    }\n    if (marker.collapsed) {\n      if (collapsedAtStart != collapsedAtEnd)\n        throw new Error(\"Inserting collapsed marker overlapping an existing one\");\n      marker.size = size;\n      marker.atomic = true;\n    }\n    if (cm) {\n      if (updateMaxLine) cm.curOp.updateMaxLine = true;\n      if (marker.className || marker.startStyle || marker.endStyle || marker.collapsed)\n        regChange(cm, from.line, to.line + 1);\n      if (marker.atomic) reCheckSelection(cm);\n    }\n    return marker;\n  }\n\n  // SHARED TEXTMARKERS\n\n  function SharedTextMarker(markers, primary) {\n    this.markers = markers;\n    this.primary = primary;\n    for (var i = 0, me = this; i < markers.length; ++i) {\n      markers[i].parent = this;\n      on(markers[i], \"clear\", function(){me.clear();});\n    }\n  }\n  CodeMirror.SharedTextMarker = SharedTextMarker;\n\n  SharedTextMarker.prototype.clear = function() {\n    if (this.explicitlyCleared) return;\n    this.explicitlyCleared = true;\n    for (var i = 0; i < this.markers.length; ++i)\n      this.markers[i].clear();\n    signalLater(this, \"clear\");\n  };\n  SharedTextMarker.prototype.find = function() {\n    return this.primary.find();\n  };\n\n  function markTextShared(doc, from, to, options, type) {\n    options = copyObj(options);\n    options.shared = false;\n    var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n    var widget = options.replacedWith;\n    linkedDocs(doc, function(doc) {\n      if (widget) options.replacedWith = widget.cloneNode(true);\n      markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n      for (var i = 0; i < doc.linked.length; ++i)\n        if (doc.linked[i].isParent) return;\n      primary = lst(markers);\n    });\n    return new SharedTextMarker(markers, primary);\n  }\n\n  // TEXTMARKER SPANS\n\n  function getMarkedSpanFor(spans, marker) {\n    if (spans) for (var i = 0; i < spans.length; ++i) {\n      var span = spans[i];\n      if (span.marker == marker) return span;\n    }\n  }\n  function removeMarkedSpan(spans, span) {\n    for (var r, i = 0; i < spans.length; ++i)\n      if (spans[i] != span) (r || (r = [])).push(spans[i]);\n    return r;\n  }\n  function addMarkedSpan(line, span) {\n    line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n    span.marker.attachLine(line);\n  }\n\n  function markedSpansBefore(old, startCh, isInsert) {\n    if (old) for (var i = 0, nw; i < old.length; ++i) {\n      var span = old[i], marker = span.marker;\n      var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n      if (startsBefore || marker.type == \"bookmark\" && span.from == startCh && (!isInsert || !span.marker.insertLeft)) {\n        var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);\n        (nw || (nw = [])).push({from: span.from,\n                                to: endsAfter ? null : span.to,\n                                marker: marker});\n      }\n    }\n    return nw;\n  }\n\n  function markedSpansAfter(old, endCh, isInsert) {\n    if (old) for (var i = 0, nw; i < old.length; ++i) {\n      var span = old[i], marker = span.marker;\n      var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n      if (endsAfter || marker.type == \"bookmark\" && span.from == endCh && (!isInsert || span.marker.insertLeft)) {\n        var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);\n        (nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh,\n                                to: span.to == null ? null : span.to - endCh,\n                                marker: marker});\n      }\n    }\n    return nw;\n  }\n\n  function stretchSpansOverChange(doc, change) {\n    var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n    var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n    if (!oldFirst && !oldLast) return null;\n\n    var startCh = change.from.ch, endCh = change.to.ch, isInsert = posEq(change.from, change.to);\n    // Get the spans that 'stick out' on both sides\n    var first = markedSpansBefore(oldFirst, startCh, isInsert);\n    var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n    // Next, merge those two ends\n    var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n    if (first) {\n      // Fix up .to properties of first\n      for (var i = 0; i < first.length; ++i) {\n        var span = first[i];\n        if (span.to == null) {\n          var found = getMarkedSpanFor(last, span.marker);\n          if (!found) span.to = startCh;\n          else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n        }\n      }\n    }\n    if (last) {\n      // Fix up .from in last (or move them into first in case of sameLine)\n      for (var i = 0; i < last.length; ++i) {\n        var span = last[i];\n        if (span.to != null) span.to += offset;\n        if (span.from == null) {\n          var found = getMarkedSpanFor(first, span.marker);\n          if (!found) {\n            span.from = offset;\n            if (sameLine) (first || (first = [])).push(span);\n          }\n        } else {\n          span.from += offset;\n          if (sameLine) (first || (first = [])).push(span);\n        }\n      }\n    }\n    if (sameLine && first) {\n      // Make sure we didn't create any zero-length spans\n      for (var i = 0; i < first.length; ++i)\n        if (first[i].from != null && first[i].from == first[i].to && first[i].marker.type != \"bookmark\")\n          first.splice(i--, 1);\n      if (!first.length) first = null;\n    }\n\n    var newMarkers = [first];\n    if (!sameLine) {\n      // Fill gap with whole-line-spans\n      var gap = change.text.length - 2, gapMarkers;\n      if (gap > 0 && first)\n        for (var i = 0; i < first.length; ++i)\n          if (first[i].to == null)\n            (gapMarkers || (gapMarkers = [])).push({from: null, to: null, marker: first[i].marker});\n      for (var i = 0; i < gap; ++i)\n        newMarkers.push(gapMarkers);\n      newMarkers.push(last);\n    }\n    return newMarkers;\n  }\n\n  function mergeOldSpans(doc, change) {\n    var old = getOldSpans(doc, change);\n    var stretched = stretchSpansOverChange(doc, change);\n    if (!old) return stretched;\n    if (!stretched) return old;\n\n    for (var i = 0; i < old.length; ++i) {\n      var oldCur = old[i], stretchCur = stretched[i];\n      if (oldCur && stretchCur) {\n        spans: for (var j = 0; j < stretchCur.length; ++j) {\n          var span = stretchCur[j];\n          for (var k = 0; k < oldCur.length; ++k)\n            if (oldCur[k].marker == span.marker) continue spans;\n          oldCur.push(span);\n        }\n      } else if (stretchCur) {\n        old[i] = stretchCur;\n      }\n    }\n    return old;\n  }\n\n  function removeReadOnlyRanges(doc, from, to) {\n    var markers = null;\n    doc.iter(from.line, to.line + 1, function(line) {\n      if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n        var mark = line.markedSpans[i].marker;\n        if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n          (markers || (markers = [])).push(mark);\n      }\n    });\n    if (!markers) return null;\n    var parts = [{from: from, to: to}];\n    for (var i = 0; i < markers.length; ++i) {\n      var mk = markers[i], m = mk.find();\n      for (var j = 0; j < parts.length; ++j) {\n        var p = parts[j];\n        if (posLess(p.to, m.from) || posLess(m.to, p.from)) continue;\n        var newParts = [j, 1];\n        if (posLess(p.from, m.from) || !mk.inclusiveLeft && posEq(p.from, m.from))\n          newParts.push({from: p.from, to: m.from});\n        if (posLess(m.to, p.to) || !mk.inclusiveRight && posEq(p.to, m.to))\n          newParts.push({from: m.to, to: p.to});\n        parts.splice.apply(parts, newParts);\n        j += newParts.length - 1;\n      }\n    }\n    return parts;\n  }\n\n  function collapsedSpanAt(line, ch) {\n    var sps = sawCollapsedSpans && line.markedSpans, found;\n    if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n      sp = sps[i];\n      if (!sp.marker.collapsed) continue;\n      if ((sp.from == null || sp.from < ch) &&\n          (sp.to == null || sp.to > ch) &&\n          (!found || found.width < sp.marker.width))\n        found = sp.marker;\n    }\n    return found;\n  }\n  function collapsedSpanAtStart(line) { return collapsedSpanAt(line, -1); }\n  function collapsedSpanAtEnd(line) { return collapsedSpanAt(line, line.text.length + 1); }\n\n  function visualLine(doc, line) {\n    var merged;\n    while (merged = collapsedSpanAtStart(line))\n      line = getLine(doc, merged.find().from.line);\n    return line;\n  }\n\n  function lineIsHidden(doc, line) {\n    var sps = sawCollapsedSpans && line.markedSpans;\n    if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n      sp = sps[i];\n      if (!sp.marker.collapsed) continue;\n      if (sp.from == null) return true;\n      if (sp.marker.replacedWith) continue;\n      if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n        return true;\n    }\n  }\n  function lineIsHiddenInner(doc, line, span) {\n    if (span.to == null) {\n      var end = span.marker.find().to, endLine = getLine(doc, end.line);\n      return lineIsHiddenInner(doc, endLine, getMarkedSpanFor(endLine.markedSpans, span.marker));\n    }\n    if (span.marker.inclusiveRight && span.to == line.text.length)\n      return true;\n    for (var sp, i = 0; i < line.markedSpans.length; ++i) {\n      sp = line.markedSpans[i];\n      if (sp.marker.collapsed && !sp.marker.replacedWith && sp.from == span.to &&\n          (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n          lineIsHiddenInner(doc, line, sp)) return true;\n    }\n  }\n\n  function detachMarkedSpans(line) {\n    var spans = line.markedSpans;\n    if (!spans) return;\n    for (var i = 0; i < spans.length; ++i)\n      spans[i].marker.detachLine(line);\n    line.markedSpans = null;\n  }\n\n  function attachMarkedSpans(line, spans) {\n    if (!spans) return;\n    for (var i = 0; i < spans.length; ++i)\n      spans[i].marker.attachLine(line);\n    line.markedSpans = spans;\n  }\n\n  // LINE WIDGETS\n\n  var LineWidget = CodeMirror.LineWidget = function(cm, node, options) {\n    for (var opt in options) if (options.hasOwnProperty(opt))\n      this[opt] = options[opt];\n    this.cm = cm;\n    this.node = node;\n  };\n  function widgetOperation(f) {\n    return function() {\n      var withOp = !this.cm.curOp;\n      if (withOp) startOperation(this.cm);\n      try {var result = f.apply(this, arguments);}\n      finally {if (withOp) endOperation(this.cm);}\n      return result;\n    };\n  }\n  LineWidget.prototype.clear = widgetOperation(function() {\n    var ws = this.line.widgets, no = lineNo(this.line);\n    if (no == null || !ws) return;\n    for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1);\n    if (!ws.length) this.line.widgets = null;\n    updateLineHeight(this.line, Math.max(0, this.line.height - widgetHeight(this)));\n    regChange(this.cm, no, no + 1);\n  });\n  LineWidget.prototype.changed = widgetOperation(function() {\n    var oldH = this.height;\n    this.height = null;\n    var diff = widgetHeight(this) - oldH;\n    if (!diff) return;\n    updateLineHeight(this.line, this.line.height + diff);\n    var no = lineNo(this.line);\n    regChange(this.cm, no, no + 1);\n  });\n\n  function widgetHeight(widget) {\n    if (widget.height != null) return widget.height;\n    if (!widget.node.parentNode || widget.node.parentNode.nodeType != 1)\n      removeChildrenAndAdd(widget.cm.display.measure, elt(\"div\", [widget.node], null, \"position: relative\"));\n    return widget.height = widget.node.offsetHeight;\n  }\n\n  function addLineWidget(cm, handle, node, options) {\n    var widget = new LineWidget(cm, node, options);\n    if (widget.noHScroll) cm.display.alignWidgets = true;\n    changeLine(cm, handle, function(line) {\n      (line.widgets || (line.widgets = [])).push(widget);\n      widget.line = line;\n      if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) {\n        var aboveVisible = heightAtLine(cm, line) < cm.display.scroller.scrollTop;\n        updateLineHeight(line, line.height + widgetHeight(widget));\n        if (aboveVisible) addToScrollPos(cm, 0, widget.height);\n      }\n      return true;\n    });\n    return widget;\n  }\n\n  // LINE DATA STRUCTURE\n\n  // Line objects. These hold state related to a line, including\n  // highlighting info (the styles array).\n  function makeLine(text, markedSpans, estimateHeight) {\n    var line = {text: text};\n    attachMarkedSpans(line, markedSpans);\n    line.height = estimateHeight ? estimateHeight(line) : 1;\n    return line;\n  }\n\n  function updateLine(line, text, markedSpans, estimateHeight) {\n    line.text = text;\n    if (line.stateAfter) line.stateAfter = null;\n    if (line.styles) line.styles = null;\n    if (line.order != null) line.order = null;\n    detachMarkedSpans(line);\n    attachMarkedSpans(line, markedSpans);\n    var estHeight = estimateHeight ? estimateHeight(line) : 1;\n    if (estHeight != line.height) updateLineHeight(line, estHeight);\n  }\n\n  function cleanUpLine(line) {\n    line.parent = null;\n    detachMarkedSpans(line);\n  }\n\n  // Run the given mode's parser over a line, update the styles\n  // array, which contains alternating fragments of text and CSS\n  // classes.\n  function runMode(cm, text, mode, state, f) {\n    var flattenSpans = mode.flattenSpans;\n    if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n    var curStart = 0, curStyle = null;\n    var stream = new StringStream(text, cm.options.tabSize), style;\n    if (text == \"\" && mode.blankLine) mode.blankLine(state);\n    while (!stream.eol()) {\n      if (stream.pos > cm.options.maxHighlightLength) {\n        flattenSpans = false;\n        // Webkit seems to refuse to render text nodes longer than 57444 characters\n        stream.pos = Math.min(text.length, stream.start + 50000);\n        style = null;\n      } else {\n        style = mode.token(stream, state);\n      }\n      if (!flattenSpans || curStyle != style) {\n        if (curStart < stream.start) f(stream.start, curStyle);\n        curStart = stream.start; curStyle = style;\n      }\n      stream.start = stream.pos;\n    }\n    if (curStart < stream.pos) f(stream.pos, curStyle);\n  }\n\n  function highlightLine(cm, line, state) {\n    // A styles array always starts with a number identifying the\n    // mode/overlays that it is based on (for easy invalidation).\n    var st = [cm.state.modeGen];\n    // Compute the base array of styles\n    runMode(cm, line.text, cm.doc.mode, state, function(end, style) {st.push(end, style);});\n\n    // Run overlays, adjust style array.\n    for (var o = 0; o < cm.state.overlays.length; ++o) {\n      var overlay = cm.state.overlays[o], i = 1, at = 0;\n      runMode(cm, line.text, overlay.mode, true, function(end, style) {\n        var start = i;\n        // Ensure there's a token end at the current position, and that i points at it\n        while (at < end) {\n          var i_end = st[i];\n          if (i_end > end)\n            st.splice(i, 1, end, st[i+1], i_end);\n          i += 2;\n          at = Math.min(end, i_end);\n        }\n        if (!style) return;\n        if (overlay.opaque) {\n          st.splice(start, i - start, end, style);\n          i = start + 2;\n        } else {\n          for (; start < i; start += 2) {\n            var cur = st[start+1];\n            st[start+1] = cur ? cur + \" \" + style : style;\n          }\n        }\n      });\n    }\n\n    return st;\n  }\n\n  function getLineStyles(cm, line) {\n    if (!line.styles || line.styles[0] != cm.state.modeGen)\n      line.styles = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line)));\n    return line.styles;\n  }\n\n  // Lightweight form of highlight -- proceed over this line and\n  // update state, but don't save a style array.\n  function processLine(cm, line, state) {\n    var mode = cm.doc.mode;\n    var stream = new StringStream(line.text, cm.options.tabSize);\n    if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n    while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n      mode.token(stream, state);\n      stream.start = stream.pos;\n    }\n  }\n\n  var styleToClassCache = {};\n  function styleToClass(style) {\n    if (!style) return null;\n    return styleToClassCache[style] ||\n      (styleToClassCache[style] = \"cm-\" + style.replace(/ +/g, \" cm-\"));\n  }\n\n  function lineContent(cm, realLine, measure) {\n    var merged, line = realLine, empty = true;\n    while (merged = collapsedSpanAtStart(line))\n      line = getLine(cm.doc, merged.find().from.line);\n\n    var builder = {pre: elt(\"pre\"), col: 0, pos: 0, display: !measure,\n                   measure: null, measuredSomething: false, cm: cm};\n    if (line.textClass) builder.pre.className = line.textClass;\n\n    do {\n      if (line.text) empty = false;\n      builder.measure = line == realLine && measure;\n      builder.pos = 0;\n      builder.addToken = builder.measure ? buildTokenMeasure : buildToken;\n      if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n        builder.addToken = buildTokenSplitSpaces(builder.addToken);\n      var next = insertLineContent(line, builder, getLineStyles(cm, line));\n      if (measure && line == realLine && !builder.measuredSomething) {\n        measure[0] = builder.pre.appendChild(zeroWidthElement(cm.display.measure));\n        builder.measuredSomething = true;\n      }\n      if (next) line = getLine(cm.doc, next.to.line);\n    } while (next);\n\n    if (measure && !builder.measuredSomething && !measure[0])\n      measure[0] = builder.pre.appendChild(empty ? elt(\"span\", \"\\u00a0\") : zeroWidthElement(cm.display.measure));\n    if (!builder.pre.firstChild && !lineIsHidden(cm.doc, realLine))\n      builder.pre.appendChild(document.createTextNode(\"\\u00a0\"));\n\n    var order;\n    // Work around problem with the reported dimensions of single-char\n    // direction spans on IE (issue #1129). See also the comment in\n    // cursorCoords.\n    if (measure && ie && (order = getOrder(line))) {\n      var l = order.length - 1;\n      if (order[l].from == order[l].to) --l;\n      var last = order[l], prev = order[l - 1];\n      if (last.from + 1 == last.to && prev && last.level < prev.level) {\n        var span = measure[builder.pos - 1];\n        if (span) span.parentNode.insertBefore(span.measureRight = zeroWidthElement(cm.display.measure),\n                                               span.nextSibling);\n      }\n    }\n\n    signal(cm, \"renderLine\", cm, realLine, builder.pre);\n    return builder.pre;\n  }\n\n  var tokenSpecialChars = /[\\t\\u0000-\\u0019\\u00ad\\u200b\\u2028\\u2029\\uFEFF]/g;\n  function buildToken(builder, text, style, startStyle, endStyle) {\n    if (!text) return;\n    if (!tokenSpecialChars.test(text)) {\n      builder.col += text.length;\n      var content = document.createTextNode(text);\n    } else {\n      var content = document.createDocumentFragment(), pos = 0;\n      while (true) {\n        tokenSpecialChars.lastIndex = pos;\n        var m = tokenSpecialChars.exec(text);\n        var skipped = m ? m.index - pos : text.length - pos;\n        if (skipped) {\n          content.appendChild(document.createTextNode(text.slice(pos, pos + skipped)));\n          builder.col += skipped;\n        }\n        if (!m) break;\n        pos += skipped + 1;\n        if (m[0] == \"\\t\") {\n          var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n          content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n          builder.col += tabWidth;\n        } else {\n          var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n          token.title = \"\\\\u\" + m[0].charCodeAt(0).toString(16);\n          content.appendChild(token);\n          builder.col += 1;\n        }\n      }\n    }\n    if (style || startStyle || endStyle || builder.measure) {\n      var fullStyle = style || \"\";\n      if (startStyle) fullStyle += startStyle;\n      if (endStyle) fullStyle += endStyle;\n      return builder.pre.appendChild(elt(\"span\", [content], fullStyle));\n    }\n    builder.pre.appendChild(content);\n  }\n\n  function buildTokenMeasure(builder, text, style, startStyle, endStyle) {\n    var wrapping = builder.cm.options.lineWrapping;\n    for (var i = 0; i < text.length; ++i) {\n      var ch = text.charAt(i), start = i == 0;\n      if (ch >= \"\\ud800\" && ch < \"\\udbff\" && i < text.length - 1) {\n        ch = text.slice(i, i + 2);\n        ++i;\n      } else if (i && wrapping && spanAffectsWrapping(text, i)) {\n        builder.pre.appendChild(elt(\"wbr\"));\n      }\n      var span = builder.measure[builder.pos] =\n        buildToken(builder, ch, style,\n                   start && startStyle, i == text.length - 1 && endStyle);\n      // In IE single-space nodes wrap differently than spaces\n      // embedded in larger text nodes, except when set to\n      // white-space: normal (issue #1268).\n      if (ie && wrapping && ch == \" \" && i && !/\\s/.test(text.charAt(i - 1)) &&\n          i < text.length - 1 && !/\\s/.test(text.charAt(i + 1)))\n        span.style.whiteSpace = \"normal\";\n      builder.pos += ch.length;\n    }\n    if (text.length) builder.measuredSomething = true;\n  }\n\n  function buildTokenSplitSpaces(inner) {\n    function split(old) {\n      var out = \" \";\n      for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? \" \" : \"\\u00a0\";\n      out += \" \";\n      return out;\n    }\n    return function(builder, text, style, startStyle, endStyle) {\n      return inner(builder, text.replace(/ {3,}/, split), style, startStyle, endStyle);\n    };\n  }\n\n  function buildCollapsedSpan(builder, size, widget) {\n    if (widget) {\n      if (!builder.display) widget = widget.cloneNode(true);\n      if (builder.measure) {\n        builder.measure[builder.pos] = size ? widget\n          : builder.pre.appendChild(zeroWidthElement(builder.cm.display.measure));\n        builder.measuredSomething = true;\n      }\n      builder.pre.appendChild(widget);\n    }\n    builder.pos += size;\n  }\n\n  // Outputs a number of spans to make up a line, taking highlighting\n  // and marked text into account.\n  function insertLineContent(line, builder, styles) {\n    var spans = line.markedSpans, allText = line.text, at = 0;\n    if (!spans) {\n      for (var i = 1; i < styles.length; i+=2)\n        builder.addToken(builder, allText.slice(at, at = styles[i]), styleToClass(styles[i+1]));\n      return;\n    }\n\n    var len = allText.length, pos = 0, i = 1, text = \"\", style;\n    var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n    for (;;) {\n      if (nextChange == pos) { // Update current marker set\n        spanStyle = spanEndStyle = spanStartStyle = \"\";\n        collapsed = null; nextChange = Infinity;\n        var foundBookmark = null;\n        for (var j = 0; j < spans.length; ++j) {\n          var sp = spans[j], m = sp.marker;\n          if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n            if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n            if (m.className) spanStyle += \" \" + m.className;\n            if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n            if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n            if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))\n              collapsed = sp;\n          } else if (sp.from > pos && nextChange > sp.from) {\n            nextChange = sp.from;\n          }\n          if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n            foundBookmark = m.replacedWith;\n        }\n        if (collapsed && (collapsed.from || 0) == pos) {\n          buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n                             collapsed.from != null && collapsed.marker.replacedWith);\n          if (collapsed.to == null) return collapsed.marker.find();\n        }\n        if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n      }\n      if (pos >= len) break;\n\n      var upto = Math.min(len, nextChange);\n      while (true) {\n        if (text) {\n          var end = pos + text.length;\n          if (!collapsed) {\n            var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n            builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n                             spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n          }\n          if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n          pos = end;\n          spanStartStyle = \"\";\n        }\n        text = allText.slice(at, at = styles[i++]);\n        style = styleToClass(styles[i++]);\n      }\n    }\n  }\n\n  // DOCUMENT DATA STRUCTURE\n\n  function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) {\n    function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n    function update(line, text, spans) {\n      updateLine(line, text, spans, estimateHeight);\n      signalLater(line, \"change\", line, change);\n    }\n\n    var from = change.from, to = change.to, text = change.text;\n    var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n    var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n    // First adjust the line structure\n    if (from.ch == 0 && to.ch == 0 && lastText == \"\") {\n      // This is a whole-line replace. Treated specially to make\n      // sure line objects move the way they are supposed to.\n      for (var i = 0, e = text.length - 1, added = []; i < e; ++i)\n        added.push(makeLine(text[i], spansFor(i), estimateHeight));\n      update(lastLine, lastLine.text, lastSpans);\n      if (nlines) doc.remove(from.line, nlines);\n      if (added.length) doc.insert(from.line, added);\n    } else if (firstLine == lastLine) {\n      if (text.length == 1) {\n        update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n      } else {\n        for (var added = [], i = 1, e = text.length - 1; i < e; ++i)\n          added.push(makeLine(text[i], spansFor(i), estimateHeight));\n        added.push(makeLine(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n        update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n        doc.insert(from.line + 1, added);\n      }\n    } else if (text.length == 1) {\n      update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n      doc.remove(from.line + 1, nlines);\n    } else {\n      update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n      update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n      for (var i = 1, e = text.length - 1, added = []; i < e; ++i)\n        added.push(makeLine(text[i], spansFor(i), estimateHeight));\n      if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n      doc.insert(from.line + 1, added);\n    }\n\n    signalLater(doc, \"change\", doc, change);\n    setSelection(doc, selAfter.anchor, selAfter.head, null, true);\n  }\n\n  function LeafChunk(lines) {\n    this.lines = lines;\n    this.parent = null;\n    for (var i = 0, e = lines.length, height = 0; i < e; ++i) {\n      lines[i].parent = this;\n      height += lines[i].height;\n    }\n    this.height = height;\n  }\n\n  LeafChunk.prototype = {\n    chunkSize: function() { return this.lines.length; },\n    removeInner: function(at, n) {\n      for (var i = at, e = at + n; i < e; ++i) {\n        var line = this.lines[i];\n        this.height -= line.height;\n        cleanUpLine(line);\n        signalLater(line, \"delete\");\n      }\n      this.lines.splice(at, n);\n    },\n    collapse: function(lines) {\n      lines.splice.apply(lines, [lines.length, 0].concat(this.lines));\n    },\n    insertInner: function(at, lines, height) {\n      this.height += height;\n      this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n      for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this;\n    },\n    iterN: function(at, n, op) {\n      for (var e = at + n; at < e; ++at)\n        if (op(this.lines[at])) return true;\n    }\n  };\n\n  function BranchChunk(children) {\n    this.children = children;\n    var size = 0, height = 0;\n    for (var i = 0, e = children.length; i < e; ++i) {\n      var ch = children[i];\n      size += ch.chunkSize(); height += ch.height;\n      ch.parent = this;\n    }\n    this.size = size;\n    this.height = height;\n    this.parent = null;\n  }\n\n  BranchChunk.prototype = {\n    chunkSize: function() { return this.size; },\n    removeInner: function(at, n) {\n      this.size -= n;\n      for (var i = 0; i < this.children.length; ++i) {\n        var child = this.children[i], sz = child.chunkSize();\n        if (at < sz) {\n          var rm = Math.min(n, sz - at), oldHeight = child.height;\n          child.removeInner(at, rm);\n          this.height -= oldHeight - child.height;\n          if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n          if ((n -= rm) == 0) break;\n          at = 0;\n        } else at -= sz;\n      }\n      if (this.size - n < 25) {\n        var lines = [];\n        this.collapse(lines);\n        this.children = [new LeafChunk(lines)];\n        this.children[0].parent = this;\n      }\n    },\n    collapse: function(lines) {\n      for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines);\n    },\n    insertInner: function(at, lines, height) {\n      this.size += lines.length;\n      this.height += height;\n      for (var i = 0, e = this.children.length; i < e; ++i) {\n        var child = this.children[i], sz = child.chunkSize();\n        if (at <= sz) {\n          child.insertInner(at, lines, height);\n          if (child.lines && child.lines.length > 50) {\n            while (child.lines.length > 50) {\n              var spilled = child.lines.splice(child.lines.length - 25, 25);\n              var newleaf = new LeafChunk(spilled);\n              child.height -= newleaf.height;\n              this.children.splice(i + 1, 0, newleaf);\n              newleaf.parent = this;\n            }\n            this.maybeSpill();\n          }\n          break;\n        }\n        at -= sz;\n      }\n    },\n    maybeSpill: function() {\n      if (this.children.length <= 10) return;\n      var me = this;\n      do {\n        var spilled = me.children.splice(me.children.length - 5, 5);\n        var sibling = new BranchChunk(spilled);\n        if (!me.parent) { // Become the parent node\n          var copy = new BranchChunk(me.children);\n          copy.parent = me;\n          me.children = [copy, sibling];\n          me = copy;\n        } else {\n          me.size -= sibling.size;\n          me.height -= sibling.height;\n          var myIndex = indexOf(me.parent.children, me);\n          me.parent.children.splice(myIndex + 1, 0, sibling);\n        }\n        sibling.parent = me.parent;\n      } while (me.children.length > 10);\n      me.parent.maybeSpill();\n    },\n    iterN: function(at, n, op) {\n      for (var i = 0, e = this.children.length; i < e; ++i) {\n        var child = this.children[i], sz = child.chunkSize();\n        if (at < sz) {\n          var used = Math.min(n, sz - at);\n          if (child.iterN(at, used, op)) return true;\n          if ((n -= used) == 0) break;\n          at = 0;\n        } else at -= sz;\n      }\n    }\n  };\n\n  var nextDocId = 0;\n  var Doc = CodeMirror.Doc = function(text, mode, firstLine) {\n    if (!(this instanceof Doc)) return new Doc(text, mode, firstLine);\n    if (firstLine == null) firstLine = 0;\n\n    BranchChunk.call(this, [new LeafChunk([makeLine(\"\", null)])]);\n    this.first = firstLine;\n    this.scrollTop = this.scrollLeft = 0;\n    this.cantEdit = false;\n    this.history = makeHistory();\n    this.cleanGeneration = 1;\n    this.frontier = firstLine;\n    var start = Pos(firstLine, 0);\n    this.sel = {from: start, to: start, head: start, anchor: start, shift: false, extend: false, goalColumn: null};\n    this.id = ++nextDocId;\n    this.modeOption = mode;\n\n    if (typeof text == \"string\") text = splitLines(text);\n    updateDoc(this, {from: start, to: start, text: text}, null, {head: start, anchor: start});\n  };\n\n  Doc.prototype = createObj(BranchChunk.prototype, {\n    constructor: Doc,\n    iter: function(from, to, op) {\n      if (op) this.iterN(from - this.first, to - from, op);\n      else this.iterN(this.first, this.first + this.size, from);\n    },\n\n    insert: function(at, lines) {\n      var height = 0;\n      for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height;\n      this.insertInner(at - this.first, lines, height);\n    },\n    remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n    getValue: function(lineSep) {\n      var lines = getLines(this, this.first, this.first + this.size);\n      if (lineSep === false) return lines;\n      return lines.join(lineSep || \"\\n\");\n    },\n    setValue: function(code) {\n      var top = Pos(this.first, 0), last = this.first + this.size - 1;\n      makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n                        text: splitLines(code), origin: \"setValue\"},\n                 {head: top, anchor: top}, true);\n    },\n    replaceRange: function(code, from, to, origin) {\n      from = clipPos(this, from);\n      to = to ? clipPos(this, to) : from;\n      replaceRange(this, code, from, to, origin);\n    },\n    getRange: function(from, to, lineSep) {\n      var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n      if (lineSep === false) return lines;\n      return lines.join(lineSep || \"\\n\");\n    },\n\n    getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},\n    setLine: function(line, text) {\n      if (isLine(this, line))\n        replaceRange(this, text, Pos(line, 0), clipPos(this, Pos(line)));\n    },\n    removeLine: function(line) {\n      if (line) replaceRange(this, \"\", clipPos(this, Pos(line - 1)), clipPos(this, Pos(line)));\n      else replaceRange(this, \"\", Pos(0, 0), clipPos(this, Pos(1, 0)));\n    },\n\n    getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);},\n    getLineNumber: function(line) {return lineNo(line);},\n\n    lineCount: function() {return this.size;},\n    firstLine: function() {return this.first;},\n    lastLine: function() {return this.first + this.size - 1;},\n\n    clipPos: function(pos) {return clipPos(this, pos);},\n\n    getCursor: function(start) {\n      var sel = this.sel, pos;\n      if (start == null || start == \"head\") pos = sel.head;\n      else if (start == \"anchor\") pos = sel.anchor;\n      else if (start == \"end\" || start === false) pos = sel.to;\n      else pos = sel.from;\n      return copyPos(pos);\n    },\n    somethingSelected: function() {return !posEq(this.sel.head, this.sel.anchor);},\n\n    setCursor: docOperation(function(line, ch, extend) {\n      var pos = clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line);\n      if (extend) extendSelection(this, pos);\n      else setSelection(this, pos, pos);\n    }),\n    setSelection: docOperation(function(anchor, head) {\n      setSelection(this, clipPos(this, anchor), clipPos(this, head || anchor));\n    }),\n    extendSelection: docOperation(function(from, to) {\n      extendSelection(this, clipPos(this, from), to && clipPos(this, to));\n    }),\n\n    getSelection: function(lineSep) {return this.getRange(this.sel.from, this.sel.to, lineSep);},\n    replaceSelection: function(code, collapse, origin) {\n      makeChange(this, {from: this.sel.from, to: this.sel.to, text: splitLines(code), origin: origin}, collapse || \"around\");\n    },\n    undo: docOperation(function() {makeChangeFromHistory(this, \"undo\");}),\n    redo: docOperation(function() {makeChangeFromHistory(this, \"redo\");}),\n\n    setExtending: function(val) {this.sel.extend = val;},\n\n    historySize: function() {\n      var hist = this.history;\n      return {undo: hist.done.length, redo: hist.undone.length};\n    },\n    clearHistory: function() {this.history = makeHistory(this.history.maxGeneration);},\n\n    markClean: function() {\n      this.cleanGeneration = this.changeGeneration();\n    },\n    changeGeneration: function() {\n      this.history.lastOp = this.history.lastOrigin = null;\n      return this.history.generation;\n    },\n    isClean: function (gen) {\n      return this.history.generation == (gen || this.cleanGeneration);\n    },\n\n    getHistory: function() {\n      return {done: copyHistoryArray(this.history.done),\n              undone: copyHistoryArray(this.history.undone)};\n    },\n    setHistory: function(histData) {\n      var hist = this.history = makeHistory(this.history.maxGeneration);\n      hist.done = histData.done.slice(0);\n      hist.undone = histData.undone.slice(0);\n    },\n\n    markText: function(from, to, options) {\n      return markText(this, clipPos(this, from), clipPos(this, to), options, \"range\");\n    },\n    setBookmark: function(pos, options) {\n      var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n                      insertLeft: options && options.insertLeft};\n      pos = clipPos(this, pos);\n      return markText(this, pos, pos, realOpts, \"bookmark\");\n    },\n    findMarksAt: function(pos) {\n      pos = clipPos(this, pos);\n      var markers = [], spans = getLine(this, pos.line).markedSpans;\n      if (spans) for (var i = 0; i < spans.length; ++i) {\n        var span = spans[i];\n        if ((span.from == null || span.from <= pos.ch) &&\n            (span.to == null || span.to >= pos.ch))\n          markers.push(span.marker.parent || span.marker);\n      }\n      return markers;\n    },\n    getAllMarks: function() {\n      var markers = [];\n      this.iter(function(line) {\n        var sps = line.markedSpans;\n        if (sps) for (var i = 0; i < sps.length; ++i)\n          if (sps[i].from != null) markers.push(sps[i].marker);\n      });\n      return markers;\n    },\n\n    posFromIndex: function(off) {\n      var ch, lineNo = this.first;\n      this.iter(function(line) {\n        var sz = line.text.length + 1;\n        if (sz > off) { ch = off; return true; }\n        off -= sz;\n        ++lineNo;\n      });\n      return clipPos(this, Pos(lineNo, ch));\n    },\n    indexFromPos: function (coords) {\n      coords = clipPos(this, coords);\n      var index = coords.ch;\n      if (coords.line < this.first || coords.ch < 0) return 0;\n      this.iter(this.first, coords.line, function (line) {\n        index += line.text.length + 1;\n      });\n      return index;\n    },\n\n    copy: function(copyHistory) {\n      var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first);\n      doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n      doc.sel = {from: this.sel.from, to: this.sel.to, head: this.sel.head, anchor: this.sel.anchor,\n                 shift: this.sel.shift, extend: false, goalColumn: this.sel.goalColumn};\n      if (copyHistory) {\n        doc.history.undoDepth = this.history.undoDepth;\n        doc.setHistory(this.getHistory());\n      }\n      return doc;\n    },\n\n    linkedDoc: function(options) {\n      if (!options) options = {};\n      var from = this.first, to = this.first + this.size;\n      if (options.from != null && options.from > from) from = options.from;\n      if (options.to != null && options.to < to) to = options.to;\n      var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from);\n      if (options.sharedHist) copy.history = this.history;\n      (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n      copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n      return copy;\n    },\n    unlinkDoc: function(other) {\n      if (other instanceof CodeMirror) other = other.doc;\n      if (this.linked) for (var i = 0; i < this.linked.length; ++i) {\n        var link = this.linked[i];\n        if (link.doc != other) continue;\n        this.linked.splice(i, 1);\n        other.unlinkDoc(this);\n        break;\n      }\n      // If the histories were shared, split them again\n      if (other.history == this.history) {\n        var splitIds = [other.id];\n        linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true);\n        other.history = makeHistory();\n        other.history.done = copyHistoryArray(this.history.done, splitIds);\n        other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n      }\n    },\n    iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n    getMode: function() {return this.mode;},\n    getEditor: function() {return this.cm;}\n  });\n\n  Doc.prototype.eachLine = Doc.prototype.iter;\n\n  // The Doc methods that should be available on CodeMirror instances\n  var dontDelegate = \"iter insert remove copy getEditor\".split(\" \");\n  for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n    CodeMirror.prototype[prop] = (function(method) {\n      return function() {return method.apply(this.doc, arguments);};\n    })(Doc.prototype[prop]);\n\n  function linkedDocs(doc, f, sharedHistOnly) {\n    function propagate(doc, skip, sharedHist) {\n      if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n        var rel = doc.linked[i];\n        if (rel.doc == skip) continue;\n        var shared = sharedHist && rel.sharedHist;\n        if (sharedHistOnly && !shared) continue;\n        f(rel.doc, shared);\n        propagate(rel.doc, doc, shared);\n      }\n    }\n    propagate(doc, null, true);\n  }\n\n  function attachDoc(cm, doc) {\n    if (doc.cm) throw new Error(\"This document is already in use.\");\n    cm.doc = doc;\n    doc.cm = cm;\n    estimateLineHeights(cm);\n    loadMode(cm);\n    if (!cm.options.lineWrapping) computeMaxLength(cm);\n    cm.options.mode = doc.modeOption;\n    regChange(cm);\n  }\n\n  // LINE UTILITIES\n\n  function getLine(chunk, n) {\n    n -= chunk.first;\n    while (!chunk.lines) {\n      for (var i = 0;; ++i) {\n        var child = chunk.children[i], sz = child.chunkSize();\n        if (n < sz) { chunk = child; break; }\n        n -= sz;\n      }\n    }\n    return chunk.lines[n];\n  }\n\n  function getBetween(doc, start, end) {\n    var out = [], n = start.line;\n    doc.iter(start.line, end.line + 1, function(line) {\n      var text = line.text;\n      if (n == end.line) text = text.slice(0, end.ch);\n      if (n == start.line) text = text.slice(start.ch);\n      out.push(text);\n      ++n;\n    });\n    return out;\n  }\n  function getLines(doc, from, to) {\n    var out = [];\n    doc.iter(from, to, function(line) { out.push(line.text); });\n    return out;\n  }\n\n  function updateLineHeight(line, height) {\n    var diff = height - line.height;\n    for (var n = line; n; n = n.parent) n.height += diff;\n  }\n\n  function lineNo(line) {\n    if (line.parent == null) return null;\n    var cur = line.parent, no = indexOf(cur.lines, line);\n    for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n      for (var i = 0;; ++i) {\n        if (chunk.children[i] == cur) break;\n        no += chunk.children[i].chunkSize();\n      }\n    }\n    return no + cur.first;\n  }\n\n  function lineAtHeight(chunk, h) {\n    var n = chunk.first;\n    outer: do {\n      for (var i = 0, e = chunk.children.length; i < e; ++i) {\n        var child = chunk.children[i], ch = child.height;\n        if (h < ch) { chunk = child; continue outer; }\n        h -= ch;\n        n += child.chunkSize();\n      }\n      return n;\n    } while (!chunk.lines);\n    for (var i = 0, e = chunk.lines.length; i < e; ++i) {\n      var line = chunk.lines[i], lh = line.height;\n      if (h < lh) break;\n      h -= lh;\n    }\n    return n + i;\n  }\n\n  function heightAtLine(cm, lineObj) {\n    lineObj = visualLine(cm.doc, lineObj);\n\n    var h = 0, chunk = lineObj.parent;\n    for (var i = 0; i < chunk.lines.length; ++i) {\n      var line = chunk.lines[i];\n      if (line == lineObj) break;\n      else h += line.height;\n    }\n    for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n      for (var i = 0; i < p.children.length; ++i) {\n        var cur = p.children[i];\n        if (cur == chunk) break;\n        else h += cur.height;\n      }\n    }\n    return h;\n  }\n\n  function getOrder(line) {\n    var order = line.order;\n    if (order == null) order = line.order = bidiOrdering(line.text);\n    return order;\n  }\n\n  // HISTORY\n\n  function makeHistory(startGen) {\n    return {\n      // Arrays of history events. Doing something adds an event to\n      // done and clears undo. Undoing moves events from done to\n      // undone, redoing moves them in the other direction.\n      done: [], undone: [], undoDepth: Infinity,\n      // Used to track when changes can be merged into a single undo\n      // event\n      lastTime: 0, lastOp: null, lastOrigin: null,\n      // Used by the isClean() method\n      generation: startGen || 1, maxGeneration: startGen || 1\n    };\n  }\n\n  function attachLocalSpans(doc, change, from, to) {\n    var existing = change[\"spans_\" + doc.id], n = 0;\n    doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) {\n      if (line.markedSpans)\n        (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans;\n      ++n;\n    });\n  }\n\n  function historyChangeFromChange(doc, change) {\n    var histChange = {from: change.from, to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n    attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n    linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n    return histChange;\n  }\n\n  function addToHistory(doc, change, selAfter, opId) {\n    var hist = doc.history;\n    hist.undone.length = 0;\n    var time = +new Date, cur = lst(hist.done);\n\n    if (cur &&\n        (hist.lastOp == opId ||\n         hist.lastOrigin == change.origin && change.origin &&\n         ((change.origin.charAt(0) == \"+\" && doc.cm && hist.lastTime > time - doc.cm.options.historyEventDelay) ||\n          change.origin.charAt(0) == \"*\"))) {\n      // Merge this change into the last event\n      var last = lst(cur.changes);\n      if (posEq(change.from, change.to) && posEq(change.from, last.to)) {\n        // Optimized case for simple insertion -- don't want to add\n        // new changesets for every character typed\n        last.to = changeEnd(change);\n      } else {\n        // Add new sub-event\n        cur.changes.push(historyChangeFromChange(doc, change));\n      }\n      cur.anchorAfter = selAfter.anchor; cur.headAfter = selAfter.head;\n    } else {\n      // Can not be merged, start a new event.\n      cur = {changes: [historyChangeFromChange(doc, change)],\n             generation: hist.generation,\n             anchorBefore: doc.sel.anchor, headBefore: doc.sel.head,\n             anchorAfter: selAfter.anchor, headAfter: selAfter.head};\n      hist.done.push(cur);\n      hist.generation = ++hist.maxGeneration;\n      while (hist.done.length > hist.undoDepth)\n        hist.done.shift();\n    }\n    hist.lastTime = time;\n    hist.lastOp = opId;\n    hist.lastOrigin = change.origin;\n  }\n\n  function removeClearedSpans(spans) {\n    if (!spans) return null;\n    for (var i = 0, out; i < spans.length; ++i) {\n      if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n      else if (out) out.push(spans[i]);\n    }\n    return !out ? spans : out.length ? out : null;\n  }\n\n  function getOldSpans(doc, change) {\n    var found = change[\"spans_\" + doc.id];\n    if (!found) return null;\n    for (var i = 0, nw = []; i < change.text.length; ++i)\n      nw.push(removeClearedSpans(found[i]));\n    return nw;\n  }\n\n  // Used both to provide a JSON-safe object in .getHistory, and, when\n  // detaching a document, to split the history in two\n  function copyHistoryArray(events, newGroup) {\n    for (var i = 0, copy = []; i < events.length; ++i) {\n      var event = events[i], changes = event.changes, newChanges = [];\n      copy.push({changes: newChanges, anchorBefore: event.anchorBefore, headBefore: event.headBefore,\n                 anchorAfter: event.anchorAfter, headAfter: event.headAfter});\n      for (var j = 0; j < changes.length; ++j) {\n        var change = changes[j], m;\n        newChanges.push({from: change.from, to: change.to, text: change.text});\n        if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\\d+)$/)) {\n          if (indexOf(newGroup, Number(m[1])) > -1) {\n            lst(newChanges)[prop] = change[prop];\n            delete change[prop];\n          }\n        }\n      }\n    }\n    return copy;\n  }\n\n  // Rebasing/resetting history to deal with externally-sourced changes\n\n  function rebaseHistSel(pos, from, to, diff) {\n    if (to < pos.line) {\n      pos.line += diff;\n    } else if (from < pos.line) {\n      pos.line = from;\n      pos.ch = 0;\n    }\n  }\n\n  // Tries to rebase an array of history events given a change in the\n  // document. If the change touches the same lines as the event, the\n  // event, and everything 'behind' it, is discarded. If the change is\n  // before the event, the event's positions are updated. Uses a\n  // copy-on-write scheme for the positions, to avoid having to\n  // reallocate them all on every rebase, but also avoid problems with\n  // shared position objects being unsafely updated.\n  function rebaseHistArray(array, from, to, diff) {\n    for (var i = 0; i < array.length; ++i) {\n      var sub = array[i], ok = true;\n      for (var j = 0; j < sub.changes.length; ++j) {\n        var cur = sub.changes[j];\n        if (!sub.copied) { cur.from = copyPos(cur.from); cur.to = copyPos(cur.to); }\n        if (to < cur.from.line) {\n          cur.from.line += diff;\n          cur.to.line += diff;\n        } else if (from <= cur.to.line) {\n          ok = false;\n          break;\n        }\n      }\n      if (!sub.copied) {\n        sub.anchorBefore = copyPos(sub.anchorBefore); sub.headBefore = copyPos(sub.headBefore);\n        sub.anchorAfter = copyPos(sub.anchorAfter); sub.readAfter = copyPos(sub.headAfter);\n        sub.copied = true;\n      }\n      if (!ok) {\n        array.splice(0, i + 1);\n        i = 0;\n      } else {\n        rebaseHistSel(sub.anchorBefore); rebaseHistSel(sub.headBefore);\n        rebaseHistSel(sub.anchorAfter); rebaseHistSel(sub.headAfter);\n      }\n    }\n  }\n\n  function rebaseHist(hist, change) {\n    var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n    rebaseHistArray(hist.done, from, to, diff);\n    rebaseHistArray(hist.undone, from, to, diff);\n  }\n\n  // EVENT OPERATORS\n\n  function stopMethod() {e_stop(this);}\n  // Ensure an event has a stop method.\n  function addStop(event) {\n    if (!event.stop) event.stop = stopMethod;\n    return event;\n  }\n\n  function e_preventDefault(e) {\n    if (e.preventDefault) e.preventDefault();\n    else e.returnValue = false;\n  }\n  function e_stopPropagation(e) {\n    if (e.stopPropagation) e.stopPropagation();\n    else e.cancelBubble = true;\n  }\n  function e_defaultPrevented(e) {\n    return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false;\n  }\n  function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n  CodeMirror.e_stop = e_stop;\n  CodeMirror.e_preventDefault = e_preventDefault;\n  CodeMirror.e_stopPropagation = e_stopPropagation;\n\n  function e_target(e) {return e.target || e.srcElement;}\n  function e_button(e) {\n    var b = e.which;\n    if (b == null) {\n      if (e.button & 1) b = 1;\n      else if (e.button & 2) b = 3;\n      else if (e.button & 4) b = 2;\n    }\n    if (mac && e.ctrlKey && b == 1) b = 3;\n    return b;\n  }\n\n  // EVENT HANDLING\n\n  function on(emitter, type, f) {\n    if (emitter.addEventListener)\n      emitter.addEventListener(type, f, false);\n    else if (emitter.attachEvent)\n      emitter.attachEvent(\"on\" + type, f);\n    else {\n      var map = emitter._handlers || (emitter._handlers = {});\n      var arr = map[type] || (map[type] = []);\n      arr.push(f);\n    }\n  }\n\n  function off(emitter, type, f) {\n    if (emitter.removeEventListener)\n      emitter.removeEventListener(type, f, false);\n    else if (emitter.detachEvent)\n      emitter.detachEvent(\"on\" + type, f);\n    else {\n      var arr = emitter._handlers && emitter._handlers[type];\n      if (!arr) return;\n      for (var i = 0; i < arr.length; ++i)\n        if (arr[i] == f) { arr.splice(i, 1); break; }\n    }\n  }\n\n  function signal(emitter, type /*, values...*/) {\n    var arr = emitter._handlers && emitter._handlers[type];\n    if (!arr) return;\n    var args = Array.prototype.slice.call(arguments, 2);\n    for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args);\n  }\n\n  var delayedCallbacks, delayedCallbackDepth = 0;\n  function signalLater(emitter, type /*, values...*/) {\n    var arr = emitter._handlers && emitter._handlers[type];\n    if (!arr) return;\n    var args = Array.prototype.slice.call(arguments, 2);\n    if (!delayedCallbacks) {\n      ++delayedCallbackDepth;\n      delayedCallbacks = [];\n      setTimeout(fireDelayed, 0);\n    }\n    function bnd(f) {return function(){f.apply(null, args);};};\n    for (var i = 0; i < arr.length; ++i)\n      delayedCallbacks.push(bnd(arr[i]));\n  }\n\n  function signalDOMEvent(cm, e) {\n    signal(cm, e.type, cm, e);\n    return e_defaultPrevented(e);\n  }\n\n  function fireDelayed() {\n    --delayedCallbackDepth;\n    var delayed = delayedCallbacks;\n    delayedCallbacks = null;\n    for (var i = 0; i < delayed.length; ++i) delayed[i]();\n  }\n\n  function hasHandler(emitter, type) {\n    var arr = emitter._handlers && emitter._handlers[type];\n    return arr && arr.length > 0;\n  }\n\n  CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal;\n\n  // MISC UTILITIES\n\n  // Number of pixels added to scroller and sizer to hide scrollbar\n  var scrollerCutOff = 30;\n\n  // Returned or thrown by various protocols to signal 'I'm not\n  // handling this'.\n  var Pass = CodeMirror.Pass = {toString: function(){return \"CodeMirror.Pass\";}};\n\n  function Delayed() {this.id = null;}\n  Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}};\n\n  // Counts the column offset in a string, taking tabs into account.\n  // Used mostly to find indentation.\n  function countColumn(string, end, tabSize, startIndex, startValue) {\n    if (end == null) {\n      end = string.search(/[^\\s\\u00a0]/);\n      if (end == -1) end = string.length;\n    }\n    for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) {\n      if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n      else ++n;\n    }\n    return n;\n  }\n  CodeMirror.countColumn = countColumn;\n\n  var spaceStrs = [\"\"];\n  function spaceStr(n) {\n    while (spaceStrs.length <= n)\n      spaceStrs.push(lst(spaceStrs) + \" \");\n    return spaceStrs[n];\n  }\n\n  function lst(arr) { return arr[arr.length-1]; }\n\n  function selectInput(node) {\n    if (ios) { // Mobile Safari apparently has a bug where select() is broken.\n      node.selectionStart = 0;\n      node.selectionEnd = node.value.length;\n    } else {\n      // Suppress mysterious IE10 errors\n      try { node.select(); }\n      catch(_e) {}\n    }\n  }\n\n  function indexOf(collection, elt) {\n    if (collection.indexOf) return collection.indexOf(elt);\n    for (var i = 0, e = collection.length; i < e; ++i)\n      if (collection[i] == elt) return i;\n    return -1;\n  }\n\n  function createObj(base, props) {\n    function Obj() {}\n    Obj.prototype = base;\n    var inst = new Obj();\n    if (props) copyObj(props, inst);\n    return inst;\n  }\n\n  function copyObj(obj, target) {\n    if (!target) target = {};\n    for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop];\n    return target;\n  }\n\n  function emptyArray(size) {\n    for (var a = [], i = 0; i < size; ++i) a.push(undefined);\n    return a;\n  }\n\n  function bind(f) {\n    var args = Array.prototype.slice.call(arguments, 1);\n    return function(){return f.apply(null, args);};\n  }\n\n  var nonASCIISingleCaseWordChar = /[\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n  function isWordChar(ch) {\n    return /\\w/.test(ch) || ch > \"\\x80\" &&\n      (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));\n  }\n\n  function isEmpty(obj) {\n    for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false;\n    return true;\n  }\n\n  var isExtendingChar = /[\\u0300-\\u036F\\u0483-\\u0487\\u0488-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1-\\u05C2\\u05C4-\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7-\\u06E8\\u06EA-\\u06ED\\uA66F\\uA670-\\uA672\\uA674-\\uA67D\\uA69F\\udc00-\\udfff]/;\n\n  // DOM UTILITIES\n\n  function elt(tag, content, className, style) {\n    var e = document.createElement(tag);\n    if (className) e.className = className;\n    if (style) e.style.cssText = style;\n    if (typeof content == \"string\") setTextContent(e, content);\n    else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);\n    return e;\n  }\n\n  function removeChildren(e) {\n    for (var count = e.childNodes.length; count > 0; --count)\n      e.removeChild(e.firstChild);\n    return e;\n  }\n\n  function removeChildrenAndAdd(parent, e) {\n    return removeChildren(parent).appendChild(e);\n  }\n\n  function setTextContent(e, str) {\n    if (ie_lt9) {\n      e.innerHTML = \"\";\n      e.appendChild(document.createTextNode(str));\n    } else e.textContent = str;\n  }\n\n  function getRect(node) {\n    return node.getBoundingClientRect();\n  }\n  CodeMirror.replaceGetRect = function(f) { getRect = f; };\n\n  // FEATURE DETECTION\n\n  // Detect drag-and-drop\n  var dragAndDrop = function() {\n    // There is *some* kind of drag-and-drop support in IE6-8, but I\n    // couldn't get it to work yet.\n    if (ie_lt9) return false;\n    var div = elt('div');\n    return \"draggable\" in div || \"dragDrop\" in div;\n  }();\n\n  // For a reason I have yet to figure out, some browsers disallow\n  // word wrapping between certain characters *only* if a new inline\n  // element is started between them. This makes it hard to reliably\n  // measure the position of things, since that requires inserting an\n  // extra span. This terribly fragile set of tests matches the\n  // character combinations that suffer from this phenomenon on the\n  // various browsers.\n  function spanAffectsWrapping() { return false; }\n  if (gecko) // Only for \"$'\"\n    spanAffectsWrapping = function(str, i) {\n      return str.charCodeAt(i - 1) == 36 && str.charCodeAt(i) == 39;\n    };\n  else if (safari && !/Version\\/([6-9]|\\d\\d)\\b/.test(navigator.userAgent))\n    spanAffectsWrapping = function(str, i) {\n      return /\\-[^ \\-?]|\\?[^ !\\'\\\"\\),.\\-\\/:;\\?\\]\\}]/.test(str.slice(i - 1, i + 1));\n    };\n  else if (webkit)\n    spanAffectsWrapping = function(str, i) {\n      if (i > 1 && str.charCodeAt(i - 1) == 45 && /\\w/.test(str.charAt(i - 2)) && /[^\\-?\\.]/.test(str.charAt(i)))\n        return true;\n      return /[~!#%&*)=+}\\]|\\\"\\.>,:;][({[<]|-[^\\-?\\.\\u2010-\\u201f\\u2026]|\\?[\\w~`@#$%\\^&*(_=+{[|><]|…[\\w~`@#$%\\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1));\n    };\n\n  var knownScrollbarWidth;\n  function scrollbarWidth(measure) {\n    if (knownScrollbarWidth != null) return knownScrollbarWidth;\n    var test = elt(\"div\", null, null, \"width: 50px; height: 50px; overflow-x: scroll\");\n    removeChildrenAndAdd(measure, test);\n    if (test.offsetWidth)\n      knownScrollbarWidth = test.offsetHeight - test.clientHeight;\n    return knownScrollbarWidth || 0;\n  }\n\n  var zwspSupported;\n  function zeroWidthElement(measure) {\n    if (zwspSupported == null) {\n      var test = elt(\"span\", \"\\u200b\");\n      removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n      if (measure.firstChild.offsetHeight != 0)\n        zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8;\n    }\n    if (zwspSupported) return elt(\"span\", \"\\u200b\");\n    else return elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n  }\n\n  // See if \"\".split is the broken IE version, if so, provide an\n  // alternative way to split lines.\n  var splitLines = \"\\n\\nb\".split(/\\n/).length != 3 ? function(string) {\n    var pos = 0, result = [], l = string.length;\n    while (pos <= l) {\n      var nl = string.indexOf(\"\\n\", pos);\n      if (nl == -1) nl = string.length;\n      var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n      var rt = line.indexOf(\"\\r\");\n      if (rt != -1) {\n        result.push(line.slice(0, rt));\n        pos += rt + 1;\n      } else {\n        result.push(line);\n        pos = nl + 1;\n      }\n    }\n    return result;\n  } : function(string){return string.split(/\\r\\n?|\\n/);};\n  CodeMirror.splitLines = splitLines;\n\n  var hasSelection = window.getSelection ? function(te) {\n    try { return te.selectionStart != te.selectionEnd; }\n    catch(e) { return false; }\n  } : function(te) {\n    try {var range = te.ownerDocument.selection.createRange();}\n    catch(e) {}\n    if (!range || range.parentElement() != te) return false;\n    return range.compareEndPoints(\"StartToEnd\", range) != 0;\n  };\n\n  var hasCopyEvent = (function() {\n    var e = elt(\"div\");\n    if (\"oncopy\" in e) return true;\n    e.setAttribute(\"oncopy\", \"return;\");\n    return typeof e.oncopy == 'function';\n  })();\n\n  // KEY NAMING\n\n  var keyNames = {3: \"Enter\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n                  19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n                  36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n                  46: \"Delete\", 59: \";\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\", 109: \"-\", 107: \"=\", 127: \"Delete\",\n                  186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n                  221: \"]\", 222: \"'\", 63276: \"PageUp\", 63277: \"PageDown\", 63275: \"End\", 63273: \"Home\",\n                  63234: \"Left\", 63232: \"Up\", 63235: \"Right\", 63233: \"Down\", 63302: \"Insert\", 63272: \"Delete\"};\n  CodeMirror.keyNames = keyNames;\n  (function() {\n    // Number keys\n    for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i);\n    // Alphabetic keys\n    for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i);\n    // Function keys\n    for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = \"F\" + i;\n  })();\n\n  // BIDI HELPERS\n\n  function iterateBidiSections(order, from, to, f) {\n    if (!order) return f(from, to, \"ltr\");\n    for (var i = 0; i < order.length; ++i) {\n      var part = order[i];\n      if (part.from < to && part.to > from || from == to && part.to == from)\n        f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\");\n    }\n  }\n\n  function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }\n  function bidiRight(part) { return part.level % 2 ? part.from : part.to; }\n\n  function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; }\n  function lineRight(line) {\n    var order = getOrder(line);\n    if (!order) return line.text.length;\n    return bidiRight(lst(order));\n  }\n\n  function lineStart(cm, lineN) {\n    var line = getLine(cm.doc, lineN);\n    var visual = visualLine(cm.doc, line);\n    if (visual != line) lineN = lineNo(visual);\n    var order = getOrder(visual);\n    var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual);\n    return Pos(lineN, ch);\n  }\n  function lineEnd(cm, lineN) {\n    var merged, line;\n    while (merged = collapsedSpanAtEnd(line = getLine(cm.doc, lineN)))\n      lineN = merged.find().to.line;\n    var order = getOrder(line);\n    var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);\n    return Pos(lineN, ch);\n  }\n\n  function compareBidiLevel(order, a, b) {\n    var linedir = order[0].level;\n    if (a == linedir) return true;\n    if (b == linedir) return false;\n    return a < b;\n  }\n  var bidiOther;\n  function getBidiPartAt(order, pos) {\n    for (var i = 0, found; i < order.length; ++i) {\n      var cur = order[i];\n      if (cur.from < pos && cur.to > pos) { bidiOther = null; return i; }\n      if (cur.from == pos || cur.to == pos) {\n        if (found == null) {\n          found = i;\n        } else if (compareBidiLevel(order, cur.level, order[found].level)) {\n          bidiOther = found;\n          return i;\n        } else {\n          bidiOther = i;\n          return found;\n        }\n      }\n    }\n    bidiOther = null;\n    return found;\n  }\n\n  function moveInLine(line, pos, dir, byUnit) {\n    if (!byUnit) return pos + dir;\n    do pos += dir;\n    while (pos > 0 && isExtendingChar.test(line.text.charAt(pos)));\n    return pos;\n  }\n\n  // This is somewhat involved. It is needed in order to move\n  // 'visually' through bi-directional text -- i.e., pressing left\n  // should make the cursor go left, even when in RTL text. The\n  // tricky part is the 'jumps', where RTL and LTR text touch each\n  // other. This often requires the cursor offset to move more than\n  // one unit, in order to visually move one unit.\n  function moveVisually(line, start, dir, byUnit) {\n    var bidi = getOrder(line);\n    if (!bidi) return moveLogically(line, start, dir, byUnit);\n    var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n    var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n    for (;;) {\n      if (target > part.from && target < part.to) return target;\n      if (target == part.from || target == part.to) {\n        if (getBidiPartAt(bidi, target) == pos) return target;\n        part = bidi[pos += dir];\n        return (dir > 0) == part.level % 2 ? part.to : part.from;\n      } else {\n        part = bidi[pos += dir];\n        if (!part) return null;\n        if ((dir > 0) == part.level % 2)\n          target = moveInLine(line, part.to, -1, byUnit);\n        else\n          target = moveInLine(line, part.from, 1, byUnit);\n      }\n    }\n  }\n\n  function moveLogically(line, start, dir, byUnit) {\n    var target = start + dir;\n    if (byUnit) while (target > 0 && isExtendingChar.test(line.text.charAt(target))) target += dir;\n    return target < 0 || target > line.text.length ? null : target;\n  }\n\n  // Bidirectional ordering algorithm\n  // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n  // that this (partially) implements.\n\n  // One-char codes used for character types:\n  // L (L):   Left-to-Right\n  // R (R):   Right-to-Left\n  // r (AL):  Right-to-Left Arabic\n  // 1 (EN):  European Number\n  // + (ES):  European Number Separator\n  // % (ET):  European Number Terminator\n  // n (AN):  Arabic Number\n  // , (CS):  Common Number Separator\n  // m (NSM): Non-Spacing Mark\n  // b (BN):  Boundary Neutral\n  // s (B):   Paragraph Separator\n  // t (S):   Segment Separator\n  // w (WS):  Whitespace\n  // N (ON):  Other Neutrals\n\n  // Returns null if characters are ordered as they appear\n  // (left-to-right), or an array of sections ({from, to, level}\n  // objects) in the order in which they occur visually.\n  var bidiOrdering = (function() {\n    // Character types for codepoints 0 to 0xff\n    var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL\";\n    // Character types for codepoints 0x600 to 0x6ff\n    var arabicTypes = \"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr\";\n    function charType(code) {\n      if (code <= 0xff) return lowTypes.charAt(code);\n      else if (0x590 <= code && code <= 0x5f4) return \"R\";\n      else if (0x600 <= code && code <= 0x6ff) return arabicTypes.charAt(code - 0x600);\n      else if (0x700 <= code && code <= 0x8ac) return \"r\";\n      else return \"L\";\n    }\n\n    var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n    var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n    // Browsers seem to always treat the boundaries of block elements as being L.\n    var outerType = \"L\";\n\n    return function(str) {\n      if (!bidiRE.test(str)) return false;\n      var len = str.length, types = [];\n      for (var i = 0, type; i < len; ++i)\n        types.push(type = charType(str.charCodeAt(i)));\n\n      // W1. Examine each non-spacing mark (NSM) in the level run, and\n      // change the type of the NSM to the type of the previous\n      // character. If the NSM is at the start of the level run, it will\n      // get the type of sor.\n      for (var i = 0, prev = outerType; i < len; ++i) {\n        var type = types[i];\n        if (type == \"m\") types[i] = prev;\n        else prev = type;\n      }\n\n      // W2. Search backwards from each instance of a European number\n      // until the first strong type (R, L, AL, or sor) is found. If an\n      // AL is found, change the type of the European number to Arabic\n      // number.\n      // W3. Change all ALs to R.\n      for (var i = 0, cur = outerType; i < len; ++i) {\n        var type = types[i];\n        if (type == \"1\" && cur == \"r\") types[i] = \"n\";\n        else if (isStrong.test(type)) { cur = type; if (type == \"r\") types[i] = \"R\"; }\n      }\n\n      // W4. A single European separator between two European numbers\n      // changes to a European number. A single common separator between\n      // two numbers of the same type changes to that type.\n      for (var i = 1, prev = types[0]; i < len - 1; ++i) {\n        var type = types[i];\n        if (type == \"+\" && prev == \"1\" && types[i+1] == \"1\") types[i] = \"1\";\n        else if (type == \",\" && prev == types[i+1] &&\n                 (prev == \"1\" || prev == \"n\")) types[i] = prev;\n        prev = type;\n      }\n\n      // W5. A sequence of European terminators adjacent to European\n      // numbers changes to all European numbers.\n      // W6. Otherwise, separators and terminators change to Other\n      // Neutral.\n      for (var i = 0; i < len; ++i) {\n        var type = types[i];\n        if (type == \",\") types[i] = \"N\";\n        else if (type == \"%\") {\n          for (var end = i + 1; end < len && types[end] == \"%\"; ++end) {}\n          var replace = (i && types[i-1] == \"!\") || (end < len - 1 && types[end] == \"1\") ? \"1\" : \"N\";\n          for (var j = i; j < end; ++j) types[j] = replace;\n          i = end - 1;\n        }\n      }\n\n      // W7. Search backwards from each instance of a European number\n      // until the first strong type (R, L, or sor) is found. If an L is\n      // found, then change the type of the European number to L.\n      for (var i = 0, cur = outerType; i < len; ++i) {\n        var type = types[i];\n        if (cur == \"L\" && type == \"1\") types[i] = \"L\";\n        else if (isStrong.test(type)) cur = type;\n      }\n\n      // N1. A sequence of neutrals takes the direction of the\n      // surrounding strong text if the text on both sides has the same\n      // direction. European and Arabic numbers act as if they were R in\n      // terms of their influence on neutrals. Start-of-level-run (sor)\n      // and end-of-level-run (eor) are used at level run boundaries.\n      // N2. Any remaining neutrals take the embedding direction.\n      for (var i = 0; i < len; ++i) {\n        if (isNeutral.test(types[i])) {\n          for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {}\n          var before = (i ? types[i-1] : outerType) == \"L\";\n          var after = (end < len - 1 ? types[end] : outerType) == \"L\";\n          var replace = before || after ? \"L\" : \"R\";\n          for (var j = i; j < end; ++j) types[j] = replace;\n          i = end - 1;\n        }\n      }\n\n      // Here we depart from the documented algorithm, in order to avoid\n      // building up an actual levels array. Since there are only three\n      // levels (0, 1, 2) in an implementation that doesn't take\n      // explicit embedding into account, we can build up the order on\n      // the fly, without following the level-based algorithm.\n      var order = [], m;\n      for (var i = 0; i < len;) {\n        if (countsAsLeft.test(types[i])) {\n          var start = i;\n          for (++i; i < len && countsAsLeft.test(types[i]); ++i) {}\n          order.push({from: start, to: i, level: 0});\n        } else {\n          var pos = i, at = order.length;\n          for (++i; i < len && types[i] != \"L\"; ++i) {}\n          for (var j = pos; j < i;) {\n            if (countsAsNum.test(types[j])) {\n              if (pos < j) order.splice(at, 0, {from: pos, to: j, level: 1});\n              var nstart = j;\n              for (++j; j < i && countsAsNum.test(types[j]); ++j) {}\n              order.splice(at, 0, {from: nstart, to: j, level: 2});\n              pos = j;\n            } else ++j;\n          }\n          if (pos < i) order.splice(at, 0, {from: pos, to: i, level: 1});\n        }\n      }\n      if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n        order[0].from = m[0].length;\n        order.unshift({from: 0, to: m[0].length, level: 0});\n      }\n      if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n        lst(order).to -= m[0].length;\n        order.push({from: len - m[0].length, to: len, level: 0});\n      }\n      if (order[0].level != lst(order).level)\n        order.push({from: len, to: len, level: order[0].level});\n\n      return order;\n    };\n  })();\n\n  // THE END\n\n  CodeMirror.version = \"3.14.0\";\n\n  return CodeMirror;\n})();\n"
  },
  {
    "path": "editor/scripts/editor.js",
    "content": "requirejs.config({\n    shim: {\n        'underscore': {\n            exports: '_'\n        }\n    }\n});\n\nrequire([\"./ki\", \"text!ki.sjs\", \"./mori\", \"./sweet\"], function(ki, ki_core, mori, sweet) {\n    var storage_code = 'editor_code';\n    var storage_mode = 'editor_mode';\n\n    var starting_code = $(\"#editor\").text();\n\n    var editor = CodeMirror.fromTextArea($('#editor')[0], {\n        lineNumbers: true,\n        smartIndent: false,\n        indentWithTabs: true,\n        tabSize: 4,\n        autofocus: true,\n        theme: 'sweetprism',\n        extraKeys: {\n          \"Ctrl-Enter\": function(cm) {\n            run();\n          }\n        }\n    });\n\n    if (window.location.hash) {\n        editor.setValue(decodeURI(window.location.hash.slice(1)));\n    } else {\n        editor.setValue(localStorage[storage_code] ? localStorage[storage_code] : starting_code);\n    }\n    if(localStorage[storage_mode]) {\n        editor.setOption(\"keyMap\", localStorage[storage_mode]);\n    }\n\n    var output = CodeMirror.fromTextArea($('#output')[0], {\n        lineNumbers: true,\n        theme: 'sweetprism',\n        readOnly: true\n    });\n\n    var updateTimeout;\n    editor.on(\"change\", function(e) {\n        clearTimeout(updateTimeout);\n        updateTimeout = setTimeout(updateExpand, 200);\n    });\n\n    $('#btn-run').click(function() {\n      run();\n    });\n\n    var displayRequire = false;\n    $('#ck-require').click(function() {\n      displayRequire = !displayRequire;\n      updateExpand();\n    });\n\n    var options = {\n      modules: sweet.loadModule(ki.joinModule(editor.getValue(),ki_core))\n    };\n\n    $('#edit-box').css({visibility: 'visible'})\n    $('#output-box').css({visibility: 'visible'})\n\n    $('#btn-reload-macros').click(function() {\n      options.modules = sweet.loadModule(ki.joinModule(editor.getValue(),ki_core));\n    });\n\n    function updateExpand() {\n        var code = editor.getValue();\n        window.location = \"editor.html#\" + encodeURI(code);\n        localStorage[storage_code] = code;\n        try {\n            if (!displayRequire) {\n              code = code.replace('ki require core','');\n            }\n            var res = ki.compile(code,options);\n            output.setValue(res.code);\n\n            $('#errors').text('');\n            $('#errors').hide();\n        } catch (e) {\n            $('#return').hide();\n            $('#errors').text(e);\n            $('#errors').show();\n        }\n    }\n    updateExpand();\n\n    function run() {\n      var code = editor.getValue();\n      var res = ki.compile(code,options);\n      try {\n        $('#errors').text('');\n        $('#errors').hide();\n        $('#return').text('Output: ' + eval('(function() {' + res.code + '}())'));\n        $('#return').show();\n      } catch (e) {\n        $('#return').text('');\n        $('#return').hide();\n        $('#errors').text(e);\n        $('#errors').show();\n      }\n    }\n});\n"
  },
  {
    "path": "editor/scripts/escodegen.js",
    "content": "// Generated by CommonJS Everywhere 0.8.1\n(function (global) {\n  function require(file, parentModule) {\n    if ({}.hasOwnProperty.call(require.cache, file))\n      return require.cache[file];\n    var resolved = require.resolve(file);\n    if (!resolved)\n      throw new Error('Failed to resolve module ' + file);\n    var module$ = {\n        id: file,\n        require: require,\n        filename: file,\n        exports: {},\n        loaded: false,\n        parent: parentModule,\n        children: []\n      };\n    if (parentModule)\n      parentModule.children.push(module$);\n    var dirname = file.slice(0, file.lastIndexOf('/') + 1);\n    require.cache[file] = module$.exports;\n    resolved.call(module$.exports, module$, module$.exports, dirname, file);\n    module$.loaded = true;\n    return require.cache[file] = module$.exports;\n  }\n  require.modules = {};\n  require.cache = {};\n  require.resolve = function (file) {\n    return {}.hasOwnProperty.call(require.modules, file) ? require.modules[file] : void 0;\n  };\n  require.define = function (file, fn) {\n    require.modules[file] = fn;\n  };\n  var process = function () {\n      var cwd = '/';\n      return {\n        title: 'browser',\n        version: 'v0.10.24',\n        browser: true,\n        env: {},\n        argv: [],\n        nextTick: global.setImmediate || function (fn) {\n          setTimeout(fn, 0);\n        },\n        cwd: function () {\n          return cwd;\n        },\n        chdir: function (dir) {\n          cwd = dir;\n        }\n      };\n    }();\n  require.define('/tools/entry-point.js', function (module, exports, __dirname, __filename) {\n    (function () {\n      'use strict';\n      global.escodegen = require('/escodegen.js', module);\n      escodegen.browser = true;\n    }());\n  });\n  require.define('/escodegen.js', function (module, exports, __dirname, __filename) {\n    (function () {\n      'use strict';\n      var Syntax, Precedence, BinaryPrecedence, SourceNode, estraverse, esutils, isArray, base, indent, json, renumber, hexadecimal, quotes, escapeless, newline, space, parentheses, semicolons, safeConcatenation, directive, extra, parse, sourceMap, FORMAT_MINIFY, FORMAT_DEFAULTS;\n      estraverse = require('/node_modules/estraverse/estraverse.js', module);\n      esutils = require('/node_modules/esutils/lib/utils.js', module);\n      Syntax = {\n        AssignmentExpression: 'AssignmentExpression',\n        ArrayExpression: 'ArrayExpression',\n        ArrayPattern: 'ArrayPattern',\n        ArrowFunctionExpression: 'ArrowFunctionExpression',\n        BlockStatement: 'BlockStatement',\n        BinaryExpression: 'BinaryExpression',\n        BreakStatement: 'BreakStatement',\n        CallExpression: 'CallExpression',\n        CatchClause: 'CatchClause',\n        ComprehensionBlock: 'ComprehensionBlock',\n        ComprehensionExpression: 'ComprehensionExpression',\n        ConditionalExpression: 'ConditionalExpression',\n        ContinueStatement: 'ContinueStatement',\n        DirectiveStatement: 'DirectiveStatement',\n        DoWhileStatement: 'DoWhileStatement',\n        DebuggerStatement: 'DebuggerStatement',\n        EmptyStatement: 'EmptyStatement',\n        ExportDeclaration: 'ExportDeclaration',\n        ExpressionStatement: 'ExpressionStatement',\n        ForStatement: 'ForStatement',\n        ForInStatement: 'ForInStatement',\n        FunctionDeclaration: 'FunctionDeclaration',\n        FunctionExpression: 'FunctionExpression',\n        GeneratorExpression: 'GeneratorExpression',\n        Identifier: 'Identifier',\n        IfStatement: 'IfStatement',\n        Literal: 'Literal',\n        LabeledStatement: 'LabeledStatement',\n        LogicalExpression: 'LogicalExpression',\n        MemberExpression: 'MemberExpression',\n        NewExpression: 'NewExpression',\n        ObjectExpression: 'ObjectExpression',\n        ObjectPattern: 'ObjectPattern',\n        Program: 'Program',\n        Property: 'Property',\n        ReturnStatement: 'ReturnStatement',\n        SequenceExpression: 'SequenceExpression',\n        SwitchStatement: 'SwitchStatement',\n        SwitchCase: 'SwitchCase',\n        ThisExpression: 'ThisExpression',\n        ThrowStatement: 'ThrowStatement',\n        TryStatement: 'TryStatement',\n        UnaryExpression: 'UnaryExpression',\n        UpdateExpression: 'UpdateExpression',\n        VariableDeclaration: 'VariableDeclaration',\n        VariableDeclarator: 'VariableDeclarator',\n        WhileStatement: 'WhileStatement',\n        WithStatement: 'WithStatement',\n        YieldExpression: 'YieldExpression'\n      };\n      Precedence = {\n        Sequence: 0,\n        Yield: 1,\n        Assignment: 1,\n        Conditional: 2,\n        ArrowFunction: 2,\n        LogicalOR: 3,\n        LogicalAND: 4,\n        BitwiseOR: 5,\n        BitwiseXOR: 6,\n        BitwiseAND: 7,\n        Equality: 8,\n        Relational: 9,\n        BitwiseSHIFT: 10,\n        Additive: 11,\n        Multiplicative: 12,\n        Unary: 13,\n        Postfix: 14,\n        Call: 15,\n        New: 16,\n        Member: 17,\n        Primary: 18\n      };\n      BinaryPrecedence = {\n        '||': Precedence.LogicalOR,\n        '&&': Precedence.LogicalAND,\n        '|': Precedence.BitwiseOR,\n        '^': Precedence.BitwiseXOR,\n        '&': Precedence.BitwiseAND,\n        '==': Precedence.Equality,\n        '!=': Precedence.Equality,\n        '===': Precedence.Equality,\n        '!==': Precedence.Equality,\n        'is': Precedence.Equality,\n        'isnt': Precedence.Equality,\n        '<': Precedence.Relational,\n        '>': Precedence.Relational,\n        '<=': Precedence.Relational,\n        '>=': Precedence.Relational,\n        'in': Precedence.Relational,\n        'instanceof': Precedence.Relational,\n        '<<': Precedence.BitwiseSHIFT,\n        '>>': Precedence.BitwiseSHIFT,\n        '>>>': Precedence.BitwiseSHIFT,\n        '+': Precedence.Additive,\n        '-': Precedence.Additive,\n        '*': Precedence.Multiplicative,\n        '%': Precedence.Multiplicative,\n        '/': Precedence.Multiplicative\n      };\n      function getDefaultOptions() {\n        return {\n          indent: null,\n          base: null,\n          parse: null,\n          comment: false,\n          format: {\n            indent: {\n              style: '    ',\n              base: 0,\n              adjustMultilineComment: false\n            },\n            newline: '\\n',\n            space: ' ',\n            json: false,\n            renumber: false,\n            hexadecimal: false,\n            quotes: 'single',\n            escapeless: false,\n            compact: false,\n            parentheses: true,\n            semicolons: true,\n            safeConcatenation: false\n          },\n          moz: {\n            comprehensionExpressionStartsWithAssignment: false,\n            starlessGenerator: false,\n            parenthesizedComprehensionBlock: false\n          },\n          sourceMap: null,\n          sourceMapRoot: null,\n          sourceMapWithCode: false,\n          directive: false,\n          verbatim: null\n        };\n      }\n      function stringRepeat(str, num) {\n        var result = '';\n        for (num |= 0; num > 0; num >>>= 1, str += str) {\n          if (num & 1) {\n            result += str;\n          }\n        }\n        return result;\n      }\n      isArray = Array.isArray;\n      if (!isArray) {\n        isArray = function isArray(array) {\n          return Object.prototype.toString.call(array) === '[object Array]';\n        };\n      }\n      function hasLineTerminator(str) {\n        return /[\\r\\n]/g.test(str);\n      }\n      function endsWithLineTerminator(str) {\n        var len = str.length;\n        return len && esutils.code.isLineTerminator(str.charCodeAt(len - 1));\n      }\n      function updateDeeply(target, override) {\n        var key, val;\n        function isHashObject(target) {\n          return typeof target === 'object' && target instanceof Object && !(target instanceof RegExp);\n        }\n        for (key in override) {\n          if (override.hasOwnProperty(key)) {\n            val = override[key];\n            if (isHashObject(val)) {\n              if (isHashObject(target[key])) {\n                updateDeeply(target[key], val);\n              } else {\n                target[key] = updateDeeply({}, val);\n              }\n            } else {\n              target[key] = val;\n            }\n          }\n        }\n        return target;\n      }\n      function generateNumber(value) {\n        var result, point, temp, exponent, pos;\n        if (value !== value) {\n          throw new Error('Numeric literal whose value is NaN');\n        }\n        if (value < 0 || value === 0 && 1 / value < 0) {\n          throw new Error('Numeric literal whose value is negative');\n        }\n        if (value === 1 / 0) {\n          return json ? 'null' : renumber ? '1e400' : '1e+400';\n        }\n        result = '' + value;\n        if (!renumber || result.length < 3) {\n          return result;\n        }\n        point = result.indexOf('.');\n        if (!json && result.charCodeAt(0) === 48 && point === 1) {\n          point = 0;\n          result = result.slice(1);\n        }\n        temp = result;\n        result = result.replace('e+', 'e');\n        exponent = 0;\n        if ((pos = temp.indexOf('e')) > 0) {\n          exponent = +temp.slice(pos + 1);\n          temp = temp.slice(0, pos);\n        }\n        if (point >= 0) {\n          exponent -= temp.length - point - 1;\n          temp = +(temp.slice(0, point) + temp.slice(point + 1)) + '';\n        }\n        pos = 0;\n        while (temp.charCodeAt(temp.length + pos - 1) === 48) {\n          --pos;\n        }\n        if (pos !== 0) {\n          exponent -= pos;\n          temp = temp.slice(0, pos);\n        }\n        if (exponent !== 0) {\n          temp += 'e' + exponent;\n        }\n        if ((temp.length < result.length || hexadecimal && value > 1e12 && Math.floor(value) === value && (temp = '0x' + value.toString(16)).length < result.length) && +temp === value) {\n          result = temp;\n        }\n        return result;\n      }\n      function escapeRegExpCharacter(ch, previousIsBackslash) {\n        if ((ch & ~1) === 8232) {\n          return (previousIsBackslash ? 'u' : '\\\\u') + (ch === 8232 ? '2028' : '2029');\n        } else if (ch === 10 || ch === 13) {\n          return (previousIsBackslash ? '' : '\\\\') + (ch === 10 ? 'n' : 'r');\n        }\n        return String.fromCharCode(ch);\n      }\n      function generateRegExp(reg) {\n        var match, result, flags, i, iz, ch, characterInBrack, previousIsBackslash;\n        result = reg.toString();\n        if (reg.source) {\n          match = result.match(/\\/([^/]*)$/);\n          if (!match) {\n            return result;\n          }\n          flags = match[1];\n          result = '';\n          characterInBrack = false;\n          previousIsBackslash = false;\n          for (i = 0, iz = reg.source.length; i < iz; ++i) {\n            ch = reg.source.charCodeAt(i);\n            if (!previousIsBackslash) {\n              if (characterInBrack) {\n                if (ch === 93) {\n                  characterInBrack = false;\n                }\n              } else {\n                if (ch === 47) {\n                  result += '\\\\';\n                } else if (ch === 91) {\n                  characterInBrack = true;\n                }\n              }\n              result += escapeRegExpCharacter(ch, previousIsBackslash);\n              previousIsBackslash = ch === 92;\n            } else {\n              result += escapeRegExpCharacter(ch, previousIsBackslash);\n              previousIsBackslash = false;\n            }\n          }\n          return '/' + result + '/' + flags;\n        }\n        return result;\n      }\n      function escapeAllowedCharacter(code, next) {\n        var hex, result = '\\\\';\n        switch (code) {\n        case 8:\n          result += 'b';\n          break;\n        case 12:\n          result += 'f';\n          break;\n        case 9:\n          result += 't';\n          break;\n        default:\n          hex = code.toString(16).toUpperCase();\n          if (json || code > 255) {\n            result += 'u' + '0000'.slice(hex.length) + hex;\n          } else if (code === 0 && !esutils.code.isDecimalDigit(next)) {\n            result += '0';\n          } else if (code === 11) {\n            result += 'x0B';\n          } else {\n            result += 'x' + '00'.slice(hex.length) + hex;\n          }\n          break;\n        }\n        return result;\n      }\n      function escapeDisallowedCharacter(code) {\n        var result = '\\\\';\n        switch (code) {\n        case 92:\n          result += '\\\\';\n          break;\n        case 10:\n          result += 'n';\n          break;\n        case 13:\n          result += 'r';\n          break;\n        case 8232:\n          result += 'u2028';\n          break;\n        case 8233:\n          result += 'u2029';\n          break;\n        default:\n          throw new Error('Incorrectly classified character');\n        }\n        return result;\n      }\n      function escapeDirective(str) {\n        var i, iz, code, quote;\n        quote = quotes === 'double' ? '\"' : \"'\";\n        for (i = 0, iz = str.length; i < iz; ++i) {\n          code = str.charCodeAt(i);\n          if (code === 39) {\n            quote = '\"';\n            break;\n          } else if (code === 34) {\n            quote = \"'\";\n            break;\n          } else if (code === 92) {\n            ++i;\n          }\n        }\n        return quote + str + quote;\n      }\n      function escapeString(str) {\n        var result = '', i, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote;\n        for (i = 0, len = str.length; i < len; ++i) {\n          code = str.charCodeAt(i);\n          if (code === 39) {\n            ++singleQuotes;\n          } else if (code === 34) {\n            ++doubleQuotes;\n          } else if (code === 47 && json) {\n            result += '\\\\';\n          } else if (esutils.code.isLineTerminator(code) || code === 92) {\n            result += escapeDisallowedCharacter(code);\n            continue;\n          } else if (json && code < 32 || !(json || escapeless || code >= 32 && code <= 126)) {\n            result += escapeAllowedCharacter(code, str.charCodeAt(i + 1));\n            continue;\n          }\n          result += String.fromCharCode(code);\n        }\n        single = !(quotes === 'double' || quotes === 'auto' && doubleQuotes < singleQuotes);\n        quote = single ? \"'\" : '\"';\n        if (!(single ? singleQuotes : doubleQuotes)) {\n          return quote + result + quote;\n        }\n        str = result;\n        result = quote;\n        for (i = 0, len = str.length; i < len; ++i) {\n          code = str.charCodeAt(i);\n          if (code === 39 && single || code === 34 && !single) {\n            result += '\\\\';\n          }\n          result += String.fromCharCode(code);\n        }\n        return result + quote;\n      }\n      function flattenToString(arr) {\n        var i, iz, elem, result = '';\n        for (i = 0, iz = arr.length; i < iz; ++i) {\n          elem = arr[i];\n          result += isArray(elem) ? flattenToString(elem) : elem;\n        }\n        return result;\n      }\n      function toSourceNodeWhenNeeded(generated, node) {\n        if (!sourceMap) {\n          if (isArray(generated)) {\n            return flattenToString(generated);\n          } else {\n            return generated;\n          }\n        }\n        if (node == null) {\n          if (generated instanceof SourceNode) {\n            return generated;\n          } else {\n            node = {};\n          }\n        }\n        if (node.loc == null) {\n          return new SourceNode(null, null, sourceMap, generated, node.name || null);\n        }\n        return new SourceNode(node.loc.start.line, node.loc.start.column, sourceMap === true ? node.loc.source || null : sourceMap, generated, node.name || null);\n      }\n      function noEmptySpace() {\n        return space ? space : ' ';\n      }\n      function join(left, right) {\n        var leftSource = toSourceNodeWhenNeeded(left).toString(), rightSource = toSourceNodeWhenNeeded(right).toString(), leftCharCode = leftSource.charCodeAt(leftSource.length - 1), rightCharCode = rightSource.charCodeAt(0);\n        if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPart(leftCharCode) && esutils.code.isIdentifierPart(rightCharCode) || leftCharCode === 47 && rightCharCode === 105) {\n          return [\n            left,\n            noEmptySpace(),\n            right\n          ];\n        } else if (esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode)) {\n          return [\n            left,\n            right\n          ];\n        }\n        return [\n          left,\n          space,\n          right\n        ];\n      }\n      function addIndent(stmt) {\n        return [\n          base,\n          stmt\n        ];\n      }\n      function withIndent(fn) {\n        var previousBase, result;\n        previousBase = base;\n        base += indent;\n        result = fn.call(this, base);\n        base = previousBase;\n        return result;\n      }\n      function calculateSpaces(str) {\n        var i;\n        for (i = str.length - 1; i >= 0; --i) {\n          if (esutils.code.isLineTerminator(str.charCodeAt(i))) {\n            break;\n          }\n        }\n        return str.length - 1 - i;\n      }\n      function adjustMultilineComment(value, specialBase) {\n        var array, i, len, line, j, spaces, previousBase, sn;\n        array = value.split(/\\r\\n|[\\r\\n]/);\n        spaces = Number.MAX_VALUE;\n        for (i = 1, len = array.length; i < len; ++i) {\n          line = array[i];\n          j = 0;\n          while (j < line.length && esutils.code.isWhiteSpace(line.charCodeAt(j))) {\n            ++j;\n          }\n          if (spaces > j) {\n            spaces = j;\n          }\n        }\n        if (typeof specialBase !== 'undefined') {\n          previousBase = base;\n          if (array[1][spaces] === '*') {\n            specialBase += ' ';\n          }\n          base = specialBase;\n        } else {\n          if (spaces & 1) {\n            --spaces;\n          }\n          previousBase = base;\n        }\n        for (i = 1, len = array.length; i < len; ++i) {\n          sn = toSourceNodeWhenNeeded(addIndent(array[i].slice(spaces)));\n          array[i] = sourceMap ? sn.join('') : sn;\n        }\n        base = previousBase;\n        return array.join('\\n');\n      }\n      function generateComment(comment, specialBase) {\n        if (comment.type === 'Line') {\n          if (endsWithLineTerminator(comment.value)) {\n            return '//' + comment.value;\n          } else {\n            return '//' + comment.value + '\\n';\n          }\n        }\n        if (extra.format.indent.adjustMultilineComment && /[\\n\\r]/.test(comment.value)) {\n          return adjustMultilineComment('/*' + comment.value + '*/', specialBase);\n        }\n        return '/*' + comment.value + '*/';\n      }\n      function addCommentsToStatement(stmt, result) {\n        var i, len, comment, save, tailingToStatement, specialBase, fragment;\n        if (stmt.leadingComments && stmt.leadingComments.length > 0) {\n          save = result;\n          comment = stmt.leadingComments[0];\n          result = [];\n          if (safeConcatenation && stmt.type === Syntax.Program && stmt.body.length === 0) {\n            result.push('\\n');\n          }\n          result.push(generateComment(comment));\n          if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {\n            result.push('\\n');\n          }\n          for (i = 1, len = stmt.leadingComments.length; i < len; ++i) {\n            comment = stmt.leadingComments[i];\n            fragment = [generateComment(comment)];\n            if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) {\n              fragment.push('\\n');\n            }\n            result.push(addIndent(fragment));\n          }\n          result.push(addIndent(save));\n        }\n        if (stmt.trailingComments) {\n          tailingToStatement = !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString());\n          specialBase = stringRepeat(' ', calculateSpaces(toSourceNodeWhenNeeded([\n            base,\n            result,\n            indent\n          ]).toString()));\n          for (i = 0, len = stmt.trailingComments.length; i < len; ++i) {\n            comment = stmt.trailingComments[i];\n            if (tailingToStatement) {\n              if (i === 0) {\n                result = [\n                  result,\n                  indent\n                ];\n              } else {\n                result = [\n                  result,\n                  specialBase\n                ];\n              }\n              result.push(generateComment(comment, specialBase));\n            } else {\n              result = [\n                result,\n                addIndent(generateComment(comment))\n              ];\n            }\n            if (i !== len - 1 && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {\n              result = [\n                result,\n                '\\n'\n              ];\n            }\n          }\n        }\n        return result;\n      }\n      function parenthesize(text, current, should) {\n        if (current < should) {\n          return [\n            '(',\n            text,\n            ')'\n          ];\n        }\n        return text;\n      }\n      function maybeBlock(stmt, semicolonOptional, functionBody) {\n        var result, noLeadingComment;\n        noLeadingComment = !extra.comment || !stmt.leadingComments;\n        if (stmt.type === Syntax.BlockStatement && noLeadingComment) {\n          return [\n            space,\n            generateStatement(stmt, { functionBody: functionBody })\n          ];\n        }\n        if (stmt.type === Syntax.EmptyStatement && noLeadingComment) {\n          return ';';\n        }\n        withIndent(function () {\n          result = [\n            newline,\n            addIndent(generateStatement(stmt, {\n              semicolonOptional: semicolonOptional,\n              functionBody: functionBody\n            }))\n          ];\n        });\n        return result;\n      }\n      function maybeBlockSuffix(stmt, result) {\n        var ends = endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString());\n        if (stmt.type === Syntax.BlockStatement && (!extra.comment || !stmt.leadingComments) && !ends) {\n          return [\n            result,\n            space\n          ];\n        }\n        if (ends) {\n          return [\n            result,\n            base\n          ];\n        }\n        return [\n          result,\n          newline,\n          base\n        ];\n      }\n      function generateVerbatim(expr, option) {\n        var i, result;\n        result = expr[extra.verbatim].split(/\\r\\n|\\n/);\n        for (i = 1; i < result.length; i++) {\n          result[i] = newline + base + result[i];\n        }\n        result = parenthesize(result, Precedence.Sequence, option.precedence);\n        return toSourceNodeWhenNeeded(result, expr);\n      }\n      function generateIdentifier(node) {\n        return toSourceNodeWhenNeeded(node.name, node);\n      }\n      function generatePattern(node, options) {\n        var result;\n        if (node.type === Syntax.Identifier) {\n          result = generateIdentifier(node);\n        } else {\n          result = generateExpression(node, {\n            precedence: options.precedence,\n            allowIn: options.allowIn,\n            allowCall: true\n          });\n        }\n        return result;\n      }\n      function generateFunctionBody(node) {\n        var result, i, len, expr, arrow;\n        arrow = node.type === Syntax.ArrowFunctionExpression;\n        if (arrow && node.params.length === 1 && node.params[0].type === Syntax.Identifier) {\n          result = [generateIdentifier(node.params[0])];\n        } else {\n          result = ['('];\n          for (i = 0, len = node.params.length; i < len; ++i) {\n            result.push(generatePattern(node.params[i], {\n              precedence: Precedence.Assignment,\n              allowIn: true\n            }));\n            if (i + 1 < len) {\n              result.push(',' + space);\n            }\n          }\n          result.push(')');\n        }\n        if (arrow) {\n          result.push(space, '=>');\n        }\n        if (node.expression) {\n          result.push(space);\n          expr = generateExpression(node.body, {\n            precedence: Precedence.Assignment,\n            allowIn: true,\n            allowCall: true\n          });\n          if (expr.toString().charAt(0) === '{') {\n            expr = [\n              '(',\n              expr,\n              ')'\n            ];\n          }\n          result.push(expr);\n        } else {\n          result.push(maybeBlock(node.body, false, true));\n        }\n        return result;\n      }\n      function generateExpression(expr, option) {\n        var result, precedence, type, currentPrecedence, i, len, raw, fragment, multiline, leftCharCode, leftSource, rightCharCode, allowIn, allowCall, allowUnparenthesizedNew, property, isGenerator;\n        precedence = option.precedence;\n        allowIn = option.allowIn;\n        allowCall = option.allowCall;\n        type = expr.type || option.type;\n        if (extra.verbatim && expr.hasOwnProperty(extra.verbatim)) {\n          return generateVerbatim(expr, option);\n        }\n        switch (type) {\n        case Syntax.SequenceExpression:\n          result = [];\n          allowIn |= Precedence.Sequence < precedence;\n          for (i = 0, len = expr.expressions.length; i < len; ++i) {\n            result.push(generateExpression(expr.expressions[i], {\n              precedence: Precedence.Assignment,\n              allowIn: allowIn,\n              allowCall: true\n            }));\n            if (i + 1 < len) {\n              result.push(',' + space);\n            }\n          }\n          result = parenthesize(result, Precedence.Sequence, precedence);\n          break;\n        case Syntax.AssignmentExpression:\n          allowIn |= Precedence.Assignment < precedence;\n          result = parenthesize([\n            generateExpression(expr.left, {\n              precedence: Precedence.Call,\n              allowIn: allowIn,\n              allowCall: true\n            }),\n            space + expr.operator + space,\n            generateExpression(expr.right, {\n              precedence: Precedence.Assignment,\n              allowIn: allowIn,\n              allowCall: true\n            })\n          ], Precedence.Assignment, precedence);\n          break;\n        case Syntax.ArrowFunctionExpression:\n          allowIn |= Precedence.ArrowFunction < precedence;\n          result = parenthesize(generateFunctionBody(expr), Precedence.ArrowFunction, precedence);\n          break;\n        case Syntax.ConditionalExpression:\n          allowIn |= Precedence.Conditional < precedence;\n          result = parenthesize([\n            generateExpression(expr.test, {\n              precedence: Precedence.LogicalOR,\n              allowIn: allowIn,\n              allowCall: true\n            }),\n            space + '?' + space,\n            generateExpression(expr.consequent, {\n              precedence: Precedence.Assignment,\n              allowIn: allowIn,\n              allowCall: true\n            }),\n            space + ':' + space,\n            generateExpression(expr.alternate, {\n              precedence: Precedence.Assignment,\n              allowIn: allowIn,\n              allowCall: true\n            })\n          ], Precedence.Conditional, precedence);\n          break;\n        case Syntax.LogicalExpression:\n        case Syntax.BinaryExpression:\n          currentPrecedence = BinaryPrecedence[expr.operator];\n          allowIn |= currentPrecedence < precedence;\n          fragment = generateExpression(expr.left, {\n            precedence: currentPrecedence,\n            allowIn: allowIn,\n            allowCall: true\n          });\n          leftSource = fragment.toString();\n          if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPart(expr.operator.charCodeAt(0))) {\n            result = [\n              fragment,\n              noEmptySpace(),\n              expr.operator\n            ];\n          } else {\n            result = join(fragment, expr.operator);\n          }\n          fragment = generateExpression(expr.right, {\n            precedence: currentPrecedence + 1,\n            allowIn: allowIn,\n            allowCall: true\n          });\n          if (expr.operator === '/' && fragment.toString().charAt(0) === '/' || expr.operator.slice(-1) === '<' && fragment.toString().slice(0, 3) === '!--') {\n            result.push(noEmptySpace(), fragment);\n          } else {\n            result = join(result, fragment);\n          }\n          if (expr.operator === 'in' && !allowIn) {\n            result = [\n              '(',\n              result,\n              ')'\n            ];\n          } else {\n            result = parenthesize(result, currentPrecedence, precedence);\n          }\n          break;\n        case Syntax.CallExpression:\n          result = [generateExpression(expr.callee, {\n              precedence: Precedence.Call,\n              allowIn: true,\n              allowCall: true,\n              allowUnparenthesizedNew: false\n            })];\n          result.push('(');\n          for (i = 0, len = expr['arguments'].length; i < len; ++i) {\n            result.push(generateExpression(expr['arguments'][i], {\n              precedence: Precedence.Assignment,\n              allowIn: true,\n              allowCall: true\n            }));\n            if (i + 1 < len) {\n              result.push(',' + space);\n            }\n          }\n          result.push(')');\n          if (!allowCall) {\n            result = [\n              '(',\n              result,\n              ')'\n            ];\n          } else {\n            result = parenthesize(result, Precedence.Call, precedence);\n          }\n          break;\n        case Syntax.NewExpression:\n          len = expr['arguments'].length;\n          allowUnparenthesizedNew = option.allowUnparenthesizedNew === undefined || option.allowUnparenthesizedNew;\n          result = join('new', generateExpression(expr.callee, {\n            precedence: Precedence.New,\n            allowIn: true,\n            allowCall: false,\n            allowUnparenthesizedNew: allowUnparenthesizedNew && !parentheses && len === 0\n          }));\n          if (!allowUnparenthesizedNew || parentheses || len > 0) {\n            result.push('(');\n            for (i = 0; i < len; ++i) {\n              result.push(generateExpression(expr['arguments'][i], {\n                precedence: Precedence.Assignment,\n                allowIn: true,\n                allowCall: true\n              }));\n              if (i + 1 < len) {\n                result.push(',' + space);\n              }\n            }\n            result.push(')');\n          }\n          result = parenthesize(result, Precedence.New, precedence);\n          break;\n        case Syntax.MemberExpression:\n          result = [generateExpression(expr.object, {\n              precedence: Precedence.Call,\n              allowIn: true,\n              allowCall: allowCall,\n              allowUnparenthesizedNew: false\n            })];\n          if (expr.computed) {\n            result.push('[', generateExpression(expr.property, {\n              precedence: Precedence.Sequence,\n              allowIn: true,\n              allowCall: allowCall\n            }), ']');\n          } else {\n            if (expr.object.type === Syntax.Literal && typeof expr.object.value === 'number') {\n              fragment = toSourceNodeWhenNeeded(result).toString();\n              if (fragment.indexOf('.') < 0 && !/[eExX]/.test(fragment) && esutils.code.isDecimalDigit(fragment.charCodeAt(fragment.length - 1)) && !(fragment.length >= 2 && fragment.charCodeAt(0) === 48)) {\n                result.push('.');\n              }\n            }\n            result.push('.', generateIdentifier(expr.property));\n          }\n          result = parenthesize(result, Precedence.Member, precedence);\n          break;\n        case Syntax.UnaryExpression:\n          fragment = generateExpression(expr.argument, {\n            precedence: Precedence.Unary,\n            allowIn: true,\n            allowCall: true\n          });\n          if (space === '') {\n            result = join(expr.operator, fragment);\n          } else {\n            result = [expr.operator];\n            if (expr.operator.length > 2) {\n              result = join(result, fragment);\n            } else {\n              leftSource = toSourceNodeWhenNeeded(result).toString();\n              leftCharCode = leftSource.charCodeAt(leftSource.length - 1);\n              rightCharCode = fragment.toString().charCodeAt(0);\n              if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPart(leftCharCode) && esutils.code.isIdentifierPart(rightCharCode)) {\n                result.push(noEmptySpace(), fragment);\n              } else {\n                result.push(fragment);\n              }\n            }\n          }\n          result = parenthesize(result, Precedence.Unary, precedence);\n          break;\n        case Syntax.YieldExpression:\n          if (expr.delegate) {\n            result = 'yield*';\n          } else {\n            result = 'yield';\n          }\n          if (expr.argument) {\n            result = join(result, generateExpression(expr.argument, {\n              precedence: Precedence.Yield,\n              allowIn: true,\n              allowCall: true\n            }));\n          }\n          result = parenthesize(result, Precedence.Yield, precedence);\n          break;\n        case Syntax.UpdateExpression:\n          if (expr.prefix) {\n            result = parenthesize([\n              expr.operator,\n              generateExpression(expr.argument, {\n                precedence: Precedence.Unary,\n                allowIn: true,\n                allowCall: true\n              })\n            ], Precedence.Unary, precedence);\n          } else {\n            result = parenthesize([\n              generateExpression(expr.argument, {\n                precedence: Precedence.Postfix,\n                allowIn: true,\n                allowCall: true\n              }),\n              expr.operator\n            ], Precedence.Postfix, precedence);\n          }\n          break;\n        case Syntax.FunctionExpression:\n          isGenerator = expr.generator && !extra.moz.starlessGenerator;\n          result = isGenerator ? 'function*' : 'function';\n          if (expr.id) {\n            result = [\n              result,\n              isGenerator ? space : noEmptySpace(),\n              generateIdentifier(expr.id),\n              generateFunctionBody(expr)\n            ];\n          } else {\n            result = [\n              result + space,\n              generateFunctionBody(expr)\n            ];\n          }\n          break;\n        case Syntax.ArrayPattern:\n        case Syntax.ArrayExpression:\n          if (!expr.elements.length) {\n            result = '[]';\n            break;\n          }\n          multiline = expr.elements.length > 1;\n          result = [\n            '[',\n            multiline ? newline : ''\n          ];\n          withIndent(function (indent) {\n            for (i = 0, len = expr.elements.length; i < len; ++i) {\n              if (!expr.elements[i]) {\n                if (multiline) {\n                  result.push(indent);\n                }\n                if (i + 1 === len) {\n                  result.push(',');\n                }\n              } else {\n                result.push(multiline ? indent : '', generateExpression(expr.elements[i], {\n                  precedence: Precedence.Assignment,\n                  allowIn: true,\n                  allowCall: true\n                }));\n              }\n              if (i + 1 < len) {\n                result.push(',' + (multiline ? newline : space));\n              }\n            }\n          });\n          if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {\n            result.push(newline);\n          }\n          result.push(multiline ? base : '', ']');\n          break;\n        case Syntax.Property:\n          if (expr.kind === 'get' || expr.kind === 'set') {\n            result = [\n              expr.kind,\n              noEmptySpace(),\n              generateExpression(expr.key, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }),\n              generateFunctionBody(expr.value)\n            ];\n          } else {\n            if (expr.shorthand) {\n              result = generateExpression(expr.key, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              });\n            } else if (expr.method) {\n              result = [];\n              if (expr.value.generator) {\n                result.push('*');\n              }\n              result.push(generateExpression(expr.key, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }), generateFunctionBody(expr.value));\n            } else {\n              result = [\n                generateExpression(expr.key, {\n                  precedence: Precedence.Sequence,\n                  allowIn: true,\n                  allowCall: true\n                }),\n                ':' + space,\n                generateExpression(expr.value, {\n                  precedence: Precedence.Assignment,\n                  allowIn: true,\n                  allowCall: true\n                })\n              ];\n            }\n          }\n          break;\n        case Syntax.ObjectExpression:\n          if (!expr.properties.length) {\n            result = '{}';\n            break;\n          }\n          multiline = expr.properties.length > 1;\n          withIndent(function () {\n            fragment = generateExpression(expr.properties[0], {\n              precedence: Precedence.Sequence,\n              allowIn: true,\n              allowCall: true,\n              type: Syntax.Property\n            });\n          });\n          if (!multiline) {\n            if (!hasLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) {\n              result = [\n                '{',\n                space,\n                fragment,\n                space,\n                '}'\n              ];\n              break;\n            }\n          }\n          withIndent(function (indent) {\n            result = [\n              '{',\n              newline,\n              indent,\n              fragment\n            ];\n            if (multiline) {\n              result.push(',' + newline);\n              for (i = 1, len = expr.properties.length; i < len; ++i) {\n                result.push(indent, generateExpression(expr.properties[i], {\n                  precedence: Precedence.Sequence,\n                  allowIn: true,\n                  allowCall: true,\n                  type: Syntax.Property\n                }));\n                if (i + 1 < len) {\n                  result.push(',' + newline);\n                }\n              }\n            }\n          });\n          if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {\n            result.push(newline);\n          }\n          result.push(base, '}');\n          break;\n        case Syntax.ObjectPattern:\n          if (!expr.properties.length) {\n            result = '{}';\n            break;\n          }\n          multiline = false;\n          if (expr.properties.length === 1) {\n            property = expr.properties[0];\n            if (property.value.type !== Syntax.Identifier) {\n              multiline = true;\n            }\n          } else {\n            for (i = 0, len = expr.properties.length; i < len; ++i) {\n              property = expr.properties[i];\n              if (!property.shorthand) {\n                multiline = true;\n                break;\n              }\n            }\n          }\n          result = [\n            '{',\n            multiline ? newline : ''\n          ];\n          withIndent(function (indent) {\n            for (i = 0, len = expr.properties.length; i < len; ++i) {\n              result.push(multiline ? indent : '', generateExpression(expr.properties[i], {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }));\n              if (i + 1 < len) {\n                result.push(',' + (multiline ? newline : space));\n              }\n            }\n          });\n          if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {\n            result.push(newline);\n          }\n          result.push(multiline ? base : '', '}');\n          break;\n        case Syntax.ThisExpression:\n          result = 'this';\n          break;\n        case Syntax.Identifier:\n          result = generateIdentifier(expr);\n          break;\n        case Syntax.Literal:\n          if (expr.hasOwnProperty('raw') && parse) {\n            try {\n              raw = parse(expr.raw).body[0].expression;\n              if (raw.type === Syntax.Literal) {\n                if (raw.value === expr.value) {\n                  result = expr.raw;\n                  break;\n                }\n              }\n            } catch (e) {\n            }\n          }\n          if (expr.value === null) {\n            result = 'null';\n            break;\n          }\n          if (typeof expr.value === 'string') {\n            result = escapeString(expr.value);\n            break;\n          }\n          if (typeof expr.value === 'number') {\n            result = generateNumber(expr.value);\n            break;\n          }\n          if (typeof expr.value === 'boolean') {\n            result = expr.value ? 'true' : 'false';\n            break;\n          }\n          result = generateRegExp(expr.value);\n          break;\n        case Syntax.GeneratorExpression:\n        case Syntax.ComprehensionExpression:\n          result = type === Syntax.GeneratorExpression ? ['('] : ['['];\n          if (extra.moz.comprehensionExpressionStartsWithAssignment) {\n            fragment = generateExpression(expr.body, {\n              precedence: Precedence.Assignment,\n              allowIn: true,\n              allowCall: true\n            });\n            result.push(fragment);\n          }\n          if (expr.blocks) {\n            withIndent(function () {\n              for (i = 0, len = expr.blocks.length; i < len; ++i) {\n                fragment = generateExpression(expr.blocks[i], {\n                  precedence: Precedence.Sequence,\n                  allowIn: true,\n                  allowCall: true\n                });\n                if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) {\n                  result = join(result, fragment);\n                } else {\n                  result.push(fragment);\n                }\n              }\n            });\n          }\n          if (expr.filter) {\n            result = join(result, 'if' + space);\n            fragment = generateExpression(expr.filter, {\n              precedence: Precedence.Sequence,\n              allowIn: true,\n              allowCall: true\n            });\n            if (extra.moz.parenthesizedComprehensionBlock) {\n              result = join(result, [\n                '(',\n                fragment,\n                ')'\n              ]);\n            } else {\n              result = join(result, fragment);\n            }\n          }\n          if (!extra.moz.comprehensionExpressionStartsWithAssignment) {\n            fragment = generateExpression(expr.body, {\n              precedence: Precedence.Assignment,\n              allowIn: true,\n              allowCall: true\n            });\n            result = join(result, fragment);\n          }\n          result.push(type === Syntax.GeneratorExpression ? ')' : ']');\n          break;\n        case Syntax.ComprehensionBlock:\n          if (expr.left.type === Syntax.VariableDeclaration) {\n            fragment = [\n              expr.left.kind,\n              noEmptySpace(),\n              generateStatement(expr.left.declarations[0], { allowIn: false })\n            ];\n          } else {\n            fragment = generateExpression(expr.left, {\n              precedence: Precedence.Call,\n              allowIn: true,\n              allowCall: true\n            });\n          }\n          fragment = join(fragment, expr.of ? 'of' : 'in');\n          fragment = join(fragment, generateExpression(expr.right, {\n            precedence: Precedence.Sequence,\n            allowIn: true,\n            allowCall: true\n          }));\n          if (extra.moz.parenthesizedComprehensionBlock) {\n            result = [\n              'for' + space + '(',\n              fragment,\n              ')'\n            ];\n          } else {\n            result = join('for' + space, fragment);\n          }\n          break;\n        default:\n          throw new Error('Unknown expression type: ' + expr.type);\n        }\n        return toSourceNodeWhenNeeded(result, expr);\n      }\n      function generateStatement(stmt, option) {\n        var i, len, result, node, allowIn, functionBody, directiveContext, fragment, semicolon, isGenerator;\n        allowIn = true;\n        semicolon = ';';\n        functionBody = false;\n        directiveContext = false;\n        if (option) {\n          allowIn = option.allowIn === undefined || option.allowIn;\n          if (!semicolons && option.semicolonOptional === true) {\n            semicolon = '';\n          }\n          functionBody = option.functionBody;\n          directiveContext = option.directiveContext;\n        }\n        switch (stmt.type) {\n        case Syntax.BlockStatement:\n          result = [\n            '{',\n            newline\n          ];\n          withIndent(function () {\n            for (i = 0, len = stmt.body.length; i < len; ++i) {\n              fragment = addIndent(generateStatement(stmt.body[i], {\n                semicolonOptional: i === len - 1,\n                directiveContext: functionBody\n              }));\n              result.push(fragment);\n              if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) {\n                result.push(newline);\n              }\n            }\n          });\n          result.push(addIndent('}'));\n          break;\n        case Syntax.BreakStatement:\n          if (stmt.label) {\n            result = 'break ' + stmt.label.name + semicolon;\n          } else {\n            result = 'break' + semicolon;\n          }\n          break;\n        case Syntax.ContinueStatement:\n          if (stmt.label) {\n            result = 'continue ' + stmt.label.name + semicolon;\n          } else {\n            result = 'continue' + semicolon;\n          }\n          break;\n        case Syntax.DirectiveStatement:\n          if (stmt.raw) {\n            result = stmt.raw + semicolon;\n          } else {\n            result = escapeDirective(stmt.directive) + semicolon;\n          }\n          break;\n        case Syntax.DoWhileStatement:\n          result = join('do', maybeBlock(stmt.body));\n          result = maybeBlockSuffix(stmt.body, result);\n          result = join(result, [\n            'while' + space + '(',\n            generateExpression(stmt.test, {\n              precedence: Precedence.Sequence,\n              allowIn: true,\n              allowCall: true\n            }),\n            ')' + semicolon\n          ]);\n          break;\n        case Syntax.CatchClause:\n          withIndent(function () {\n            var guard;\n            result = [\n              'catch' + space + '(',\n              generateExpression(stmt.param, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }),\n              ')'\n            ];\n            if (stmt.guard) {\n              guard = generateExpression(stmt.guard, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              });\n              result.splice(2, 0, ' if ', guard);\n            }\n          });\n          result.push(maybeBlock(stmt.body));\n          break;\n        case Syntax.DebuggerStatement:\n          result = 'debugger' + semicolon;\n          break;\n        case Syntax.EmptyStatement:\n          result = ';';\n          break;\n        case Syntax.ExportDeclaration:\n          result = 'export ';\n          if (stmt.declaration) {\n            result = [\n              result,\n              generateStatement(stmt.declaration, { semicolonOptional: semicolon === '' })\n            ];\n            break;\n          }\n          break;\n        case Syntax.ExpressionStatement:\n          result = [generateExpression(stmt.expression, {\n              precedence: Precedence.Sequence,\n              allowIn: true,\n              allowCall: true\n            })];\n          fragment = toSourceNodeWhenNeeded(result).toString();\n          if (fragment.charAt(0) === '{' || fragment.slice(0, 8) === 'function' && '* ('.indexOf(fragment.charAt(8)) >= 0 || directive && directiveContext && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value === 'string') {\n            result = [\n              '(',\n              result,\n              ')' + semicolon\n            ];\n          } else {\n            result.push(semicolon);\n          }\n          break;\n        case Syntax.VariableDeclarator:\n          if (stmt.init) {\n            result = [\n              generateExpression(stmt.id, {\n                precedence: Precedence.Assignment,\n                allowIn: allowIn,\n                allowCall: true\n              }),\n              space,\n              '=',\n              space,\n              generateExpression(stmt.init, {\n                precedence: Precedence.Assignment,\n                allowIn: allowIn,\n                allowCall: true\n              })\n            ];\n          } else {\n            result = generatePattern(stmt.id, {\n              precedence: Precedence.Assignment,\n              allowIn: allowIn\n            });\n          }\n          break;\n        case Syntax.VariableDeclaration:\n          result = [stmt.kind];\n          if (stmt.declarations.length === 1 && stmt.declarations[0].init && stmt.declarations[0].init.type === Syntax.FunctionExpression) {\n            result.push(noEmptySpace(), generateStatement(stmt.declarations[0], { allowIn: allowIn }));\n          } else {\n            withIndent(function () {\n              node = stmt.declarations[0];\n              if (extra.comment && node.leadingComments) {\n                result.push('\\n', addIndent(generateStatement(node, { allowIn: allowIn })));\n              } else {\n                result.push(noEmptySpace(), generateStatement(node, { allowIn: allowIn }));\n              }\n              for (i = 1, len = stmt.declarations.length; i < len; ++i) {\n                node = stmt.declarations[i];\n                if (extra.comment && node.leadingComments) {\n                  result.push(',' + newline, addIndent(generateStatement(node, { allowIn: allowIn })));\n                } else {\n                  result.push(',' + space, generateStatement(node, { allowIn: allowIn }));\n                }\n              }\n            });\n          }\n          result.push(semicolon);\n          break;\n        case Syntax.ThrowStatement:\n          result = [\n            join('throw', generateExpression(stmt.argument, {\n              precedence: Precedence.Sequence,\n              allowIn: true,\n              allowCall: true\n            })),\n            semicolon\n          ];\n          break;\n        case Syntax.TryStatement:\n          result = [\n            'try',\n            maybeBlock(stmt.block)\n          ];\n          result = maybeBlockSuffix(stmt.block, result);\n          if (stmt.handlers) {\n            for (i = 0, len = stmt.handlers.length; i < len; ++i) {\n              result = join(result, generateStatement(stmt.handlers[i]));\n              if (stmt.finalizer || i + 1 !== len) {\n                result = maybeBlockSuffix(stmt.handlers[i].body, result);\n              }\n            }\n          } else {\n            stmt.guardedHandlers = stmt.guardedHandlers || [];\n            for (i = 0, len = stmt.guardedHandlers.length; i < len; ++i) {\n              result = join(result, generateStatement(stmt.guardedHandlers[i]));\n              if (stmt.finalizer || i + 1 !== len) {\n                result = maybeBlockSuffix(stmt.guardedHandlers[i].body, result);\n              }\n            }\n            if (stmt.handler) {\n              if (isArray(stmt.handler)) {\n                for (i = 0, len = stmt.handler.length; i < len; ++i) {\n                  result = join(result, generateStatement(stmt.handler[i]));\n                  if (stmt.finalizer || i + 1 !== len) {\n                    result = maybeBlockSuffix(stmt.handler[i].body, result);\n                  }\n                }\n              } else {\n                result = join(result, generateStatement(stmt.handler));\n                if (stmt.finalizer) {\n                  result = maybeBlockSuffix(stmt.handler.body, result);\n                }\n              }\n            }\n          }\n          if (stmt.finalizer) {\n            result = join(result, [\n              'finally',\n              maybeBlock(stmt.finalizer)\n            ]);\n          }\n          break;\n        case Syntax.SwitchStatement:\n          withIndent(function () {\n            result = [\n              'switch' + space + '(',\n              generateExpression(stmt.discriminant, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }),\n              ')' + space + '{' + newline\n            ];\n          });\n          if (stmt.cases) {\n            for (i = 0, len = stmt.cases.length; i < len; ++i) {\n              fragment = addIndent(generateStatement(stmt.cases[i], { semicolonOptional: i === len - 1 }));\n              result.push(fragment);\n              if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) {\n                result.push(newline);\n              }\n            }\n          }\n          result.push(addIndent('}'));\n          break;\n        case Syntax.SwitchCase:\n          withIndent(function () {\n            if (stmt.test) {\n              result = [\n                join('case', generateExpression(stmt.test, {\n                  precedence: Precedence.Sequence,\n                  allowIn: true,\n                  allowCall: true\n                })),\n                ':'\n              ];\n            } else {\n              result = ['default:'];\n            }\n            i = 0;\n            len = stmt.consequent.length;\n            if (len && stmt.consequent[0].type === Syntax.BlockStatement) {\n              fragment = maybeBlock(stmt.consequent[0]);\n              result.push(fragment);\n              i = 1;\n            }\n            if (i !== len && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {\n              result.push(newline);\n            }\n            for (; i < len; ++i) {\n              fragment = addIndent(generateStatement(stmt.consequent[i], { semicolonOptional: i === len - 1 && semicolon === '' }));\n              result.push(fragment);\n              if (i + 1 !== len && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) {\n                result.push(newline);\n              }\n            }\n          });\n          break;\n        case Syntax.IfStatement:\n          withIndent(function () {\n            result = [\n              'if' + space + '(',\n              generateExpression(stmt.test, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }),\n              ')'\n            ];\n          });\n          if (stmt.alternate) {\n            result.push(maybeBlock(stmt.consequent));\n            result = maybeBlockSuffix(stmt.consequent, result);\n            if (stmt.alternate.type === Syntax.IfStatement) {\n              result = join(result, [\n                'else ',\n                generateStatement(stmt.alternate, { semicolonOptional: semicolon === '' })\n              ]);\n            } else {\n              result = join(result, join('else', maybeBlock(stmt.alternate, semicolon === '')));\n            }\n          } else {\n            result.push(maybeBlock(stmt.consequent, semicolon === ''));\n          }\n          break;\n        case Syntax.ForStatement:\n          withIndent(function () {\n            result = ['for' + space + '('];\n            if (stmt.init) {\n              if (stmt.init.type === Syntax.VariableDeclaration) {\n                result.push(generateStatement(stmt.init, { allowIn: false }));\n              } else {\n                result.push(generateExpression(stmt.init, {\n                  precedence: Precedence.Sequence,\n                  allowIn: false,\n                  allowCall: true\n                }), ';');\n              }\n            } else {\n              result.push(';');\n            }\n            if (stmt.test) {\n              result.push(space, generateExpression(stmt.test, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }), ';');\n            } else {\n              result.push(';');\n            }\n            if (stmt.update) {\n              result.push(space, generateExpression(stmt.update, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }), ')');\n            } else {\n              result.push(')');\n            }\n          });\n          result.push(maybeBlock(stmt.body, semicolon === ''));\n          break;\n        case Syntax.ForInStatement:\n          result = ['for' + space + '('];\n          withIndent(function () {\n            if (stmt.left.type === Syntax.VariableDeclaration) {\n              withIndent(function () {\n                result.push(stmt.left.kind + noEmptySpace(), generateStatement(stmt.left.declarations[0], { allowIn: false }));\n              });\n            } else {\n              result.push(generateExpression(stmt.left, {\n                precedence: Precedence.Call,\n                allowIn: true,\n                allowCall: true\n              }));\n            }\n            result = join(result, 'in');\n            result = [\n              join(result, generateExpression(stmt.right, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              })),\n              ')'\n            ];\n          });\n          result.push(maybeBlock(stmt.body, semicolon === ''));\n          break;\n        case Syntax.LabeledStatement:\n          result = [\n            stmt.label.name + ':',\n            maybeBlock(stmt.body, semicolon === '')\n          ];\n          break;\n        case Syntax.Program:\n          len = stmt.body.length;\n          result = [safeConcatenation && len > 0 ? '\\n' : ''];\n          for (i = 0; i < len; ++i) {\n            fragment = addIndent(generateStatement(stmt.body[i], {\n              semicolonOptional: !safeConcatenation && i === len - 1,\n              directiveContext: true\n            }));\n            result.push(fragment);\n            if (i + 1 < len && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) {\n              result.push(newline);\n            }\n          }\n          break;\n        case Syntax.FunctionDeclaration:\n          isGenerator = stmt.generator && !extra.moz.starlessGenerator;\n          result = [\n            isGenerator ? 'function*' : 'function',\n            isGenerator ? space : noEmptySpace(),\n            generateIdentifier(stmt.id),\n            generateFunctionBody(stmt)\n          ];\n          break;\n        case Syntax.ReturnStatement:\n          if (stmt.argument) {\n            result = [\n              join('return', generateExpression(stmt.argument, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              })),\n              semicolon\n            ];\n          } else {\n            result = ['return' + semicolon];\n          }\n          break;\n        case Syntax.WhileStatement:\n          withIndent(function () {\n            result = [\n              'while' + space + '(',\n              generateExpression(stmt.test, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }),\n              ')'\n            ];\n          });\n          result.push(maybeBlock(stmt.body, semicolon === ''));\n          break;\n        case Syntax.WithStatement:\n          withIndent(function () {\n            result = [\n              'with' + space + '(',\n              generateExpression(stmt.object, {\n                precedence: Precedence.Sequence,\n                allowIn: true,\n                allowCall: true\n              }),\n              ')'\n            ];\n          });\n          result.push(maybeBlock(stmt.body, semicolon === ''));\n          break;\n        default:\n          throw new Error('Unknown statement type: ' + stmt.type);\n        }\n        if (extra.comment) {\n          result = addCommentsToStatement(stmt, result);\n        }\n        fragment = toSourceNodeWhenNeeded(result).toString();\n        if (stmt.type === Syntax.Program && !safeConcatenation && newline === '' && fragment.charAt(fragment.length - 1) === '\\n') {\n          result = sourceMap ? toSourceNodeWhenNeeded(result).replaceRight(/\\s+$/, '') : fragment.replace(/\\s+$/, '');\n        }\n        return toSourceNodeWhenNeeded(result, stmt);\n      }\n      function generate(node, options) {\n        var defaultOptions = getDefaultOptions(), result, pair;\n        if (options != null) {\n          if (typeof options.indent === 'string') {\n            defaultOptions.format.indent.style = options.indent;\n          }\n          if (typeof options.base === 'number') {\n            defaultOptions.format.indent.base = options.base;\n          }\n          options = updateDeeply(defaultOptions, options);\n          indent = options.format.indent.style;\n          if (typeof options.base === 'string') {\n            base = options.base;\n          } else {\n            base = stringRepeat(indent, options.format.indent.base);\n          }\n        } else {\n          options = defaultOptions;\n          indent = options.format.indent.style;\n          base = stringRepeat(indent, options.format.indent.base);\n        }\n        json = options.format.json;\n        renumber = options.format.renumber;\n        hexadecimal = json ? false : options.format.hexadecimal;\n        quotes = json ? 'double' : options.format.quotes;\n        escapeless = options.format.escapeless;\n        newline = options.format.newline;\n        space = options.format.space;\n        if (options.format.compact) {\n          newline = space = indent = base = '';\n        }\n        parentheses = options.format.parentheses;\n        semicolons = options.format.semicolons;\n        safeConcatenation = options.format.safeConcatenation;\n        directive = options.directive;\n        parse = json ? null : options.parse;\n        sourceMap = options.sourceMap;\n        extra = options;\n        if (sourceMap) {\n          if (!exports.browser) {\n            SourceNode = require('/node_modules/source-map/lib/source-map.js', module).SourceNode;\n          } else {\n            SourceNode = global.sourceMap.SourceNode;\n          }\n        }\n        switch (node.type) {\n        case Syntax.BlockStatement:\n        case Syntax.BreakStatement:\n        case Syntax.CatchClause:\n        case Syntax.ContinueStatement:\n        case Syntax.DirectiveStatement:\n        case Syntax.DoWhileStatement:\n        case Syntax.DebuggerStatement:\n        case Syntax.EmptyStatement:\n        case Syntax.ExpressionStatement:\n        case Syntax.ForStatement:\n        case Syntax.ForInStatement:\n        case Syntax.FunctionDeclaration:\n        case Syntax.IfStatement:\n        case Syntax.LabeledStatement:\n        case Syntax.Program:\n        case Syntax.ReturnStatement:\n        case Syntax.SwitchStatement:\n        case Syntax.SwitchCase:\n        case Syntax.ThrowStatement:\n        case Syntax.TryStatement:\n        case Syntax.VariableDeclaration:\n        case Syntax.VariableDeclarator:\n        case Syntax.WhileStatement:\n        case Syntax.WithStatement:\n          result = generateStatement(node);\n          break;\n        case Syntax.AssignmentExpression:\n        case Syntax.ArrayExpression:\n        case Syntax.ArrayPattern:\n        case Syntax.BinaryExpression:\n        case Syntax.CallExpression:\n        case Syntax.ConditionalExpression:\n        case Syntax.FunctionExpression:\n        case Syntax.Identifier:\n        case Syntax.Literal:\n        case Syntax.LogicalExpression:\n        case Syntax.MemberExpression:\n        case Syntax.NewExpression:\n        case Syntax.ObjectExpression:\n        case Syntax.ObjectPattern:\n        case Syntax.Property:\n        case Syntax.SequenceExpression:\n        case Syntax.ThisExpression:\n        case Syntax.UnaryExpression:\n        case Syntax.UpdateExpression:\n        case Syntax.YieldExpression:\n          result = generateExpression(node, {\n            precedence: Precedence.Sequence,\n            allowIn: true,\n            allowCall: true\n          });\n          break;\n        default:\n          throw new Error('Unknown node type: ' + node.type);\n        }\n        if (!sourceMap) {\n          return result.toString();\n        }\n        pair = result.toStringWithSourceMap({\n          file: options.file,\n          sourceRoot: options.sourceMapRoot\n        });\n        if (options.sourceContent) {\n          pair.map.setSourceContent(options.sourceMap, options.sourceContent);\n        }\n        if (options.sourceMapWithCode) {\n          return pair;\n        }\n        return pair.map.toString();\n      }\n      FORMAT_MINIFY = {\n        indent: {\n          style: '',\n          base: 0\n        },\n        renumber: true,\n        hexadecimal: true,\n        quotes: 'auto',\n        escapeless: true,\n        compact: true,\n        parentheses: false,\n        semicolons: false\n      };\n      FORMAT_DEFAULTS = getDefaultOptions().format;\n      exports.version = require('/package.json', module).version;\n      exports.generate = generate;\n      exports.attachComments = estraverse.attachComments;\n      exports.browser = false;\n      exports.FORMAT_MINIFY = FORMAT_MINIFY;\n      exports.FORMAT_DEFAULTS = FORMAT_DEFAULTS;\n    }());\n  });\n  require.define('/package.json', function (module, exports, __dirname, __filename) {\n    module.exports = {\n      'name': 'escodegen',\n      'description': 'ECMAScript code generator',\n      'homepage': 'http://github.com/Constellation/escodegen',\n      'main': 'escodegen.js',\n      'bin': {\n        'esgenerate': './bin/esgenerate.js',\n        'escodegen': './bin/escodegen.js'\n      },\n      'version': '1.1.0-dev',\n      'engines': { 'node': '>=0.4.0' },\n      'maintainers': [{\n          'name': 'Yusuke Suzuki',\n          'email': 'utatane.tea@gmail.com',\n          'web': 'http://github.com/Constellation'\n        }],\n      'repository': {\n        'type': 'git',\n        'url': 'http://github.com/Constellation/escodegen.git'\n      },\n      'dependencies': {\n        'esprima': '~1.0.4',\n        'estraverse': '~1.5.0',\n        'esutils': '~1.0.0'\n      },\n      'optionalDependencies': { 'source-map': '~0.1.30' },\n      'devDependencies': {\n        'esprima-moz': '*',\n        'commonjs-everywhere': '~0.8.0',\n        'q': '*',\n        'bower': '*',\n        'semver': '*',\n        'chai': '~1.7.2',\n        'grunt-contrib-jshint': '~0.5.0',\n        'grunt-cli': '~0.1.9',\n        'grunt': '~0.4.1',\n        'grunt-mocha-test': '~0.6.2'\n      },\n      'licenses': [{\n          'type': 'BSD',\n          'url': 'http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD'\n        }],\n      'scripts': {\n        'test': 'grunt travis',\n        'unit-test': 'grunt test',\n        'lint': 'grunt lint',\n        'release': 'node tools/release.js',\n        'build-min': './node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js',\n        'build': './node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js'\n      }\n    };\n  });\n  require.define('/node_modules/source-map/lib/source-map.js', function (module, exports, __dirname, __filename) {\n    exports.SourceMapGenerator = require('/node_modules/source-map/lib/source-map/source-map-generator.js', module).SourceMapGenerator;\n    exports.SourceMapConsumer = require('/node_modules/source-map/lib/source-map/source-map-consumer.js', module).SourceMapConsumer;\n    exports.SourceNode = require('/node_modules/source-map/lib/source-map/source-node.js', module).SourceNode;\n  });\n  require.define('/node_modules/source-map/lib/source-map/source-node.js', function (module, exports, __dirname, __filename) {\n    if (typeof define !== 'function') {\n      var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);\n    }\n    define(function (require, exports, module) {\n      var SourceMapGenerator = require('/node_modules/source-map/lib/source-map/source-map-generator.js', module).SourceMapGenerator;\n      var util = require('/node_modules/source-map/lib/source-map/util.js', module);\n      function SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n        this.children = [];\n        this.sourceContents = {};\n        this.line = aLine === undefined ? null : aLine;\n        this.column = aColumn === undefined ? null : aColumn;\n        this.source = aSource === undefined ? null : aSource;\n        this.name = aName === undefined ? null : aName;\n        if (aChunks != null)\n          this.add(aChunks);\n      }\n      SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {\n        var node = new SourceNode;\n        var remainingLines = aGeneratedCode.split('\\n');\n        var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n        var lastMapping = null;\n        aSourceMapConsumer.eachMapping(function (mapping) {\n          if (lastMapping === null) {\n            while (lastGeneratedLine < mapping.generatedLine) {\n              node.add(remainingLines.shift() + '\\n');\n              lastGeneratedLine++;\n            }\n            if (lastGeneratedColumn < mapping.generatedColumn) {\n              var nextLine = remainingLines[0];\n              node.add(nextLine.substr(0, mapping.generatedColumn));\n              remainingLines[0] = nextLine.substr(mapping.generatedColumn);\n              lastGeneratedColumn = mapping.generatedColumn;\n            }\n          } else {\n            if (lastGeneratedLine < mapping.generatedLine) {\n              var code = '';\n              do {\n                code += remainingLines.shift() + '\\n';\n                lastGeneratedLine++;\n                lastGeneratedColumn = 0;\n              } while (lastGeneratedLine < mapping.generatedLine);\n              if (lastGeneratedColumn < mapping.generatedColumn) {\n                var nextLine = remainingLines[0];\n                code += nextLine.substr(0, mapping.generatedColumn);\n                remainingLines[0] = nextLine.substr(mapping.generatedColumn);\n                lastGeneratedColumn = mapping.generatedColumn;\n              }\n              addMappingWithCode(lastMapping, code);\n            } else {\n              var nextLine = remainingLines[0];\n              var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);\n              remainingLines[0] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);\n              lastGeneratedColumn = mapping.generatedColumn;\n              addMappingWithCode(lastMapping, code);\n            }\n          }\n          lastMapping = mapping;\n        }, this);\n        addMappingWithCode(lastMapping, remainingLines.join('\\n'));\n        aSourceMapConsumer.sources.forEach(function (sourceFile) {\n          var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n          if (content) {\n            node.setSourceContent(sourceFile, content);\n          }\n        });\n        return node;\n        function addMappingWithCode(mapping, code) {\n          if (mapping === null || mapping.source === undefined) {\n            node.add(code);\n          } else {\n            node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, mapping.source, code, mapping.name));\n          }\n        }\n      };\n      SourceNode.prototype.add = function SourceNode_add(aChunk) {\n        if (Array.isArray(aChunk)) {\n          aChunk.forEach(function (chunk) {\n            this.add(chunk);\n          }, this);\n        } else if (aChunk instanceof SourceNode || typeof aChunk === 'string') {\n          if (aChunk) {\n            this.children.push(aChunk);\n          }\n        } else {\n          throw new TypeError('Expected a SourceNode, string, or an array of SourceNodes and strings. Got ' + aChunk);\n        }\n        return this;\n      };\n      SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n        if (Array.isArray(aChunk)) {\n          for (var i = aChunk.length - 1; i >= 0; i--) {\n            this.prepend(aChunk[i]);\n          }\n        } else if (aChunk instanceof SourceNode || typeof aChunk === 'string') {\n          this.children.unshift(aChunk);\n        } else {\n          throw new TypeError('Expected a SourceNode, string, or an array of SourceNodes and strings. Got ' + aChunk);\n        }\n        return this;\n      };\n      SourceNode.prototype.walk = function SourceNode_walk(aFn) {\n        var chunk;\n        for (var i = 0, len = this.children.length; i < len; i++) {\n          chunk = this.children[i];\n          if (chunk instanceof SourceNode) {\n            chunk.walk(aFn);\n          } else {\n            if (chunk !== '') {\n              aFn(chunk, {\n                source: this.source,\n                line: this.line,\n                column: this.column,\n                name: this.name\n              });\n            }\n          }\n        }\n      };\n      SourceNode.prototype.join = function SourceNode_join(aSep) {\n        var newChildren;\n        var i;\n        var len = this.children.length;\n        if (len > 0) {\n          newChildren = [];\n          for (i = 0; i < len - 1; i++) {\n            newChildren.push(this.children[i]);\n            newChildren.push(aSep);\n          }\n          newChildren.push(this.children[i]);\n          this.children = newChildren;\n        }\n        return this;\n      };\n      SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n        var lastChild = this.children[this.children.length - 1];\n        if (lastChild instanceof SourceNode) {\n          lastChild.replaceRight(aPattern, aReplacement);\n        } else if (typeof lastChild === 'string') {\n          this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n        } else {\n          this.children.push(''.replace(aPattern, aReplacement));\n        }\n        return this;\n      };\n      SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n        this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n      };\n      SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {\n        for (var i = 0, len = this.children.length; i < len; i++) {\n          if (this.children[i] instanceof SourceNode) {\n            this.children[i].walkSourceContents(aFn);\n          }\n        }\n        var sources = Object.keys(this.sourceContents);\n        for (var i = 0, len = sources.length; i < len; i++) {\n          aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n        }\n      };\n      SourceNode.prototype.toString = function SourceNode_toString() {\n        var str = '';\n        this.walk(function (chunk) {\n          str += chunk;\n        });\n        return str;\n      };\n      SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n        var generated = {\n            code: '',\n            line: 1,\n            column: 0\n          };\n        var map = new SourceMapGenerator(aArgs);\n        var sourceMappingActive = false;\n        var lastOriginalSource = null;\n        var lastOriginalLine = null;\n        var lastOriginalColumn = null;\n        var lastOriginalName = null;\n        this.walk(function (chunk, original) {\n          generated.code += chunk;\n          if (original.source !== null && original.line !== null && original.column !== null) {\n            if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {\n              map.addMapping({\n                source: original.source,\n                original: {\n                  line: original.line,\n                  column: original.column\n                },\n                generated: {\n                  line: generated.line,\n                  column: generated.column\n                },\n                name: original.name\n              });\n            }\n            lastOriginalSource = original.source;\n            lastOriginalLine = original.line;\n            lastOriginalColumn = original.column;\n            lastOriginalName = original.name;\n            sourceMappingActive = true;\n          } else if (sourceMappingActive) {\n            map.addMapping({\n              generated: {\n                line: generated.line,\n                column: generated.column\n              }\n            });\n            lastOriginalSource = null;\n            sourceMappingActive = false;\n          }\n          chunk.split('').forEach(function (ch) {\n            if (ch === '\\n') {\n              generated.line++;\n              generated.column = 0;\n            } else {\n              generated.column++;\n            }\n          });\n        });\n        this.walkSourceContents(function (sourceFile, sourceContent) {\n          map.setSourceContent(sourceFile, sourceContent);\n        });\n        return {\n          code: generated.code,\n          map: map\n        };\n      };\n      exports.SourceNode = SourceNode;\n    });\n  });\n  require.define('/node_modules/source-map/lib/source-map/util.js', function (module, exports, __dirname, __filename) {\n    if (typeof define !== 'function') {\n      var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);\n    }\n    define(function (require, exports, module) {\n      function getArg(aArgs, aName, aDefaultValue) {\n        if (aName in aArgs) {\n          return aArgs[aName];\n        } else if (arguments.length === 3) {\n          return aDefaultValue;\n        } else {\n          throw new Error('\"' + aName + '\" is a required argument.');\n        }\n      }\n      exports.getArg = getArg;\n      var urlRegexp = /([\\w+\\-.]+):\\/\\/((\\w+:\\w+)@)?([\\w.]+)?(:(\\d+))?(\\S+)?/;\n      var dataUrlRegexp = /^data:.+\\,.+/;\n      function urlParse(aUrl) {\n        var match = aUrl.match(urlRegexp);\n        if (!match) {\n          return null;\n        }\n        return {\n          scheme: match[1],\n          auth: match[3],\n          host: match[4],\n          port: match[6],\n          path: match[7]\n        };\n      }\n      exports.urlParse = urlParse;\n      function urlGenerate(aParsedUrl) {\n        var url = aParsedUrl.scheme + '://';\n        if (aParsedUrl.auth) {\n          url += aParsedUrl.auth + '@';\n        }\n        if (aParsedUrl.host) {\n          url += aParsedUrl.host;\n        }\n        if (aParsedUrl.port) {\n          url += ':' + aParsedUrl.port;\n        }\n        if (aParsedUrl.path) {\n          url += aParsedUrl.path;\n        }\n        return url;\n      }\n      exports.urlGenerate = urlGenerate;\n      function join(aRoot, aPath) {\n        var url;\n        if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) {\n          return aPath;\n        }\n        if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) {\n          url.path = aPath;\n          return urlGenerate(url);\n        }\n        return aRoot.replace(/\\/$/, '') + '/' + aPath;\n      }\n      exports.join = join;\n      function toSetString(aStr) {\n        return '$' + aStr;\n      }\n      exports.toSetString = toSetString;\n      function fromSetString(aStr) {\n        return aStr.substr(1);\n      }\n      exports.fromSetString = fromSetString;\n      function relative(aRoot, aPath) {\n        aRoot = aRoot.replace(/\\/$/, '');\n        var url = urlParse(aRoot);\n        if (aPath.charAt(0) == '/' && url && url.path == '/') {\n          return aPath.slice(1);\n        }\n        return aPath.indexOf(aRoot + '/') === 0 ? aPath.substr(aRoot.length + 1) : aPath;\n      }\n      exports.relative = relative;\n      function strcmp(aStr1, aStr2) {\n        var s1 = aStr1 || '';\n        var s2 = aStr2 || '';\n        return (s1 > s2) - (s1 < s2);\n      }\n      function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n        var cmp;\n        cmp = strcmp(mappingA.source, mappingB.source);\n        if (cmp) {\n          return cmp;\n        }\n        cmp = mappingA.originalLine - mappingB.originalLine;\n        if (cmp) {\n          return cmp;\n        }\n        cmp = mappingA.originalColumn - mappingB.originalColumn;\n        if (cmp || onlyCompareOriginal) {\n          return cmp;\n        }\n        cmp = strcmp(mappingA.name, mappingB.name);\n        if (cmp) {\n          return cmp;\n        }\n        cmp = mappingA.generatedLine - mappingB.generatedLine;\n        if (cmp) {\n          return cmp;\n        }\n        return mappingA.generatedColumn - mappingB.generatedColumn;\n      }\n      ;\n      exports.compareByOriginalPositions = compareByOriginalPositions;\n      function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {\n        var cmp;\n        cmp = mappingA.generatedLine - mappingB.generatedLine;\n        if (cmp) {\n          return cmp;\n        }\n        cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n        if (cmp || onlyCompareGenerated) {\n          return cmp;\n        }\n        cmp = strcmp(mappingA.source, mappingB.source);\n        if (cmp) {\n          return cmp;\n        }\n        cmp = mappingA.originalLine - mappingB.originalLine;\n        if (cmp) {\n          return cmp;\n        }\n        cmp = mappingA.originalColumn - mappingB.originalColumn;\n        if (cmp) {\n          return cmp;\n        }\n        return strcmp(mappingA.name, mappingB.name);\n      }\n      ;\n      exports.compareByGeneratedPositions = compareByGeneratedPositions;\n    });\n  });\n  require.define('/node_modules/source-map/node_modules/amdefine/amdefine.js', function (module, exports, __dirname, __filename) {\n    'use strict';\n    function amdefine(module, requireFn) {\n      'use strict';\n      var defineCache = {}, loaderCache = {}, alreadyCalled = false, path = require('path', module), makeRequire, stringRequire;\n      function trimDots(ary) {\n        var i, part;\n        for (i = 0; ary[i]; i += 1) {\n          part = ary[i];\n          if (part === '.') {\n            ary.splice(i, 1);\n            i -= 1;\n          } else if (part === '..') {\n            if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {\n              break;\n            } else if (i > 0) {\n              ary.splice(i - 1, 2);\n              i -= 2;\n            }\n          }\n        }\n      }\n      function normalize(name, baseName) {\n        var baseParts;\n        if (name && name.charAt(0) === '.') {\n          if (baseName) {\n            baseParts = baseName.split('/');\n            baseParts = baseParts.slice(0, baseParts.length - 1);\n            baseParts = baseParts.concat(name.split('/'));\n            trimDots(baseParts);\n            name = baseParts.join('/');\n          }\n        }\n        return name;\n      }\n      function makeNormalize(relName) {\n        return function (name) {\n          return normalize(name, relName);\n        };\n      }\n      function makeLoad(id) {\n        function load(value) {\n          loaderCache[id] = value;\n        }\n        load.fromText = function (id, text) {\n          throw new Error('amdefine does not implement load.fromText');\n        };\n        return load;\n      }\n      makeRequire = function (systemRequire, exports, module, relId) {\n        function amdRequire(deps, callback) {\n          if (typeof deps === 'string') {\n            return stringRequire(systemRequire, exports, module, deps, relId);\n          } else {\n            deps = deps.map(function (depName) {\n              return stringRequire(systemRequire, exports, module, depName, relId);\n            });\n            process.nextTick(function () {\n              callback.apply(null, deps);\n            });\n          }\n        }\n        amdRequire.toUrl = function (filePath) {\n          if (filePath.indexOf('.') === 0) {\n            return normalize(filePath, path.dirname(module.filename));\n          } else {\n            return filePath;\n          }\n        };\n        return amdRequire;\n      };\n      requireFn = requireFn || function req() {\n        return module.require.apply(module, arguments);\n      };\n      function runFactory(id, deps, factory) {\n        var r, e, m, result;\n        if (id) {\n          e = loaderCache[id] = {};\n          m = {\n            id: id,\n            uri: __filename,\n            exports: e\n          };\n          r = makeRequire(requireFn, e, m, id);\n        } else {\n          if (alreadyCalled) {\n            throw new Error('amdefine with no module ID cannot be called more than once per file.');\n          }\n          alreadyCalled = true;\n          e = module.exports;\n          m = module;\n          r = makeRequire(requireFn, e, m, module.id);\n        }\n        if (deps) {\n          deps = deps.map(function (depName) {\n            return r(depName);\n          });\n        }\n        if (typeof factory === 'function') {\n          result = factory.apply(m.exports, deps);\n        } else {\n          result = factory;\n        }\n        if (result !== undefined) {\n          m.exports = result;\n          if (id) {\n            loaderCache[id] = m.exports;\n          }\n        }\n      }\n      stringRequire = function (systemRequire, exports, module, id, relId) {\n        var index = id.indexOf('!'), originalId = id, prefix, plugin;\n        if (index === -1) {\n          id = normalize(id, relId);\n          if (id === 'require') {\n            return makeRequire(systemRequire, exports, module, relId);\n          } else if (id === 'exports') {\n            return exports;\n          } else if (id === 'module') {\n            return module;\n          } else if (loaderCache.hasOwnProperty(id)) {\n            return loaderCache[id];\n          } else if (defineCache[id]) {\n            runFactory.apply(null, defineCache[id]);\n            return loaderCache[id];\n          } else {\n            if (systemRequire) {\n              return systemRequire(originalId);\n            } else {\n              throw new Error('No module with ID: ' + id);\n            }\n          }\n        } else {\n          prefix = id.substring(0, index);\n          id = id.substring(index + 1, id.length);\n          plugin = stringRequire(systemRequire, exports, module, prefix, relId);\n          if (plugin.normalize) {\n            id = plugin.normalize(id, makeNormalize(relId));\n          } else {\n            id = normalize(id, relId);\n          }\n          if (loaderCache[id]) {\n            return loaderCache[id];\n          } else {\n            plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {});\n            return loaderCache[id];\n          }\n        }\n      };\n      function define(id, deps, factory) {\n        if (Array.isArray(id)) {\n          factory = deps;\n          deps = id;\n          id = undefined;\n        } else if (typeof id !== 'string') {\n          factory = id;\n          id = deps = undefined;\n        }\n        if (deps && !Array.isArray(deps)) {\n          factory = deps;\n          deps = undefined;\n        }\n        if (!deps) {\n          deps = [\n            'require',\n            'exports',\n            'module'\n          ];\n        }\n        if (id) {\n          defineCache[id] = [\n            id,\n            deps,\n            factory\n          ];\n        } else {\n          runFactory(id, deps, factory);\n        }\n      }\n      define.require = function (id) {\n        if (loaderCache[id]) {\n          return loaderCache[id];\n        }\n        if (defineCache[id]) {\n          runFactory.apply(null, defineCache[id]);\n          return loaderCache[id];\n        }\n      };\n      define.amd = {};\n      return define;\n    }\n    module.exports = amdefine;\n  });\n  require.define('/node_modules/source-map/lib/source-map/source-map-generator.js', function (module, exports, __dirname, __filename) {\n    if (typeof define !== 'function') {\n      var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);\n    }\n    define(function (require, exports, module) {\n      var base64VLQ = require('/node_modules/source-map/lib/source-map/base64-vlq.js', module);\n      var util = require('/node_modules/source-map/lib/source-map/util.js', module);\n      var ArraySet = require('/node_modules/source-map/lib/source-map/array-set.js', module).ArraySet;\n      function SourceMapGenerator(aArgs) {\n        this._file = util.getArg(aArgs, 'file');\n        this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n        this._sources = new ArraySet;\n        this._names = new ArraySet;\n        this._mappings = [];\n        this._sourcesContents = null;\n      }\n      SourceMapGenerator.prototype._version = 3;\n      SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n        var sourceRoot = aSourceMapConsumer.sourceRoot;\n        var generator = new SourceMapGenerator({\n            file: aSourceMapConsumer.file,\n            sourceRoot: sourceRoot\n          });\n        aSourceMapConsumer.eachMapping(function (mapping) {\n          var newMapping = {\n              generated: {\n                line: mapping.generatedLine,\n                column: mapping.generatedColumn\n              }\n            };\n          if (mapping.source) {\n            newMapping.source = mapping.source;\n            if (sourceRoot) {\n              newMapping.source = util.relative(sourceRoot, newMapping.source);\n            }\n            newMapping.original = {\n              line: mapping.originalLine,\n              column: mapping.originalColumn\n            };\n            if (mapping.name) {\n              newMapping.name = mapping.name;\n            }\n          }\n          generator.addMapping(newMapping);\n        });\n        aSourceMapConsumer.sources.forEach(function (sourceFile) {\n          var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n          if (content) {\n            generator.setSourceContent(sourceFile, content);\n          }\n        });\n        return generator;\n      };\n      SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {\n        var generated = util.getArg(aArgs, 'generated');\n        var original = util.getArg(aArgs, 'original', null);\n        var source = util.getArg(aArgs, 'source', null);\n        var name = util.getArg(aArgs, 'name', null);\n        this._validateMapping(generated, original, source, name);\n        if (source && !this._sources.has(source)) {\n          this._sources.add(source);\n        }\n        if (name && !this._names.has(name)) {\n          this._names.add(name);\n        }\n        this._mappings.push({\n          generatedLine: generated.line,\n          generatedColumn: generated.column,\n          originalLine: original != null && original.line,\n          originalColumn: original != null && original.column,\n          source: source,\n          name: name\n        });\n      };\n      SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n        var source = aSourceFile;\n        if (this._sourceRoot) {\n          source = util.relative(this._sourceRoot, source);\n        }\n        if (aSourceContent !== null) {\n          if (!this._sourcesContents) {\n            this._sourcesContents = {};\n          }\n          this._sourcesContents[util.toSetString(source)] = aSourceContent;\n        } else {\n          delete this._sourcesContents[util.toSetString(source)];\n          if (Object.keys(this._sourcesContents).length === 0) {\n            this._sourcesContents = null;\n          }\n        }\n      };\n      SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) {\n        if (!aSourceFile) {\n          aSourceFile = aSourceMapConsumer.file;\n        }\n        var sourceRoot = this._sourceRoot;\n        if (sourceRoot) {\n          aSourceFile = util.relative(sourceRoot, aSourceFile);\n        }\n        var newSources = new ArraySet;\n        var newNames = new ArraySet;\n        this._mappings.forEach(function (mapping) {\n          if (mapping.source === aSourceFile && mapping.originalLine) {\n            var original = aSourceMapConsumer.originalPositionFor({\n                line: mapping.originalLine,\n                column: mapping.originalColumn\n              });\n            if (original.source !== null) {\n              if (sourceRoot) {\n                mapping.source = util.relative(sourceRoot, original.source);\n              } else {\n                mapping.source = original.source;\n              }\n              mapping.originalLine = original.line;\n              mapping.originalColumn = original.column;\n              if (original.name !== null && mapping.name !== null) {\n                mapping.name = original.name;\n              }\n            }\n          }\n          var source = mapping.source;\n          if (source && !newSources.has(source)) {\n            newSources.add(source);\n          }\n          var name = mapping.name;\n          if (name && !newNames.has(name)) {\n            newNames.add(name);\n          }\n        }, this);\n        this._sources = newSources;\n        this._names = newNames;\n        aSourceMapConsumer.sources.forEach(function (sourceFile) {\n          var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n          if (content) {\n            if (sourceRoot) {\n              sourceFile = util.relative(sourceRoot, sourceFile);\n            }\n            this.setSourceContent(sourceFile, content);\n          }\n        }, this);\n      };\n      SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {\n        if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {\n          return;\n        } 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) {\n          return;\n        } else {\n          throw new Error('Invalid mapping: ' + JSON.stringify({\n            generated: aGenerated,\n            source: aSource,\n            orginal: aOriginal,\n            name: aName\n          }));\n        }\n      };\n      SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {\n        var previousGeneratedColumn = 0;\n        var previousGeneratedLine = 1;\n        var previousOriginalColumn = 0;\n        var previousOriginalLine = 0;\n        var previousName = 0;\n        var previousSource = 0;\n        var result = '';\n        var mapping;\n        this._mappings.sort(util.compareByGeneratedPositions);\n        for (var i = 0, len = this._mappings.length; i < len; i++) {\n          mapping = this._mappings[i];\n          if (mapping.generatedLine !== previousGeneratedLine) {\n            previousGeneratedColumn = 0;\n            while (mapping.generatedLine !== previousGeneratedLine) {\n              result += ';';\n              previousGeneratedLine++;\n            }\n          } else {\n            if (i > 0) {\n              if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) {\n                continue;\n              }\n              result += ',';\n            }\n          }\n          result += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);\n          previousGeneratedColumn = mapping.generatedColumn;\n          if (mapping.source) {\n            result += base64VLQ.encode(this._sources.indexOf(mapping.source) - previousSource);\n            previousSource = this._sources.indexOf(mapping.source);\n            result += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);\n            previousOriginalLine = mapping.originalLine - 1;\n            result += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);\n            previousOriginalColumn = mapping.originalColumn;\n            if (mapping.name) {\n              result += base64VLQ.encode(this._names.indexOf(mapping.name) - previousName);\n              previousName = this._names.indexOf(mapping.name);\n            }\n          }\n        }\n        return result;\n      };\n      SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n        return aSources.map(function (source) {\n          if (!this._sourcesContents) {\n            return null;\n          }\n          if (aSourceRoot) {\n            source = util.relative(aSourceRoot, source);\n          }\n          var key = util.toSetString(source);\n          return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;\n        }, this);\n      };\n      SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {\n        var map = {\n            version: this._version,\n            file: this._file,\n            sources: this._sources.toArray(),\n            names: this._names.toArray(),\n            mappings: this._serializeMappings()\n          };\n        if (this._sourceRoot) {\n          map.sourceRoot = this._sourceRoot;\n        }\n        if (this._sourcesContents) {\n          map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n        }\n        return map;\n      };\n      SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {\n        return JSON.stringify(this);\n      };\n      exports.SourceMapGenerator = SourceMapGenerator;\n    });\n  });\n  require.define('/node_modules/source-map/lib/source-map/array-set.js', function (module, exports, __dirname, __filename) {\n    if (typeof define !== 'function') {\n      var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);\n    }\n    define(function (require, exports, module) {\n      var util = require('/node_modules/source-map/lib/source-map/util.js', module);\n      function ArraySet() {\n        this._array = [];\n        this._set = {};\n      }\n      ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n        var set = new ArraySet;\n        for (var i = 0, len = aArray.length; i < len; i++) {\n          set.add(aArray[i], aAllowDuplicates);\n        }\n        return set;\n      };\n      ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n        var isDuplicate = this.has(aStr);\n        var idx = this._array.length;\n        if (!isDuplicate || aAllowDuplicates) {\n          this._array.push(aStr);\n        }\n        if (!isDuplicate) {\n          this._set[util.toSetString(aStr)] = idx;\n        }\n      };\n      ArraySet.prototype.has = function ArraySet_has(aStr) {\n        return Object.prototype.hasOwnProperty.call(this._set, util.toSetString(aStr));\n      };\n      ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n        if (this.has(aStr)) {\n          return this._set[util.toSetString(aStr)];\n        }\n        throw new Error('\"' + aStr + '\" is not in the set.');\n      };\n      ArraySet.prototype.at = function ArraySet_at(aIdx) {\n        if (aIdx >= 0 && aIdx < this._array.length) {\n          return this._array[aIdx];\n        }\n        throw new Error('No element indexed by ' + aIdx);\n      };\n      ArraySet.prototype.toArray = function ArraySet_toArray() {\n        return this._array.slice();\n      };\n      exports.ArraySet = ArraySet;\n    });\n  });\n  require.define('/node_modules/source-map/lib/source-map/base64-vlq.js', function (module, exports, __dirname, __filename) {\n    if (typeof define !== 'function') {\n      var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);\n    }\n    define(function (require, exports, module) {\n      var base64 = require('/node_modules/source-map/lib/source-map/base64.js', module);\n      var VLQ_BASE_SHIFT = 5;\n      var VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n      var VLQ_BASE_MASK = VLQ_BASE - 1;\n      var VLQ_CONTINUATION_BIT = VLQ_BASE;\n      function toVLQSigned(aValue) {\n        return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;\n      }\n      function fromVLQSigned(aValue) {\n        var isNegative = (aValue & 1) === 1;\n        var shifted = aValue >> 1;\n        return isNegative ? -shifted : shifted;\n      }\n      exports.encode = function base64VLQ_encode(aValue) {\n        var encoded = '';\n        var digit;\n        var vlq = toVLQSigned(aValue);\n        do {\n          digit = vlq & VLQ_BASE_MASK;\n          vlq >>>= VLQ_BASE_SHIFT;\n          if (vlq > 0) {\n            digit |= VLQ_CONTINUATION_BIT;\n          }\n          encoded += base64.encode(digit);\n        } while (vlq > 0);\n        return encoded;\n      };\n      exports.decode = function base64VLQ_decode(aStr) {\n        var i = 0;\n        var strLen = aStr.length;\n        var result = 0;\n        var shift = 0;\n        var continuation, digit;\n        do {\n          if (i >= strLen) {\n            throw new Error('Expected more digits in base 64 VLQ value.');\n          }\n          digit = base64.decode(aStr.charAt(i++));\n          continuation = !!(digit & VLQ_CONTINUATION_BIT);\n          digit &= VLQ_BASE_MASK;\n          result = result + (digit << shift);\n          shift += VLQ_BASE_SHIFT;\n        } while (continuation);\n        return {\n          value: fromVLQSigned(result),\n          rest: aStr.slice(i)\n        };\n      };\n    });\n  });\n  require.define('/node_modules/source-map/lib/source-map/base64.js', function (module, exports, __dirname, __filename) {\n    if (typeof define !== 'function') {\n      var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);\n    }\n    define(function (require, exports, module) {\n      var charToIntMap = {};\n      var intToCharMap = {};\n      'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('').forEach(function (ch, index) {\n        charToIntMap[ch] = index;\n        intToCharMap[index] = ch;\n      });\n      exports.encode = function base64_encode(aNumber) {\n        if (aNumber in intToCharMap) {\n          return intToCharMap[aNumber];\n        }\n        throw new TypeError('Must be between 0 and 63: ' + aNumber);\n      };\n      exports.decode = function base64_decode(aChar) {\n        if (aChar in charToIntMap) {\n          return charToIntMap[aChar];\n        }\n        throw new TypeError('Not a valid base 64 digit: ' + aChar);\n      };\n    });\n  });\n  require.define('/node_modules/source-map/lib/source-map/source-map-consumer.js', function (module, exports, __dirname, __filename) {\n    if (typeof define !== 'function') {\n      var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);\n    }\n    define(function (require, exports, module) {\n      var util = require('/node_modules/source-map/lib/source-map/util.js', module);\n      var binarySearch = require('/node_modules/source-map/lib/source-map/binary-search.js', module);\n      var ArraySet = require('/node_modules/source-map/lib/source-map/array-set.js', module).ArraySet;\n      var base64VLQ = require('/node_modules/source-map/lib/source-map/base64-vlq.js', module);\n      function SourceMapConsumer(aSourceMap) {\n        var sourceMap = aSourceMap;\n        if (typeof aSourceMap === 'string') {\n          sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n        }\n        var version = util.getArg(sourceMap, 'version');\n        var sources = util.getArg(sourceMap, 'sources');\n        var names = util.getArg(sourceMap, 'names', []);\n        var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n        var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n        var mappings = util.getArg(sourceMap, 'mappings');\n        var file = util.getArg(sourceMap, 'file', null);\n        if (version != this._version) {\n          throw new Error('Unsupported version: ' + version);\n        }\n        this._names = ArraySet.fromArray(names, true);\n        this._sources = ArraySet.fromArray(sources, true);\n        this.sourceRoot = sourceRoot;\n        this.sourcesContent = sourcesContent;\n        this._mappings = mappings;\n        this.file = file;\n      }\n      SourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) {\n        var smc = Object.create(SourceMapConsumer.prototype);\n        smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n        smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n        smc.sourceRoot = aSourceMap._sourceRoot;\n        smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);\n        smc.file = aSourceMap._file;\n        smc.__generatedMappings = aSourceMap._mappings.slice().sort(util.compareByGeneratedPositions);\n        smc.__originalMappings = aSourceMap._mappings.slice().sort(util.compareByOriginalPositions);\n        return smc;\n      };\n      SourceMapConsumer.prototype._version = 3;\n      Object.defineProperty(SourceMapConsumer.prototype, 'sources', {\n        get: function () {\n          return this._sources.toArray().map(function (s) {\n            return this.sourceRoot ? util.join(this.sourceRoot, s) : s;\n          }, this);\n        }\n      });\n      SourceMapConsumer.prototype.__generatedMappings = null;\n      Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n        get: function () {\n          if (!this.__generatedMappings) {\n            this.__generatedMappings = [];\n            this.__originalMappings = [];\n            this._parseMappings(this._mappings, this.sourceRoot);\n          }\n          return this.__generatedMappings;\n        }\n      });\n      SourceMapConsumer.prototype.__originalMappings = null;\n      Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n        get: function () {\n          if (!this.__originalMappings) {\n            this.__generatedMappings = [];\n            this.__originalMappings = [];\n            this._parseMappings(this._mappings, this.sourceRoot);\n          }\n          return this.__originalMappings;\n        }\n      });\n      SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n        var generatedLine = 1;\n        var previousGeneratedColumn = 0;\n        var previousOriginalLine = 0;\n        var previousOriginalColumn = 0;\n        var previousSource = 0;\n        var previousName = 0;\n        var mappingSeparator = /^[,;]/;\n        var str = aStr;\n        var mapping;\n        var temp;\n        while (str.length > 0) {\n          if (str.charAt(0) === ';') {\n            generatedLine++;\n            str = str.slice(1);\n            previousGeneratedColumn = 0;\n          } else if (str.charAt(0) === ',') {\n            str = str.slice(1);\n          } else {\n            mapping = {};\n            mapping.generatedLine = generatedLine;\n            temp = base64VLQ.decode(str);\n            mapping.generatedColumn = previousGeneratedColumn + temp.value;\n            previousGeneratedColumn = mapping.generatedColumn;\n            str = temp.rest;\n            if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {\n              temp = base64VLQ.decode(str);\n              mapping.source = this._sources.at(previousSource + temp.value);\n              previousSource += temp.value;\n              str = temp.rest;\n              if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {\n                throw new Error('Found a source, but no line and column');\n              }\n              temp = base64VLQ.decode(str);\n              mapping.originalLine = previousOriginalLine + temp.value;\n              previousOriginalLine = mapping.originalLine;\n              mapping.originalLine += 1;\n              str = temp.rest;\n              if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {\n                throw new Error('Found a source and line, but no column');\n              }\n              temp = base64VLQ.decode(str);\n              mapping.originalColumn = previousOriginalColumn + temp.value;\n              previousOriginalColumn = mapping.originalColumn;\n              str = temp.rest;\n              if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {\n                temp = base64VLQ.decode(str);\n                mapping.name = this._names.at(previousName + temp.value);\n                previousName += temp.value;\n                str = temp.rest;\n              }\n            }\n            this.__generatedMappings.push(mapping);\n            if (typeof mapping.originalLine === 'number') {\n              this.__originalMappings.push(mapping);\n            }\n          }\n        }\n        this.__originalMappings.sort(util.compareByOriginalPositions);\n      };\n      SourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator) {\n        if (aNeedle[aLineName] <= 0) {\n          throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]);\n        }\n        if (aNeedle[aColumnName] < 0) {\n          throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]);\n        }\n        return binarySearch.search(aNeedle, aMappings, aComparator);\n      };\n      SourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {\n        var needle = {\n            generatedLine: util.getArg(aArgs, 'line'),\n            generatedColumn: util.getArg(aArgs, 'column')\n          };\n        var mapping = this._findMapping(needle, this._generatedMappings, 'generatedLine', 'generatedColumn', util.compareByGeneratedPositions);\n        if (mapping) {\n          var source = util.getArg(mapping, 'source', null);\n          if (source && this.sourceRoot) {\n            source = util.join(this.sourceRoot, source);\n          }\n          return {\n            source: source,\n            line: util.getArg(mapping, 'originalLine', null),\n            column: util.getArg(mapping, 'originalColumn', null),\n            name: util.getArg(mapping, 'name', null)\n          };\n        }\n        return {\n          source: null,\n          line: null,\n          column: null,\n          name: null\n        };\n      };\n      SourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource) {\n        if (!this.sourcesContent) {\n          return null;\n        }\n        if (this.sourceRoot) {\n          aSource = util.relative(this.sourceRoot, aSource);\n        }\n        if (this._sources.has(aSource)) {\n          return this.sourcesContent[this._sources.indexOf(aSource)];\n        }\n        var url;\n        if (this.sourceRoot && (url = util.urlParse(this.sourceRoot))) {\n          var fileUriAbsPath = aSource.replace(/^file:\\/\\//, '');\n          if (url.scheme == 'file' && this._sources.has(fileUriAbsPath)) {\n            return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];\n          }\n          if ((!url.path || url.path == '/') && this._sources.has('/' + aSource)) {\n            return this.sourcesContent[this._sources.indexOf('/' + aSource)];\n          }\n        }\n        throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n      };\n      SourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {\n        var needle = {\n            source: util.getArg(aArgs, 'source'),\n            originalLine: util.getArg(aArgs, 'line'),\n            originalColumn: util.getArg(aArgs, 'column')\n          };\n        if (this.sourceRoot) {\n          needle.source = util.relative(this.sourceRoot, needle.source);\n        }\n        var mapping = this._findMapping(needle, this._originalMappings, 'originalLine', 'originalColumn', util.compareByOriginalPositions);\n        if (mapping) {\n          return {\n            line: util.getArg(mapping, 'generatedLine', null),\n            column: util.getArg(mapping, 'generatedColumn', null)\n          };\n        }\n        return {\n          line: null,\n          column: null\n        };\n      };\n      SourceMapConsumer.GENERATED_ORDER = 1;\n      SourceMapConsumer.ORIGINAL_ORDER = 2;\n      SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n        var context = aContext || null;\n        var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n        var mappings;\n        switch (order) {\n        case SourceMapConsumer.GENERATED_ORDER:\n          mappings = this._generatedMappings;\n          break;\n        case SourceMapConsumer.ORIGINAL_ORDER:\n          mappings = this._originalMappings;\n          break;\n        default:\n          throw new Error('Unknown order of iteration.');\n        }\n        var sourceRoot = this.sourceRoot;\n        mappings.map(function (mapping) {\n          var source = mapping.source;\n          if (source && sourceRoot) {\n            source = util.join(sourceRoot, source);\n          }\n          return {\n            source: source,\n            generatedLine: mapping.generatedLine,\n            generatedColumn: mapping.generatedColumn,\n            originalLine: mapping.originalLine,\n            originalColumn: mapping.originalColumn,\n            name: mapping.name\n          };\n        }).forEach(aCallback, context);\n      };\n      exports.SourceMapConsumer = SourceMapConsumer;\n    });\n  });\n  require.define('/node_modules/source-map/lib/source-map/binary-search.js', function (module, exports, __dirname, __filename) {\n    if (typeof define !== 'function') {\n      var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);\n    }\n    define(function (require, exports, module) {\n      function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {\n        var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n        var cmp = aCompare(aNeedle, aHaystack[mid], true);\n        if (cmp === 0) {\n          return aHaystack[mid];\n        } else if (cmp > 0) {\n          if (aHigh - mid > 1) {\n            return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);\n          }\n          return aHaystack[mid];\n        } else {\n          if (mid - aLow > 1) {\n            return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);\n          }\n          return aLow < 0 ? null : aHaystack[aLow];\n        }\n      }\n      exports.search = function search(aNeedle, aHaystack, aCompare) {\n        return aHaystack.length > 0 ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) : null;\n      };\n    });\n  });\n  require.define('/node_modules/esutils/lib/utils.js', function (module, exports, __dirname, __filename) {\n    (function () {\n      'use strict';\n      exports.code = require('/node_modules/esutils/lib/code.js', module);\n      exports.keyword = require('/node_modules/esutils/lib/keyword.js', module);\n    }());\n  });\n  require.define('/node_modules/esutils/lib/keyword.js', function (module, exports, __dirname, __filename) {\n    (function () {\n      'use strict';\n      var code = require('/node_modules/esutils/lib/code.js', module);\n      function isStrictModeReservedWordES6(id) {\n        switch (id) {\n        case 'implements':\n        case 'interface':\n        case 'package':\n        case 'private':\n        case 'protected':\n        case 'public':\n        case 'static':\n        case 'let':\n          return true;\n        default:\n          return false;\n        }\n      }\n      function isKeywordES5(id, strict) {\n        if (!strict && id === 'yield') {\n          return false;\n        }\n        return isKeywordES6(id, strict);\n      }\n      function isKeywordES6(id, strict) {\n        if (strict && isStrictModeReservedWordES6(id)) {\n          return true;\n        }\n        switch (id.length) {\n        case 2:\n          return id === 'if' || id === 'in' || id === 'do';\n        case 3:\n          return id === 'var' || id === 'for' || id === 'new' || id === 'try';\n        case 4:\n          return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum';\n        case 5:\n          return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super';\n        case 6:\n          return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import';\n        case 7:\n          return id === 'default' || id === 'finally' || id === 'extends';\n        case 8:\n          return id === 'function' || id === 'continue' || id === 'debugger';\n        case 10:\n          return id === 'instanceof';\n        default:\n          return false;\n        }\n      }\n      function isRestrictedWord(id) {\n        return id === 'eval' || id === 'arguments';\n      }\n      function isIdentifierName(id) {\n        var i, iz, ch;\n        if (id.length === 0) {\n          return false;\n        }\n        ch = id.charCodeAt(0);\n        if (!code.isIdentifierStart(ch) || ch === 92) {\n          return false;\n        }\n        for (i = 1, iz = id.length; i < iz; ++i) {\n          ch = id.charCodeAt(i);\n          if (!code.isIdentifierPart(ch) || ch === 92) {\n            return false;\n          }\n        }\n        return true;\n      }\n      module.exports = {\n        isKeywordES5: isKeywordES5,\n        isKeywordES6: isKeywordES6,\n        isRestrictedWord: isRestrictedWord,\n        isIdentifierName: isIdentifierName\n      };\n    }());\n  });\n  require.define('/node_modules/esutils/lib/code.js', function (module, exports, __dirname, __filename) {\n    (function () {\n      'use strict';\n      var Regex;\n      Regex = {\n        NonAsciiIdentifierStart: new RegExp('[\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc]'),\n        NonAsciiIdentifierPart: new RegExp('[\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0300-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u0483-\\u0487\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0610-\\u061a\\u0620-\\u0669\\u066e-\\u06d3\\u06d5-\\u06dc\\u06df-\\u06e8\\u06ea-\\u06fc\\u06ff\\u0710-\\u074a\\u074d-\\u07b1\\u07c0-\\u07f5\\u07fa\\u0800-\\u082d\\u0840-\\u085b\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\u0900-\\u0963\\u0966-\\u096f\\u0971-\\u0977\\u0979-\\u097f\\u0981-\\u0983\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bc-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09ce\\u09d7\\u09dc\\u09dd\\u09df-\\u09e3\\u09e6-\\u09f1\\u0a01-\\u0a03\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a59-\\u0a5c\\u0a5e\\u0a66-\\u0a75\\u0a81-\\u0a83\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abc-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ad0\\u0ae0-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3c-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5c\\u0b5d\\u0b5f-\\u0b63\\u0b66-\\u0b6f\\u0b71\\u0b82\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd0\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c58\\u0c59\\u0c60-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbc-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0cde\\u0ce0-\\u0ce3\\u0ce6-\\u0cef\\u0cf1\\u0cf2\\u0d02\\u0d03\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4e\\u0d57\\u0d60-\\u0d63\\u0d66-\\u0d6f\\u0d7a-\\u0d7f\\u0d82\\u0d83\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u0e50-\\u0e59\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb9\\u0ebb-\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0edc-\\u0edf\\u0f00\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e-\\u0f47\\u0f49-\\u0f6c\\u0f71-\\u0f84\\u0f86-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1049\\u1050-\\u109d\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u135d-\\u135f\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176c\\u176e-\\u1770\\u1772\\u1773\\u1780-\\u17d3\\u17d7\\u17dc\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a1b\\u1a20-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1aa7\\u1b00-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1bf3\\u1c00-\\u1c37\\u1c40-\\u1c49\\u1c4d-\\u1c7d\\u1cd0-\\u1cd2\\u1cd4-\\u1cf6\\u1d00-\\u1de6\\u1dfc-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u200c\\u200d\\u203f\\u2040\\u2054\\u2071\\u207f\\u2090-\\u209c\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d7f-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2de0-\\u2dff\\u2e2f\\u3005-\\u3007\\u3021-\\u302f\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u3099\\u309a\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua62b\\ua640-\\ua66f\\ua674-\\ua67d\\ua67f-\\ua697\\ua69f-\\ua6f1\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua827\\ua840-\\ua873\\ua880-\\ua8c4\\ua8d0-\\ua8d9\\ua8e0-\\ua8f7\\ua8fb\\ua900-\\ua92d\\ua930-\\ua953\\ua960-\\ua97c\\ua980-\\ua9c0\\ua9cf-\\ua9d9\\uaa00-\\uaa36\\uaa40-\\uaa4d\\uaa50-\\uaa59\\uaa60-\\uaa76\\uaa7a\\uaa7b\\uaa80-\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaef\\uaaf2-\\uaaf6\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff10-\\uff19\\uff21-\\uff3a\\uff3f\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc]')\n      };\n      function isDecimalDigit(ch) {\n        return ch >= 48 && ch <= 57;\n      }\n      function isHexDigit(ch) {\n        return isDecimalDigit(ch) || 97 <= ch && ch <= 102 || 65 <= ch && ch <= 70;\n      }\n      function isOctalDigit(ch) {\n        return ch >= 48 && ch <= 55;\n      }\n      function isWhiteSpace(ch) {\n        return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch >= 5760 && [\n          5760,\n          6158,\n          8192,\n          8193,\n          8194,\n          8195,\n          8196,\n          8197,\n          8198,\n          8199,\n          8200,\n          8201,\n          8202,\n          8239,\n          8287,\n          12288,\n          65279\n        ].indexOf(ch) >= 0;\n      }\n      function isLineTerminator(ch) {\n        return ch === 10 || ch === 13 || ch === 8232 || ch === 8233;\n      }\n      function isIdentifierStart(ch) {\n        return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 92 || ch >= 128 && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch));\n      }\n      function isIdentifierPart(ch) {\n        return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 92 || ch >= 128 && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch));\n      }\n      module.exports = {\n        isDecimalDigit: isDecimalDigit,\n        isHexDigit: isHexDigit,\n        isOctalDigit: isOctalDigit,\n        isWhiteSpace: isWhiteSpace,\n        isLineTerminator: isLineTerminator,\n        isIdentifierStart: isIdentifierStart,\n        isIdentifierPart: isIdentifierPart\n      };\n    }());\n  });\n  require.define('/node_modules/estraverse/estraverse.js', function (module, exports, __dirname, __filename) {\n    (function (root, factory) {\n      'use strict';\n      if (typeof define === 'function' && define.amd) {\n        define(['exports'], factory);\n      } else if (typeof exports !== 'undefined') {\n        factory(exports);\n      } else {\n        factory(root.estraverse = {});\n      }\n    }(this, function (exports) {\n      'use strict';\n      var Syntax, isArray, VisitorOption, VisitorKeys, BREAK, SKIP;\n      Syntax = {\n        AssignmentExpression: 'AssignmentExpression',\n        ArrayExpression: 'ArrayExpression',\n        ArrayPattern: 'ArrayPattern',\n        ArrowFunctionExpression: 'ArrowFunctionExpression',\n        BlockStatement: 'BlockStatement',\n        BinaryExpression: 'BinaryExpression',\n        BreakStatement: 'BreakStatement',\n        CallExpression: 'CallExpression',\n        CatchClause: 'CatchClause',\n        ClassBody: 'ClassBody',\n        ClassDeclaration: 'ClassDeclaration',\n        ClassExpression: 'ClassExpression',\n        ConditionalExpression: 'ConditionalExpression',\n        ContinueStatement: 'ContinueStatement',\n        DebuggerStatement: 'DebuggerStatement',\n        DirectiveStatement: 'DirectiveStatement',\n        DoWhileStatement: 'DoWhileStatement',\n        EmptyStatement: 'EmptyStatement',\n        ExpressionStatement: 'ExpressionStatement',\n        ForStatement: 'ForStatement',\n        ForInStatement: 'ForInStatement',\n        FunctionDeclaration: 'FunctionDeclaration',\n        FunctionExpression: 'FunctionExpression',\n        Identifier: 'Identifier',\n        IfStatement: 'IfStatement',\n        Literal: 'Literal',\n        LabeledStatement: 'LabeledStatement',\n        LogicalExpression: 'LogicalExpression',\n        MemberExpression: 'MemberExpression',\n        MethodDefinition: 'MethodDefinition',\n        NewExpression: 'NewExpression',\n        ObjectExpression: 'ObjectExpression',\n        ObjectPattern: 'ObjectPattern',\n        Program: 'Program',\n        Property: 'Property',\n        ReturnStatement: 'ReturnStatement',\n        SequenceExpression: 'SequenceExpression',\n        SwitchStatement: 'SwitchStatement',\n        SwitchCase: 'SwitchCase',\n        ThisExpression: 'ThisExpression',\n        ThrowStatement: 'ThrowStatement',\n        TryStatement: 'TryStatement',\n        UnaryExpression: 'UnaryExpression',\n        UpdateExpression: 'UpdateExpression',\n        VariableDeclaration: 'VariableDeclaration',\n        VariableDeclarator: 'VariableDeclarator',\n        WhileStatement: 'WhileStatement',\n        WithStatement: 'WithStatement',\n        YieldExpression: 'YieldExpression'\n      };\n      function ignoreJSHintError() {\n      }\n      isArray = Array.isArray;\n      if (!isArray) {\n        isArray = function isArray(array) {\n          return Object.prototype.toString.call(array) === '[object Array]';\n        };\n      }\n      function deepCopy(obj) {\n        var ret = {}, key, val;\n        for (key in obj) {\n          if (obj.hasOwnProperty(key)) {\n            val = obj[key];\n            if (typeof val === 'object' && val !== null) {\n              ret[key] = deepCopy(val);\n            } else {\n              ret[key] = val;\n            }\n          }\n        }\n        return ret;\n      }\n      function shallowCopy(obj) {\n        var ret = {}, key;\n        for (key in obj) {\n          if (obj.hasOwnProperty(key)) {\n            ret[key] = obj[key];\n          }\n        }\n        return ret;\n      }\n      ignoreJSHintError(shallowCopy);\n      function upperBound(array, func) {\n        var diff, len, i, current;\n        len = array.length;\n        i = 0;\n        while (len) {\n          diff = len >>> 1;\n          current = i + diff;\n          if (func(array[current])) {\n            len = diff;\n          } else {\n            i = current + 1;\n            len -= diff + 1;\n          }\n        }\n        return i;\n      }\n      function lowerBound(array, func) {\n        var diff, len, i, current;\n        len = array.length;\n        i = 0;\n        while (len) {\n          diff = len >>> 1;\n          current = i + diff;\n          if (func(array[current])) {\n            i = current + 1;\n            len -= diff + 1;\n          } else {\n            len = diff;\n          }\n        }\n        return i;\n      }\n      ignoreJSHintError(lowerBound);\n      VisitorKeys = {\n        AssignmentExpression: [\n          'left',\n          'right'\n        ],\n        ArrayExpression: ['elements'],\n        ArrayPattern: ['elements'],\n        ArrowFunctionExpression: [\n          'params',\n          'defaults',\n          'rest',\n          'body'\n        ],\n        BlockStatement: ['body'],\n        BinaryExpression: [\n          'left',\n          'right'\n        ],\n        BreakStatement: ['label'],\n        CallExpression: [\n          'callee',\n          'arguments'\n        ],\n        CatchClause: [\n          'param',\n          'body'\n        ],\n        ClassBody: ['body'],\n        ClassDeclaration: [\n          'id',\n          'body',\n          'superClass'\n        ],\n        ClassExpression: [\n          'id',\n          'body',\n          'superClass'\n        ],\n        ConditionalExpression: [\n          'test',\n          'consequent',\n          'alternate'\n        ],\n        ContinueStatement: ['label'],\n        DebuggerStatement: [],\n        DirectiveStatement: [],\n        DoWhileStatement: [\n          'body',\n          'test'\n        ],\n        EmptyStatement: [],\n        ExpressionStatement: ['expression'],\n        ForStatement: [\n          'init',\n          'test',\n          'update',\n          'body'\n        ],\n        ForInStatement: [\n          'left',\n          'right',\n          'body'\n        ],\n        FunctionDeclaration: [\n          'id',\n          'params',\n          'defaults',\n          'rest',\n          'body'\n        ],\n        FunctionExpression: [\n          'id',\n          'params',\n          'defaults',\n          'rest',\n          'body'\n        ],\n        Identifier: [],\n        IfStatement: [\n          'test',\n          'consequent',\n          'alternate'\n        ],\n        Literal: [],\n        LabeledStatement: [\n          'label',\n          'body'\n        ],\n        LogicalExpression: [\n          'left',\n          'right'\n        ],\n        MemberExpression: [\n          'object',\n          'property'\n        ],\n        MethodDefinition: [\n          'key',\n          'value'\n        ],\n        NewExpression: [\n          'callee',\n          'arguments'\n        ],\n        ObjectExpression: ['properties'],\n        ObjectPattern: ['properties'],\n        Program: ['body'],\n        Property: [\n          'key',\n          'value'\n        ],\n        ReturnStatement: ['argument'],\n        SequenceExpression: ['expressions'],\n        SwitchStatement: [\n          'discriminant',\n          'cases'\n        ],\n        SwitchCase: [\n          'test',\n          'consequent'\n        ],\n        ThisExpression: [],\n        ThrowStatement: ['argument'],\n        TryStatement: [\n          'block',\n          'handlers',\n          'handler',\n          'guardedHandlers',\n          'finalizer'\n        ],\n        UnaryExpression: ['argument'],\n        UpdateExpression: ['argument'],\n        VariableDeclaration: ['declarations'],\n        VariableDeclarator: [\n          'id',\n          'init'\n        ],\n        WhileStatement: [\n          'test',\n          'body'\n        ],\n        WithStatement: [\n          'object',\n          'body'\n        ],\n        YieldExpression: ['argument']\n      };\n      BREAK = {};\n      SKIP = {};\n      VisitorOption = {\n        Break: BREAK,\n        Skip: SKIP\n      };\n      function Reference(parent, key) {\n        this.parent = parent;\n        this.key = key;\n      }\n      Reference.prototype.replace = function replace(node) {\n        this.parent[this.key] = node;\n      };\n      function Element(node, path, wrap, ref) {\n        this.node = node;\n        this.path = path;\n        this.wrap = wrap;\n        this.ref = ref;\n      }\n      function Controller() {\n      }\n      Controller.prototype.path = function path() {\n        var i, iz, j, jz, result, element;\n        function addToPath(result, path) {\n          if (isArray(path)) {\n            for (j = 0, jz = path.length; j < jz; ++j) {\n              result.push(path[j]);\n            }\n          } else {\n            result.push(path);\n          }\n        }\n        if (!this.__current.path) {\n          return null;\n        }\n        result = [];\n        for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {\n          element = this.__leavelist[i];\n          addToPath(result, element.path);\n        }\n        addToPath(result, this.__current.path);\n        return result;\n      };\n      Controller.prototype.parents = function parents() {\n        var i, iz, result;\n        result = [];\n        for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {\n          result.push(this.__leavelist[i].node);\n        }\n        return result;\n      };\n      Controller.prototype.current = function current() {\n        return this.__current.node;\n      };\n      Controller.prototype.__execute = function __execute(callback, element) {\n        var previous, result;\n        result = undefined;\n        previous = this.__current;\n        this.__current = element;\n        this.__state = null;\n        if (callback) {\n          result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);\n        }\n        this.__current = previous;\n        return result;\n      };\n      Controller.prototype.notify = function notify(flag) {\n        this.__state = flag;\n      };\n      Controller.prototype.skip = function () {\n        this.notify(SKIP);\n      };\n      Controller.prototype['break'] = function () {\n        this.notify(BREAK);\n      };\n      Controller.prototype.__initialize = function (root, visitor) {\n        this.visitor = visitor;\n        this.root = root;\n        this.__worklist = [];\n        this.__leavelist = [];\n        this.__current = null;\n        this.__state = null;\n      };\n      Controller.prototype.traverse = function traverse(root, visitor) {\n        var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;\n        this.__initialize(root, visitor);\n        sentinel = {};\n        worklist = this.__worklist;\n        leavelist = this.__leavelist;\n        worklist.push(new Element(root, null, null, null));\n        leavelist.push(new Element(null, null, null, null));\n        while (worklist.length) {\n          element = worklist.pop();\n          if (element === sentinel) {\n            element = leavelist.pop();\n            ret = this.__execute(visitor.leave, element);\n            if (this.__state === BREAK || ret === BREAK) {\n              return;\n            }\n            continue;\n          }\n          if (element.node) {\n            ret = this.__execute(visitor.enter, element);\n            if (this.__state === BREAK || ret === BREAK) {\n              return;\n            }\n            worklist.push(sentinel);\n            leavelist.push(element);\n            if (this.__state === SKIP || ret === SKIP) {\n              continue;\n            }\n            node = element.node;\n            nodeType = element.wrap || node.type;\n            candidates = VisitorKeys[nodeType];\n            current = candidates.length;\n            while ((current -= 1) >= 0) {\n              key = candidates[current];\n              candidate = node[key];\n              if (!candidate) {\n                continue;\n              }\n              if (!isArray(candidate)) {\n                worklist.push(new Element(candidate, key, null, null));\n                continue;\n              }\n              current2 = candidate.length;\n              while ((current2 -= 1) >= 0) {\n                if (!candidate[current2]) {\n                  continue;\n                }\n                if ((nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === candidates[current]) {\n                  element = new Element(candidate[current2], [\n                    key,\n                    current2\n                  ], 'Property', null);\n                } else {\n                  element = new Element(candidate[current2], [\n                    key,\n                    current2\n                  ], null, null);\n                }\n                worklist.push(element);\n              }\n            }\n          }\n        }\n      };\n      Controller.prototype.replace = function replace(root, visitor) {\n        var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;\n        this.__initialize(root, visitor);\n        sentinel = {};\n        worklist = this.__worklist;\n        leavelist = this.__leavelist;\n        outer = { root: root };\n        element = new Element(root, null, null, new Reference(outer, 'root'));\n        worklist.push(element);\n        leavelist.push(element);\n        while (worklist.length) {\n          element = worklist.pop();\n          if (element === sentinel) {\n            element = leavelist.pop();\n            target = this.__execute(visitor.leave, element);\n            if (target !== undefined && target !== BREAK && target !== SKIP) {\n              element.ref.replace(target);\n            }\n            if (this.__state === BREAK || target === BREAK) {\n              return outer.root;\n            }\n            continue;\n          }\n          target = this.__execute(visitor.enter, element);\n          if (target !== undefined && target !== BREAK && target !== SKIP) {\n            element.ref.replace(target);\n            element.node = target;\n          }\n          if (this.__state === BREAK || target === BREAK) {\n            return outer.root;\n          }\n          node = element.node;\n          if (!node) {\n            continue;\n          }\n          worklist.push(sentinel);\n          leavelist.push(element);\n          if (this.__state === SKIP || target === SKIP) {\n            continue;\n          }\n          nodeType = element.wrap || node.type;\n          candidates = VisitorKeys[nodeType];\n          current = candidates.length;\n          while ((current -= 1) >= 0) {\n            key = candidates[current];\n            candidate = node[key];\n            if (!candidate) {\n              continue;\n            }\n            if (!isArray(candidate)) {\n              worklist.push(new Element(candidate, key, null, new Reference(node, key)));\n              continue;\n            }\n            current2 = candidate.length;\n            while ((current2 -= 1) >= 0) {\n              if (!candidate[current2]) {\n                continue;\n              }\n              if (nodeType === Syntax.ObjectExpression && 'properties' === candidates[current]) {\n                element = new Element(candidate[current2], [\n                  key,\n                  current2\n                ], 'Property', new Reference(candidate, current2));\n              } else {\n                element = new Element(candidate[current2], [\n                  key,\n                  current2\n                ], null, new Reference(candidate, current2));\n              }\n              worklist.push(element);\n            }\n          }\n        }\n        return outer.root;\n      };\n      function traverse(root, visitor) {\n        var controller = new Controller;\n        return controller.traverse(root, visitor);\n      }\n      function replace(root, visitor) {\n        var controller = new Controller;\n        return controller.replace(root, visitor);\n      }\n      function extendCommentRange(comment, tokens) {\n        var target;\n        target = upperBound(tokens, function search(token) {\n          return token.range[0] > comment.range[0];\n        });\n        comment.extendedRange = [\n          comment.range[0],\n          comment.range[1]\n        ];\n        if (target !== tokens.length) {\n          comment.extendedRange[1] = tokens[target].range[0];\n        }\n        target -= 1;\n        if (target >= 0) {\n          comment.extendedRange[0] = tokens[target].range[1];\n        }\n        return comment;\n      }\n      function attachComments(tree, providedComments, tokens) {\n        var comments = [], comment, len, i, cursor;\n        if (!tree.range) {\n          throw new Error('attachComments needs range information');\n        }\n        if (!tokens.length) {\n          if (providedComments.length) {\n            for (i = 0, len = providedComments.length; i < len; i += 1) {\n              comment = deepCopy(providedComments[i]);\n              comment.extendedRange = [\n                0,\n                tree.range[0]\n              ];\n              comments.push(comment);\n            }\n            tree.leadingComments = comments;\n          }\n          return tree;\n        }\n        for (i = 0, len = providedComments.length; i < len; i += 1) {\n          comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));\n        }\n        cursor = 0;\n        traverse(tree, {\n          enter: function (node) {\n            var comment;\n            while (cursor < comments.length) {\n              comment = comments[cursor];\n              if (comment.extendedRange[1] > node.range[0]) {\n                break;\n              }\n              if (comment.extendedRange[1] === node.range[0]) {\n                if (!node.leadingComments) {\n                  node.leadingComments = [];\n                }\n                node.leadingComments.push(comment);\n                comments.splice(cursor, 1);\n              } else {\n                cursor += 1;\n              }\n            }\n            if (cursor === comments.length) {\n              return VisitorOption.Break;\n            }\n            if (comments[cursor].extendedRange[0] > node.range[1]) {\n              return VisitorOption.Skip;\n            }\n          }\n        });\n        cursor = 0;\n        traverse(tree, {\n          leave: function (node) {\n            var comment;\n            while (cursor < comments.length) {\n              comment = comments[cursor];\n              if (node.range[1] < comment.extendedRange[0]) {\n                break;\n              }\n              if (node.range[1] === comment.extendedRange[0]) {\n                if (!node.trailingComments) {\n                  node.trailingComments = [];\n                }\n                node.trailingComments.push(comment);\n                comments.splice(cursor, 1);\n              } else {\n                cursor += 1;\n              }\n            }\n            if (cursor === comments.length) {\n              return VisitorOption.Break;\n            }\n            if (comments[cursor].extendedRange[0] > node.range[1]) {\n              return VisitorOption.Skip;\n            }\n          }\n        });\n        return tree;\n      }\n      exports.version = '1.3.3-dev';\n      exports.Syntax = Syntax;\n      exports.traverse = traverse;\n      exports.replace = replace;\n      exports.attachComments = attachComments;\n      exports.VisitorKeys = VisitorKeys;\n      exports.VisitorOption = VisitorOption;\n      exports.Controller = Controller;\n    }));\n  });\n  require('/tools/entry-point.js');\n}.call(this, this));\n"
  },
  {
    "path": "editor/scripts/escope.js",
    "content": "/*\n  Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>\n  Copyright (C) 2013 Alex Seville <hi@alexanderseville.com>\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/**\n * Escope (<a href=\"http://github.com/Constellation/escope\">escope</a>) is an <a\n * href=\"http://www.ecma-international.org/publications/standards/Ecma-262.htm\">ECMAScript</a>\n * scope analyzer extracted from the <a\n * href=\"http://github.com/Constellation/esmangle\">esmangle project</a/>.\n * <p>\n * <em>escope</em> finds lexical scopes in a source program, i.e. areas of that\n * program where different occurrences of the same identifier refer to the same\n * variable. With each scope the contained variables are collected, and each\n * identifier reference in code is linked to its corresponding variable (if\n * possible).\n * <p>\n * <em>escope</em> works on a syntax tree of the parsed source code which has\n * to adhere to the <a\n * href=\"https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API\">\n * Mozilla Parser API</a>. E.g. <a href=\"http://esprima.org\">esprima</a> is a parser\n * that produces such syntax trees.\n * <p>\n * The main interface is the {@link analyze} function.\n * @module\n */\n\n/*jslint bitwise:true */\n/*global exports:true, define:true, require:true*/\n(function (factory, global) {\n    'use strict';\n\n    function namespace(str, obj) {\n        var i, iz, names, name;\n        names = str.split('.');\n        for (i = 0, iz = names.length; i < iz; ++i) {\n            name = names[i];\n            if (obj.hasOwnProperty(name)) {\n                obj = obj[name];\n            } else {\n                obj = (obj[name] = {});\n            }\n        }\n        return obj;\n    }\n\n    // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n    // and plain browser loading,\n    if (typeof define === 'function' && define.amd) {\n        define('escope', ['exports', 'estraverse'], function (exports, estraverse) {\n            factory(exports, global, estraverse);\n        });\n    } else if (typeof exports !== 'undefined') {\n        factory(exports, global, require('estraverse'));\n    } else {\n        factory(namespace('escope', global), global, global.estraverse);\n    }\n}(function (exports, global, estraverse) {\n    'use strict';\n\n    var Syntax,\n        Map,\n        currentScope,\n        globalScope,\n        scopes,\n        options;\n\n    Syntax = estraverse.Syntax;\n\n    if (typeof global.Map !== 'undefined') {\n        // ES6 Map\n        Map = global.Map;\n    } else {\n        Map = function Map() {\n            this.__data = {};\n        };\n\n        Map.prototype.get = function MapGet(key) {\n            key = '$' + key;\n            if (this.__data.hasOwnProperty(key)) {\n                return this.__data[key];\n            }\n            return undefined;\n        };\n\n        Map.prototype.has = function MapHas(key) {\n            key = '$' + key;\n            return this.__data.hasOwnProperty(key);\n        };\n\n        Map.prototype.set = function MapSet(key, val) {\n            key = '$' + key;\n            this.__data[key] = val;\n        };\n\n        Map.prototype['delete'] = function MapDelete(key) {\n            key = '$' + key;\n            return delete this.__data[key];\n        };\n    }\n\n    function assert(cond, text) {\n        if (!cond) {\n            throw new Error(text);\n        }\n    }\n\n    function defaultOptions() {\n        return {\n            optimistic: false,\n            directive: false\n        };\n    }\n\n    function updateDeeply(target, override) {\n        var key, val;\n\n        function isHashObject(target) {\n            return typeof target === 'object' && target instanceof Object && !(target instanceof RegExp);\n        }\n\n        for (key in override) {\n            if (override.hasOwnProperty(key)) {\n                val = override[key];\n                if (isHashObject(val)) {\n                    if (isHashObject(target[key])) {\n                        updateDeeply(target[key], val);\n                    } else {\n                        target[key] = updateDeeply({}, val);\n                    }\n                } else {\n                    target[key] = val;\n                }\n            }\n        }\n        return target;\n    }\n\n    /**\n     * A Reference represents a single occurrence of an identifier in code.\n     * @class Reference\n     */\n    function Reference(ident, scope, flag, writeExpr, maybeImplicitGlobal) {\n        /** \n         * Identifier syntax node.\n         * @member {esprima#Identifier} Reference#identifier \n         */\n        this.identifier = ident;\n        /** \n         * Reference to the enclosing Scope.\n         * @member {Scope} Reference#from \n         */\n        this.from = scope;\n        /**\n         * Whether the reference comes from a dynamic scope (such as 'eval',\n         * 'with', etc.), and may be trapped by dynamic scopes.\n         * @member {boolean} Reference#tainted\n         */\n        this.tainted = false;\n        /** \n         * The variable this reference is resolved with.\n         * @member {Variable} Reference#resolved \n         */\n        this.resolved = null;\n        /** \n         * The read-write mode of the reference. (Value is one of {@link\n         * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).\n         * @member {number} Reference#flag \n         * @private\n         */\n        this.flag = flag;\n        if (this.isWrite()) {\n            /** \n             * If reference is writeable, this is the tree being written to it.\n             * @member {esprima#Node} Reference#writeExpr \n             */\n            this.writeExpr = writeExpr;\n        }\n        /** \n         * Whether the Reference might refer to a global variable.\n         * @member {boolean} Reference#__maybeImplicitGlobal \n         * @private\n         */\n        this.__maybeImplicitGlobal = maybeImplicitGlobal;\n    }\n\n    /** \n     * @constant Reference.READ \n     * @private\n     */\n    Reference.READ = 0x1;\n    /** \n     * @constant Reference.WRITE \n     * @private\n     */\n    Reference.WRITE = 0x2;\n    /** \n     * @constant Reference.RW \n     * @private\n     */\n    Reference.RW = 0x3;\n\n    /**\n     * Whether the reference is static.\n     * @method Reference#isStatic\n     * @return {boolean}\n     */\n    Reference.prototype.isStatic = function isStatic() {\n        return !this.tainted && this.resolved && this.resolved.scope.isStatic();\n    };\n\n    /**\n     * Whether the reference is writeable.\n     * @method Reference#isWrite\n     * @return {boolean}\n     */\n    Reference.prototype.isWrite = function isWrite() {\n        return this.flag & Reference.WRITE;\n    };\n\n    /**\n     * Whether the reference is readable.\n     * @method Reference#isRead\n     * @return {boolean}\n     */\n    Reference.prototype.isRead = function isRead() {\n        return this.flag & Reference.READ;\n    };\n\n    /**\n     * Whether the reference is read-only.\n     * @method Reference#isReadOnly\n     * @return {boolean}\n     */\n    Reference.prototype.isReadOnly = function isReadOnly() {\n        return this.flag === Reference.READ;\n    };\n\n    /**\n     * Whether the reference is write-only.\n     * @method Reference#isWriteOnly\n     * @return {boolean}\n     */\n    Reference.prototype.isWriteOnly = function isWriteOnly() {\n        return this.flag === Reference.WRITE;\n    };\n\n    /**\n     * Whether the reference is read-write.\n     * @method Reference#isReadWrite\n     * @return {boolean}\n     */\n    Reference.prototype.isReadWrite = function isReadWrite() {\n        return this.flag === Reference.RW;\n    };\n\n    /**\n     * A Variable represents a locally scoped identifier. These include arguments to\n     * functions.\n     * @class Variable\n     */\n    function Variable(name, scope) {\n        /**  \n         * The variable name, as given in the source code.\n         * @member {String} Variable#name \n         */\n        this.name = name;\n        /**\n         * List of defining occurrences of this variable (like in 'var ...'\n         * statements or as parameter), as AST nodes.\n         * @member {esprima.Identifier[]} Variable#identifiers\n         */\n        this.identifiers = [];\n        /**\n         * List of {@link Reference|references} of this variable (excluding parameter entries)\n         * in its defining scope and all nested scopes. For defining\n         * occurrences only see {@link Variable#defs}.\n         * @member {Reference[]} Variable#references\n         */\n        this.references = [];\n\n        /**\n         * List of defining occurrences of this variable (like in 'var ...'\n         * statements or as parameter), as custom objects.\n         * @typedef {Object} DefEntry\n         * @property {String} DefEntry.type - the type of the occurrence (e.g.\n         *      \"Parameter\", \"Variable\", ...)\n         * @property {esprima.Identifier} DefEntry.name - the identifier AST node of the occurrence\n         * @property {esprima.Node} DefEntry.node - the enclosing node of the\n         *      identifier\n         * @property {esprima.Node} [DefEntry.parent] - the enclosing statement\n         *      node of the identifier\n         * @member {DefEntry[]} Variable#defs\n         */\n        this.defs = [];\n\n        this.tainted = false;\n        /**\n         * Whether this is a stack variable.\n         * @member {boolean} Variable#stack\n         */\n        this.stack = true;\n        /** \n         * Reference to the enclosing Scope.\n         * @member {Scope} Variable#scope \n         */\n        this.scope = scope;\n    }\n\n    Variable.CatchClause = 'CatchClause';\n    Variable.Parameter = 'Parameter';\n    Variable.FunctionName = 'FunctionName';\n    Variable.Variable = 'Variable';\n    Variable.ImplicitGlobalVariable = 'ImplicitGlobalVariable';\n\n    function isStrictScope(scope, block) {\n        var body, i, iz, stmt, expr;\n\n        // When upper scope is exists and strict, inner scope is also strict.\n        if (scope.upper && scope.upper.isStrict) {\n            return true;\n        }\n\n        if (scope.type === 'function') {\n            body = block.body;\n        } else if (scope.type === 'global') {\n            body = block;\n        } else {\n            return false;\n        }\n\n        if (options.directive) {\n            for (i = 0, iz = body.body.length; i < iz; ++i) {\n                stmt = body.body[i];\n                if (stmt.type !== 'DirectiveStatement') {\n                    break;\n                }\n                if (stmt.raw === '\"use strict\"' || stmt.raw === '\\'use strict\\'') {\n                    return true;\n                }\n            }\n        } else {\n            for (i = 0, iz = body.body.length; i < iz; ++i) {\n                stmt = body.body[i];\n                if (stmt.type !== Syntax.ExpressionStatement) {\n                    break;\n                }\n                expr = stmt.expression;\n                if (expr.type !== Syntax.Literal || typeof expr.value !== 'string') {\n                    break;\n                }\n                if (expr.raw != null) {\n                    if (expr.raw === '\"use strict\"' || expr.raw === '\\'use strict\\'') {\n                        return true;\n                    }\n                } else {\n                    if (expr.value === 'use strict') {\n                        return true;\n                    }\n                }\n            }\n        }\n        return false;\n    }\n\n    /**\n     * @class Scope\n     */\n    function Scope(block, opt) {\n        var variable, body;\n\n        /**\n         * One of 'catch', 'with', 'function' or 'global'.\n         * @member {String} Scope#type\n         */\n        this.type =\n            (block.type === Syntax.CatchClause) ? 'catch' :\n            (block.type === Syntax.WithStatement) ? 'with' :\n            (block.type === Syntax.Program) ? 'global' : 'function';\n         /**\n         * The scoped {@link Variable}s of this scope, as <code>{ Variable.name\n         * : Variable }</code>.\n         * @member {Map} Scope#set\n         */\n        this.set = new Map();\n        /**\n         * The tainted variables of this scope, as <code>{ Variable.name :\n         * boolean }</code>.\n         * @member {Map} Scope#taints */\n        this.taints = new Map();\n        /**\n         * Generally, through the lexical scoping of JS you can always know\n         * which variable an identifier in the source code refers to. There are\n         * a few exceptions to this rule. With 'global' and 'with' scopes you\n         * can only decide at runtime which variable a reference refers to.\n         * Moreover, if 'eval()' is used in a scope, it might introduce new\n         * bindings in this or its prarent scopes.\n         * All those scopes are considered 'dynamic'.\n         * @member {boolean} Scope#dynamic\n         */\n        this.dynamic = this.type === 'global' || this.type === 'with';\n        /**\n         * A reference to the scope-defining syntax node.\n         * @member {esprima.Node} Scope#block\n         */\n        this.block = block;\n         /**\n         * The {@link Reference|references} that are not resolved with this scope.\n         * @member {Reference[]} Scope#through\n         */\n        this.through = [];\n         /**\n         * The scoped {@link Variable}s of this scope. In the case of a\n         * 'function' scope this includes the automatic argument <em>arguments</em> as\n         * its first element, as well as all further formal arguments.\n         * @member {Variable[]} Scope#variables\n         */\n        this.variables = [];\n         /**\n         * Any variable {@link Reference|reference} found in this scope. This\n         * includes occurrences of local variables as well as variables from\n         * parent scopes (including the global scope). For local variables\n         * this also includes defining occurrences (like in a 'var' statement).\n         * In a 'function' scope this does not include the occurrences of the\n         * formal parameter in the parameter list.\n         * @member {Reference[]} Scope#references\n         */\n        this.references = [];\n         /**\n         * List of {@link Reference}s that are left to be resolved (i.e. which\n         * need to be linked to the variable they refer to). Used internally to\n         * resolve bindings during scope analysis. On a finalized scope\n         * analysis, all sopes have <em>left</em> value <strong>null</strong>.\n         * @member {Reference[]} Scope#left\n         */\n        this.left = [];\n         /**\n         * For 'global' and 'function' scopes, this is a self-reference. For\n         * other scope types this is the <em>variableScope</em> value of the\n         * parent scope.\n         * @member {Scope} Scope#variableScope\n         */\n        this.variableScope =\n            (this.type === 'global' || this.type === 'function') ? this : currentScope.variableScope;\n         /**\n         * Whether this scope is created by a FunctionExpression.\n         * @member {boolean} Scope#functionExpressionScope\n         */\n        this.functionExpressionScope = false;\n         /**\n         * Whether this is a scope that contains an 'eval()' invocation.\n         * @member {boolean} Scope#directCallToEvalScope\n         */\n        this.directCallToEvalScope = false;\n         /**\n         * @member {boolean} Scope#thisFound\n         */\n        this.thisFound = false;\n        body = this.type === 'function' ? block.body : block;\n        if (opt.naming) {\n            this.__define(block.id, {\n                type: Variable.FunctionName,\n                name: block.id,\n                node: block\n            });\n            this.functionExpressionScope = true;\n        } else {\n            if (this.type === 'function') {\n                variable = new Variable('arguments', this);\n                this.taints.set('arguments', true);\n                this.set.set('arguments', variable);\n                this.variables.push(variable);\n            }\n\n            if (block.type === Syntax.FunctionExpression && block.id) {\n                new Scope(block, { naming: true });\n            }\n        }\n\n         /**\n         * Reference to the parent {@link Scope|scope}.\n         * @member {Scope} Scope#upper\n         */\n        this.upper = currentScope;\n         /**\n         * Whether 'use strict' is in effect in this scope.\n         * @member {boolean} Scope#isStrict\n         */\n        this.isStrict = isStrictScope(this, block);\n\n         /**\n         * List of nested {@link Scope}s.\n         * @member {Scope[]} Scope#childScopes\n         */\n        this.childScopes = [];\n        if (currentScope) {\n            currentScope.childScopes.push(this);\n        }\n\n\n        // RAII\n        currentScope = this;\n        if (this.type === 'global') {\n            globalScope = this;\n            globalScope.implicit = {\n                set: new Map(),\n                variables: []\n            };\n        }\n        scopes.push(this);\n    }\n\n    Scope.prototype.__close = function __close() {\n        var i, iz, ref, current, node, implicit;\n\n        // Because if this is global environment, upper is null\n        if (!this.dynamic || options.optimistic) {\n            // static resolve\n            for (i = 0, iz = this.left.length; i < iz; ++i) {\n                ref = this.left[i];\n                if (!this.__resolve(ref)) {\n                    this.__delegateToUpperScope(ref);\n                }\n            }\n        } else {\n            // this is \"global\" / \"with\" / \"function with eval\" environment\n            if (this.type === 'with') {\n                for (i = 0, iz = this.left.length; i < iz; ++i) {\n                    ref = this.left[i];\n                    ref.tainted = true;\n                    this.__delegateToUpperScope(ref);\n                }\n            } else {\n                for (i = 0, iz = this.left.length; i < iz; ++i) {\n                    // notify all names are through to global\n                    ref = this.left[i];\n                    current = this;\n                    do {\n                        current.through.push(ref);\n                        current = current.upper;\n                    } while (current);\n                }\n            }\n        }\n\n        if (this.type === 'global') {\n            implicit = [];\n            for (i = 0, iz = this.left.length; i < iz; ++i) {\n                ref = this.left[i];\n                if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {\n                    implicit.push(ref.__maybeImplicitGlobal);\n                }\n            }\n\n            // create an implicit global variable from assignment expression\n            for (i = 0, iz = implicit.length; i < iz; ++i) {\n                node = implicit[i];\n                this.__defineImplicit(node.left, {\n                    type: Variable.ImplicitGlobalVariable,\n                    name: node.left,\n                    node: node\n                });\n            }\n        }\n\n        this.left = null;\n        currentScope = this.upper;\n    };\n\n    Scope.prototype.__resolve = function __resolve(ref) {\n        var variable, name;\n        name = ref.identifier.name;\n        if (this.set.has(name)) {\n            variable = this.set.get(name);\n            variable.references.push(ref);\n            variable.stack = variable.stack && ref.from.variableScope === this.variableScope;\n            if (ref.tainted) {\n                variable.tainted = true;\n                this.taints.set(variable.name, true);\n            }\n            ref.resolved = variable;\n            return true;\n        }\n        return false;\n    };\n\n    Scope.prototype.__delegateToUpperScope = function __delegateToUpperScope(ref) {\n        if (this.upper) {\n            this.upper.left.push(ref);\n        }\n        this.through.push(ref);\n    };\n\n    Scope.prototype.__defineImplicit = function __defineImplicit(node, info) {\n        var name, variable;\n        if (node && node.type === Syntax.Identifier) {\n            name = node.name;\n            if (!this.implicit.set.has(name)) {\n                variable = new Variable(name, this);\n                variable.identifiers.push(node);\n                variable.defs.push(info);\n                this.implicit.set.set(name, variable);\n                this.implicit.variables.push(variable);\n            } else {\n                variable = this.implicit.set.get(name);\n                variable.identifiers.push(node);\n                variable.defs.push(info);\n            }\n        }\n    };\n\n    Scope.prototype.__define = function __define(node, info) {\n        var name, variable;\n        if (node && node.type === Syntax.Identifier) {\n            name = node.name;\n            if (!this.set.has(name)) {\n                variable = new Variable(name, this);\n                variable.identifiers.push(node);\n                variable.defs.push(info);\n                this.set.set(name, variable);\n                this.variables.push(variable);\n            } else {\n                variable = this.set.get(name);\n                variable.identifiers.push(node);\n                variable.defs.push(info);\n            }\n        }\n    };\n\n    Scope.prototype.__referencing = function __referencing(node, assign, writeExpr, maybeImplicitGlobal) {\n        var ref;\n        // because Array element may be null\n        if (node && node.type === Syntax.Identifier) {\n            ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal);\n            this.references.push(ref);\n            this.left.push(ref);\n        }\n    };\n\n    Scope.prototype.__detectEval = function __detectEval() {\n        var current;\n        current = this;\n        this.directCallToEvalScope = true;\n        do {\n            current.dynamic = true;\n            current = current.upper;\n        } while (current);\n    };\n\n    Scope.prototype.__detectThis = function __detectThis() {\n        this.thisFound = true;\n    };\n\n    Scope.prototype.__isClosed = function isClosed() {\n        return this.left === null;\n    };\n\n    // API Scope#resolve(name)\n    // returns resolved reference\n    Scope.prototype.resolve = function resolve(ident) {\n        var ref, i, iz;\n        assert(this.__isClosed(), 'scope should be closed');\n        assert(ident.type === Syntax.Identifier, 'target should be identifier');\n        for (i = 0, iz = this.references.length; i < iz; ++i) {\n            ref = this.references[i];\n            if (ref.identifier === ident) {\n                return ref;\n            }\n        }\n        return null;\n    };\n\n    // API Scope#isStatic\n    // returns this scope is static\n    Scope.prototype.isStatic = function isStatic() {\n        return !this.dynamic;\n    };\n\n    // API Scope#isArgumentsMaterialized\n    // return this scope has materialized arguments\n    Scope.prototype.isArgumentsMaterialized = function isArgumentsMaterialized() {\n        // TODO(Constellation)\n        // We can more aggressive on this condition like this.\n        //\n        // function t() {\n        //     // arguments of t is always hidden.\n        //     function arguments() {\n        //     }\n        // }\n        var variable;\n\n        // This is not function scope\n        if (this.type !== 'function') {\n            return true;\n        }\n\n        if (!this.isStatic()) {\n            return true;\n        }\n\n        variable = this.set.get('arguments');\n        assert(variable, 'always have arguments variable');\n        return variable.tainted || variable.references.length  !== 0;\n    };\n\n    // API Scope#isThisMaterialized\n    // return this scope has materialized `this` reference\n    Scope.prototype.isThisMaterialized = function isThisMaterialized() {\n        // This is not function scope\n        if (this.type !== 'function') {\n            return true;\n        }\n        if (!this.isStatic()) {\n            return true;\n        }\n        return this.thisFound;\n    };\n\n    Scope.mangledName = '__$escope$__';\n\n    Scope.prototype.attach = function attach() {\n        if (!this.functionExpressionScope) {\n            this.block[Scope.mangledName] = this;\n        }\n    };\n\n    Scope.prototype.detach = function detach() {\n        if (!this.functionExpressionScope) {\n            delete this.block[Scope.mangledName];\n        }\n    };\n\n    Scope.prototype.isUsedName = function (name) {\n        if (this.set.has(name)) {\n            return true;\n        }\n        for (var i = 0, iz = this.through.length; i < iz; ++i) {\n            if (this.through[i].identifier.name === name) {\n                return true;\n            }\n        }\n        return false;\n    };\n\n    /**\n     * @class ScopeManager\n     */\n    function ScopeManager(scopes) {\n        this.scopes = scopes;\n        this.attached = false;\n    }\n\n    // Returns appropliate scope for this node\n    ScopeManager.prototype.__get = function __get(node) {\n        var i, iz, scope;\n        if (this.attached) {\n            return node[Scope.mangledName] || null;\n        }\n        if (Scope.isScopeRequired(node)) {\n            for (i = 0, iz = this.scopes.length; i < iz; ++i) {\n                scope = this.scopes[i];\n                if (!scope.functionExpressionScope) {\n                    if (scope.block === node) {\n                        return scope;\n                    }\n                }\n            }\n        }\n        return null;\n    };\n\n    ScopeManager.prototype.acquire = function acquire(node) {\n        return this.__get(node);\n    };\n\n    ScopeManager.prototype.release = function release(node) {\n        var scope = this.__get(node);\n        if (scope) {\n            scope = scope.upper;\n            while (scope) {\n                if (!scope.functionExpressionScope) {\n                    return scope;\n                }\n                scope = scope.upper;\n            }\n        }\n        return null;\n    };\n\n    ScopeManager.prototype.attach = function attach() {\n        var i, iz;\n        for (i = 0, iz = this.scopes.length; i < iz; ++i) {\n            this.scopes[i].attach();\n        }\n        this.attached = true;\n    };\n\n    ScopeManager.prototype.detach = function detach() {\n        var i, iz;\n        for (i = 0, iz = this.scopes.length; i < iz; ++i) {\n            this.scopes[i].detach();\n        }\n        this.attached = false;\n    };\n\n    Scope.isScopeRequired = function isScopeRequired(node) {\n        return Scope.isVariableScopeRequired(node) || node.type === Syntax.WithStatement || node.type === Syntax.CatchClause;\n    };\n\n    Scope.isVariableScopeRequired = function isVariableScopeRequired(node) {\n        return node.type === Syntax.Program || node.type === Syntax.FunctionExpression || node.type === Syntax.FunctionDeclaration;\n    };\n\n    /**\n     * Main interface function. Takes an Esprima syntax tree and returns the\n     * analyzed scopes.\n     * @function analyze\n     * @param {esprima.Tree} tree\n     * @param {Object} providedOptions - Options that tailor the scope analysis\n     * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag\n     * @param {boolean} [providedOptions.directive=false]- the directive flag\n     * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls\n     * @return {ScopeManager}\n     */\n    function analyze(tree, providedOptions) {\n        var resultScopes;\n\n        options = updateDeeply(defaultOptions(), providedOptions);\n        resultScopes = scopes = [];\n        currentScope = null;\n        globalScope = null;\n\n        // attach scope and collect / resolve names\n        estraverse.traverse(tree, {\n            enter: function enter(node) {\n                var i, iz, decl;\n                if (Scope.isScopeRequired(node)) {\n                    new Scope(node, {});\n                }\n\n                switch (node.type) {\n                case Syntax.AssignmentExpression:\n                    if (node.operator === '=') {\n                        currentScope.__referencing(node.left, Reference.WRITE, node.right, (!currentScope.isStrict && node.left.name != null) && node);\n                    } else {\n                        currentScope.__referencing(node.left, Reference.RW, node.right);\n                    }\n                    currentScope.__referencing(node.right);\n                    break;\n\n                case Syntax.ArrayExpression:\n                    for (i = 0, iz = node.elements.length; i < iz; ++i) {\n                        currentScope.__referencing(node.elements[i]);\n                    }\n                    break;\n\n                case Syntax.BlockStatement:\n                    break;\n\n                case Syntax.BinaryExpression:\n                    currentScope.__referencing(node.left);\n                    currentScope.__referencing(node.right);\n                    break;\n\n                case Syntax.BreakStatement:\n                    break;\n\n                case Syntax.CallExpression:\n                    currentScope.__referencing(node.callee);\n                    for (i = 0, iz = node['arguments'].length; i < iz; ++i) {\n                        currentScope.__referencing(node['arguments'][i]);\n                    }\n\n                    // check this is direct call to eval\n                    if (!options.ignoreEval && node.callee.type === Syntax.Identifier && node.callee.name === 'eval') {\n                        currentScope.variableScope.__detectEval();\n                    }\n                    break;\n\n                case Syntax.CatchClause:\n                    currentScope.__define(node.param, {\n                        type: Variable.CatchClause,\n                        name: node.param,\n                        node: node\n                    });\n                    break;\n\n                case Syntax.ConditionalExpression:\n                    currentScope.__referencing(node.test);\n                    currentScope.__referencing(node.consequent);\n                    currentScope.__referencing(node.alternate);\n                    break;\n\n                case Syntax.ContinueStatement:\n                    break;\n\n                case Syntax.DirectiveStatement:\n                    break;\n\n                case Syntax.DoWhileStatement:\n                    currentScope.__referencing(node.test);\n                    break;\n\n                case Syntax.DebuggerStatement:\n                    break;\n\n                case Syntax.EmptyStatement:\n                    break;\n\n                case Syntax.ExpressionStatement:\n                    currentScope.__referencing(node.expression);\n                    break;\n\n                case Syntax.ForStatement:\n                    currentScope.__referencing(node.init);\n                    currentScope.__referencing(node.test);\n                    currentScope.__referencing(node.update);\n                    break;\n\n                case Syntax.ForInStatement:\n                    if (node.left.type === Syntax.VariableDeclaration) {\n                        currentScope.__referencing(node.left.declarations[0].id, Reference.WRITE, null, false);\n                    } else {\n                        currentScope.__referencing(node.left, Reference.WRITE, null, (!currentScope.isStrict && node.left.name != null) && node);\n                    }\n                    currentScope.__referencing(node.right);\n                    break;\n\n                case Syntax.FunctionDeclaration:\n                    // FunctionDeclaration name is defined in upper scope\n                    currentScope.upper.__define(node.id, {\n                        type: Variable.FunctionName,\n                        name: node.id,\n                        node: node\n                    });\n                    for (i = 0, iz = node.params.length; i < iz; ++i) {\n                        currentScope.__define(node.params[i], {\n                            type: Variable.Parameter,\n                            name: node.params[i],\n                            node: node,\n                            index: i\n                        });\n                    }\n                    break;\n\n                case Syntax.FunctionExpression:\n                    // id is defined in upper scope\n                    for (i = 0, iz = node.params.length; i < iz; ++i) {\n                        currentScope.__define(node.params[i], {\n                            type: Variable.Parameter,\n                            name: node.params[i],\n                            node: node,\n                            index: i\n                        });\n                    }\n                    break;\n\n                case Syntax.Identifier:\n                    break;\n\n                case Syntax.IfStatement:\n                    currentScope.__referencing(node.test);\n                    break;\n\n                case Syntax.Literal:\n                    break;\n\n                case Syntax.LabeledStatement:\n                    break;\n\n                case Syntax.LogicalExpression:\n                    currentScope.__referencing(node.left);\n                    currentScope.__referencing(node.right);\n                    break;\n\n                case Syntax.MemberExpression:\n                    currentScope.__referencing(node.object);\n                    if (node.computed) {\n                        currentScope.__referencing(node.property);\n                    }\n                    break;\n\n                case Syntax.NewExpression:\n                    currentScope.__referencing(node.callee);\n                    for (i = 0, iz = node['arguments'].length; i < iz; ++i) {\n                        currentScope.__referencing(node['arguments'][i]);\n                    }\n                    break;\n\n                case Syntax.ObjectExpression:\n                    break;\n\n                case Syntax.Program:\n                    break;\n\n                case Syntax.Property:\n                    currentScope.__referencing(node.value);\n                    break;\n\n                case Syntax.ReturnStatement:\n                    currentScope.__referencing(node.argument);\n                    break;\n\n                case Syntax.SequenceExpression:\n                    for (i = 0, iz = node.expressions.length; i < iz; ++i) {\n                        currentScope.__referencing(node.expressions[i]);\n                    }\n                    break;\n\n                case Syntax.SwitchStatement:\n                    currentScope.__referencing(node.discriminant);\n                    break;\n\n                case Syntax.SwitchCase:\n                    currentScope.__referencing(node.test);\n                    break;\n\n                case Syntax.ThisExpression:\n                    currentScope.variableScope.__detectThis();\n                    break;\n\n                case Syntax.ThrowStatement:\n                    currentScope.__referencing(node.argument);\n                    break;\n\n                case Syntax.TryStatement:\n                    break;\n\n                case Syntax.UnaryExpression:\n                    currentScope.__referencing(node.argument);\n                    break;\n\n                case Syntax.UpdateExpression:\n                    currentScope.__referencing(node.argument, Reference.RW, null);\n                    break;\n\n                case Syntax.VariableDeclaration:\n                    for (i = 0, iz = node.declarations.length; i < iz; ++i) {\n                        decl = node.declarations[i];\n                        currentScope.variableScope.__define(decl.id, {\n                            type: Variable.Variable,\n                            name: decl.id,\n                            node: decl,\n                            index: i,\n                            parent: node\n                        });\n                        if (decl.init) {\n                            // initializer is found\n                            currentScope.__referencing(decl.id, Reference.WRITE, decl.init, false);\n                            currentScope.__referencing(decl.init);\n                        }\n                    }\n                    break;\n\n                case Syntax.VariableDeclarator:\n                    break;\n\n                case Syntax.WhileStatement:\n                    currentScope.__referencing(node.test);\n                    break;\n\n                case Syntax.WithStatement:\n                    // WithStatement object is referenced at upper scope\n                    currentScope.upper.__referencing(node.object);\n                    break;\n                }\n            },\n\n            leave: function leave(node) {\n                while (currentScope && node === currentScope.block) {\n                    currentScope.__close();\n                }\n            }\n        });\n\n        assert(currentScope === null);\n        globalScope = null;\n        scopes = null;\n        options = null;\n\n        return new ScopeManager(resultScopes);\n    }\n\n    /** @name module:escope.version */\n    exports.version = '1.0.1';\n    /** @name module:escope.Reference */\n    exports.Reference = Reference;\n    /** @name module:escope.Variable */\n    exports.Variable = Variable;\n    /** @name module:escope.Scope */\n    exports.Scope = Scope;\n    /** @name module:escope.ScopeManager */\n    exports.ScopeManager = ScopeManager;\n    /** @name module:escope.analyze */\n    exports.analyze = analyze;\n}, this));\n/* vim: set sw=4 ts=4 et tw=80 : */\n"
  },
  {
    "path": "editor/scripts/estraverse.js",
    "content": "/*\n  Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>\n  Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/*jslint vars:false, bitwise:true*/\n/*jshint indent:4*/\n/*global exports:true, define:true*/\n(function (root, factory) {\n    'use strict';\n\n    // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n    // and plain browser loading,\n    if (typeof define === 'function' && define.amd) {\n        define(['exports'], factory);\n    } else if (typeof exports !== 'undefined') {\n        factory(exports);\n    } else {\n        factory((root.estraverse = {}));\n    }\n}(this, function (exports) {\n    'use strict';\n\n    var Syntax,\n        isArray,\n        VisitorOption,\n        VisitorKeys,\n        BREAK,\n        SKIP;\n\n    Syntax = {\n        AssignmentExpression: 'AssignmentExpression',\n        ArrayExpression: 'ArrayExpression',\n        ArrayPattern: 'ArrayPattern',\n        ArrowFunctionExpression: 'ArrowFunctionExpression',\n        BlockStatement: 'BlockStatement',\n        BinaryExpression: 'BinaryExpression',\n        BreakStatement: 'BreakStatement',\n        CallExpression: 'CallExpression',\n        CatchClause: 'CatchClause',\n        ClassBody: 'ClassBody',\n        ClassDeclaration: 'ClassDeclaration',\n        ClassExpression: 'ClassExpression',\n        ConditionalExpression: 'ConditionalExpression',\n        ContinueStatement: 'ContinueStatement',\n        DebuggerStatement: 'DebuggerStatement',\n        DirectiveStatement: 'DirectiveStatement',\n        DoWhileStatement: 'DoWhileStatement',\n        EmptyStatement: 'EmptyStatement',\n        ExpressionStatement: 'ExpressionStatement',\n        ForStatement: 'ForStatement',\n        ForInStatement: 'ForInStatement',\n        FunctionDeclaration: 'FunctionDeclaration',\n        FunctionExpression: 'FunctionExpression',\n        Identifier: 'Identifier',\n        IfStatement: 'IfStatement',\n        Literal: 'Literal',\n        LabeledStatement: 'LabeledStatement',\n        LogicalExpression: 'LogicalExpression',\n        MemberExpression: 'MemberExpression',\n        MethodDefinition: 'MethodDefinition',\n        NewExpression: 'NewExpression',\n        ObjectExpression: 'ObjectExpression',\n        ObjectPattern: 'ObjectPattern',\n        Program: 'Program',\n        Property: 'Property',\n        ReturnStatement: 'ReturnStatement',\n        SequenceExpression: 'SequenceExpression',\n        SwitchStatement: 'SwitchStatement',\n        SwitchCase: 'SwitchCase',\n        ThisExpression: 'ThisExpression',\n        ThrowStatement: 'ThrowStatement',\n        TryStatement: 'TryStatement',\n        UnaryExpression: 'UnaryExpression',\n        UpdateExpression: 'UpdateExpression',\n        VariableDeclaration: 'VariableDeclaration',\n        VariableDeclarator: 'VariableDeclarator',\n        WhileStatement: 'WhileStatement',\n        WithStatement: 'WithStatement',\n        YieldExpression: 'YieldExpression'\n    };\n\n    function ignoreJSHintError() { }\n\n    isArray = Array.isArray;\n    if (!isArray) {\n        isArray = function isArray(array) {\n            return Object.prototype.toString.call(array) === '[object Array]';\n        };\n    }\n\n    function deepCopy(obj) {\n        var ret = {}, key, val;\n        for (key in obj) {\n            if (obj.hasOwnProperty(key)) {\n                val = obj[key];\n                if (typeof val === 'object' && val !== null) {\n                    ret[key] = deepCopy(val);\n                } else {\n                    ret[key] = val;\n                }\n            }\n        }\n        return ret;\n    }\n\n    function shallowCopy(obj) {\n        var ret = {}, key;\n        for (key in obj) {\n            if (obj.hasOwnProperty(key)) {\n                ret[key] = obj[key];\n            }\n        }\n        return ret;\n    }\n    ignoreJSHintError(shallowCopy);\n\n    // based on LLVM libc++ upper_bound / lower_bound\n    // MIT License\n\n    function upperBound(array, func) {\n        var diff, len, i, current;\n\n        len = array.length;\n        i = 0;\n\n        while (len) {\n            diff = len >>> 1;\n            current = i + diff;\n            if (func(array[current])) {\n                len = diff;\n            } else {\n                i = current + 1;\n                len -= diff + 1;\n            }\n        }\n        return i;\n    }\n\n    function lowerBound(array, func) {\n        var diff, len, i, current;\n\n        len = array.length;\n        i = 0;\n\n        while (len) {\n            diff = len >>> 1;\n            current = i + diff;\n            if (func(array[current])) {\n                i = current + 1;\n                len -= diff + 1;\n            } else {\n                len = diff;\n            }\n        }\n        return i;\n    }\n    ignoreJSHintError(lowerBound);\n\n    VisitorKeys = {\n        AssignmentExpression: ['left', 'right'],\n        ArrayExpression: ['elements'],\n        ArrayPattern: ['elements'],\n        ArrowFunctionExpression: ['params', 'defaults', 'rest', 'body'],\n        BlockStatement: ['body'],\n        BinaryExpression: ['left', 'right'],\n        BreakStatement: ['label'],\n        CallExpression: ['callee', 'arguments'],\n        CatchClause: ['param', 'body'],\n        ClassBody: ['body'],\n        ClassDeclaration: ['id', 'body', 'superClass'],\n        ClassExpression: ['id', 'body', 'superClass'],\n        ConditionalExpression: ['test', 'consequent', 'alternate'],\n        ContinueStatement: ['label'],\n        DebuggerStatement: [],\n        DirectiveStatement: [],\n        DoWhileStatement: ['body', 'test'],\n        EmptyStatement: [],\n        ExpressionStatement: ['expression'],\n        ForStatement: ['init', 'test', 'update', 'body'],\n        ForInStatement: ['left', 'right', 'body'],\n        FunctionDeclaration: ['id', 'params', 'defaults', 'rest', 'body'],\n        FunctionExpression: ['id', 'params', 'defaults', 'rest', 'body'],\n        Identifier: [],\n        IfStatement: ['test', 'consequent', 'alternate'],\n        Literal: [],\n        LabeledStatement: ['label', 'body'],\n        LogicalExpression: ['left', 'right'],\n        MemberExpression: ['object', 'property'],\n        MethodDefinition: ['key', 'value'],\n        NewExpression: ['callee', 'arguments'],\n        ObjectExpression: ['properties'],\n        ObjectPattern: ['properties'],\n        Program: ['body'],\n        Property: ['key', 'value'],\n        ReturnStatement: ['argument'],\n        SequenceExpression: ['expressions'],\n        SwitchStatement: ['discriminant', 'cases'],\n        SwitchCase: ['test', 'consequent'],\n        ThisExpression: [],\n        ThrowStatement: ['argument'],\n        TryStatement: ['block', 'handlers', 'handler', 'guardedHandlers', 'finalizer'],\n        UnaryExpression: ['argument'],\n        UpdateExpression: ['argument'],\n        VariableDeclaration: ['declarations'],\n        VariableDeclarator: ['id', 'init'],\n        WhileStatement: ['test', 'body'],\n        WithStatement: ['object', 'body'],\n        YieldExpression: ['argument']\n    };\n\n    // unique id\n    BREAK = {};\n    SKIP = {};\n\n    VisitorOption = {\n        Break: BREAK,\n        Skip: SKIP\n    };\n\n    function Reference(parent, key) {\n        this.parent = parent;\n        this.key = key;\n    }\n\n    Reference.prototype.replace = function replace(node) {\n        this.parent[this.key] = node;\n    };\n\n    function Element(node, path, wrap, ref) {\n        this.node = node;\n        this.path = path;\n        this.wrap = wrap;\n        this.ref = ref;\n    }\n\n    function Controller() { }\n\n    // API:\n    // return property path array from root to current node\n    Controller.prototype.path = function path() {\n        var i, iz, j, jz, result, element;\n\n        function addToPath(result, path) {\n            if (isArray(path)) {\n                for (j = 0, jz = path.length; j < jz; ++j) {\n                    result.push(path[j]);\n                }\n            } else {\n                result.push(path);\n            }\n        }\n\n        // root node\n        if (!this.__current.path) {\n            return null;\n        }\n\n        // first node is sentinel, second node is root element\n        result = [];\n        for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {\n            element = this.__leavelist[i];\n            addToPath(result, element.path);\n        }\n        addToPath(result, this.__current.path);\n        return result;\n    };\n\n    // API:\n    // return array of parent elements\n    Controller.prototype.parents = function parents() {\n        var i, iz, result;\n\n        // first node is sentinel\n        result = [];\n        for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {\n            result.push(this.__leavelist[i].node);\n        }\n\n        return result;\n    };\n\n    // API:\n    // return current node\n    Controller.prototype.current = function current() {\n        return this.__current.node;\n    };\n\n    Controller.prototype.__execute = function __execute(callback, element) {\n        var previous, result;\n\n        result = undefined;\n\n        previous  = this.__current;\n        this.__current = element;\n        this.__state = null;\n        if (callback) {\n            result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);\n        }\n        this.__current = previous;\n\n        return result;\n    };\n\n    // API:\n    // notify control skip / break\n    Controller.prototype.notify = function notify(flag) {\n        this.__state = flag;\n    };\n\n    // API:\n    // skip child nodes of current node\n    Controller.prototype.skip = function () {\n        this.notify(SKIP);\n    };\n\n    // API:\n    // break traversals\n    Controller.prototype['break'] = function () {\n        this.notify(BREAK);\n    };\n\n    Controller.prototype.__initialize = function(root, visitor) {\n        this.visitor = visitor;\n        this.root = root;\n        this.__worklist = [];\n        this.__leavelist = [];\n        this.__current = null;\n        this.__state = null;\n    };\n\n    Controller.prototype.traverse = function traverse(root, visitor) {\n        var worklist,\n            leavelist,\n            element,\n            node,\n            nodeType,\n            ret,\n            key,\n            current,\n            current2,\n            candidates,\n            candidate,\n            sentinel;\n\n        this.__initialize(root, visitor);\n\n        sentinel = {};\n\n        // reference\n        worklist = this.__worklist;\n        leavelist = this.__leavelist;\n\n        // initialize\n        worklist.push(new Element(root, null, null, null));\n        leavelist.push(new Element(null, null, null, null));\n\n        while (worklist.length) {\n            element = worklist.pop();\n\n            if (element === sentinel) {\n                element = leavelist.pop();\n\n                ret = this.__execute(visitor.leave, element);\n\n                if (this.__state === BREAK || ret === BREAK) {\n                    return;\n                }\n                continue;\n            }\n\n            if (element.node) {\n\n                ret = this.__execute(visitor.enter, element);\n\n                if (this.__state === BREAK || ret === BREAK) {\n                    return;\n                }\n\n                worklist.push(sentinel);\n                leavelist.push(element);\n\n                if (this.__state === SKIP || ret === SKIP) {\n                    continue;\n                }\n\n                node = element.node;\n                nodeType = element.wrap || node.type;\n                candidates = VisitorKeys[nodeType];\n\n                current = candidates.length;\n                while ((current -= 1) >= 0) {\n                    key = candidates[current];\n                    candidate = node[key];\n                    if (!candidate) {\n                        continue;\n                    }\n\n                    if (!isArray(candidate)) {\n                        worklist.push(new Element(candidate, key, null, null));\n                        continue;\n                    }\n\n                    current2 = candidate.length;\n                    while ((current2 -= 1) >= 0) {\n                        if (!candidate[current2]) {\n                            continue;\n                        }\n                        if ((nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === candidates[current]) {\n                            element = new Element(candidate[current2], [key, current2], 'Property', null);\n                        } else {\n                            element = new Element(candidate[current2], [key, current2], null, null);\n                        }\n                        worklist.push(element);\n                    }\n                }\n            }\n        }\n    };\n\n    Controller.prototype.replace = function replace(root, visitor) {\n        var worklist,\n            leavelist,\n            node,\n            nodeType,\n            target,\n            element,\n            current,\n            current2,\n            candidates,\n            candidate,\n            sentinel,\n            outer,\n            key;\n\n        this.__initialize(root, visitor);\n\n        sentinel = {};\n\n        // reference\n        worklist = this.__worklist;\n        leavelist = this.__leavelist;\n\n        // initialize\n        outer = {\n            root: root\n        };\n        element = new Element(root, null, null, new Reference(outer, 'root'));\n        worklist.push(element);\n        leavelist.push(element);\n\n        while (worklist.length) {\n            element = worklist.pop();\n\n            if (element === sentinel) {\n                element = leavelist.pop();\n\n                target = this.__execute(visitor.leave, element);\n\n                // node may be replaced with null,\n                // so distinguish between undefined and null in this place\n                if (target !== undefined && target !== BREAK && target !== SKIP) {\n                    // replace\n                    element.ref.replace(target);\n                }\n\n                if (this.__state === BREAK || target === BREAK) {\n                    return outer.root;\n                }\n                continue;\n            }\n\n            target = this.__execute(visitor.enter, element);\n\n            // node may be replaced with null,\n            // so distinguish between undefined and null in this place\n            if (target !== undefined && target !== BREAK && target !== SKIP) {\n                // replace\n                element.ref.replace(target);\n                element.node = target;\n            }\n\n            if (this.__state === BREAK || target === BREAK) {\n                return outer.root;\n            }\n\n            // node may be null\n            node = element.node;\n            if (!node) {\n                continue;\n            }\n\n            worklist.push(sentinel);\n            leavelist.push(element);\n\n            if (this.__state === SKIP || target === SKIP) {\n                continue;\n            }\n\n            nodeType = element.wrap || node.type;\n            candidates = VisitorKeys[nodeType];\n\n            current = candidates.length;\n            while ((current -= 1) >= 0) {\n                key = candidates[current];\n                candidate = node[key];\n                if (!candidate) {\n                    continue;\n                }\n\n                if (!isArray(candidate)) {\n                    worklist.push(new Element(candidate, key, null, new Reference(node, key)));\n                    continue;\n                }\n\n                current2 = candidate.length;\n                while ((current2 -= 1) >= 0) {\n                    if (!candidate[current2]) {\n                        continue;\n                    }\n                    if (nodeType === Syntax.ObjectExpression && 'properties' === candidates[current]) {\n                        element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));\n                    } else {\n                        element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));\n                    }\n                    worklist.push(element);\n                }\n            }\n        }\n\n        return outer.root;\n    };\n\n    function traverse(root, visitor) {\n        var controller = new Controller();\n        return controller.traverse(root, visitor);\n    }\n\n    function replace(root, visitor) {\n        var controller = new Controller();\n        return controller.replace(root, visitor);\n    }\n\n    function extendCommentRange(comment, tokens) {\n        var target;\n\n        target = upperBound(tokens, function search(token) {\n            return token.range[0] > comment.range[0];\n        });\n\n        comment.extendedRange = [comment.range[0], comment.range[1]];\n\n        if (target !== tokens.length) {\n            comment.extendedRange[1] = tokens[target].range[0];\n        }\n\n        target -= 1;\n        if (target >= 0) {\n            comment.extendedRange[0] = tokens[target].range[1];\n        }\n\n        return comment;\n    }\n\n    function attachComments(tree, providedComments, tokens) {\n        // At first, we should calculate extended comment ranges.\n        var comments = [], comment, len, i, cursor;\n\n        if (!tree.range) {\n            throw new Error('attachComments needs range information');\n        }\n\n        // tokens array is empty, we attach comments to tree as 'leadingComments'\n        if (!tokens.length) {\n            if (providedComments.length) {\n                for (i = 0, len = providedComments.length; i < len; i += 1) {\n                    comment = deepCopy(providedComments[i]);\n                    comment.extendedRange = [0, tree.range[0]];\n                    comments.push(comment);\n                }\n                tree.leadingComments = comments;\n            }\n            return tree;\n        }\n\n        for (i = 0, len = providedComments.length; i < len; i += 1) {\n            comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));\n        }\n\n        // This is based on John Freeman's implementation.\n        cursor = 0;\n        traverse(tree, {\n            enter: function (node) {\n                var comment;\n\n                while (cursor < comments.length) {\n                    comment = comments[cursor];\n                    if (comment.extendedRange[1] > node.range[0]) {\n                        break;\n                    }\n\n                    if (comment.extendedRange[1] === node.range[0]) {\n                        if (!node.leadingComments) {\n                            node.leadingComments = [];\n                        }\n                        node.leadingComments.push(comment);\n                        comments.splice(cursor, 1);\n                    } else {\n                        cursor += 1;\n                    }\n                }\n\n                // already out of owned node\n                if (cursor === comments.length) {\n                    return VisitorOption.Break;\n                }\n\n                if (comments[cursor].extendedRange[0] > node.range[1]) {\n                    return VisitorOption.Skip;\n                }\n            }\n        });\n\n        cursor = 0;\n        traverse(tree, {\n            leave: function (node) {\n                var comment;\n\n                while (cursor < comments.length) {\n                    comment = comments[cursor];\n                    if (node.range[1] < comment.extendedRange[0]) {\n                        break;\n                    }\n\n                    if (node.range[1] === comment.extendedRange[0]) {\n                        if (!node.trailingComments) {\n                            node.trailingComments = [];\n                        }\n                        node.trailingComments.push(comment);\n                        comments.splice(cursor, 1);\n                    } else {\n                        cursor += 1;\n                    }\n                }\n\n                // already out of owned node\n                if (cursor === comments.length) {\n                    return VisitorOption.Break;\n                }\n\n                if (comments[cursor].extendedRange[0] > node.range[1]) {\n                    return VisitorOption.Skip;\n                }\n            }\n        });\n\n        return tree;\n    }\n\n    exports.version = '1.3.3-dev';\n    exports.Syntax = Syntax;\n    exports.traverse = traverse;\n    exports.replace = replace;\n    exports.attachComments = attachComments;\n    exports.VisitorKeys = VisitorKeys;\n    exports.VisitorOption = VisitorOption;\n    exports.Controller = Controller;\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n"
  },
  {
    "path": "editor/scripts/expander.js",
    "content": "/*\n  Copyright (C) 2012 Tim Disney <tim@disnet.me>\n\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n(function (root, factory) {\n    if (typeof exports === 'object') {\n        // CommonJS\n        factory(exports, require('underscore'), require('./parser'), require('./syntax'), require('./scopedEval'), require('./patterns'), require('escodegen'));\n    } else if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define([\n            'exports',\n            'underscore',\n            'parser',\n            'syntax',\n            'scopedEval',\n            'patterns',\n            'escodegen'\n        ], factory);\n    }\n}(this, function (exports$2, _, parser, syn, se, patternModule, gen) {\n    'use strict';\n    // escodegen still doesn't quite support AMD: https://github.com/Constellation/escodegen/issues/115\n    var codegen = typeof escodegen !== 'undefined' ? escodegen : gen;\n    var assert = syn.assert;\n    var throwSyntaxError = syn.throwSyntaxError;\n    var throwSyntaxCaseError = syn.throwSyntaxCaseError;\n    var SyntaxCaseError = syn.SyntaxCaseError;\n    var unwrapSyntax = syn.unwrapSyntax;\n    // used to export \"private\" methods for unit testing\n    exports$2._test = {};\n    function StringMap(o) {\n        this.__data = o || {};\n    }\n    StringMap.prototype = {\n        has: function (key) {\n            return Object.prototype.hasOwnProperty.call(this.__data, key);\n        },\n        get: function (key) {\n            return this.has(key) ? this.__data[key] : void 0;\n        },\n        set: function (key, value) {\n            this.__data[key] = value;\n        },\n        extend: function () {\n            var args = _.map(_.toArray(arguments), function (x) {\n                    return x.__data;\n                });\n            _.extend.apply(_, [this.__data].concat(args));\n            return this;\n        }\n    };\n    var scopedEval = se.scopedEval;\n    var Rename = syn.Rename;\n    var Mark = syn.Mark;\n    var Def = syn.Def;\n    var syntaxFromToken = syn.syntaxFromToken;\n    var joinSyntax = syn.joinSyntax;\n    var builtinMode = false;\n    var expandCount = 0;\n    var maxExpands;\n    var push = Array.prototype.push;\n    function remdup(mark, mlist) {\n        if (mark === _.first(mlist)) {\n            return _.rest(mlist, 1);\n        }\n        return [mark].concat(mlist);\n    }\n    // (CSyntax) -> [...Num]\n    function marksof(ctx, stopName, originalName) {\n        while (ctx) {\n            if (ctx.constructor === Mark) {\n                return remdup(ctx.mark, marksof(ctx.context, stopName, originalName));\n            }\n            if (ctx.constructor === Def) {\n                ctx = ctx.context;\n                continue;\n            }\n            if (ctx.constructor === Rename) {\n                if (stopName === originalName + '$' + ctx.name) {\n                    return [];\n                }\n                ctx = ctx.context;\n                continue;\n            }\n        }\n        return [];\n    }\n    function resolve(stx) {\n        return resolveCtx(stx.token.value, stx.context, [], [], {});\n    }\n    // This call memoizes intermediate results in the recursive invocation.\n    // The scope of the memo cache is the resolve() call, so that multiple\n    // resolve() calls don't walk all over each other, and memory used for\n    // the memoization can be garbage collected.\n    //\n    // The memoization addresses issue #232.\n    //\n    // It looks like the memoization uses only the context and doesn't look\n    // at originalName, stop_spine and stop_branch arguments. This is valid\n    // because whenever in every recursive call operates on a \"deeper\" or\n    // else a newly created context.  Therefore the collection of\n    // [originalName, stop_spine, stop_branch] can all be associated with a\n    // unique context. This argument is easier to see in a recursive\n    // rewrite of the resolveCtx function than with the while loop\n    // optimization - https://gist.github.com/srikumarks/9847260 - where the\n    // recursive steps always operate on a different context.\n    //\n    // This might make it seem that the resolution results can be stored on\n    // the context object itself, but that would not work in general\n    // because multiple resolve() calls will walk over each other's cache\n    // results, which fails tests. So the memoization uses only a context's\n    // unique instance numbers as the memoization key and is local to each\n    // resolve() call.\n    //\n    // With this memoization, the time complexity of the resolveCtx call is\n    // no longer exponential for the cases in issue #232.\n    function resolveCtx(originalName, ctx, stop_spine, stop_branch, cache) {\n        if (!ctx) {\n            return originalName;\n        }\n        var key = ctx.instNum;\n        return cache[key] || (cache[key] = resolveCtxFull(originalName, ctx, stop_spine, stop_branch, cache));\n    }\n    // (Syntax) -> String\n    function resolveCtxFull(originalName, ctx, stop_spine, stop_branch, cache) {\n        while (true) {\n            if (!ctx) {\n                return originalName;\n            }\n            if (ctx.constructor === Mark) {\n                ctx = ctx.context;\n                continue;\n            }\n            if (ctx.constructor === Def) {\n                if (stop_spine.indexOf(ctx.defctx) !== -1) {\n                    ctx = ctx.context;\n                    continue;\n                } else {\n                    stop_branch = unionEl(stop_branch, ctx.defctx);\n                    ctx = renames(ctx.defctx, ctx.context, originalName);\n                    continue;\n                }\n            }\n            if (ctx.constructor === Rename) {\n                if (originalName === ctx.id.token.value) {\n                    var idName = resolveCtx(ctx.id.token.value, ctx.id.context, stop_branch, stop_branch, cache);\n                    var subName = resolveCtx(originalName, ctx.context, unionEl(stop_spine, ctx.def), stop_branch, cache);\n                    if (idName === subName) {\n                        var idMarks = marksof(ctx.id.context, originalName + '$' + ctx.name, originalName);\n                        var subMarks = marksof(ctx.context, originalName + '$' + ctx.name, originalName);\n                        if (arraysEqual(idMarks, subMarks)) {\n                            return originalName + '$' + ctx.name;\n                        }\n                    }\n                }\n                ctx = ctx.context;\n                continue;\n            }\n            return originalName;\n        }\n    }\n    function arraysEqual(a, b) {\n        if (a.length !== b.length) {\n            return false;\n        }\n        for (var i = 0; i < a.length; i++) {\n            if (a[i] !== b[i]) {\n                return false;\n            }\n        }\n        return true;\n    }\n    function renames(defctx, oldctx, originalName) {\n        var acc = oldctx;\n        for (var i = 0; i < defctx.length; i++) {\n            if (defctx[i].id.token.value === originalName) {\n                acc = new Rename(defctx[i].id, defctx[i].name, acc, defctx);\n            }\n        }\n        return acc;\n    }\n    function unionEl(arr, el) {\n        if (arr.indexOf(el) === -1) {\n            var res = arr.slice(0);\n            res.push(el);\n            return res;\n        }\n        return arr;\n    }\n    var nextFresh = 0;\n    // fun () -> Num\n    function fresh() {\n        return nextFresh++;\n    }\n    // wraps the array of syntax objects in the delimiters given by the second argument\n    // ([...CSyntax], CSyntax) -> [...CSyntax]\n    function wrapDelim(towrap, delimSyntax) {\n        assert(delimSyntax.token.type === parser.Token.Delimiter, 'expecting a delimiter token');\n        return syntaxFromToken({\n            type: parser.Token.Delimiter,\n            value: delimSyntax.token.value,\n            inner: towrap,\n            range: delimSyntax.token.range,\n            startLineNumber: delimSyntax.token.startLineNumber,\n            lineStart: delimSyntax.token.lineStart\n        }, delimSyntax);\n    }\n    // (CSyntax) -> [...CSyntax]\n    function getParamIdentifiers(argSyntax) {\n        if (argSyntax.token.type === parser.Token.Delimiter) {\n            return _.filter(argSyntax.token.inner, function (stx) {\n                return stx.token.value !== ',';\n            });\n        } else if (argSyntax.token.type === parser.Token.Identifier) {\n            return [argSyntax];\n        } else {\n            assert(false, 'expecting a delimiter or a single identifier for function parameters');\n        }\n    }\n    function inherit(parent, child, methods) {\n        var P = function () {\n        };\n        P.prototype = parent.prototype;\n        child.prototype = new P();\n        child.prototype.constructor = child;\n        _.extend(child.prototype, methods);\n    }\n    // A TermTree is the core data structure for the macro expansion process.\n    // It acts as a semi-structured representation of the syntax.\n    function TermTree() {\n    }\n    TermTree.properties = [];\n    TermTree.create = function () {\n        return new TermTree();\n    };\n    TermTree.prototype = {\n        'isTermTree': true,\n        'destruct': function () {\n            var self = this;\n            return _.reduce(this.constructor.properties, function (acc, prop) {\n                if (self[prop] && self[prop].isTermTree) {\n                    push.apply(acc, self[prop].destruct());\n                    return acc;\n                } else if (self[prop] && self[prop].token && self[prop].token.inner) {\n                    var src = self[prop].token;\n                    var keys = Object.keys(src);\n                    var newtok = {};\n                    for (var i = 0, len = keys.length, key; i < len; i++) {\n                        key = keys[i];\n                        newtok[key] = src[key];\n                    }\n                    var clone = syntaxFromToken(newtok, self[prop]);\n                    clone.token.inner = _.reduce(clone.token.inner, function (acc$2, t) {\n                        if (t && t.isTermTree) {\n                            push.apply(acc$2, t.destruct());\n                            return acc$2;\n                        }\n                        acc$2.push(t);\n                        return acc$2;\n                    }, []);\n                    acc.push(clone);\n                    return acc;\n                } else if (Array.isArray(self[prop])) {\n                    var destArr = _.reduce(self[prop], function (acc$2, t) {\n                            if (t && t.isTermTree) {\n                                push.apply(acc$2, t.destruct());\n                                return acc$2;\n                            }\n                            acc$2.push(t);\n                            return acc$2;\n                        }, []);\n                    push.apply(acc, destArr);\n                    return acc;\n                } else if (self[prop]) {\n                    acc.push(self[prop]);\n                    return acc;\n                } else {\n                    return acc;\n                }\n            }, []);\n        },\n        'addDefCtx': function (def) {\n            var self = this;\n            _.each(this.constructor.properties, function (prop) {\n                if (Array.isArray(self[prop])) {\n                    self[prop] = _.map(self[prop], function (item) {\n                        return item.addDefCtx(def);\n                    });\n                } else if (self[prop]) {\n                    self[prop] = self[prop].addDefCtx(def);\n                }\n            });\n            return this;\n        },\n        'rename': function (id, name) {\n            var self = this;\n            _.each(this.constructor.properties, function (prop) {\n                if (Array.isArray(self[prop])) {\n                    self[prop] = _.map(self[prop], function (item) {\n                        return item.rename(id, name);\n                    });\n                } else if (self[prop]) {\n                    self[prop] = self[prop].rename(id, name);\n                }\n            });\n            return this;\n        }\n    };\n    function EOF(eof) {\n        this.eof = eof;\n    }\n    EOF.properties = ['eof'];\n    EOF.create = function (eof) {\n        return new EOF(eof);\n    };\n    inherit(TermTree, EOF, { 'isEOF': true });\n    function Keyword(keyword) {\n        this.keyword = keyword;\n    }\n    Keyword.properties = ['keyword'];\n    Keyword.create = function (keyword) {\n        return new Keyword(keyword);\n    };\n    inherit(TermTree, Keyword, { 'isKeyword': true });\n    function Punc(punc) {\n        this.punc = punc;\n    }\n    Punc.properties = ['punc'];\n    Punc.create = function (punc) {\n        return new Punc(punc);\n    };\n    inherit(TermTree, Punc, { 'isPunc': true });\n    function Delimiter(delim) {\n        this.delim = delim;\n    }\n    Delimiter.properties = ['delim'];\n    Delimiter.create = function (delim) {\n        return new Delimiter(delim);\n    };\n    inherit(TermTree, Delimiter, { 'isDelimiter': true });\n    function LetMacro(name, body) {\n        this.name = name;\n        this.body = body;\n    }\n    LetMacro.properties = [\n        'name',\n        'body'\n    ];\n    LetMacro.create = function (name, body) {\n        return new LetMacro(name, body);\n    };\n    inherit(TermTree, LetMacro, { 'isLetMacro': true });\n    function Macro(name, body) {\n        this.name = name;\n        this.body = body;\n    }\n    Macro.properties = [\n        'name',\n        'body'\n    ];\n    Macro.create = function (name, body) {\n        return new Macro(name, body);\n    };\n    inherit(TermTree, Macro, { 'isMacro': true });\n    function AnonMacro(body) {\n        this.body = body;\n    }\n    AnonMacro.properties = ['body'];\n    AnonMacro.create = function (body) {\n        return new AnonMacro(body);\n    };\n    inherit(TermTree, AnonMacro, { 'isAnonMacro': true });\n    function OperatorDefinition(type, name, prec, assoc, body) {\n        this.type = type;\n        this.name = name;\n        this.prec = prec;\n        this.assoc = assoc;\n        this.body = body;\n    }\n    OperatorDefinition.properties = [\n        'type',\n        'name',\n        'prec',\n        'assoc',\n        'body'\n    ];\n    OperatorDefinition.create = function (type, name, prec, assoc, body) {\n        return new OperatorDefinition(type, name, prec, assoc, body);\n    };\n    inherit(TermTree, OperatorDefinition, { 'isOperatorDefinition': true });\n    function Module(body, exports$3) {\n        this.body = body;\n        this.exports = exports$3;\n    }\n    Module.properties = [\n        'body',\n        'exports'\n    ];\n    Module.create = function (body, exports$3) {\n        return new Module(body, exports$3);\n    };\n    inherit(TermTree, Module, { 'isModule': true });\n    function Export(name) {\n        this.name = name;\n    }\n    Export.properties = ['name'];\n    Export.create = function (name) {\n        return new Export(name);\n    };\n    inherit(TermTree, Export, { 'isExport': true });\n    function VariableDeclaration(ident, eq, init, comma) {\n        this.ident = ident;\n        this.eq = eq;\n        this.init = init;\n        this.comma = comma;\n    }\n    VariableDeclaration.properties = [\n        'ident',\n        'eq',\n        'init',\n        'comma'\n    ];\n    VariableDeclaration.create = function (ident, eq, init, comma) {\n        return new VariableDeclaration(ident, eq, init, comma);\n    };\n    inherit(TermTree, VariableDeclaration, { 'isVariableDeclaration': true });\n    function Statement() {\n    }\n    Statement.properties = [];\n    Statement.create = function () {\n        return new Statement();\n    };\n    inherit(TermTree, Statement, { 'isStatement': true });\n    function Empty() {\n    }\n    Empty.properties = [];\n    Empty.create = function () {\n        return new Empty();\n    };\n    inherit(Statement, Empty, { 'isEmpty': true });\n    function CatchClause(keyword, params, body) {\n        this.keyword = keyword;\n        this.params = params;\n        this.body = body;\n    }\n    CatchClause.properties = [\n        'keyword',\n        'params',\n        'body'\n    ];\n    CatchClause.create = function (keyword, params, body) {\n        return new CatchClause(keyword, params, body);\n    };\n    inherit(Statement, CatchClause, { 'isCatchClause': true });\n    function ForStatement(keyword, cond) {\n        this.keyword = keyword;\n        this.cond = cond;\n    }\n    ForStatement.properties = [\n        'keyword',\n        'cond'\n    ];\n    ForStatement.create = function (keyword, cond) {\n        return new ForStatement(keyword, cond);\n    };\n    inherit(Statement, ForStatement, { 'isForStatement': true });\n    function ReturnStatement(keyword, expr) {\n        this.keyword = keyword;\n        this.expr = expr;\n    }\n    ReturnStatement.properties = [\n        'keyword',\n        'expr'\n    ];\n    ReturnStatement.create = function (keyword, expr) {\n        return new ReturnStatement(keyword, expr);\n    };\n    inherit(Statement, ReturnStatement, {\n        'isReturnStatement': true,\n        'destruct': function () {\n            var expr = this.expr.destruct();\n            // need to adjust the line numbers to make sure that the expr\n            // starts on the same line as the return keyword. This might\n            // not be the case if an operator or infix macro perturbed the\n            // line numbers during expansion.\n            expr = adjustLineContext(expr, this.keyword.keyword);\n            return this.keyword.destruct().concat(expr);\n        }\n    });\n    function Expr() {\n    }\n    Expr.properties = [];\n    Expr.create = function () {\n        return new Expr();\n    };\n    inherit(Statement, Expr, { 'isExpr': true });\n    function UnaryOp(op, expr) {\n        this.op = op;\n        this.expr = expr;\n    }\n    UnaryOp.properties = [\n        'op',\n        'expr'\n    ];\n    UnaryOp.create = function (op, expr) {\n        return new UnaryOp(op, expr);\n    };\n    inherit(Expr, UnaryOp, { 'isUnaryOp': true });\n    function PostfixOp(expr, op) {\n        this.expr = expr;\n        this.op = op;\n    }\n    PostfixOp.properties = [\n        'expr',\n        'op'\n    ];\n    PostfixOp.create = function (expr, op) {\n        return new PostfixOp(expr, op);\n    };\n    inherit(Expr, PostfixOp, { 'isPostfixOp': true });\n    function BinOp(left, op, right) {\n        this.left = left;\n        this.op = op;\n        this.right = right;\n    }\n    BinOp.properties = [\n        'left',\n        'op',\n        'right'\n    ];\n    BinOp.create = function (left, op, right) {\n        return new BinOp(left, op, right);\n    };\n    inherit(Expr, BinOp, { 'isBinOp': true });\n    function AssignmentExpression(left, op, right) {\n        this.left = left;\n        this.op = op;\n        this.right = right;\n    }\n    AssignmentExpression.properties = [\n        'left',\n        'op',\n        'right'\n    ];\n    AssignmentExpression.create = function (left, op, right) {\n        return new AssignmentExpression(left, op, right);\n    };\n    inherit(Expr, AssignmentExpression, { 'isAssignmentExpression': true });\n    function ConditionalExpression(cond, question, tru, colon, fls) {\n        this.cond = cond;\n        this.question = question;\n        this.tru = tru;\n        this.colon = colon;\n        this.fls = fls;\n    }\n    ConditionalExpression.properties = [\n        'cond',\n        'question',\n        'tru',\n        'colon',\n        'fls'\n    ];\n    ConditionalExpression.create = function (cond, question, tru, colon, fls) {\n        return new ConditionalExpression(cond, question, tru, colon, fls);\n    };\n    inherit(Expr, ConditionalExpression, { 'isConditionalExpression': true });\n    function NamedFun(keyword, star, name, params, body) {\n        this.keyword = keyword;\n        this.star = star;\n        this.name = name;\n        this.params = params;\n        this.body = body;\n    }\n    NamedFun.properties = [\n        'keyword',\n        'star',\n        'name',\n        'params',\n        'body'\n    ];\n    NamedFun.create = function (keyword, star, name, params, body) {\n        return new NamedFun(keyword, star, name, params, body);\n    };\n    inherit(Expr, NamedFun, { 'isNamedFun': true });\n    function AnonFun(keyword, star, params, body) {\n        this.keyword = keyword;\n        this.star = star;\n        this.params = params;\n        this.body = body;\n    }\n    AnonFun.properties = [\n        'keyword',\n        'star',\n        'params',\n        'body'\n    ];\n    AnonFun.create = function (keyword, star, params, body) {\n        return new AnonFun(keyword, star, params, body);\n    };\n    inherit(Expr, AnonFun, { 'isAnonFun': true });\n    function ArrowFun(params, arrow, body) {\n        this.params = params;\n        this.arrow = arrow;\n        this.body = body;\n    }\n    ArrowFun.properties = [\n        'params',\n        'arrow',\n        'body'\n    ];\n    ArrowFun.create = function (params, arrow, body) {\n        return new ArrowFun(params, arrow, body);\n    };\n    inherit(Expr, ArrowFun, { 'isArrowFun': true });\n    function ObjDotGet(left, dot, right) {\n        this.left = left;\n        this.dot = dot;\n        this.right = right;\n    }\n    ObjDotGet.properties = [\n        'left',\n        'dot',\n        'right'\n    ];\n    ObjDotGet.create = function (left, dot, right) {\n        return new ObjDotGet(left, dot, right);\n    };\n    inherit(Expr, ObjDotGet, { 'isObjDotGet': true });\n    function ObjGet(left, right) {\n        this.left = left;\n        this.right = right;\n    }\n    ObjGet.properties = [\n        'left',\n        'right'\n    ];\n    ObjGet.create = function (left, right) {\n        return new ObjGet(left, right);\n    };\n    inherit(Expr, ObjGet, { 'isObjGet': true });\n    function Template(template) {\n        this.template = template;\n    }\n    Template.properties = ['template'];\n    Template.create = function (template) {\n        return new Template(template);\n    };\n    inherit(Expr, Template, { 'isTemplate': true });\n    function Call(fun, args) {\n        this.fun = fun;\n        this.args = args;\n    }\n    Call.properties = [\n        'fun',\n        'args'\n    ];\n    Call.create = function (fun, args) {\n        return new Call(fun, args);\n    };\n    inherit(Expr, Call, { 'isCall': true });\n    function PrimaryExpression() {\n    }\n    PrimaryExpression.properties = [];\n    PrimaryExpression.create = function () {\n        return new PrimaryExpression();\n    };\n    inherit(Expr, PrimaryExpression, { 'isPrimaryExpression': true });\n    function ThisExpression(keyword) {\n        this.keyword = keyword;\n    }\n    ThisExpression.properties = ['keyword'];\n    ThisExpression.create = function (keyword) {\n        return new ThisExpression(keyword);\n    };\n    inherit(PrimaryExpression, ThisExpression, { 'isThisExpression': true });\n    function Lit(lit) {\n        this.lit = lit;\n    }\n    Lit.properties = ['lit'];\n    Lit.create = function (lit) {\n        return new Lit(lit);\n    };\n    inherit(PrimaryExpression, Lit, { 'isLit': true });\n    function Block(body) {\n        this.body = body;\n    }\n    Block.properties = ['body'];\n    Block.create = function (body) {\n        return new Block(body);\n    };\n    inherit(PrimaryExpression, Block, { 'isBlock': true });\n    function ArrayLiteral(array) {\n        this.array = array;\n    }\n    ArrayLiteral.properties = ['array'];\n    ArrayLiteral.create = function (array) {\n        return new ArrayLiteral(array);\n    };\n    inherit(PrimaryExpression, ArrayLiteral, { 'isArrayLiteral': true });\n    function Id(id) {\n        this.id = id;\n    }\n    Id.properties = ['id'];\n    Id.create = function (id) {\n        return new Id(id);\n    };\n    inherit(PrimaryExpression, Id, { 'isId': true });\n    function Partial() {\n    }\n    Partial.properties = [];\n    Partial.create = function () {\n        return new Partial();\n    };\n    inherit(TermTree, Partial, { 'isPartial': true });\n    function PartialOperation(stx, left) {\n        this.stx = stx;\n        this.left = left;\n    }\n    PartialOperation.properties = [\n        'stx',\n        'left'\n    ];\n    PartialOperation.create = function (stx, left) {\n        return new PartialOperation(stx, left);\n    };\n    inherit(Partial, PartialOperation, { 'isPartialOperation': true });\n    function PartialExpression(stx, left, combine) {\n        this.stx = stx;\n        this.left = left;\n        this.combine = combine;\n    }\n    PartialExpression.properties = [\n        'stx',\n        'left',\n        'combine'\n    ];\n    PartialExpression.create = function (stx, left, combine) {\n        return new PartialExpression(stx, left, combine);\n    };\n    inherit(Partial, PartialExpression, { 'isPartialExpression': true });\n    function BindingStatement(keyword, decls) {\n        this.keyword = keyword;\n        this.decls = decls;\n    }\n    BindingStatement.properties = [\n        'keyword',\n        'decls'\n    ];\n    BindingStatement.create = function (keyword, decls) {\n        return new BindingStatement(keyword, decls);\n    };\n    inherit(Statement, BindingStatement, {\n        'isBindingStatement': true,\n        'destruct': function () {\n            return this.keyword.destruct().concat(_.reduce(this.decls, function (acc, decl) {\n                push.apply(acc, decl.destruct());\n                return acc;\n            }, []));\n        }\n    });\n    function VariableStatement(keyword, decls) {\n        this.keyword = keyword;\n        this.decls = decls;\n    }\n    VariableStatement.properties = [\n        'keyword',\n        'decls'\n    ];\n    VariableStatement.create = function (keyword, decls) {\n        return new VariableStatement(keyword, decls);\n    };\n    inherit(BindingStatement, VariableStatement, { 'isVariableStatement': true });\n    function LetStatement(keyword, decls) {\n        this.keyword = keyword;\n        this.decls = decls;\n    }\n    LetStatement.properties = [\n        'keyword',\n        'decls'\n    ];\n    LetStatement.create = function (keyword, decls) {\n        return new LetStatement(keyword, decls);\n    };\n    inherit(BindingStatement, LetStatement, { 'isLetStatement': true });\n    function ConstStatement(keyword, decls) {\n        this.keyword = keyword;\n        this.decls = decls;\n    }\n    ConstStatement.properties = [\n        'keyword',\n        'decls'\n    ];\n    ConstStatement.create = function (keyword, decls) {\n        return new ConstStatement(keyword, decls);\n    };\n    inherit(BindingStatement, ConstStatement, { 'isConstStatement': true });\n    function ParenExpression(args, delim, commas) {\n        this.args = args;\n        this.delim = delim;\n        this.commas = commas;\n    }\n    ParenExpression.properties = [\n        'args',\n        'delim',\n        'commas'\n    ];\n    ParenExpression.create = function (args, delim, commas) {\n        return new ParenExpression(args, delim, commas);\n    };\n    inherit(PrimaryExpression, ParenExpression, {\n        'isParenExpression': true,\n        'destruct': function () {\n            var commas = this.commas.slice();\n            var src = this.delim.token;\n            var keys = Object.keys(src);\n            var newtok = {};\n            for (var i = 0, len = keys.length, key; i < len; i++) {\n                key = keys[i];\n                newtok[key] = src[key];\n            }\n            var delim = syntaxFromToken(newtok, this.delim);\n            delim.token.inner = _.reduce(this.args, function (acc, term) {\n                assert(term && term.isTermTree, 'expecting term trees in destruct of ParenExpression');\n                push.apply(acc, term.destruct());\n                // add all commas except for the last one\n                if (commas.length > 0) {\n                    acc.push(commas.shift());\n                }\n                return acc;\n            }, []);\n            return Delimiter.create(delim).destruct();\n        }\n    });\n    function stxIsUnaryOp(stx) {\n        var staticOperators = [\n                '+',\n                '-',\n                '~',\n                '!',\n                'delete',\n                'void',\n                'typeof',\n                'yield',\n                'new',\n                '++',\n                '--'\n            ];\n        return _.contains(staticOperators, unwrapSyntax(stx));\n    }\n    function stxIsBinOp(stx) {\n        var staticOperators = [\n                '+',\n                '-',\n                '*',\n                '/',\n                '%',\n                '||',\n                '&&',\n                '|',\n                '&',\n                '^',\n                '==',\n                '!=',\n                '===',\n                '!==',\n                '<',\n                '>',\n                '<=',\n                '>=',\n                'in',\n                'instanceof',\n                '<<',\n                '>>',\n                '>>>'\n            ];\n        return _.contains(staticOperators, unwrapSyntax(stx));\n    }\n    function getUnaryOpPrec(op) {\n        var operatorPrecedence = {\n                'new': 16,\n                '++': 15,\n                '--': 15,\n                '!': 14,\n                '~': 14,\n                '+': 14,\n                '-': 14,\n                'typeof': 14,\n                'void': 14,\n                'delete': 14,\n                'yield': 2\n            };\n        return operatorPrecedence[op];\n    }\n    function getBinaryOpPrec(op) {\n        var operatorPrecedence = {\n                '*': 13,\n                '/': 13,\n                '%': 13,\n                '+': 12,\n                '-': 12,\n                '>>': 11,\n                '<<': 11,\n                '>>>': 11,\n                '<': 10,\n                '<=': 10,\n                '>': 10,\n                '>=': 10,\n                'in': 10,\n                'instanceof': 10,\n                '==': 9,\n                '!=': 9,\n                '===': 9,\n                '!==': 9,\n                '&': 8,\n                '^': 7,\n                '|': 6,\n                '&&': 5,\n                '||': 4\n            };\n        return operatorPrecedence[op];\n    }\n    function getBinaryOpAssoc(op) {\n        var operatorAssoc = {\n                '*': 'left',\n                '/': 'left',\n                '%': 'left',\n                '+': 'left',\n                '-': 'left',\n                '>>': 'left',\n                '<<': 'left',\n                '>>>': 'left',\n                '<': 'left',\n                '<=': 'left',\n                '>': 'left',\n                '>=': 'left',\n                'in': 'left',\n                'instanceof': 'left',\n                '==': 'left',\n                '!=': 'left',\n                '===': 'left',\n                '!==': 'left',\n                '&': 'left',\n                '^': 'left',\n                '|': 'left',\n                '&&': 'left',\n                '||': 'left'\n            };\n        return operatorAssoc[op];\n    }\n    function stxIsAssignOp(stx) {\n        var staticOperators = [\n                '=',\n                '+=',\n                '-=',\n                '*=',\n                '/=',\n                '%=',\n                '<<=',\n                '>>=',\n                '>>>=',\n                '|=',\n                '^=',\n                '&='\n            ];\n        return _.contains(staticOperators, unwrapSyntax(stx));\n    }\n    function enforestVarStatement(stx, context, varStx) {\n        var decls = [];\n        var rest = stx;\n        var rhs;\n        if (!rest.length) {\n            throwSyntaxError('enforest', 'Unexpected end of input', varStx);\n        }\n        if (expandCount >= maxExpands) {\n            return null;\n        }\n        while (rest.length) {\n            if (rest[0].token.type === parser.Token.Identifier) {\n                if (rest[1] && rest[1].token.type === parser.Token.Punctuator && rest[1].token.value === '=') {\n                    rhs = get_expression(rest.slice(2), context);\n                    if (rhs.result == null) {\n                        throwSyntaxError('enforest', 'Unexpected token', rhs.rest[0]);\n                    }\n                    if (rhs.rest[0] && rhs.rest[0].token.type === parser.Token.Punctuator && rhs.rest[0].token.value === ',') {\n                        decls.push(VariableDeclaration.create(rest[0], rest[1], rhs.result, rhs.rest[0]));\n                        rest = rhs.rest.slice(1);\n                        continue;\n                    } else {\n                        decls.push(VariableDeclaration.create(rest[0], rest[1], rhs.result, null));\n                        rest = rhs.rest;\n                        break;\n                    }\n                } else if (rest[1] && rest[1].token.type === parser.Token.Punctuator && rest[1].token.value === ',') {\n                    decls.push(VariableDeclaration.create(rest[0], null, null, rest[1]));\n                    rest = rest.slice(2);\n                } else {\n                    decls.push(VariableDeclaration.create(rest[0], null, null, null));\n                    rest = rest.slice(1);\n                    break;\n                }\n            } else {\n                throwSyntaxError('enforest', 'Unexpected token', rest[0]);\n            }\n        }\n        return {\n            result: decls,\n            rest: rest\n        };\n    }\n    function enforestAssignment(stx, context, left, prevStx, prevTerms) {\n        var op = stx[0];\n        var rightStx = stx.slice(1);\n        var opTerm = Punc.create(stx[0]);\n        var opPrevStx = tagWithTerm(opTerm, [stx[0]]).concat(tagWithTerm(left, left.destruct().reverse()), prevStx);\n        var opPrevTerms = [\n                opTerm,\n                left\n            ].concat(prevTerms);\n        var opRes = enforest(rightStx, context, opPrevStx, opPrevTerms);\n        if (opRes.result) {\n            // Lookbehind was matched, so it may not even be a binop anymore.\n            if (opRes.prevTerms.length < opPrevTerms.length) {\n                return opRes;\n            }\n            var right = opRes.result;\n            // only a binop if the right is a real expression\n            // so 2+2++ will only match 2+2\n            if (right.isExpr) {\n                var term = AssignmentExpression.create(left, op, right);\n                return {\n                    result: term,\n                    rest: opRes.rest,\n                    prevStx: prevStx,\n                    prevTerms: prevTerms\n                };\n            }\n        } else {\n            return opRes;\n        }\n    }\n    function enforestParenExpression(parens, context) {\n        var argRes, enforestedArgs = [], commas = [];\n        var innerTokens = parens.expose().token.inner;\n        while (innerTokens.length > 0) {\n            argRes = enforest(innerTokens, context);\n            if (!argRes.result || !argRes.result.isExpr) {\n                return null;\n            }\n            enforestedArgs.push(argRes.result);\n            innerTokens = argRes.rest;\n            if (innerTokens[0] && innerTokens[0].token.value === ',') {\n                // record the comma for later\n                commas.push(innerTokens[0]);\n                // but dump it for the next loop turn\n                innerTokens = innerTokens.slice(1);\n            } else {\n                // either there are no more tokens or\n                // they aren't a comma, either way we\n                // are done with the loop\n                break;\n            }\n        }\n        return innerTokens.length ? null : ParenExpression.create(enforestedArgs, parens, commas);\n    }\n    function adjustLineContext(stx, original, current) {\n        current = current || {\n            lastLineNumber: stx[0].token.lineNumber || stx[0].token.startLineNumber,\n            lineNumber: original.token.lineNumber\n        };\n        return _.map(stx, function (stx$2) {\n            if (stx$2.token.type === parser.Token.Delimiter) {\n                // handle tokens with missing line info\n                stx$2.token.startLineNumber = typeof stx$2.token.startLineNumber == 'undefined' ? original.token.lineNumber : stx$2.token.startLineNumber;\n                stx$2.token.endLineNumber = typeof stx$2.token.endLineNumber == 'undefined' ? original.token.lineNumber : stx$2.token.endLineNumber;\n                stx$2.token.startLineStart = typeof stx$2.token.startLineStart == 'undefined' ? original.token.lineStart : stx$2.token.startLineStart;\n                stx$2.token.endLineStart = typeof stx$2.token.endLineStart == 'undefined' ? original.token.lineStart : stx$2.token.endLineStart;\n                stx$2.token.startRange = typeof stx$2.token.startRange == 'undefined' ? original.token.range : stx$2.token.startRange;\n                stx$2.token.endRange = typeof stx$2.token.endRange == 'undefined' ? original.token.range : stx$2.token.endRange;\n                stx$2.token.sm_startLineNumber = typeof stx$2.token.sm_startLineNumber == 'undefined' ? stx$2.token.startLineNumber : stx$2.token.sm_startLineNumber;\n                stx$2.token.sm_endLineNumber = typeof stx$2.token.sm_endLineNumber == 'undefined' ? stx$2.token.endLineNumber : stx$2.token.sm_endLineNumber;\n                stx$2.token.sm_startLineStart = typeof stx$2.token.sm_startLineStart == 'undefined' ? stx$2.token.startLineStart : stx$2.token.sm_startLineStart;\n                stx$2.token.sm_endLineStart = typeof stx$2.token.sm_endLineStart == 'undefined' ? stx$2.token.endLineStart : stx$2.token.sm_endLineStart;\n                stx$2.token.sm_startRange = typeof stx$2.token.sm_startRange == 'undefined' ? stx$2.token.startRange : stx$2.token.sm_startRange;\n                stx$2.token.sm_endRange = typeof stx$2.token.sm_endRange == 'undefined' ? stx$2.token.endRange : stx$2.token.sm_endRange;\n                if (stx$2.token.startLineNumber !== current.lineNumber) {\n                    if (stx$2.token.startLineNumber !== current.lastLineNumber) {\n                        current.lineNumber++;\n                        current.lastLineNumber = stx$2.token.startLineNumber;\n                        stx$2.token.startLineNumber = current.lineNumber;\n                    } else {\n                        current.lastLineNumber = stx$2.token.startLineNumber;\n                        stx$2.token.startLineNumber = current.lineNumber;\n                    }\n                }\n                if (stx$2.token.inner.length > 0) {\n                    stx$2.token.inner = adjustLineContext(stx$2.token.inner, original, current);\n                }\n                return stx$2;\n            }\n            // handle tokens with missing line info\n            stx$2.token.lineNumber = typeof stx$2.token.lineNumber == 'undefined' ? original.token.lineNumber : stx$2.token.lineNumber;\n            stx$2.token.lineStart = typeof stx$2.token.lineStart == 'undefined' ? original.token.lineStart : stx$2.token.lineStart;\n            stx$2.token.range = typeof stx$2.token.range == 'undefined' ? original.token.range : stx$2.token.range;\n            // Only set the sourcemap line info once. Necessary because a single\n            // syntax object can go through expansion multiple times. If at some point\n            // we want to write an expansion stepper this might be a good place to store\n            // intermediate expansion line info (ie push to a stack instead of\n            // just write once).\n            stx$2.token.sm_lineNumber = typeof stx$2.token.sm_lineNumber == 'undefined' ? stx$2.token.lineNumber : stx$2.token.sm_lineNumber;\n            stx$2.token.sm_lineStart = typeof stx$2.token.sm_lineStart == 'undefined' ? stx$2.token.lineStart : stx$2.token.sm_lineStart;\n            stx$2.token.sm_range = typeof stx$2.token.sm_range == 'undefined' ? stx$2.token.range.slice() : stx$2.token.sm_range;\n            // move the line info to line up with the macro name\n            // (line info starting from the macro name)\n            if (stx$2.token.lineNumber !== current.lineNumber) {\n                if (stx$2.token.lineNumber !== current.lastLineNumber) {\n                    current.lineNumber++;\n                    current.lastLineNumber = stx$2.token.lineNumber;\n                    stx$2.token.lineNumber = current.lineNumber;\n                } else {\n                    current.lastLineNumber = stx$2.token.lineNumber;\n                    stx$2.token.lineNumber = current.lineNumber;\n                }\n            }\n            return stx$2;\n        });\n    }\n    function getName(head, rest) {\n        var idx = 0;\n        var curr = head;\n        var next = rest[idx];\n        var name = [head];\n        while (true) {\n            if (next && (next.token.type === parser.Token.Punctuator || next.token.type === parser.Token.Identifier || next.token.type === parser.Token.Keyword) && (curr.token.sm_range && next.token.sm_range && curr.token.sm_range[1] === next.token.sm_range[0] || curr.token.range[1] === next.token.range[0])) {\n                name.push(next);\n                curr = next;\n                next = rest[++idx];\n            } else {\n                return name;\n            }\n        }\n    }\n    function getMacroInEnv(head, rest, env) {\n        if (!(head.token.type === parser.Token.Identifier || head.token.type === parser.Token.Keyword || head.token.type === parser.Token.Punctuator)) {\n            return null;\n        }\n        var name = getName(head, rest);\n        // simple case, don't need to create a new syntax object\n        if (name.length === 1) {\n            if (env.names.get(unwrapSyntax(name[0]))) {\n                var resolvedName = resolve(name[0]);\n                if (env.has(resolvedName)) {\n                    return env.get(resolvedName);\n                }\n            }\n            return null;\n        } else {\n            while (name.length > 0) {\n                var nameStr = name.map(unwrapSyntax).join('');\n                if (env.names.get(nameStr)) {\n                    var nameStx = syn.makeIdent(nameStr, name[0]);\n                    var resolvedName = resolve(nameStx);\n                    if (env.has(resolvedName)) {\n                        return env.get(resolvedName);\n                    }\n                }\n                name.pop();\n            }\n            return null;\n        }\n    }\n    function nameInEnv(head, rest, env) {\n        return getMacroInEnv(head, rest, env) !== null;\n    }\n    // This should only be used on things that can't be rebound except by\n    // macros (puncs, keywords).\n    function resolveFast(stx, env) {\n        var name = unwrapSyntax(stx);\n        return env.names.get(name) ? resolve(stx) : name;\n    }\n    function expandMacro(stx, context, opCtx, opType, macroObj) {\n        // pull the macro transformer out the environment\n        var head = stx[0];\n        var rest = stx.slice(1);\n        macroObj = macroObj || getMacroInEnv(head, rest, context.env);\n        var stxArg = rest.slice(macroObj.fullName.length - 1);\n        var transformer;\n        if (opType != null) {\n            assert(opType === 'binary' || opType === 'unary', 'operator type should be either unary or binary: ' + opType);\n            transformer = macroObj[opType].fn;\n        } else {\n            transformer = macroObj.fn;\n        }\n        assert(typeof transformer === 'function', 'Macro transformer not bound for: ' + head.token.value);\n        // create a new mark to be used for the input to\n        // the macro\n        var newMark = fresh();\n        var transformerContext = makeExpanderContext(_.defaults({ mark: newMark }, context));\n        // apply the transformer\n        var rt;\n        try {\n            rt = transformer([head].concat(stxArg), transformerContext, opCtx.prevStx, opCtx.prevTerms);\n        } catch (e) {\n            if (e instanceof SyntaxCaseError) {\n                // add a nicer error for syntax case\n                var nameStr = macroObj.fullName.map(function (stx$2) {\n                        return stx$2.token.value;\n                    }).join('');\n                if (opType != null) {\n                    var argumentString = '`' + stxArg.slice(0, 5).map(function (stx$2) {\n                            return stx$2.token.value;\n                        }).join(' ') + '...`';\n                    throwSyntaxError('operator', 'Operator `' + nameStr + '` could not be matched with ' + argumentString, head);\n                } else {\n                    var argumentString = '`' + stxArg.slice(0, 5).map(function (stx$2) {\n                            return stx$2.token.value;\n                        }).join(' ') + '...`';\n                    throwSyntaxError('macro', 'Macro `' + nameStr + '` could not be matched with ' + argumentString, head);\n                }\n            } else {\n                // just rethrow it\n                throw e;\n            }\n        }\n        if (!builtinMode && !macroObj.builtin) {\n            expandCount++;\n        }\n        if (!Array.isArray(rt.result)) {\n            throwSyntaxError('enforest', 'Macro must return a syntax array', stx[0]);\n        }\n        if (rt.result.length > 0) {\n            var adjustedResult = adjustLineContext(rt.result, head);\n            if (stx[0].token.leadingComments) {\n                if (adjustedResult[0].token.leadingComments) {\n                    adjustedResult[0].token.leadingComments = adjustedResult[0].token.leadingComments.concat(head.token.leadingComments);\n                } else {\n                    adjustedResult[0].token.leadingComments = head.token.leadingComments;\n                }\n            }\n            rt.result = adjustedResult;\n        }\n        return rt;\n    }\n    function comparePrec(left, right, assoc) {\n        if (assoc === 'left') {\n            return left <= right;\n        }\n        return left < right;\n    }\n    // enforest the tokens, returns an object with the `result` TermTree and\n    // the uninterpreted `rest` of the syntax\n    function enforest(toks, context, prevStx, prevTerms) {\n        assert(toks.length > 0, 'enforest assumes there are tokens to work with');\n        prevStx = prevStx || [];\n        prevTerms = prevTerms || [];\n        if (expandCount >= maxExpands) {\n            return {\n                result: null,\n                rest: toks\n            };\n        }\n        function step(head, rest, opCtx) {\n            var innerTokens;\n            assert(Array.isArray(rest), 'result must at least be an empty array');\n            if (head.isTermTree) {\n                var isCustomOp = false;\n                var uopMacroObj;\n                var uopSyntax;\n                if (head.isPunc || head.isKeyword || head.isId) {\n                    if (head.isPunc) {\n                        uopSyntax = head.punc;\n                    } else if (head.isKeyword) {\n                        uopSyntax = head.keyword;\n                    } else if (head.isId) {\n                        uopSyntax = head.id;\n                    }\n                    uopMacroObj = getMacroInEnv(uopSyntax, rest, context.env);\n                    isCustomOp = uopMacroObj && uopMacroObj.isOp;\n                }\n                // look up once (we want to check multiple properties on bopMacroObj\n                // without repeatedly calling getMacroInEnv)\n                var bopMacroObj;\n                if (rest[0] && rest[1]) {\n                    bopMacroObj = getMacroInEnv(rest[0], rest.slice(1), context.env);\n                }\n                // unary operator\n                if (isCustomOp && uopMacroObj.unary || uopSyntax && stxIsUnaryOp(uopSyntax)) {\n                    var uopPrec;\n                    if (isCustomOp && uopMacroObj.unary) {\n                        uopPrec = uopMacroObj.unary.prec;\n                    } else {\n                        uopPrec = getUnaryOpPrec(unwrapSyntax(uopSyntax));\n                    }\n                    var opRest = rest;\n                    var uopMacroName;\n                    if (uopMacroObj) {\n                        uopMacroName = [uopSyntax].concat(rest.slice(0, uopMacroObj.fullName.length - 1));\n                        opRest = rest.slice(uopMacroObj.fullName.length - 1);\n                    }\n                    var leftLeft = opCtx.prevTerms[0] && opCtx.prevTerms[0].isPartial ? opCtx.prevTerms[0] : null;\n                    var unopTerm = PartialOperation.create(head, leftLeft);\n                    var unopPrevStx = tagWithTerm(unopTerm, head.destruct().reverse()).concat(opCtx.prevStx);\n                    var unopPrevTerms = [unopTerm].concat(opCtx.prevTerms);\n                    var unopOpCtx = _.extend({}, opCtx, {\n                            combine: function (t) {\n                                if (t.isExpr) {\n                                    if (isCustomOp && uopMacroObj.unary) {\n                                        var rt$2 = expandMacro(uopMacroName.concat(t.destruct()), context, opCtx, 'unary');\n                                        var newt = get_expression(rt$2.result, context);\n                                        assert(newt.rest.length === 0, 'should never have left over syntax');\n                                        return opCtx.combine(newt.result);\n                                    }\n                                    return opCtx.combine(UnaryOp.create(uopSyntax, t));\n                                } else {\n                                    // not actually an expression so don't create\n                                    // a UnaryOp term just return with the punctuator\n                                    return opCtx.combine(head);\n                                }\n                            },\n                            prec: uopPrec,\n                            prevStx: unopPrevStx,\n                            prevTerms: unopPrevTerms,\n                            op: unopTerm\n                        });\n                    return step(opRest[0], opRest.slice(1), unopOpCtx);\n                }    // BinOp\n                else if (head.isExpr && (rest[0] && rest[1] && (stxIsBinOp(rest[0]) && !bopMacroObj || bopMacroObj && bopMacroObj.isOp && bopMacroObj.binary))) {\n                    var opRes;\n                    var op = rest[0];\n                    var left = head;\n                    var rightStx = rest.slice(1);\n                    var leftLeft = opCtx.prevTerms[0] && opCtx.prevTerms[0].isPartial ? opCtx.prevTerms[0] : null;\n                    var leftTerm = PartialExpression.create(head.destruct(), leftLeft, function () {\n                            return step(head, [], opCtx);\n                        });\n                    var opTerm = PartialOperation.create(op, leftTerm);\n                    var opPrevStx = tagWithTerm(opTerm, [rest[0]]).concat(tagWithTerm(leftTerm, head.destruct()).reverse(), opCtx.prevStx);\n                    var opPrevTerms = [\n                            opTerm,\n                            leftTerm\n                        ].concat(opCtx.prevTerms);\n                    var isCustomOp = bopMacroObj && bopMacroObj.isOp && bopMacroObj.binary;\n                    var bopPrec;\n                    var bopAssoc;\n                    if (isCustomOp && bopMacroObj.binary) {\n                        bopPrec = bopMacroObj.binary.prec;\n                        bopAssoc = bopMacroObj.binary.assoc;\n                    } else {\n                        bopPrec = getBinaryOpPrec(unwrapSyntax(op));\n                        bopAssoc = getBinaryOpAssoc(unwrapSyntax(op));\n                    }\n                    assert(bopPrec !== undefined, 'expecting a precedence for operator: ' + op);\n                    var newStack;\n                    if (comparePrec(bopPrec, opCtx.prec, bopAssoc)) {\n                        var bopCtx = opCtx;\n                        var combResult = opCtx.combine(head);\n                        if (opCtx.stack.length > 0) {\n                            return step(combResult.term, rest, opCtx.stack[0]);\n                        }\n                        left = combResult.term;\n                        newStack = opCtx.stack;\n                        opPrevStx = combResult.prevStx;\n                        opPrevTerms = combResult.prevTerms;\n                    } else {\n                        newStack = [opCtx].concat(opCtx.stack);\n                    }\n                    assert(opCtx.combine !== undefined, 'expecting a combine function');\n                    var opRightStx = rightStx;\n                    var bopMacroName;\n                    if (isCustomOp) {\n                        bopMacroName = rest.slice(0, bopMacroObj.fullName.length);\n                        opRightStx = rightStx.slice(bopMacroObj.fullName.length - 1);\n                    }\n                    var bopOpCtx = _.extend({}, opCtx, {\n                            combine: function (right) {\n                                if (right.isExpr) {\n                                    if (isCustomOp && bopMacroObj.binary) {\n                                        var leftStx = left.destruct();\n                                        var rightStx$2 = right.destruct();\n                                        var rt$2 = expandMacro(bopMacroName.concat(syn.makeDelim('()', leftStx, leftStx[0]), syn.makeDelim('()', rightStx$2, rightStx$2[0])), context, opCtx, 'binary');\n                                        var newt = get_expression(rt$2.result, context);\n                                        assert(newt.rest.length === 0, 'should never have left over syntax');\n                                        return {\n                                            term: newt.result,\n                                            prevStx: opPrevStx,\n                                            prevTerms: opPrevTerms\n                                        };\n                                    }\n                                    return {\n                                        term: BinOp.create(left, op, right),\n                                        prevStx: opPrevStx,\n                                        prevTerms: opPrevTerms\n                                    };\n                                } else {\n                                    return {\n                                        term: head,\n                                        prevStx: opPrevStx,\n                                        prevTerms: opPrevTerms\n                                    };\n                                }\n                            },\n                            prec: bopPrec,\n                            op: opTerm,\n                            stack: newStack,\n                            prevStx: opPrevStx,\n                            prevTerms: opPrevTerms\n                        });\n                    return step(opRightStx[0], opRightStx.slice(1), bopOpCtx);\n                }    // Call\n                else if (head.isExpr && (rest[0] && rest[0].token.type === parser.Token.Delimiter && rest[0].token.value === '()')) {\n                    var parenRes = enforestParenExpression(rest[0], context);\n                    if (parenRes) {\n                        return step(Call.create(head, parenRes), rest.slice(1), opCtx);\n                    }\n                }    // Conditional ( x ? true : false)\n                else if (head.isExpr && (rest[0] && resolveFast(rest[0], context.env) === '?')) {\n                    var question = rest[0];\n                    var condRes = enforest(rest.slice(1), context);\n                    if (condRes.result) {\n                        var truExpr = condRes.result;\n                        var condRight = condRes.rest;\n                        if (truExpr.isExpr && condRight[0] && resolveFast(condRight[0], context.env) === ':') {\n                            var colon = condRight[0];\n                            var flsRes = enforest(condRight.slice(1), context);\n                            var flsExpr = flsRes.result;\n                            if (flsExpr.isExpr) {\n                                // operators are combined before the ternary\n                                if (opCtx.prec >= 4) {\n                                    // ternary is like a operator with prec 4\n                                    var headResult = opCtx.combine(head);\n                                    var condTerm = ConditionalExpression.create(headResult.term, question, truExpr, colon, flsExpr);\n                                    if (opCtx.stack.length > 0) {\n                                        return step(condTerm, flsRes.rest, opCtx.stack[0]);\n                                    } else {\n                                        return {\n                                            result: condTerm,\n                                            rest: flsRes.rest,\n                                            prevStx: headResult.prevStx,\n                                            prevTerms: headResult.prevTerms\n                                        };\n                                    }\n                                } else {\n                                    var condTerm = ConditionalExpression.create(head, question, truExpr, colon, flsExpr);\n                                    return step(condTerm, flsRes.rest, opCtx);\n                                }\n                            }\n                        }\n                    }\n                }    // Arrow functions with expression bodies\n                else if (head.isDelimiter && head.delim.token.value === '()' && rest[0] && rest[0].token.type === parser.Token.Punctuator && resolveFast(rest[0], context.env) === '=>') {\n                    var arrowRes = enforest(rest.slice(1), context);\n                    if (arrowRes.result && arrowRes.result.isExpr) {\n                        return step(ArrowFun.create(head.delim, rest[0], arrowRes.result.destruct()), arrowRes.rest, opCtx);\n                    } else {\n                        throwSyntaxError('enforest', 'Body of arrow function must be an expression', rest.slice(1));\n                    }\n                }    // Arrow functions with expression bodies\n                else if (head.isId && rest[0] && rest[0].token.type === parser.Token.Punctuator && resolveFast(rest[0], context.env) === '=>') {\n                    var res = enforest(rest.slice(1), context);\n                    if (res.result && res.result.isExpr) {\n                        return step(ArrowFun.create(head.id, rest[0], res.result.destruct()), res.rest, opCtx);\n                    } else {\n                        throwSyntaxError('enforest', 'Body of arrow function must be an expression', rest.slice(1));\n                    }\n                }    // ParenExpr\n                else if (head.isDelimiter && head.delim.token.value === '()') {\n                    // empty parens are acceptable but enforest\n                    // doesn't accept empty arrays so short\n                    // circuit here\n                    if (head.delim.token.inner.length === 0) {\n                        return step(ParenExpression.create([Empty.create()], head.delim.expose(), []), rest, opCtx);\n                    } else {\n                        var parenRes = enforestParenExpression(head.delim, context);\n                        if (parenRes) {\n                            return step(parenRes, rest, opCtx);\n                        }\n                    }\n                }    // AssignmentExpression\n                else if (head.isExpr && ((head.isId || head.isObjGet || head.isObjDotGet || head.isThisExpression) && rest[0] && rest[1] && !bopMacroObj && stxIsAssignOp(rest[0]))) {\n                    var opRes = enforestAssignment(rest, context, head, prevStx, prevTerms);\n                    if (opRes && opRes.result) {\n                        return step(opRes.result, opRes.rest, _.extend({}, opCtx, {\n                            prevStx: opRes.prevStx,\n                            prevTerms: opRes.prevTerms\n                        }));\n                    }\n                }    // Postfix\n                else if (head.isExpr && (rest[0] && (unwrapSyntax(rest[0]) === '++' || unwrapSyntax(rest[0]) === '--'))) {\n                    // Check if the operator is a macro first.\n                    if (context.env.has(resolveFast(rest[0], context.env))) {\n                        var headStx = tagWithTerm(head, head.destruct().reverse());\n                        var opPrevStx = headStx.concat(prevStx);\n                        var opPrevTerms = [head].concat(prevTerms);\n                        var opRes = enforest(rest, context, opPrevStx, opPrevTerms);\n                        if (opRes.prevTerms.length < opPrevTerms.length) {\n                            return opRes;\n                        } else if (opRes.result) {\n                            return step(head, opRes.result.destruct().concat(opRes.rest), opCtx);\n                        }\n                    }\n                    return step(PostfixOp.create(head, rest[0]), rest.slice(1), opCtx);\n                }    // ObjectGet (computed)\n                else if (head.isExpr && (rest[0] && rest[0].token.value === '[]')) {\n                    return step(ObjGet.create(head, Delimiter.create(rest[0].expose())), rest.slice(1), opCtx);\n                }    // ObjectGet\n                else if (head.isExpr && (rest[0] && unwrapSyntax(rest[0]) === '.' && !context.env.has(resolveFast(rest[0], context.env)) && rest[1] && (rest[1].token.type === parser.Token.Identifier || rest[1].token.type === parser.Token.Keyword))) {\n                    // Check if the identifier is a macro first.\n                    if (context.env.has(resolveFast(rest[1], context.env))) {\n                        var headStx = tagWithTerm(head, head.destruct().reverse());\n                        var dotTerm = Punc.create(rest[0]);\n                        var dotTerms = [dotTerm].concat(head, prevTerms);\n                        var dotStx = tagWithTerm(dotTerm, [rest[0]]).concat(headStx, prevStx);\n                        var dotRes = enforest(rest.slice(1), context, dotStx, dotTerms);\n                        if (dotRes.prevTerms.length < dotTerms.length) {\n                            return dotRes;\n                        } else if (dotRes.result) {\n                            return step(head, [rest[0]].concat(dotRes.result.destruct(), dotRes.rest), opCtx);\n                        }\n                    }\n                    return step(ObjDotGet.create(head, rest[0], rest[1]), rest.slice(2), opCtx);\n                }    // ArrayLiteral\n                else if (head.isDelimiter && head.delim.token.value === '[]') {\n                    return step(ArrayLiteral.create(head), rest, opCtx);\n                }    // Block\n                else if (head.isDelimiter && head.delim.token.value === '{}') {\n                    return step(Block.create(head), rest, opCtx);\n                }    // quote syntax\n                else if (head.isId && unwrapSyntax(head.id) === '#quoteSyntax' && rest[0] && rest[0].token.value === '{}') {\n                    var tempId = fresh();\n                    context.templateMap.set(tempId, rest[0].token.inner);\n                    return step(syn.makeIdent('getTemplate', head.id), [syn.makeDelim('()', [syn.makeValue(tempId, head.id)], head.id)].concat(rest.slice(1)), opCtx);\n                }    // return statement\n                else if (head.isKeyword && unwrapSyntax(head.keyword) === 'return') {\n                    if (rest[0]) {\n                        var returnPrevStx = tagWithTerm(head, head.destruct()).concat(opCtx.prevStx);\n                        var returnPrevTerms = [head].concat(opCtx.prevTerms);\n                        var returnExpr = enforest(rest, context, returnPrevStx, returnPrevTerms);\n                        if (returnExpr.prevTerms.length < opCtx.prevTerms.length) {\n                            return returnExpr;\n                        }\n                        if (returnExpr.result.isExpr) {\n                            return step(ReturnStatement.create(head, returnExpr.result), returnExpr.rest, opCtx);\n                        }\n                    }\n                }    // let statements\n                else if (head.isKeyword && unwrapSyntax(head.keyword) === 'let') {\n                    var nameTokens = [];\n                    if (rest[0] && rest[0].token.type === parser.Token.Delimiter && rest[0].token.value === '()') {\n                        nameTokens = rest[0].token.inner;\n                    } else {\n                        nameTokens.push(rest[0]);\n                    }\n                    // Let macro\n                    if (rest[1] && rest[1].token.value === '=' && rest[2] && rest[2].token.value === 'macro') {\n                        var mac = enforest(rest.slice(2), context);\n                        if (mac.result) {\n                            if (!mac.result.isAnonMacro) {\n                                throwSyntaxError('enforest', 'expecting an anonymous macro definition in syntax let binding', rest.slice(2));\n                            }\n                            return step(LetMacro.create(nameTokens, mac.result.body), mac.rest, opCtx);\n                        }\n                    }    // Let statement\n                    else {\n                        var lsRes = enforestVarStatement(rest, context, head.keyword);\n                        if (lsRes && lsRes.result) {\n                            return step(LetStatement.create(head, lsRes.result), lsRes.rest, opCtx);\n                        }\n                    }\n                }    // VariableStatement\n                else if (head.isKeyword && unwrapSyntax(head.keyword) === 'var' && rest[0]) {\n                    var vsRes = enforestVarStatement(rest, context, head.keyword);\n                    if (vsRes && vsRes.result) {\n                        return step(VariableStatement.create(head, vsRes.result), vsRes.rest, opCtx);\n                    }\n                }    // Const Statement\n                else if (head.isKeyword && unwrapSyntax(head.keyword) === 'const' && rest[0]) {\n                    var csRes = enforestVarStatement(rest, context, head.keyword);\n                    if (csRes && csRes.result) {\n                        return step(ConstStatement.create(head, csRes.result), csRes.rest, opCtx);\n                    }\n                }    // for statement\n                else if (head.isKeyword && unwrapSyntax(head.keyword) === 'for' && rest[0] && rest[0].token.value === '()') {\n                    return step(ForStatement.create(head.keyword, rest[0]), rest.slice(1), opCtx);\n                }\n            } else {\n                assert(head && head.token, 'assuming head is a syntax object');\n                var macroObj = expandCount < maxExpands && getMacroInEnv(head, rest, context.env);\n                // macro invocation\n                if (macroObj && !macroObj.isOp) {\n                    var rt = expandMacro([head].concat(rest), context, opCtx, null, macroObj);\n                    var newOpCtx = opCtx;\n                    if (rt.prevTerms && rt.prevTerms.length < opCtx.prevTerms.length) {\n                        newOpCtx = rewindOpCtx(opCtx, rt);\n                    }\n                    if (rt.result.length > 0) {\n                        return step(rt.result[0], rt.result.slice(1).concat(rt.rest), newOpCtx);\n                    } else {\n                        return step(Empty.create(), rt.rest, newOpCtx);\n                    }\n                }    // anon macro definition\n                else if (head.token.type === parser.Token.Identifier && resolve(head) === 'macro' && rest[0] && rest[0].token.value === '{}') {\n                    return step(AnonMacro.create(rest[0].expose().token.inner), rest.slice(1), opCtx);\n                }    // macro definition\n                else if (head.token.type === parser.Token.Identifier && resolve(head) === 'macro') {\n                    var nameTokens = [];\n                    if (rest[0] && rest[0].token.type === parser.Token.Delimiter && rest[0].token.value === '()') {\n                        nameTokens = rest[0].expose().token.inner;\n                    } else {\n                        nameTokens.push(rest[0]);\n                    }\n                    if (rest[1] && rest[1].token.type === parser.Token.Delimiter) {\n                        return step(Macro.create(nameTokens, rest[1].expose().token.inner), rest.slice(2), opCtx);\n                    } else {\n                        throwSyntaxError('enforest', 'Macro declaration must include body', rest[1]);\n                    }\n                }    // operator definition\n                     // unaryop (neg) 1 { macro { rule { $op:expr } => { $op } } }\n                else if (head.token.type === parser.Token.Identifier && head.token.value === 'unaryop' && rest[0] && rest[0].token.type === parser.Token.Delimiter && rest[0].token.value === '()' && rest[1] && rest[1].token.type === parser.Token.NumericLiteral && rest[2] && rest[2].token.type === parser.Token.Delimiter && rest[2] && rest[2].token.value === '{}') {\n                    var trans = enforest(rest[2].expose().token.inner, context);\n                    return step(OperatorDefinition.create('unary', rest[0].expose().token.inner, rest[1], null, trans.result.body), rest.slice(3), opCtx);\n                }    // operator definition\n                     // binaryop (neg) 1 left { macro { rule { $op:expr } => { $op } } }\n                else if (head.token.type === parser.Token.Identifier && head.token.value === 'binaryop' && rest[0] && rest[0].token.type === parser.Token.Delimiter && rest[0].token.value === '()' && rest[1] && rest[1].token.type === parser.Token.NumericLiteral && rest[2] && rest[2].token.type === parser.Token.Identifier && rest[3] && rest[3].token.type === parser.Token.Delimiter && rest[3] && rest[3].token.value === '{}') {\n                    var trans = enforest(rest[3].expose().token.inner, context);\n                    return step(OperatorDefinition.create('binary', rest[0].expose().token.inner, rest[1], rest[2], trans.result.body), rest.slice(4), opCtx);\n                }    // module definition\n                else if (unwrapSyntax(head) === 'module' && rest[0] && rest[0].token.value === '{}') {\n                    return step(Module.create(rest[0], []), rest.slice(1), opCtx);\n                }    // function definition\n                else if (head.token.type === parser.Token.Keyword && unwrapSyntax(head) === 'function' && rest[0] && rest[0].token.type === parser.Token.Identifier && rest[1] && rest[1].token.type === parser.Token.Delimiter && rest[1].token.value === '()' && rest[2] && rest[2].token.type === parser.Token.Delimiter && rest[2].token.value === '{}') {\n                    rest[1].token.inner = rest[1].expose().token.inner;\n                    rest[2].token.inner = rest[2].expose().token.inner;\n                    return step(NamedFun.create(head, null, rest[0], rest[1], rest[2]), rest.slice(3), opCtx);\n                }    // generator function definition\n                else if (head.token.type === parser.Token.Keyword && unwrapSyntax(head) === 'function' && rest[0] && rest[0].token.type === parser.Token.Punctuator && rest[0].token.value === '*' && rest[1] && rest[1].token.type === parser.Token.Identifier && rest[2] && rest[2].token.type === parser.Token.Delimiter && rest[2].token.value === '()' && rest[3] && rest[3].token.type === parser.Token.Delimiter && rest[3].token.value === '{}') {\n                    rest[2].token.inner = rest[2].expose().token.inner;\n                    rest[3].token.inner = rest[3].expose().token.inner;\n                    return step(NamedFun.create(head, rest[0], rest[1], rest[2], rest[3]), rest.slice(4), opCtx);\n                }    // anonymous function definition\n                else if (head.token.type === parser.Token.Keyword && unwrapSyntax(head) === 'function' && rest[0] && rest[0].token.type === parser.Token.Delimiter && rest[0].token.value === '()' && rest[1] && rest[1].token.type === parser.Token.Delimiter && rest[1].token.value === '{}') {\n                    rest[0].token.inner = rest[0].expose().token.inner;\n                    rest[1].token.inner = rest[1].expose().token.inner;\n                    return step(AnonFun.create(head, null, rest[0], rest[1]), rest.slice(2), opCtx);\n                }    // anonymous generator function definition\n                else if (head.token.type === parser.Token.Keyword && unwrapSyntax(head) === 'function' && rest[0] && rest[0].token.type === parser.Token.Punctuator && rest[0].token.value === '*' && rest[1] && rest[1].token.type === parser.Token.Delimiter && rest[1].token.value === '()' && rest[2] && rest[2].token.type === parser.Token.Delimiter && rest[2].token.value === '{}') {\n                    rest[1].token.inner = rest[1].expose().token.inner;\n                    rest[2].token.inner = rest[2].expose().token.inner;\n                    return step(AnonFun.create(head, rest[0], rest[1], rest[2]), rest.slice(3), opCtx);\n                }    // arrow function\n                else if ((head.token.type === parser.Token.Delimiter && head.token.value === '()' || head.token.type === parser.Token.Identifier) && rest[0] && rest[0].token.type === parser.Token.Punctuator && resolveFast(rest[0], context.env) === '=>' && rest[1] && rest[1].token.type === parser.Token.Delimiter && rest[1].token.value === '{}') {\n                    return step(ArrowFun.create(head, rest[0], rest[1]), rest.slice(2), opCtx);\n                }    // catch statement\n                else if (head.token.type === parser.Token.Keyword && unwrapSyntax(head) === 'catch' && rest[0] && rest[0].token.type === parser.Token.Delimiter && rest[0].token.value === '()' && rest[1] && rest[1].token.type === parser.Token.Delimiter && rest[1].token.value === '{}') {\n                    rest[0].token.inner = rest[0].expose().token.inner;\n                    rest[1].token.inner = rest[1].expose().token.inner;\n                    return step(CatchClause.create(head, rest[0], rest[1]), rest.slice(2), opCtx);\n                }    // this expression\n                else if (head.token.type === parser.Token.Keyword && unwrapSyntax(head) === 'this') {\n                    return step(ThisExpression.create(head), rest, opCtx);\n                }    // literal\n                else if (head.token.type === parser.Token.NumericLiteral || head.token.type === parser.Token.StringLiteral || head.token.type === parser.Token.BooleanLiteral || head.token.type === parser.Token.RegularExpression || head.token.type === parser.Token.NullLiteral) {\n                    return step(Lit.create(head), rest, opCtx);\n                }    // export\n                else if (head.token.type === parser.Token.Keyword && unwrapSyntax(head) === 'export' && rest[0] && (rest[0].token.type === parser.Token.Identifier || rest[0].token.type === parser.Token.Keyword || rest[0].token.type === parser.Token.Punctuator || rest[0].token.type === parser.Token.Delimiter && rest[0].token.value === '()')) {\n                    // Consume optional semicolon                      \n                    if (unwrapSyntax(rest[1]) === ';') {\n                        rest.splice(1, 1);\n                    }\n                    return step(Export.create(rest[0]), rest.slice(1), opCtx);\n                }    // identifier\n                else if (head.token.type === parser.Token.Identifier) {\n                    return step(Id.create(head), rest, opCtx);\n                }    // punctuator\n                else if (head.token.type === parser.Token.Punctuator) {\n                    return step(Punc.create(head), rest, opCtx);\n                } else if (head.token.type === parser.Token.Keyword && unwrapSyntax(head) === 'with') {\n                    throwSyntaxError('enforest', 'with is not supported in sweet.js', head);\n                }    // keyword\n                else if (head.token.type === parser.Token.Keyword) {\n                    return step(Keyword.create(head), rest, opCtx);\n                }    // Delimiter\n                else if (head.token.type === parser.Token.Delimiter) {\n                    return step(Delimiter.create(head.expose()), rest, opCtx);\n                } else if (head.token.type === parser.Token.Template) {\n                    return step(Template.create(head), rest, opCtx);\n                }    // end of file\n                else if (head.token.type === parser.Token.EOF) {\n                    assert(rest.length === 0, 'nothing should be after an EOF');\n                    return step(EOF.create(head), [], opCtx);\n                } else {\n                    // todo: are we missing cases?\n                    assert(false, 'not implemented');\n                }\n            }\n            // Potentially an infix macro\n            // This should only be invoked on runtime syntax terms\n            if (!head.isMacro && !head.isLetMacro && !head.isAnonMacro && !head.isOperatorDefinition && rest.length && nameInEnv(rest[0], rest.slice(1), context.env) && getMacroInEnv(rest[0], rest.slice(1), context.env).isOp === false) {\n                var infLeftTerm = opCtx.prevTerms[0] && opCtx.prevTerms[0].isPartial ? opCtx.prevTerms[0] : null;\n                var infTerm = PartialExpression.create(head.destruct(), infLeftTerm, function () {\n                        return step(head, [], opCtx);\n                    });\n                var infPrevStx = tagWithTerm(infTerm, head.destruct()).reverse().concat(opCtx.prevStx);\n                var infPrevTerms = [infTerm].concat(opCtx.prevTerms);\n                var infRes = expandMacro(rest, context, {\n                        prevStx: infPrevStx,\n                        prevTerms: infPrevTerms\n                    });\n                if (infRes.prevTerms && infRes.prevTerms.length < infPrevTerms.length) {\n                    var infOpCtx = rewindOpCtx(opCtx, infRes);\n                    return step(infRes.result[0], infRes.result.slice(1).concat(infRes.rest), infOpCtx);\n                } else {\n                    return step(head, infRes.result.concat(infRes.rest), opCtx);\n                }\n            }\n            // done with current step so combine and continue on\n            var combResult = opCtx.combine(head);\n            if (opCtx.stack.length === 0) {\n                return {\n                    result: combResult.term,\n                    rest: rest,\n                    prevStx: combResult.prevStx,\n                    prevTerms: combResult.prevTerms\n                };\n            } else {\n                return step(combResult.term, rest, opCtx.stack[0]);\n            }\n        }\n        return step(toks[0], toks.slice(1), {\n            combine: function (t) {\n                return {\n                    term: t,\n                    prevStx: prevStx,\n                    prevTerms: prevTerms\n                };\n            },\n            prec: 0,\n            stack: [],\n            op: null,\n            prevStx: prevStx,\n            prevTerms: prevTerms\n        });\n    }\n    function rewindOpCtx(opCtx, res) {\n        // If we've consumed all pending operators, we can just start over.\n        // It's important that we always thread the new prevStx and prevTerms\n        // through, otherwise the old ones will still persist.\n        if (!res.prevTerms.length || !res.prevTerms[0].isPartial) {\n            return _.extend({}, opCtx, {\n                combine: function (t) {\n                    return {\n                        term: t,\n                        prevStx: res.prevStx,\n                        prevTerms: res.prevTerms\n                    };\n                },\n                prec: 0,\n                op: null,\n                stack: [],\n                prevStx: res.prevStx,\n                prevTerms: res.prevTerms\n            });\n        }\n        // To rewind, we need to find the first (previous) pending operator. It\n        // acts as a marker in the opCtx to let us know how far we need to go\n        // back.\n        var op = null;\n        for (var i = 0; i < res.prevTerms.length; i++) {\n            if (!res.prevTerms[i].isPartial) {\n                break;\n            }\n            if (res.prevTerms[i].isPartialOperation) {\n                op = res.prevTerms[i];\n                break;\n            }\n        }\n        // If the op matches the current opCtx, we don't need to rewind\n        // anything, but we still need to persist the prevStx and prevTerms.\n        if (opCtx.op === op) {\n            return _.extend({}, opCtx, {\n                prevStx: res.prevStx,\n                prevTerms: res.prevTerms\n            });\n        }\n        for (var i = 0; i < opCtx.stack.length; i++) {\n            if (opCtx.stack[i].op === op) {\n                return _.extend({}, opCtx.stack[i], {\n                    prevStx: res.prevStx,\n                    prevTerms: res.prevTerms\n                });\n            }\n        }\n        assert(false, 'Rewind failed.');\n    }\n    function get_expression(stx, context) {\n        if (stx[0].term) {\n            for (var termLen = 1; termLen < stx.length; termLen++) {\n                if (stx[termLen].term !== stx[0].term) {\n                    break;\n                }\n            }\n            // Guard the termLen because we can have a multi-token term that\n            // we don't want to split. TODO: is there something we can do to\n            // get around this safely?\n            if (stx[0].term.isPartialExpression && termLen === stx[0].term.stx.length) {\n                var expr = stx[0].term.combine().result;\n                for (var i = 1, term = stx[0].term; i < stx.length; i++) {\n                    if (stx[i].term !== term) {\n                        if (term && term.isPartial) {\n                            term = term.left;\n                            i--;\n                        } else {\n                            break;\n                        }\n                    }\n                }\n                return {\n                    result: expr,\n                    rest: stx.slice(i)\n                };\n            } else if (stx[0].term.isExpr) {\n                return {\n                    result: stx[0].term,\n                    rest: stx.slice(termLen)\n                };\n            } else {\n                return {\n                    result: null,\n                    rest: stx\n                };\n            }\n        }\n        var res = enforest(stx, context);\n        if (!res.result || !res.result.isExpr) {\n            return {\n                result: null,\n                rest: stx\n            };\n        }\n        return res;\n    }\n    function tagWithTerm(term, stx) {\n        return stx.map(function (s) {\n            var src = s.token;\n            var keys = Object.keys(src);\n            var newtok = {};\n            for (var i = 0, len = keys.length, key; i < len; i++) {\n                key = keys[i];\n                newtok[key] = src[key];\n            }\n            s = syntaxFromToken(newtok, s);\n            s.term = term;\n            return s;\n        });\n    }\n    // mark each syntax object in the pattern environment,\n    // mutating the environment\n    function applyMarkToPatternEnv(newMark, env) {\n        /*\n        Takes a `match` object:\n\n            {\n                level: <num>,\n                match: [<match> or <syntax>]\n            }\n\n        where the match property is an array of syntax objects at the bottom (0) level.\n        Does a depth-first search and applys the mark to each syntax object.\n        */\n        function dfs(match) {\n            if (match.level === 0) {\n                // replace the match property with the marked syntax\n                match.match = _.map(match.match, function (stx) {\n                    return stx.mark(newMark);\n                });\n            } else {\n                _.each(match.match, function (match$2) {\n                    dfs(match$2);\n                });\n            }\n        }\n        _.keys(env).forEach(function (key) {\n            dfs(env[key]);\n        });\n    }\n    // given the syntax for a macro, produce a macro transformer\n    // (Macro) -> (([...CSyntax]) -> ReadTree)\n    function loadMacroDef(body, context) {\n        // raw function primitive form\n        if (!(body[0] && body[0].token.type === parser.Token.Keyword && body[0].token.value === 'function')) {\n            throwSyntaxError('load macro', 'Primitive macro form must contain a function for the macro body', body);\n        }\n        var stub = parser.read('()');\n        stub[0].token.inner = body;\n        var expanded = expand(stub, context);\n        expanded = expanded[0].destruct().concat(expanded[1].eof);\n        var flattend = flatten(expanded);\n        var bodyCode = codegen.generate(parser.parse(flattend));\n        var macroFn = scopedEval(bodyCode, {\n                makeValue: syn.makeValue,\n                makeRegex: syn.makeRegex,\n                makeIdent: syn.makeIdent,\n                makeKeyword: syn.makeKeyword,\n                makePunc: syn.makePunc,\n                makeDelim: syn.makeDelim,\n                filename: context.filename,\n                require: function (id) {\n                    if (context.requireModule) {\n                        return context.requireModule(id, context.filename);\n                    }\n                    return require(id);\n                },\n                getExpr: function (stx) {\n                    var r;\n                    if (stx.length === 0) {\n                        return {\n                            success: false,\n                            result: [],\n                            rest: []\n                        };\n                    }\n                    r = get_expression(stx, context);\n                    return {\n                        success: r.result !== null,\n                        result: r.result === null ? [] : r.result.destruct(),\n                        rest: r.rest\n                    };\n                },\n                getIdent: function (stx) {\n                    if (stx[0] && stx[0].token.type === parser.Token.Identifier) {\n                        return {\n                            success: true,\n                            result: [stx[0]],\n                            rest: stx.slice(1)\n                        };\n                    }\n                    return {\n                        success: false,\n                        result: [],\n                        rest: stx\n                    };\n                },\n                getLit: function (stx) {\n                    if (stx[0] && patternModule.typeIsLiteral(stx[0].token.type)) {\n                        return {\n                            success: true,\n                            result: [stx[0]],\n                            rest: stx.slice(1)\n                        };\n                    }\n                    return {\n                        success: false,\n                        result: [],\n                        rest: stx\n                    };\n                },\n                unwrapSyntax: syn.unwrapSyntax,\n                throwSyntaxError: throwSyntaxError,\n                throwSyntaxCaseError: throwSyntaxCaseError,\n                prettyPrint: syn.prettyPrint,\n                parser: parser,\n                __fresh: fresh,\n                _: _,\n                patternModule: patternModule,\n                getPattern: function (id) {\n                    return context.patternMap.get(id);\n                },\n                getTemplate: function (id) {\n                    return syn.cloneSyntaxArray(context.templateMap.get(id));\n                },\n                applyMarkToPatternEnv: applyMarkToPatternEnv,\n                mergeMatches: function (newMatch, oldMatch) {\n                    newMatch.patternEnv = _.extend({}, oldMatch.patternEnv, newMatch.patternEnv);\n                    return newMatch;\n                }\n            });\n        return macroFn;\n    }\n    // similar to `parse1` in the honu paper\n    // ([Syntax], Map) -> {terms: [TermTree], env: Map}\n    function expandToTermTree(stx, context) {\n        assert(context, 'expander context is required');\n        var f, head, prevStx, restStx, prevTerms, macroDefinition;\n        var rest = stx;\n        while (rest.length > 0) {\n            assert(rest[0].token, 'expecting a syntax object');\n            f = enforest(rest, context, prevStx, prevTerms);\n            // head :: TermTree\n            head = f.result;\n            // rest :: [Syntax]\n            rest = f.rest;\n            if (!head) {\n                // no head means the expansions stopped prematurely (for stepping)\n                restStx = rest;\n                break;\n            }\n            if (head.isMacro && expandCount < maxExpands) {\n                // load the macro definition into the environment and continue expanding\n                macroDefinition = loadMacroDef(head.body, context);\n                var name = head.name.map(unwrapSyntax).join('');\n                var nameStx = syn.makeIdent(name, head.name[0]);\n                addToDefinitionCtx([nameStx], context.defscope, false, context.paramscope);\n                context.env.names.set(name, true);\n                context.env.set(resolve(nameStx), {\n                    fn: macroDefinition,\n                    isOp: false,\n                    builtin: builtinMode,\n                    fullName: head.name\n                });\n                continue;\n            }\n            if (head.isLetMacro && expandCount < maxExpands) {\n                // load the macro definition into the environment and continue expanding\n                macroDefinition = loadMacroDef(head.body, context);\n                var freshName = fresh();\n                var name = head.name.map(unwrapSyntax).join('');\n                var nameStx = syn.makeIdent(name, head.name[0]);\n                var renamedName = nameStx.rename(nameStx, freshName);\n                rest = _.map(rest, function (stx$2) {\n                    return stx$2.rename(nameStx, freshName);\n                });\n                context.env.names.set(name, true);\n                context.env.set(resolve(renamedName), {\n                    fn: macroDefinition,\n                    isOp: false,\n                    builtin: builtinMode,\n                    fullName: head.name\n                });\n                continue;\n            }\n            if (head.isOperatorDefinition) {\n                var opDefinition = loadMacroDef(head.body, context);\n                var name = head.name.map(unwrapSyntax).join('');\n                var nameStx = syn.makeIdent(name, head.name[0]);\n                addToDefinitionCtx([nameStx], context.defscope, false, context.paramscope);\n                var resolvedName = resolve(nameStx);\n                var opObj = context.env.get(resolvedName);\n                if (!opObj) {\n                    opObj = {\n                        isOp: true,\n                        builtin: builtinMode,\n                        fullName: head.name\n                    };\n                }\n                assert(head.type === 'binary' || head.type === 'unary', 'operator must either be binary or unary');\n                opObj[head.type] = {\n                    fn: opDefinition,\n                    prec: head.prec.token.value,\n                    assoc: head.assoc ? head.assoc.token.value : null\n                };\n                context.env.names.set(name, true);\n                context.env.set(resolvedName, opObj);\n                continue;\n            }\n            // We build the newPrevTerms/Stx here (instead of at the beginning) so\n            // that macro definitions don't get added to it.\n            var destructed = tagWithTerm(head, f.result.destruct());\n            prevTerms = [head].concat(f.prevTerms);\n            prevStx = destructed.reverse().concat(f.prevStx);\n            if (head.isNamedFun) {\n                addToDefinitionCtx([head.name], context.defscope, true, context.paramscope);\n            }\n            if (head.isVariableStatement || head.isLetStatement || head.isConstStatement) {\n                addToDefinitionCtx(_.map(head.decls, function (decl) {\n                    return decl.ident;\n                }), context.defscope, true, context.paramscope);\n            }\n            if (head.isBlock && head.body.isDelimiter) {\n                head.body.delim.token.inner.forEach(function (term) {\n                    if (term.isVariableStatement) {\n                        addToDefinitionCtx(_.map(term.decls, function (decl) {\n                            return decl.ident;\n                        }), context.defscope, true, context.paramscope);\n                    }\n                });\n            }\n            if (head.isDelimiter) {\n                head.delim.token.inner.forEach(function (term) {\n                    if (term.isVariableStatement) {\n                        addToDefinitionCtx(_.map(term.decls, function (decl) {\n                            return decl.ident;\n                        }), context.defscope, true, context.paramscope);\n                    }\n                });\n            }\n            if (head.isForStatement) {\n                head.cond.expose();\n                var forCond = head.cond.token.inner;\n                if (forCond[0] && resolve(forCond[0]) === 'let' && forCond[1] && forCond[1].token.type === parser.Token.Identifier) {\n                    var letNew = fresh();\n                    var letId = forCond[1];\n                    forCond = forCond.map(function (stx$2) {\n                        return stx$2.rename(letId, letNew);\n                    });\n                    // hack: we want to do the let renaming here, not\n                    // in the expansion of `for (...)` so just remove the `let`\n                    // keyword\n                    head.cond.token.inner = expand([forCond[0]], context).concat(expand(forCond.slice(1), context));\n                    // nice and easy case: `for (...) { ... }`\n                    if (rest[0] && rest[0].token.value === '{}') {\n                        rest[0] = rest[0].rename(letId, letNew);\n                    } else {\n                        // need to deal with things like `for (...) if (...) log(...)`\n                        var bodyEnf = enforest(rest, context);\n                        var bodyDestructed = bodyEnf.result.destruct();\n                        var renamedBodyTerm = bodyEnf.result.rename(letId, letNew);\n                        tagWithTerm(renamedBodyTerm, bodyDestructed);\n                        rest = bodyEnf.rest;\n                        prevStx = bodyDestructed.reverse().concat(prevStx);\n                        prevTerms = [renamedBodyTerm].concat(prevTerms);\n                    }\n                } else {\n                    head.cond.token.inner = expand(head.cond.token.inner, context);\n                }\n            }\n        }\n        return {\n            terms: prevTerms ? prevTerms.reverse() : [],\n            restStx: restStx,\n            context: context\n        };\n    }\n    function addToDefinitionCtx(idents, defscope, skipRep, paramscope) {\n        assert(idents && idents.length > 0, 'expecting some variable identifiers');\n        // flag for skipping repeats since we reuse this function to place both\n        // variables declarations (which need to skip redeclarations) and\n        // macro definitions which don't\n        skipRep = skipRep || false;\n        _.chain(idents).filter(function (id) {\n            if (skipRep) {\n                /*\n                       When var declarations repeat in the same function scope:\n\n                       var x = 24;\n                       ...\n                       var x = 42;\n\n                       we just need to use the first renaming and leave the\n                       definition context as is.\n                    */\n                var varDeclRep = _.find(defscope, function (def) {\n                        return def.id.token.value === id.token.value && arraysEqual(marksof(def.id.context), marksof(id.context));\n                    });\n                /* \n                        When var declaration repeat one of the function parameters:\n\n                        function foo(x) {\n                            var x;\n                        }\n\n                        we don't need to add the var to the definition context.\n                    */\n                var paramDeclRep = _.find(paramscope, function (param) {\n                        return param.token.value === id.token.value && arraysEqual(marksof(param.context), marksof(id.context));\n                    });\n                return typeof varDeclRep === 'undefined' && typeof paramDeclRep === 'undefined';\n            }\n            return true;\n        }).each(function (id) {\n            var name = fresh();\n            defscope.push({\n                id: id,\n                name: name\n            });\n        });\n    }\n    // similar to `parse2` in the honu paper except here we\n    // don't generate an AST yet\n    // (TermTree, Map, Map) -> TermTree\n    function expandTermTreeToFinal(term, context) {\n        assert(context && context.env, 'environment map is required');\n        if (term.isArrayLiteral) {\n            term.array.delim.token.inner = expand(term.array.delim.expose().token.inner, context);\n            return term;\n        } else if (term.isBlock) {\n            term.body.delim.token.inner = expand(term.body.delim.expose().token.inner, context);\n            return term;\n        } else if (term.isParenExpression) {\n            term.args = _.map(term.args, function (arg) {\n                return expandTermTreeToFinal(arg, context);\n            });\n            return term;\n        } else if (term.isCall) {\n            term.fun = expandTermTreeToFinal(term.fun, context);\n            term.args = expandTermTreeToFinal(term.args, context);\n            return term;\n        } else if (term.isReturnStatement) {\n            term.expr = expandTermTreeToFinal(term.expr, context);\n            return term;\n        } else if (term.isUnaryOp) {\n            term.expr = expandTermTreeToFinal(term.expr, context);\n            return term;\n        } else if (term.isBinOp || term.isAssignmentExpression) {\n            term.left = expandTermTreeToFinal(term.left, context);\n            term.right = expandTermTreeToFinal(term.right, context);\n            return term;\n        } else if (term.isObjGet) {\n            term.left = expandTermTreeToFinal(term.left, context);\n            term.right.delim.token.inner = expand(term.right.delim.expose().token.inner, context);\n            return term;\n        } else if (term.isObjDotGet) {\n            term.left = expandTermTreeToFinal(term.left, context);\n            term.right = expandTermTreeToFinal(term.right, context);\n            return term;\n        } else if (term.isConditionalExpression) {\n            term.cond = expandTermTreeToFinal(term.cond, context);\n            term.tru = expandTermTreeToFinal(term.tru, context);\n            term.fls = expandTermTreeToFinal(term.fls, context);\n            return term;\n        } else if (term.isVariableDeclaration) {\n            if (term.init) {\n                term.init = expandTermTreeToFinal(term.init, context);\n            }\n            return term;\n        } else if (term.isVariableStatement) {\n            term.decls = _.map(term.decls, function (decl) {\n                return expandTermTreeToFinal(decl, context);\n            });\n            return term;\n        } else if (term.isDelimiter) {\n            // expand inside the delimiter and then continue on\n            term.delim.token.inner = expand(term.delim.expose().token.inner, context);\n            return term;\n        } else if (term.isNamedFun || term.isAnonFun || term.isCatchClause || term.isArrowFun || term.isModule) {\n            // function definitions need a bunch of hygiene logic\n            // push down a fresh definition context\n            var newDef = [];\n            var paramSingleIdent = term.params && term.params.token.type === parser.Token.Identifier;\n            var params;\n            if (term.params && term.params.token.type === parser.Token.Delimiter) {\n                params = term.params.expose();\n            } else if (paramSingleIdent) {\n                params = term.params;\n            } else {\n                params = syn.makeDelim('()', [], null);\n            }\n            var bodies;\n            if (Array.isArray(term.body)) {\n                bodies = syn.makeDelim('{}', term.body, null);\n            } else {\n                bodies = term.body;\n            }\n            bodies = bodies.addDefCtx(newDef);\n            var paramNames = _.map(getParamIdentifiers(params), function (param) {\n                    var freshName = fresh();\n                    return {\n                        freshName: freshName,\n                        originalParam: param,\n                        renamedParam: param.rename(param, freshName)\n                    };\n                });\n            var bodyContext = makeExpanderContext(_.defaults({\n                    defscope: newDef,\n                    paramscope: paramNames.map(function (p) {\n                        return p.renamedParam;\n                    })\n                }, context));\n            // rename the function body for each of the parameters\n            var renamedBody = _.reduce(paramNames, function (accBody, p) {\n                    return accBody.rename(p.originalParam, p.freshName);\n                }, bodies);\n            renamedBody = renamedBody.expose();\n            var expandedResult = expandToTermTree(renamedBody.token.inner, bodyContext);\n            var bodyTerms = expandedResult.terms;\n            if (expandedResult.restStx) {\n                // The expansion was halted prematurely. Just stop and\n                // return what we have so far, along with the rest of the syntax\n                renamedBody.token.inner = expandedResult.terms.concat(expandedResult.restStx);\n                if (Array.isArray(term.body)) {\n                    term.body = renamedBody.token.inner;\n                } else {\n                    term.body = renamedBody;\n                }\n                return term;\n            }\n            var renamedParams = _.map(paramNames, function (p) {\n                    return p.renamedParam;\n                });\n            var flatArgs;\n            if (paramSingleIdent) {\n                flatArgs = renamedParams[0];\n            } else {\n                var puncCtx = term.params || null;\n                flatArgs = syn.makeDelim('()', joinSyntax(renamedParams, syn.makePunc(',', puncCtx)), puncCtx);\n            }\n            var expandedArgs = expand([flatArgs], bodyContext);\n            assert(expandedArgs.length === 1, 'should only get back one result');\n            // stitch up the function with all the renamings\n            if (term.params) {\n                term.params = expandedArgs[0];\n            }\n            bodyTerms = _.map(bodyTerms, function (bodyTerm) {\n                // add the definition context to the result of\n                // expansion (this makes sure that syntax objects\n                // introduced by expansion have the def context)\n                if (bodyTerm.isBlock) {\n                    // we need to expand blocks before adding the defctx since\n                    // blocks defer macro expansion.\n                    var blockFinal = expandTermTreeToFinal(bodyTerm, expandedResult.context);\n                    return blockFinal.addDefCtx(newDef);\n                } else {\n                    var termWithCtx = bodyTerm.addDefCtx(newDef);\n                    // finish expansion\n                    return expandTermTreeToFinal(termWithCtx, expandedResult.context);\n                }\n            });\n            if (term.isModule) {\n                bodyTerms = _.filter(bodyTerms, function (bodyTerm) {\n                    if (bodyTerm.isExport) {\n                        term.exports.push(bodyTerm);\n                        return false;\n                    } else {\n                        return true;\n                    }\n                });\n            }\n            renamedBody.token.inner = bodyTerms;\n            if (Array.isArray(term.body)) {\n                term.body = renamedBody.token.inner;\n            } else {\n                term.body = renamedBody;\n            }\n            // and continue expand the rest\n            return term;\n        }\n        // the term is fine as is\n        return term;\n    }\n    // similar to `parse` in the honu paper\n    // ([Syntax], Map, Map) -> [TermTree]\n    function expand(stx, context) {\n        assert(context, 'must provide an expander context');\n        var trees = expandToTermTree(stx, context);\n        var terms = _.map(trees.terms, function (term) {\n                return expandTermTreeToFinal(term, trees.context);\n            });\n        if (trees.restStx) {\n            terms.push.apply(terms, trees.restStx);\n        }\n        return terms;\n    }\n    function makeExpanderContext(o) {\n        o = o || {};\n        var env = o.env || new StringMap();\n        if (!env.names) {\n            env.names = new StringMap();\n        }\n        // read-only but can enumerate\n        return Object.create(Object.prototype, {\n            filename: {\n                value: o.filename,\n                writable: false,\n                enumerable: true,\n                configurable: false\n            },\n            requireModule: {\n                value: o.requireModule,\n                writable: false,\n                enumerable: true,\n                configurable: false\n            },\n            env: {\n                value: env,\n                writable: false,\n                enumerable: true,\n                configurable: false\n            },\n            defscope: {\n                value: o.defscope,\n                writable: false,\n                enumerable: true,\n                configurable: false\n            },\n            paramscope: {\n                value: o.paramscope,\n                writable: false,\n                enumerable: true,\n                configurable: false\n            },\n            templateMap: {\n                value: o.templateMap || new StringMap(),\n                writable: false,\n                enumerable: true,\n                configurable: false\n            },\n            patternMap: {\n                value: o.patternMap || new StringMap(),\n                writable: false,\n                enumerable: true,\n                configurable: false\n            },\n            mark: {\n                value: o.mark,\n                writable: false,\n                enumerable: true,\n                configurable: false\n            }\n        });\n    }\n    function makeTopLevelExpanderContext(options) {\n        var requireModule = options ? options.requireModule : undefined;\n        var filename = options && options.filename ? options.filename : '<anonymous module>';\n        return makeExpanderContext({\n            filename: filename,\n            requireModule: requireModule\n        });\n    }\n    // a hack to make the top level hygiene work out\n    function expandTopLevel(stx, moduleContexts, options) {\n        moduleContexts = moduleContexts || [];\n        options = options || {};\n        options.flatten = options.flatten != null ? options.flatten : true;\n        maxExpands = options.maxExpands || Infinity;\n        expandCount = 0;\n        var context = makeTopLevelExpanderContext(options);\n        var modBody = syn.makeDelim('{}', stx, null);\n        modBody = _.reduce(moduleContexts, function (acc, mod) {\n            context.env.extend(mod.env);\n            context.env.names.extend(mod.env.names);\n            return loadModuleExports(acc, context.env, mod.exports, mod.env);\n        }, modBody);\n        var res = expand([\n                syn.makeIdent('module', null),\n                modBody\n            ], context);\n        res = res[0].destruct();\n        res = res[0].token.inner;\n        return options.flatten ? flatten(res) : res;\n    }\n    function expandModule(stx, moduleContexts, options) {\n        moduleContexts = moduleContexts || [];\n        maxExpands = Infinity;\n        expandCount = 0;\n        var context = makeTopLevelExpanderContext(options);\n        var modBody = syn.makeDelim('{}', stx, null);\n        modBody = _.reduce(moduleContexts, function (acc, mod) {\n            context.env.extend(mod.env);\n            context.env.names.extend(mod.env.names);\n            return loadModuleExports(acc, context.env, mod.exports, mod.env);\n        }, modBody);\n        builtinMode = true;\n        var moduleRes = expand([\n                syn.makeIdent('module', null),\n                modBody\n            ], context);\n        builtinMode = false;\n        context.exports = _.map(moduleRes[0].exports, function (term) {\n            var nameStr, name;\n            if (term.name.token.type === parser.Token.Delimiter) {\n                nameStr = term.name.token.inner.map(unwrapSyntax).join('');\n                name = syn.makeIdent(nameStr, term.name);\n            } else {\n                name = term.name;\n                nameStr = unwrapSyntax(name);\n            }\n            return {\n                oldExport: name,\n                newParam: syn.makeIdent(nameStr, null)\n            };\n        });\n        return context;\n    }\n    function loadModuleExports(stx, newEnv, exports$3, oldEnv) {\n        return _.reduce(exports$3, function (acc, param) {\n            var newName = fresh();\n            var transformer = oldEnv.get(resolve(param.oldExport));\n            if (transformer) {\n                newEnv.set(resolve(param.newParam.rename(param.newParam, newName)), transformer);\n                return acc.rename(param.newParam, newName);\n            } else {\n                return acc;\n            }\n        }, stx);\n    }\n    // break delimiter tree structure down to flat array of syntax objects\n    function flatten(stx) {\n        return _.reduce(stx, function (acc, stx$2) {\n            if (stx$2.token.type === parser.Token.Delimiter) {\n                var exposed = stx$2.expose();\n                var openParen = syntaxFromToken({\n                        type: parser.Token.Punctuator,\n                        value: stx$2.token.value[0],\n                        range: stx$2.token.startRange,\n                        sm_range: typeof stx$2.token.sm_startRange == 'undefined' ? stx$2.token.startRange : stx$2.token.sm_startRange,\n                        lineNumber: stx$2.token.startLineNumber,\n                        sm_lineNumber: typeof stx$2.token.sm_startLineNumber == 'undefined' ? stx$2.token.startLineNumber : stx$2.token.sm_startLineNumber,\n                        lineStart: stx$2.token.startLineStart,\n                        sm_lineStart: typeof stx$2.token.sm_startLineStart == 'undefined' ? stx$2.token.startLineStart : stx$2.token.sm_startLineStart\n                    }, exposed);\n                var closeParen = syntaxFromToken({\n                        type: parser.Token.Punctuator,\n                        value: stx$2.token.value[1],\n                        range: stx$2.token.endRange,\n                        sm_range: typeof stx$2.token.sm_endRange == 'undefined' ? stx$2.token.endRange : stx$2.token.sm_endRange,\n                        lineNumber: stx$2.token.endLineNumber,\n                        sm_lineNumber: typeof stx$2.token.sm_endLineNumber == 'undefined' ? stx$2.token.endLineNumber : stx$2.token.sm_endLineNumber,\n                        lineStart: stx$2.token.endLineStart,\n                        sm_lineStart: typeof stx$2.token.sm_endLineStart == 'undefined' ? stx$2.token.endLineStart : stx$2.token.sm_endLineStart\n                    }, exposed);\n                if (stx$2.token.leadingComments) {\n                    openParen.token.leadingComments = stx$2.token.leadingComments;\n                }\n                if (stx$2.token.trailingComments) {\n                    openParen.token.trailingComments = stx$2.token.trailingComments;\n                }\n                acc.push(openParen);\n                push.apply(acc, flatten(exposed.token.inner));\n                acc.push(closeParen);\n                return acc;\n            }\n            stx$2.token.sm_lineNumber = typeof stx$2.token.sm_lineNumber != 'undefined' ? stx$2.token.sm_lineNumber : stx$2.token.lineNumber;\n            stx$2.token.sm_lineStart = typeof stx$2.token.sm_lineStart != 'undefined' ? stx$2.token.sm_lineStart : stx$2.token.lineStart;\n            stx$2.token.sm_range = typeof stx$2.token.sm_range != 'undefined' ? stx$2.token.sm_range : stx$2.token.range;\n            acc.push(stx$2);\n            return acc;\n        }, []);\n    }\n    exports$2.StringMap = StringMap;\n    exports$2.enforest = enforest;\n    exports$2.expand = expandTopLevel;\n    exports$2.expandModule = expandModule;\n    exports$2.resolve = resolve;\n    exports$2.get_expression = get_expression;\n    exports$2.getName = getName;\n    exports$2.getMacroInEnv = getMacroInEnv;\n    exports$2.nameInEnv = nameInEnv;\n    exports$2.makeExpanderContext = makeExpanderContext;\n    exports$2.Expr = Expr;\n    exports$2.VariableStatement = VariableStatement;\n    exports$2.tokensToSyntax = syn.tokensToSyntax;\n    exports$2.syntaxToTokens = syn.syntaxToTokens;\n}));\n//# sourceMappingURL=expander.js.map"
  },
  {
    "path": "editor/scripts/jquery.js",
    "content": "/*!\n * jQuery JavaScript Library v2.0.3\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2013-07-03T13:30Z\n */\n(function( window, undefined ) {\n\n// Can't do this because several apps including ASP.NET trace\n// the stack via arguments.caller.callee and Firefox dies if\n// you try to trace through \"use strict\" call chains. (#13335)\n// Support: Firefox 18+\n//\"use strict\";\nvar\n\t// A central reference to the root jQuery(document)\n\trootjQuery,\n\n\t// The deferred used on DOM ready\n\treadyList,\n\n\t// Support: IE9\n\t// For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`\n\tcore_strundefined = typeof undefined,\n\n\t// Use the correct document accordingly with window argument (sandbox)\n\tlocation = window.location,\n\tdocument = window.document,\n\tdocElem = document.documentElement,\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$,\n\n\t// [[Class]] -> type pairs\n\tclass2type = {},\n\n\t// List of deleted data cache ids, so we can reuse them\n\tcore_deletedIds = [],\n\n\tcore_version = \"2.0.3\",\n\n\t// Save a reference to some core methods\n\tcore_concat = core_deletedIds.concat,\n\tcore_push = core_deletedIds.push,\n\tcore_slice = core_deletedIds.slice,\n\tcore_indexOf = core_deletedIds.indexOf,\n\tcore_toString = class2type.toString,\n\tcore_hasOwn = class2type.hasOwnProperty,\n\tcore_trim = core_version.trim,\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\treturn new jQuery.fn.init( selector, context, rootjQuery );\n\t},\n\n\t// Used for matching numbers\n\tcore_pnum = /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,\n\n\t// Used for splitting on whitespace\n\tcore_rnotwhite = /\\S+/g,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\n\n\t// Match a standalone tag\n\trsingleTag = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n\n\t// Matches dashed string for camelizing\n\trmsPrefix = /^-ms-/,\n\trdashAlpha = /-([\\da-z])/gi,\n\n\t// Used by jQuery.camelCase as callback to replace()\n\tfcamelCase = function( all, letter ) {\n\t\treturn letter.toUpperCase();\n\t},\n\n\t// The ready event handler and self cleanup method\n\tcompleted = function() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed, false );\n\t\twindow.removeEventListener( \"load\", completed, false );\n\t\tjQuery.ready();\n\t};\n\njQuery.fn = jQuery.prototype = {\n\t// The current version of jQuery being used\n\tjquery: core_version,\n\n\tconstructor: jQuery,\n\tinit: function( selector, context, rootjQuery ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector.charAt(0) === \"<\" && selector.charAt( selector.length - 1 ) === \">\" && selector.length >= 3 ) {\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && (match[1] || !context) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[1] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[0] : context;\n\n\t\t\t\t\t// scripts is true for back-compat\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[1],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( jQuery.isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[2] );\n\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t\tthis[0] = elem;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.context = document;\n\t\t\t\t\tthis.selector = selector;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || rootjQuery ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis.context = this[0] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( jQuery.isFunction( selector ) ) {\n\t\t\treturn rootjQuery.ready( selector );\n\t\t}\n\n\t\tif ( selector.selector !== undefined ) {\n\t\t\tthis.selector = selector.selector;\n\t\t\tthis.context = selector.context;\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t},\n\n\t// Start with an empty selector\n\tselector: \"\",\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn core_slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\t\treturn num == null ?\n\n\t\t\t// Return a 'clean' array\n\t\t\tthis.toArray() :\n\n\t\t\t// Return just the object\n\t\t\t( num < 0 ? this[ this.length + num ] : this[ num ] );\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\t\tret.context = this.context;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\t// (You can seed the arguments with an array of args, but this is\n\t// only used internally.)\n\teach: function( callback, args ) {\n\t\treturn jQuery.each( this, callback, args );\n\t},\n\n\tready: function( fn ) {\n\t\t// Add the callback\n\t\tjQuery.ready.promise().done( fn );\n\n\t\treturn this;\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( core_slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map(this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t}));\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor(null);\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: core_push,\n\tsort: [].sort,\n\tsplice: [].splice\n};\n\n// Give the init function the jQuery prototype for later instantiation\njQuery.fn.init.prototype = jQuery.fn;\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[0] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend({\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( core_version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\tnoConflict: function( deep ) {\n\t\tif ( window.$ === jQuery ) {\n\t\t\twindow.$ = _$;\n\t\t}\n\n\t\tif ( deep && window.jQuery === jQuery ) {\n\t\t\twindow.jQuery = _jQuery;\n\t\t}\n\n\t\treturn jQuery;\n\t},\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Hold (or release) the ready event\n\tholdReady: function( hold ) {\n\t\tif ( hold ) {\n\t\t\tjQuery.readyWait++;\n\t\t} else {\n\t\t\tjQuery.ready( true );\n\t\t}\n\t},\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\n\t\t// Trigger any bound ready events\n\t\tif ( jQuery.fn.trigger ) {\n\t\t\tjQuery( document ).trigger(\"ready\").off(\"ready\");\n\t\t}\n\t},\n\n\t// See test/unit/core.js for details concerning isFunction.\n\t// Since version 1.3, DOM methods and functions like alert\n\t// aren't supported. They return false on IE (#2968).\n\tisFunction: function( obj ) {\n\t\treturn jQuery.type(obj) === \"function\";\n\t},\n\n\tisArray: Array.isArray,\n\n\tisWindow: function( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t},\n\n\tisNumeric: function( obj ) {\n\t\treturn !isNaN( parseFloat(obj) ) && isFinite( obj );\n\t},\n\n\ttype: function( obj ) {\n\t\tif ( obj == null ) {\n\t\t\treturn String( obj );\n\t\t}\n\t\t// Support: Safari <= 5.1 (functionish RegExp)\n\t\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\t\tclass2type[ core_toString.call(obj) ] || \"object\" :\n\t\t\ttypeof obj;\n\t},\n\n\tisPlainObject: function( obj ) {\n\t\t// Not plain objects:\n\t\t// - Any object or value whose internal [[Class]] property is not \"[object Object]\"\n\t\t// - DOM nodes\n\t\t// - window\n\t\tif ( jQuery.type( obj ) !== \"object\" || obj.nodeType || jQuery.isWindow( obj ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Support: Firefox <20\n\t\t// The try/catch suppresses exceptions thrown when attempting to access\n\t\t// the \"constructor\" property of certain host objects, ie. |window.location|\n\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=814622\n\t\ttry {\n\t\t\tif ( obj.constructor &&\n\t\t\t\t\t!core_hasOwn.call( obj.constructor.prototype, \"isPrototypeOf\" ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the function hasn't returned already, we're confident that\n\t\t// |obj| is a plain object, created by {} or constructed with new Object\n\t\treturn true;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\t// data: string of html\n\t// context (optional): If specified, the fragment will be created in this context, defaults to document\n\t// keepScripts (optional): If true, will include scripts passed in the html string\n\tparseHTML: function( data, context, keepScripts ) {\n\t\tif ( !data || typeof data !== \"string\" ) {\n\t\t\treturn null;\n\t\t}\n\t\tif ( typeof context === \"boolean\" ) {\n\t\t\tkeepScripts = context;\n\t\t\tcontext = false;\n\t\t}\n\t\tcontext = context || document;\n\n\t\tvar parsed = rsingleTag.exec( data ),\n\t\t\tscripts = !keepScripts && [];\n\n\t\t// Single tag\n\t\tif ( parsed ) {\n\t\t\treturn [ context.createElement( parsed[1] ) ];\n\t\t}\n\n\t\tparsed = jQuery.buildFragment( [ data ], context, scripts );\n\n\t\tif ( scripts ) {\n\t\t\tjQuery( scripts ).remove();\n\t\t}\n\n\t\treturn jQuery.merge( [], parsed.childNodes );\n\t},\n\n\tparseJSON: JSON.parse,\n\n\t// Cross-browser xml parsing\n\tparseXML: function( data ) {\n\t\tvar xml, tmp;\n\t\tif ( !data || typeof data !== \"string\" ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Support: IE9\n\t\ttry {\n\t\t\ttmp = new DOMParser();\n\t\t\txml = tmp.parseFromString( data , \"text/xml\" );\n\t\t} catch ( e ) {\n\t\t\txml = undefined;\n\t\t}\n\n\t\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\t\tjQuery.error( \"Invalid XML: \" + data );\n\t\t}\n\t\treturn xml;\n\t},\n\n\tnoop: function() {},\n\n\t// Evaluates a script in a global context\n\tglobalEval: function( code ) {\n\t\tvar script,\n\t\t\t\tindirect = eval;\n\n\t\tcode = jQuery.trim( code );\n\n\t\tif ( code ) {\n\t\t\t// If the code includes a valid, prologue position\n\t\t\t// strict mode pragma, execute code by injecting a\n\t\t\t// script tag into the document.\n\t\t\tif ( code.indexOf(\"use strict\") === 1 ) {\n\t\t\t\tscript = document.createElement(\"script\");\n\t\t\t\tscript.text = code;\n\t\t\t\tdocument.head.appendChild( script ).parentNode.removeChild( script );\n\t\t\t} else {\n\t\t\t// Otherwise, avoid the DOM node creation, insertion\n\t\t\t// and removal by using an indirect global eval\n\t\t\t\tindirect( code );\n\t\t\t}\n\t\t}\n\t},\n\n\t// Convert dashed to camelCase; used by the css and data modules\n\t// Microsoft forgot to hump their vendor prefix (#9572)\n\tcamelCase: function( string ) {\n\t\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n\t},\n\n\tnodeName: function( elem, name ) {\n\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\t},\n\n\t// args is for internal usage only\n\teach: function( obj, callback, args ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = obj.length,\n\t\t\tisArray = isArraylike( obj );\n\n\t\tif ( args ) {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t\t} else {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\ttrim: function( text ) {\n\t\treturn text == null ? \"\" : core_trim.call( text );\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArraylike( Object(arr) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcore_push.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : core_indexOf.call( arr, elem, i );\n\t},\n\n\tmerge: function( first, second ) {\n\t\tvar l = second.length,\n\t\t\ti = first.length,\n\t\t\tj = 0;\n\n\t\tif ( typeof l === \"number\" ) {\n\t\t\tfor ( ; j < l; j++ ) {\n\t\t\t\tfirst[ i++ ] = second[ j ];\n\t\t\t}\n\t\t} else {\n\t\t\twhile ( second[j] !== undefined ) {\n\t\t\t\tfirst[ i++ ] = second[ j++ ];\n\t\t\t}\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, inv ) {\n\t\tvar retVal,\n\t\t\tret = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length;\n\t\tinv = !!inv;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tretVal = !!callback( elems[ i ], i );\n\t\t\tif ( inv !== retVal ) {\n\t\t\t\tret.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tisArray = isArraylike( elems ),\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their\n\t\tif ( isArray ) {\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret[ ret.length ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret[ ret.length ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn core_concat.apply( [], ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// Bind a function to a context, optionally partially applying any\n\t// arguments.\n\tproxy: function( fn, context ) {\n\t\tvar tmp, args, proxy;\n\n\t\tif ( typeof context === \"string\" ) {\n\t\t\ttmp = fn[ context ];\n\t\t\tcontext = fn;\n\t\t\tfn = tmp;\n\t\t}\n\n\t\t// Quick check to determine if target is callable, in the spec\n\t\t// this throws a TypeError, but we will just return undefined.\n\t\tif ( !jQuery.isFunction( fn ) ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Simulated bind\n\t\targs = core_slice.call( arguments, 2 );\n\t\tproxy = function() {\n\t\t\treturn fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );\n\t\t};\n\n\t\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\t\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\t\treturn proxy;\n\t},\n\n\t// Multifunctional method to get and set values of a collection\n\t// The value/s can optionally be executed if it's a function\n\taccess: function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\t\tvar i = 0,\n\t\t\tlength = elems.length,\n\t\t\tbulk = key == null;\n\n\t\t// Sets many values\n\t\tif ( jQuery.type( key ) === \"object\" ) {\n\t\t\tchainable = true;\n\t\t\tfor ( i in key ) {\n\t\t\t\tjQuery.access( elems, fn, i, key[i], true, emptyGet, raw );\n\t\t\t}\n\n\t\t// Sets one value\n\t\t} else if ( value !== undefined ) {\n\t\t\tchainable = true;\n\n\t\t\tif ( !jQuery.isFunction( value ) ) {\n\t\t\t\traw = true;\n\t\t\t}\n\n\t\t\tif ( bulk ) {\n\t\t\t\t// Bulk operations run against the entire set\n\t\t\t\tif ( raw ) {\n\t\t\t\t\tfn.call( elems, value );\n\t\t\t\t\tfn = null;\n\n\t\t\t\t// ...except when executing function values\n\t\t\t\t} else {\n\t\t\t\t\tbulk = fn;\n\t\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( fn ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tfn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn chainable ?\n\t\t\telems :\n\n\t\t\t// Gets\n\t\t\tbulk ?\n\t\t\t\tfn.call( elems ) :\n\t\t\t\tlength ? fn( elems[0], key ) : emptyGet;\n\t},\n\n\tnow: Date.now,\n\n\t// A method for quickly swapping in/out CSS properties to get correct calculations.\n\t// Note: this method belongs to the css module but it's needed here for the support module.\n\t// If support gets modularized, this method should be moved back to the css module.\n\tswap: function( elem, options, callback, args ) {\n\t\tvar ret, name,\n\t\t\told = {};\n\n\t\t// Remember the old values, and insert the new ones\n\t\tfor ( name in options ) {\n\t\t\told[ name ] = elem.style[ name ];\n\t\t\telem.style[ name ] = options[ name ];\n\t\t}\n\n\t\tret = callback.apply( elem, args || [] );\n\n\t\t// Revert the old values\n\t\tfor ( name in options ) {\n\t\t\telem.style[ name ] = old[ name ];\n\t\t}\n\n\t\treturn ret;\n\t}\n});\n\njQuery.ready.promise = function( obj ) {\n\tif ( !readyList ) {\n\n\t\treadyList = jQuery.Deferred();\n\n\t\t// Catch cases where $(document).ready() is called after the browser event has already occurred.\n\t\t// we once tried to use readyState \"interactive\" here, but it caused issues like the one\n\t\t// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15\n\t\tif ( document.readyState === \"complete\" ) {\n\t\t\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\t\t\tsetTimeout( jQuery.ready );\n\n\t\t} else {\n\n\t\t\t// Use the handy event callback\n\t\t\tdocument.addEventListener( \"DOMContentLoaded\", completed, false );\n\n\t\t\t// A fallback to window.onload, that will always work\n\t\t\twindow.addEventListener( \"load\", completed, false );\n\t\t}\n\t}\n\treturn readyList.promise( obj );\n};\n\n// Populate the class2type map\njQuery.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nfunction isArraylike( obj ) {\n\tvar length = obj.length,\n\t\ttype = jQuery.type( obj );\n\n\tif ( jQuery.isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\tif ( obj.nodeType === 1 && length ) {\n\t\treturn true;\n\t}\n\n\treturn type === \"array\" || type !== \"function\" &&\n\t\t( length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj );\n}\n\n// All jQuery objects should point back to these\nrootjQuery = jQuery(document);\n/*!\n * Sizzle CSS Selector Engine v1.9.4-pre\n * http://sizzlejs.com/\n *\n * Copyright 2013 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2013-06-03\n */\n(function( window, undefined ) {\n\nvar i,\n\tsupport,\n\tcachedruns,\n\tExpr,\n\tgetText,\n\tisXML,\n\tcompile,\n\toutermostContext,\n\tsortInput,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + -(new Date()),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\thasDuplicate = false,\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// General-purpose constants\n\tstrundefined = typeof undefined,\n\tMAX_NEGATIVE = 1 << 31,\n\n\t// Instance methods\n\thasOwn = ({}).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf if we can't use a native one\n\tindexOf = arr.indexOf || function( elem ) {\n\t\tvar i = 0,\n\t\t\tlen = this.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( this[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\t// http://www.w3.org/TR/css3-syntax/#characters\n\tcharacterEncoding = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n\n\t// Loosely modeled on CSS identifier characters\n\t// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\t// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = characterEncoding.replace( \"w\", \"w#\" ),\n\n\t// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + characterEncoding + \")\" + whitespace +\n\t\t\"*(?:([*^$|!~]?=)\" + whitespace + \"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\" + identifier + \")|)|)\" + whitespace + \"*\\\\]\",\n\n\t// Prefer arguments quoted,\n\t//   then not containing pseudos/brackets,\n\t//   then attribute selectors/non-parenthetical expressions,\n\t//   then anything else\n\t// These preferences are here to reduce the number of selectors\n\t//   needing tokenize in the PSEUDO preFilter\n\tpseudos = \":(\" + characterEncoding + \")(?:\\\\(((['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes.replace( 3, 8 ) + \")*)|.*)\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\n\trsibling = new RegExp( whitespace + \"*[+~]\" ),\n\trattributeQuotes = new RegExp( \"=\" + whitespace + \"*([^\\\\]'\\\"]*)\" + whitespace + \"*\\\\]\", \"g\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + characterEncoding + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + characterEncoding + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + characterEncoding.replace( \"w\", \"w*\" ) + \")\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trescape = /'|\\\\/g,\n\n\t// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n\tfunescape = function( _, escaped, escapedWhitespace ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\t// Support: Firefox\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\t// BMP codepoint\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t};\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar match, elem, m, nodeType,\n\t\t// QSA vars\n\t\ti, groups, old, nid, newContext, newSelector;\n\n\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\n\tcontext = context || document;\n\tresults = results || [];\n\n\tif ( !selector || typeof selector !== \"string\" ) {\n\t\treturn results;\n\t}\n\n\tif ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {\n\t\treturn [];\n\t}\n\n\tif ( documentIsHTML && !seed ) {\n\n\t\t// Shortcuts\n\t\tif ( (match = rquickExpr.exec( selector )) ) {\n\t\t\t// Speed-up: Sizzle(\"#ID\")\n\t\t\tif ( (m = match[1]) ) {\n\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\telem = context.getElementById( m );\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Handle the case where IE, Opera, and Webkit return items\n\t\t\t\t\t\t// by name instead of ID\n\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Context is not a document\n\t\t\t\t\tif ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\n\t\t\t\t\t\tcontains( context, elem ) && elem.id === m ) {\n\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Speed-up: Sizzle(\"TAG\")\n\t\t\t} else if ( match[2] ) {\n\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\treturn results;\n\n\t\t\t// Speed-up: Sizzle(\".CLASS\")\n\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {\n\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\treturn results;\n\t\t\t}\n\t\t}\n\n\t\t// QSA path\n\t\tif ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\n\t\t\tnid = old = expando;\n\t\t\tnewContext = context;\n\t\t\tnewSelector = nodeType === 9 && selector;\n\n\t\t\t// qSA works strangely on Element-rooted queries\n\t\t\t// We can work around this by specifying an extra ID on the root\n\t\t\t// and working up from there (Thanks to Andrew Dupont for the technique)\n\t\t\t// IE 8 doesn't work on object elements\n\t\t\tif ( nodeType === 1 && context.nodeName.toLowerCase() !== \"object\" ) {\n\t\t\t\tgroups = tokenize( selector );\n\n\t\t\t\tif ( (old = context.getAttribute(\"id\")) ) {\n\t\t\t\t\tnid = old.replace( rescape, \"\\\\$&\" );\n\t\t\t\t} else {\n\t\t\t\t\tcontext.setAttribute( \"id\", nid );\n\t\t\t\t}\n\t\t\t\tnid = \"[id='\" + nid + \"'] \";\n\n\t\t\t\ti = groups.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tgroups[i] = nid + toSelector( groups[i] );\n\t\t\t\t}\n\t\t\t\tnewContext = rsibling.test( selector ) && context.parentNode || context;\n\t\t\t\tnewSelector = groups.join(\",\");\n\t\t\t}\n\n\t\t\tif ( newSelector ) {\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch(qsaError) {\n\t\t\t\t} finally {\n\t\t\t\t\tif ( !old ) {\n\t\t\t\t\t\tcontext.removeAttribute(\"id\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {Function(string, Object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key += \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key ] = value);\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created div and expects a boolean result\n */\nfunction assert( fn ) {\n\tvar div = document.createElement(\"div\");\n\n\ttry {\n\t\treturn !!fn( div );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// Remove from its parent by default\n\t\tif ( div.parentNode ) {\n\t\t\tdiv.parentNode.removeChild( div );\n\t\t}\n\t\t// release memory in IE\n\t\tdiv = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split(\"|\"),\n\t\ti = attrs.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[i] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\t( ~b.sourceIndex || MAX_NEGATIVE ) -\n\t\t\t( ~a.sourceIndex || MAX_NEGATIVE );\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect xml\n * @param {Element|Object} elem An element or a document\n */\nisXML = Sizzle.isXML = function( elem ) {\n\t// documentElement is verified for cases where it doesn't yet exist\n\t// (such as loading iframes in IE - #4833)\n\tvar documentElement = elem && (elem.ownerDocument || elem).documentElement;\n\treturn documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar doc = node ? node.ownerDocument || node : preferredDoc,\n\t\tparent = doc.defaultView;\n\n\t// If no document and documentElement is available, return\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Set our document\n\tdocument = doc;\n\tdocElem = doc.documentElement;\n\n\t// Support tests\n\tdocumentIsHTML = !isXML( doc );\n\n\t// Support: IE>8\n\t// If iframe document is assigned to \"document\" variable and if iframe has been reloaded,\n\t// IE will throw \"permission denied\" error when accessing \"document\" variable, see jQuery #13936\n\t// IE6-8 do not support the defaultView property so parent will be undefined\n\tif ( parent && parent.attachEvent && parent !== parent.top ) {\n\t\tparent.attachEvent( \"onbeforeunload\", function() {\n\t\t\tsetDocument();\n\t\t});\n\t}\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)\n\tsupport.attributes = assert(function( div ) {\n\t\tdiv.className = \"i\";\n\t\treturn !div.getAttribute(\"className\");\n\t});\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( div ) {\n\t\tdiv.appendChild( doc.createComment(\"\") );\n\t\treturn !div.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Check if getElementsByClassName can be trusted\n\tsupport.getElementsByClassName = assert(function( div ) {\n\t\tdiv.innerHTML = \"<div class='a'></div><div class='a i'></div>\";\n\n\t\t// Support: Safari<4\n\t\t// Catch class over-caching\n\t\tdiv.firstChild.className = \"i\";\n\t\t// Support: Opera<10\n\t\t// Catch gEBCN failure to find non-leading classes\n\t\treturn div.getElementsByClassName(\"i\").length === 2;\n\t});\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert(function( div ) {\n\t\tdocElem.appendChild( div ).id = expando;\n\t\treturn !doc.getElementsByName || !doc.getElementsByName( expando ).length;\n\t});\n\n\t// ID find and filter\n\tif ( support.getById ) {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\treturn m && m.parentNode ? [m] : [];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t} else {\n\t\t// Support: IE6/7\n\t\t// getElementById is not reliable as a find shortcut\n\t\tdelete Expr.find[\"ID\"];\n\n\t\tExpr.filter[\"ID\"] =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== strundefined ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\t\t\t}\n\t\t} :\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See http://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( div ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// http://bugs.jquery.com/ticket/12359\n\t\t\tdiv.innerHTML = \"<select><option selected=''></option></select>\";\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !div.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( div ) {\n\n\t\t\t// Support: Opera 10-12/IE8\n\t\t\t// ^= $= *= and empty values\n\t\t\t// Should not select anything\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type attribute is restricted during .innerHTML assignment\n\t\t\tvar input = doc.createElement(\"input\");\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tdiv.appendChild( input ).setAttribute( \"t\", \"\" );\n\n\t\t\tif ( div.querySelectorAll(\"[t^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":enabled\").length ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tdiv.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( div ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( div, \"div\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( div, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\n\t// Element contains another\n\t// Purposefully does not implement inclusive descendent\n\t// As in, an element does not contain itself\n\tcontains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = docElem.compareDocumentPosition ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );\n\n\t\tif ( compare ) {\n\t\t\t// Disconnected nodes\n\t\t\tif ( compare & 1 ||\n\t\t\t\t(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t\tif ( a === doc || contains(preferredDoc, a) ) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif ( b === doc || contains(preferredDoc, b) ) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\t// Maintain original order\n\t\t\t\treturn sortInput ?\n\t\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t\t0;\n\t\t\t}\n\n\t\t\treturn compare & 4 ? -1 : 1;\n\t\t}\n\n\t\t// Not directly comparable, sort on existence of method\n\t\treturn a.compareDocumentPosition ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\t} else if ( !aup || !bup ) {\n\t\t\treturn a === doc ? -1 :\n\t\t\t\tb === doc ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn doc;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\t// Make sure that attribute selectors are quoted\n\texpr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch(e) {}\n\t}\n\n\treturn Sizzle( expr, document, null, [elem] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val === undefined ?\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t(val = elem.getAttributeNode(name)) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull :\n\t\tval;\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\tfor ( ; (node = elem[i]); i++ ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (see #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[5] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[3] && match[4] !== undefined ) {\n\t\t\t\tmatch[2] = match[4];\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() { return true; } :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute(\"class\") || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, diff, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || (parent[ expando ] = {});\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[0] === dirruns && cache[1];\n\t\t\t\t\t\t\tdiff = cache[0] === dirruns && cache[2];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {\n\t\t\t\t\t\t\tdiff = cache[1];\n\n\t\t\t\t\t\t// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\tif ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {\n\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": function( elem ) {\n\t\t\treturn elem.disabled === false;\n\t\t},\n\n\t\t\"disabled\": function( elem ) {\n\t\t\treturn elem.disabled === true;\n\t\t},\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\n\t\t\t//   not comment, processing instructions, or others\n\t\t\t// Thanks to Diego Perini for the nodeName shortcut\n\t\t\t//   Greater than \"@\" means alpha characters (specifically not starting with \"#\" or \"?\")\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeName > \"@\" || elem.nodeType === 3 || elem.nodeType === 4 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\t// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\n\t\t\t// use getAttribute instead to test this case\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === elem.type );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( tokens = [] );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push({\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t});\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push({\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t});\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tcheckNonElements = base && dir === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar data, cache, outerCache,\n\t\t\t\tdirkey = dirruns + \" \" + doneName;\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\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\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\t\t\t\t\t\tif ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {\n\t\t\t\t\t\t\tif ( (data = cache[1]) === true || data === cachedruns ) {\n\t\t\t\t\t\t\t\treturn data === true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcache = outerCache[ dir ] = [ dirkey ];\n\t\t\t\t\t\t\tcache[1] = matcher( elem, context, xml ) || cachedruns;\n\t\t\t\t\t\t\tif ( cache[1] === true ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\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\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\treturn ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\t// A counter to specify which element is currently being matched\n\tvar matcherCachedRuns = 0,\n\t\tbySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, expandContext ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tsetMatched = [],\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\toutermost = expandContext != null,\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", expandContext && context.parentNode || context ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context !== document && context;\n\t\t\t\tcachedruns = matcherCachedRuns;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Keep `i` a string if there are no elements so `matchedCount` will be \"00\" below\n\t\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t\tcachedruns = ++matcherCachedRuns;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\tmatchedCount += i;\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !group ) {\n\t\t\tgroup = tokenize( selector );\n\t\t}\n\t\ti = group.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( group[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\t}\n\treturn cached;\n};\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tmatch = tokenize( selector );\n\n\tif ( !seed ) {\n\t\t// Try to minimize operations if there is only one group\n\t\tif ( match.length === 1 ) {\n\n\t\t\t// Take a shortcut and set the context if the root selector is an ID\n\t\t\ttokens = match[0] = match[0].slice( 0 );\n\t\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\t\tsupport.getById && context.nodeType === 9 && documentIsHTML &&\n\t\t\t\t\tExpr.relative[ tokens[1].type ] ) {\n\n\t\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\t\tif ( !context ) {\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t\t}\n\n\t\t\t// Fetch a seed set for right-to-left matching\n\t\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\ttoken = tokens[i];\n\n\t\t\t\t// Abort if we hit a combinator\n\t\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\t\tif ( (seed = find(\n\t\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\t\trsibling.test( tokens[0].type ) && context.parentNode || context\n\t\t\t\t\t)) ) {\n\n\t\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\tcompile( selector, match )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\trsibling.test( selector )\n\t);\n\treturn results;\n}\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome<14\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( div1 ) {\n\t// Should return 1, but returns 4 (following)\n\treturn div1.compareDocumentPosition( document.createElement(\"div\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( div ) {\n\tdiv.innerHTML = \"<a href='#'></a>\";\n\treturn div.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( div ) {\n\tdiv.innerHTML = \"<input/>\";\n\tdiv.firstChild.setAttribute( \"value\", \"\" );\n\treturn div.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n\taddHandle( \"value\", function( elem, name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( div ) {\n\treturn div.getAttribute(\"disabled\") == null;\n}) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn (val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\telem[ name ] === true ? name.toLowerCase() : null;\n\t\t}\n\t});\n}\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\njQuery.expr[\":\"] = jQuery.expr.pseudos;\njQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\n\n\n})( window );\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\tfiringLength = 0;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ](function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ]\n\t\t\tdeferred[ tuple[0] ] = function() {\n\t\t\t\tdeferred[ tuple[0] + \"With\" ]( this === deferred ? promise : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\njQuery.support = (function( support ) {\n\tvar input = document.createElement(\"input\"),\n\t\tfragment = document.createDocumentFragment(),\n\t\tdiv = document.createElement(\"div\"),\n\t\tselect = document.createElement(\"select\"),\n\t\topt = select.appendChild( document.createElement(\"option\") );\n\n\t// Finish early in limited environments\n\tif ( !input.type ) {\n\t\treturn support;\n\t}\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3\n\t// Check the default checkbox/radio value (\"\" on old WebKit; \"on\" elsewhere)\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Must access the parent to make an option select properly\n\t// Support: IE9, IE10\n\tsupport.optSelected = opt.selected;\n\n\t// Will be defined later\n\tsupport.reliableMarginRight = true;\n\tsupport.boxSizingReliable = true;\n\tsupport.pixelPosition = false;\n\n\t// Make sure checked status is properly cloned\n\t// Support: IE9, IE10\n\tinput.checked = true;\n\tsupport.noCloneChecked = input.cloneNode( true ).checked;\n\n\t// Make sure that the options inside disabled selects aren't marked as disabled\n\t// (WebKit marks them as disabled)\n\tselect.disabled = true;\n\tsupport.optDisabled = !opt.disabled;\n\n\t// Check if an input maintains its value after becoming a radio\n\t// Support: IE9, IE10\n\tinput = document.createElement(\"input\");\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n\n\t// #11217 - WebKit loses check when the name is after the checked attribute\n\tinput.setAttribute( \"checked\", \"t\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tfragment.appendChild( input );\n\n\t// Support: Safari 5.1, Android 4.x, Android 2.3\n\t// old WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: Firefox, Chrome, Safari\n\t// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)\n\tsupport.focusinBubbles = \"onfocusin\" in window;\n\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\t// Run tests that need a body at doc ready\n\tjQuery(function() {\n\t\tvar container, marginDiv,\n\t\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\t\tdivReset = \"padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box\",\n\t\t\tbody = document.getElementsByTagName(\"body\")[ 0 ];\n\n\t\tif ( !body ) {\n\t\t\t// Return for frameset docs that don't have a body\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer = document.createElement(\"div\");\n\t\tcontainer.style.cssText = \"border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px\";\n\n\t\t// Check box-sizing and margin behavior.\n\t\tbody.appendChild( container ).appendChild( div );\n\t\tdiv.innerHTML = \"\";\n\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%\";\n\n\t\t// Workaround failing boxSizing test due to offsetWidth returning wrong value\n\t\t// with some non-1 values of body zoom, ticket #13543\n\t\tjQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {\n\t\t\tsupport.boxSizing = div.offsetWidth === 4;\n\t\t});\n\n\t\t// Use window.getComputedStyle because jsdom on node.js will break without it.\n\t\tif ( window.getComputedStyle ) {\n\t\t\tsupport.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== \"1%\";\n\t\t\tsupport.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: \"4px\" } ).width === \"4px\";\n\n\t\t\t// Support: Android 2.3\n\t\t\t// Check if div with explicit width and no margin-right incorrectly\n\t\t\t// gets computed margin-right based on width of container. (#3333)\n\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\tmarginDiv = div.appendChild( document.createElement(\"div\") );\n\t\t\tmarginDiv.style.cssText = div.style.cssText = divReset;\n\t\t\tmarginDiv.style.marginRight = marginDiv.style.width = \"0\";\n\t\t\tdiv.style.width = \"1px\";\n\n\t\t\tsupport.reliableMarginRight =\n\t\t\t\t!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );\n\t\t}\n\n\t\tbody.removeChild( container );\n\t});\n\n\treturn support;\n})( {} );\n\n/*\n\tImplementation Summary\n\n\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n\t2. Improve the module's maintainability by reducing the storage\n\t\tpaths to a single mechanism.\n\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n*/\nvar data_user, data_priv,\n\trbrace = /(?:\\{[\\s\\S]*\\}|\\[[\\s\\S]*\\])$/,\n\trmultiDash = /([A-Z])/g;\n\nfunction Data() {\n\t// Support: Android < 4,\n\t// Old WebKit does not have Object.preventExtensions/freeze method,\n\t// return new empty object instead with no [[set]] accessor\n\tObject.defineProperty( this.cache = {}, 0, {\n\t\tget: function() {\n\t\t\treturn {};\n\t\t}\n\t});\n\n\tthis.expando = jQuery.expando + Math.random();\n}\n\nData.uid = 1;\n\nData.accepts = function( owner ) {\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType ?\n\t\towner.nodeType === 1 || owner.nodeType === 9 : true;\n};\n\nData.prototype = {\n\tkey: function( owner ) {\n\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t// but we should not, see #8335.\n\t\t// Always return the key for a frozen object.\n\t\tif ( !Data.accepts( owner ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar descriptor = {},\n\t\t\t// Check if the owner object already has a cache key\n\t\t\tunlock = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !unlock ) {\n\t\t\tunlock = Data.uid++;\n\n\t\t\t// Secure it in a non-enumerable, non-writable property\n\t\t\ttry {\n\t\t\t\tdescriptor[ this.expando ] = { value: unlock };\n\t\t\t\tObject.defineProperties( owner, descriptor );\n\n\t\t\t// Support: Android < 4\n\t\t\t// Fallback to a less secure definition\n\t\t\t} catch ( e ) {\n\t\t\t\tdescriptor[ this.expando ] = unlock;\n\t\t\t\tjQuery.extend( owner, descriptor );\n\t\t\t}\n\t\t}\n\n\t\t// Ensure the cache object\n\t\tif ( !this.cache[ unlock ] ) {\n\t\t\tthis.cache[ unlock ] = {};\n\t\t}\n\n\t\treturn unlock;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\t// There may be an unlock assigned to this node,\n\t\t\t// if there is no entry for this \"owner\", create one inline\n\t\t\t// and set the unlock as though an owner entry had always existed\n\t\t\tunlock = this.key( owner ),\n\t\t\tcache = this.cache[ unlock ];\n\n\t\t// Handle: [ owner, key, value ] args\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ data ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\t\t\t// Fresh assignments by object are shallow copied\n\t\t\tif ( jQuery.isEmptyObject( cache ) ) {\n\t\t\t\tjQuery.extend( this.cache[ unlock ], data );\n\t\t\t// Otherwise, copy the properties one-by-one to the cache object\n\t\t\t} else {\n\t\t\t\tfor ( prop in data ) {\n\t\t\t\t\tcache[ prop ] = data[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\t// Either a valid cache is found, or will be created.\n\t\t// New caches will be created and the unlock returned,\n\t\t// allowing direct access to the newly created\n\t\t// empty data object. A valid owner object must be provided.\n\t\tvar cache = this.cache[ this.key( owner ) ];\n\n\t\treturn key === undefined ?\n\t\t\tcache : cache[ key ];\n\t},\n\taccess: function( owner, key, value ) {\n\t\tvar stored;\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t((key && typeof key === \"string\") && value === undefined) ) {\n\n\t\t\tstored = this.get( owner, key );\n\n\t\t\treturn stored !== undefined ?\n\t\t\t\tstored : this.get( owner, jQuery.camelCase(key) );\n\t\t}\n\n\t\t// [*]When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i, name, camel,\n\t\t\tunlock = this.key( owner ),\n\t\t\tcache = this.cache[ unlock ];\n\n\t\tif ( key === undefined ) {\n\t\t\tthis.cache[ unlock ] = {};\n\n\t\t} else {\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( jQuery.isArray( key ) ) {\n\t\t\t\t// If \"name\" is an array of keys...\n\t\t\t\t// When data is initially created, via (\"key\", \"val\") signature,\n\t\t\t\t// keys will be converted to camelCase.\n\t\t\t\t// Since there is no way to tell _how_ a key was added, remove\n\t\t\t\t// both plain key and camelCase key. #12786\n\t\t\t\t// This will only penalize the array argument path.\n\t\t\t\tname = key.concat( key.map( jQuery.camelCase ) );\n\t\t\t} else {\n\t\t\t\tcamel = jQuery.camelCase( key );\n\t\t\t\t// Try the string as a key before any manipulation\n\t\t\t\tif ( key in cache ) {\n\t\t\t\t\tname = [ key, camel ];\n\t\t\t\t} else {\n\t\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\t\tname = camel;\n\t\t\t\t\tname = name in cache ?\n\t\t\t\t\t\t[ name ] : ( name.match( core_rnotwhite ) || [] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti = name.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ name[ i ] ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\treturn !jQuery.isEmptyObject(\n\t\t\tthis.cache[ owner[ this.expando ] ] || {}\n\t\t);\n\t},\n\tdiscard: function( owner ) {\n\t\tif ( owner[ this.expando ] ) {\n\t\t\tdelete this.cache[ owner[ this.expando ] ];\n\t\t}\n\t}\n};\n\n// These may be used throughout the jQuery core codebase\ndata_user = new Data();\ndata_priv = new Data();\n\n\njQuery.extend({\n\tacceptData: Data.accepts,\n\n\thasData: function( elem ) {\n\t\treturn data_user.hasData( elem ) || data_priv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn data_user.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdata_user.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to data_priv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn data_priv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdata_priv.remove( elem, name );\n\t}\n});\n\njQuery.fn.extend({\n\tdata: function( key, value ) {\n\t\tvar attrs, name,\n\t\t\telem = this[ 0 ],\n\t\t\ti = 0,\n\t\t\tdata = null;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = data_user.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !data_priv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\tattrs = elem.attributes;\n\t\t\t\t\tfor ( ; i < attrs.length; i++ ) {\n\t\t\t\t\t\tname = attrs[ i ].name;\n\n\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\tname = jQuery.camelCase( name.slice(5) );\n\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdata_priv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each(function() {\n\t\t\t\tdata_user.set( this, key );\n\t\t\t});\n\t\t}\n\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\tvar data,\n\t\t\t\tcamelKey = jQuery.camelCase( key );\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// with the key as-is\n\t\t\t\tdata = data_user.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// with the key camelized\n\t\t\t\tdata = data_user.get( elem, camelKey );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, camelKey, undefined );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each(function() {\n\t\t\t\t// First, attempt to store a copy or reference of any\n\t\t\t\t// data that might've been store with a camelCased key.\n\t\t\t\tvar data = data_user.get( this, camelKey );\n\n\t\t\t\t// For HTML5 data-* attribute interop, we have to\n\t\t\t\t// store property names with dashes in a camelCase form.\n\t\t\t\t// This might not apply to all properties...*\n\t\t\t\tdata_user.set( this, camelKey, value );\n\n\t\t\t\t// *... In the case of properties that might _actually_\n\t\t\t\t// have dashes, we need to also store a copy of that\n\t\t\t\t// unchanged property.\n\t\t\t\tif ( key.indexOf(\"-\") !== -1 && data !== undefined ) {\n\t\t\t\t\tdata_user.set( this, key, value );\n\t\t\t\t}\n\t\t\t});\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each(function() {\n\t\t\tdata_user.remove( this, key );\n\t\t});\n\t}\n});\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$1\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = data === \"true\" ? true :\n\t\t\t\t\tdata === \"false\" ? false :\n\t\t\t\t\tdata === \"null\" ? null :\n\t\t\t\t\t// Only convert to a number if it doesn't change the string\n\t\t\t\t\t+data + \"\" === data ? +data :\n\t\t\t\t\trbrace.test( data ) ? JSON.parse( data ) :\n\t\t\t\t\tdata;\n\t\t\t} catch( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdata_user.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\njQuery.extend({\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = data_priv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || jQuery.isArray( data ) ) {\n\t\t\t\t\tqueue = data_priv.access( elem, type, jQuery.makeArray(data) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// not intended for public consumption - generates a queueHooks object, or returns the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn data_priv.get( elem, key ) || data_priv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks(\"once memory\").add(function() {\n\t\t\t\tdata_priv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t})\n\t\t});\n\t}\n});\n\njQuery.fn.extend({\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[0], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[0] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t});\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t});\n\t},\n\t// Based off of the plugin by Clint Helfers, with permission.\n\t// http://blindsignals.com/index.php/2009/07/jquery-delay/\n\tdelay: function( time, type ) {\n\t\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\t\ttype = type || \"fx\";\n\n\t\treturn this.queue( type, function( next, hooks ) {\n\t\t\tvar timeout = setTimeout( next, time );\n\t\t\thooks.stop = function() {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t};\n\t\t});\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile( i-- ) {\n\t\t\ttmp = data_priv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n});\nvar nodeHook, boolHook,\n\trclass = /[\\t\\r\\n\\f]/g,\n\trreturn = /\\r/g,\n\trfocusable = /^(?:input|select|textarea|button)$/i;\n\njQuery.fn.extend({\n\tattr: function( name, value ) {\n\t\treturn jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t});\n\t},\n\n\tprop: function( name, value ) {\n\t\treturn jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t});\n\t},\n\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j,\n\t\t\ti = 0,\n\t\t\tlen = this.length,\n\t\t\tproceed = typeof value === \"string\" && value;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\n\t\tif ( proceed ) {\n\t\t\t// The disjunction here is for better compressibility (see removeClass)\n\t\t\tclasses = ( value || \"\" ).match( core_rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\" \"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telem.className = jQuery.trim( cur );\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j,\n\t\t\ti = 0,\n\t\t\tlen = this.length,\n\t\t\tproceed = arguments.length === 0 || typeof value === \"string\" && value;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\t\tif ( proceed ) {\n\t\t\tclasses = ( value || \"\" ).match( core_rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\"\"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) >= 0 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telem.className = value ? jQuery.trim( cur ) : \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value;\n\n\t\tif ( typeof stateVal === \"boolean\" && type === \"string\" ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( type === \"string\" ) {\n\t\t\t\t// toggle individual class names\n\t\t\t\tvar className,\n\t\t\t\t\ti = 0,\n\t\t\t\t\tself = jQuery( this ),\n\t\t\t\t\tclassNames = value.match( core_rnotwhite ) || [];\n\n\t\t\t\twhile ( (className = classNames[ i++ ]) ) {\n\t\t\t\t\t// check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( type === core_strundefined || type === \"boolean\" ) {\n\t\t\t\tif ( this.className ) {\n\t\t\t\t\t// store className if set\n\t\t\t\t\tdata_priv.set( this, \"__className__\", this.className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed \"false\",\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tthis.className = this.className || value === false ? \"\" : data_priv.get( this, \"__className__\" ) || \"\";\n\t\t\t}\n\t\t});\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className = \" \" + selector + \" \",\n\t\t\ti = 0,\n\t\t\tl = this.length;\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( this[i].nodeType === 1 && (\" \" + this[i].className + \" \").replace(rclass, \" \").indexOf( className ) >= 0 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t},\n\n\tval: function( value ) {\n\t\tvar hooks, ret, isFunction,\n\t\t\telem = this[0];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, \"value\" )) !== undefined ) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\treturn typeof ret === \"string\" ?\n\t\t\t\t\t// handle most common string cases\n\t\t\t\t\tret.replace(rreturn, \"\") :\n\t\t\t\t\t// handle cases where value is null/undef or number\n\t\t\t\t\tret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tisFunction = jQuery.isFunction( value );\n\n\t\treturn this.each(function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\t\t\t} else if ( jQuery.isArray( val ) ) {\n\t\t\t\tval = jQuery.map(val, function ( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t});\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !(\"set\" in hooks) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\t\t\t\t// attributes.value is undefined in Blackberry 4.7 but\n\t\t\t\t// uses .value. See #6932\n\t\t\t\tvar val = elem.attributes.value;\n\t\t\t\treturn !val || val.specified ? elem.value : elem.text;\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\" || index < 0,\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length,\n\t\t\t\t\ti = index < 0 ?\n\t\t\t\t\t\tmax :\n\t\t\t\t\t\tone ? index : 0;\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// IE6-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t( jQuery.support.optDisabled ? !option.disabled : option.getAttribute(\"disabled\") === null ) &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\t\t\t\t\tif ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t},\n\n\tattr: function( elem, name, value ) {\n\t\tvar hooks, ret,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set attributes on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === core_strundefined ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// All attributes are lowercase\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\tname = name.toLowerCase();\n\t\t\thooks = jQuery.attrHooks[ name ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\n\t\t\t} else if ( hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {\n\t\t\t\treturn ret;\n\n\t\t\t} else {\n\t\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t} else if ( hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ) {\n\t\t\treturn ret;\n\n\t\t} else {\n\t\t\tret = jQuery.find.attr( elem, name );\n\n\t\t\t// Non-existent attributes return null, we normalize to undefined\n\t\t\treturn ret == null ?\n\t\t\t\tundefined :\n\t\t\t\tret;\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name, propName,\n\t\t\ti = 0,\n\t\t\tattrNames = value && value.match( core_rnotwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( (name = attrNames[i++]) ) {\n\t\t\t\tpropName = jQuery.propFix[ name ] || name;\n\n\t\t\t\t// Boolean attributes get special treatment (#10870)\n\t\t\t\tif ( jQuery.expr.match.bool.test( name ) ) {\n\t\t\t\t\t// Set corresponding property to false\n\t\t\t\t\telem[ propName ] = false;\n\t\t\t\t}\n\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !jQuery.support.radioValue && value === \"radio\" && jQuery.nodeName(elem, \"input\") ) {\n\t\t\t\t\t// Setting the type on a radio button after the value resets the value in IE6-9\n\t\t\t\t\t// Reset value to default in case type is set after value during creation\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t},\n\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks, notxml,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set properties on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnotxml = nType !== 1 || !jQuery.isXMLDoc( elem );\n\n\t\tif ( notxml ) {\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\treturn hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?\n\t\t\t\tret :\n\t\t\t\t( elem[ name ] = value );\n\n\t\t} else {\n\t\t\treturn hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ?\n\t\t\t\tret :\n\t\t\t\telem[ name ];\n\t\t}\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\t\t\t\treturn elem.hasAttribute( \"tabindex\" ) || rfocusable.test( elem.nodeName ) || elem.href ?\n\t\t\t\t\telem.tabIndex :\n\t\t\t\t\t-1;\n\t\t\t}\n\t\t}\n\t}\n});\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n\tvar getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;\n\n\tjQuery.expr.attrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar fn = jQuery.expr.attrHandle[ name ],\n\t\t\tret = isXML ?\n\t\t\t\tundefined :\n\t\t\t\t/* jshint eqeqeq: false */\n\t\t\t\t// Temporarily disable this handler to check existence\n\t\t\t\t(jQuery.expr.attrHandle[ name ] = undefined) !=\n\t\t\t\t\tgetter( elem, name, isXML ) ?\n\n\t\t\t\t\tname.toLowerCase() :\n\t\t\t\t\tnull;\n\n\t\t// Restore handler\n\t\tjQuery.expr.attrHandle[ name ] = fn;\n\n\t\treturn ret;\n\t};\n});\n\n// Support: IE9+\n// Selectedness for an option in an optgroup can be inaccurate\nif ( !jQuery.support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t};\n}\n\njQuery.each([\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n});\n\n// Radios and checkboxes getter/setter\njQuery.each([ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( jQuery.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !jQuery.support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\t// Support: Webkit\n\t\t\t// \"\" is returned instead of \"on\" if a value isn't specified\n\t\t\treturn elem.getAttribute(\"value\") === null ? \"on\" : elem.value;\n\t\t};\n\t}\n});\nvar rkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|contextmenu)|click/,\n\trfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)$/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = data_priv.get( elem );\n\n\t\t// Don't attach events to noData or text/comment nodes (but allow plain objects)\n\t\tif ( !elemData ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !(events = elemData.events) ) {\n\t\t\tevents = elemData.events = {};\n\t\t}\n\t\tif ( !(eventHandle = elemData.handle) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?\n\t\t\t\t\tjQuery.event.dispatch.apply( eventHandle.elem, arguments ) :\n\t\t\t\t\tundefined;\n\t\t\t};\n\t\t\t// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events\n\t\t\teventHandle.elem = elem;\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( core_rnotwhite ) || [\"\"];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend({\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join(\".\")\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !(handlers = events[ type ]) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle, false );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t\t// Nullify elem to prevent memory leaks in IE\n\t\telem = null;\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = data_priv.hasData( elem ) && data_priv.get( elem );\n\n\t\tif ( !elemData || !(events = elemData.events) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( core_rnotwhite ) || [\"\"];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[2] && new RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdelete elemData.handle;\n\t\t\tdata_priv.remove( elem, \"events\" );\n\t\t}\n\t},\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = core_hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = core_hasOwn.call( event, \"namespace\" ) ? event.namespace.split(\".\") : [];\n\n\t\tcur = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf(\".\") >= 0 ) {\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split(\".\");\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf(\":\") < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join(\".\");\n\t\tevent.namespace_re = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === (elem.ownerDocument || document) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {\n\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( data_priv.get( cur, \"events\" ) || {} )[ event.type ] && data_priv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&\n\t\t\t\tjQuery.acceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\t\t\t\t\telem[ type ]();\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\tdispatch: function( event ) {\n\n\t\t// Make a writable jQuery.Event from the native event object\n\t\tevent = jQuery.event.fix( event );\n\n\t\tvar i, j, ret, matched, handleObj,\n\t\t\thandlerQueue = [],\n\t\t\targs = core_slice.call( arguments ),\n\t\t\thandlers = ( data_priv.get( this, \"events\" ) || {} )[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[0] = event;\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// Triggered event must either 1) have no namespace, or\n\t\t\t\t// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).\n\t\t\t\tif ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )\n\t\t\t\t\t\t\t.apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( (event.result = ret) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\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\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, matches, sel, handleObj,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\t// Black-hole SVG <use> instance trees (#13180)\n\t\t// Avoid non-left-click bubbling in Firefox (#3861)\n\t\tif ( delegateCount && cur.nodeType && (!event.button || event.type !== \"click\") ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.disabled !== true || event.type !== \"click\" ) {\n\t\t\t\t\tmatches = [];\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matches[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatches[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) >= 0 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matches[ sel ] ) {\n\t\t\t\t\t\t\tmatches.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matches.length ) {\n\t\t\t\t\t\thandlerQueue.push({ elem: cur, handlers: matches });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\t// Includes some event props shared by KeyEvent and MouseEvent\n\tprops: \"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),\n\n\tfixHooks: {},\n\n\tkeyHooks: {\n\t\tprops: \"char charCode key keyCode\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\n\t\t\t// Add which for key events\n\t\t\tif ( event.which == null ) {\n\t\t\t\tevent.which = original.charCode != null ? original.charCode : original.keyCode;\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tmouseHooks: {\n\t\tprops: \"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\t\t\tvar eventDoc, doc, body,\n\t\t\t\tbutton = original.button;\n\n\t\t\t// Calculate pageX/Y if missing and clientX/Y available\n\t\t\tif ( event.pageX == null && original.clientX != null ) {\n\t\t\t\teventDoc = event.target.ownerDocument || document;\n\t\t\t\tdoc = eventDoc.documentElement;\n\t\t\t\tbody = eventDoc.body;\n\n\t\t\t\tevent.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );\n\t\t\t\tevent.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );\n\t\t\t}\n\n\t\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\t\t// Note: button is not normalized, so don't use it\n\t\t\tif ( !event.which && button !== undefined ) {\n\t\t\t\tevent.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tfix: function( event ) {\n\t\tif ( event[ jQuery.expando ] ) {\n\t\t\treturn event;\n\t\t}\n\n\t\t// Create a writable copy of the event object and normalize some properties\n\t\tvar i, prop, copy,\n\t\t\ttype = event.type,\n\t\t\toriginalEvent = event,\n\t\t\tfixHook = this.fixHooks[ type ];\n\n\t\tif ( !fixHook ) {\n\t\t\tthis.fixHooks[ type ] = fixHook =\n\t\t\t\trmouseEvent.test( type ) ? this.mouseHooks :\n\t\t\t\trkeyEvent.test( type ) ? this.keyHooks :\n\t\t\t\t{};\n\t\t}\n\t\tcopy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;\n\n\t\tevent = new jQuery.Event( originalEvent );\n\n\t\ti = copy.length;\n\t\twhile ( i-- ) {\n\t\t\tprop = copy[ i ];\n\t\t\tevent[ prop ] = originalEvent[ prop ];\n\t\t}\n\n\t\t// Support: Cordova 2.5 (WebKit) (#13255)\n\t\t// All events should have a target; Cordova deviceready doesn't\n\t\tif ( !event.target ) {\n\t\t\tevent.target = document;\n\t\t}\n\n\t\t// Support: Safari 6.0+, Chrome < 28\n\t\t// Target should not be a text node (#504, #13143)\n\t\tif ( event.target.nodeType === 3 ) {\n\t\t\tevent.target = event.target.parentNode;\n\t\t}\n\n\t\treturn fixHook.filter? fixHook.filter( event, originalEvent ) : event;\n\t},\n\n\tspecial: {\n\t\tload: {\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tfocus: {\n\t\t\t// Fire native event if possible so blur/focus sequence is correct\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this !== safeActiveElement() && this.focus ) {\n\t\t\t\t\tthis.focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusin\"\n\t\t},\n\t\tblur: {\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this === safeActiveElement() && this.blur ) {\n\t\t\t\t\tthis.blur();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusout\"\n\t\t},\n\t\tclick: {\n\t\t\t// For checkbox, fire native event so checked state will be right\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this.type === \"checkbox\" && this.click && jQuery.nodeName( this, \"input\" ) ) {\n\t\t\t\t\tthis.click();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, don't fire native .click() on links\n\t\t\t_default: function( event ) {\n\t\t\t\treturn jQuery.nodeName( event.target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tsimulate: function( type, elem, event, bubble ) {\n\t\t// Piggyback on a donor event to simulate a different one.\n\t\t// Fake originalEvent to avoid donor's stopPropagation, but if the\n\t\t// simulated event prevents default then we do the same on the donor.\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true,\n\t\t\t\toriginalEvent: {}\n\t\t\t}\n\t\t);\n\t\tif ( bubble ) {\n\t\t\tjQuery.event.trigger( e, null, elem );\n\t\t} else {\n\t\t\tjQuery.event.dispatch.call( elem, e );\n\t\t}\n\t\tif ( e.isDefaultPrevented() ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n};\n\njQuery.removeEvent = function( elem, type, handle ) {\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle, false );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\t// Allow instantiation without the 'new' keyword\n\tif ( !(this instanceof jQuery.Event) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = ( src.defaultPrevented ||\n\t\t\tsrc.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || jQuery.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && e.preventDefault ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && e.stopPropagation ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// Support: Chrome 15+\njQuery.each({\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mousenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || (related !== target && !jQuery.contains( target, related )) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n});\n\n// Create \"bubbling\" focus and blur events\n// Support: Firefox, Chrome, Safari\nif ( !jQuery.support.focusinBubbles ) {\n\tjQuery.each({ focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler while someone wants focusin/focusout\n\t\tvar attaches = 0,\n\t\t\thandler = function( event ) {\n\t\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );\n\t\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\t\t\t\tif ( attaches++ === 0 ) {\n\t\t\t\t\tdocument.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tif ( --attaches === 0 ) {\n\t\t\t\t\tdocument.removeEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n}\n\njQuery.fn.extend({\n\n\ton: function( types, selector, data, fn, /*INTERNAL*/ one ) {\n\t\tvar origFn, type;\n\n\t\t// Types can be a map of types/handlers\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-Object, selector, data )\n\t\t\tif ( typeof selector !== \"string\" ) {\n\t\t\t\t// ( types-Object, data )\n\t\t\t\tdata = data || selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.on( type, selector, data, types[ type ], one );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( data == null && fn == null ) {\n\t\t\t// ( types, fn )\n\t\t\tfn = selector;\n\t\t\tdata = selector = undefined;\n\t\t} else if ( fn == null ) {\n\t\t\tif ( typeof selector === \"string\" ) {\n\t\t\t\t// ( types, selector, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = undefined;\n\t\t\t} else {\n\t\t\t\t// ( types, data, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t} else if ( !fn ) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( one === 1 ) {\n\t\t\torigFn = fn;\n\t\t\tfn = function( event ) {\n\t\t\t\t// Can use an empty set, since event contains the info\n\t\t\t\tjQuery().off( event );\n\t\t\t\treturn origFn.apply( this, arguments );\n\t\t\t};\n\t\t\t// Use same guid so caller can remove using origFn\n\t\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.add( this, types, fn, data, selector );\n\t\t});\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn this.on( types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t});\n\t},\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t});\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[0];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n});\nvar isSimple = /^.[^:#\\[\\.,]*$/,\n\trparentsprev = /^(?:parents|prev(?:Until|All))/,\n\trneedsContext = jQuery.expr.match.needsContext,\n\t// methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend({\n\tfind: function( selector ) {\n\t\tvar i,\n\t\t\tret = [],\n\t\t\tself = this,\n\t\t\tlen = self.length;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter(function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) );\n\t\t}\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\t// Needed because $( selector, context ) becomes $( context ).find( selector )\n\t\tret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );\n\t\tret.selector = this.selector ? this.selector + \" \" + selector : selector;\n\t\treturn ret;\n\t},\n\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter(function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[i] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector || [], true) );\n\t},\n\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector || [], false) );\n\t},\n\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\tpos = ( rneedsContext.test( selectors ) || typeof selectors !== \"string\" ) ?\n\t\t\t\tjQuery( selectors, context || this.context ) :\n\t\t\t\t0;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tfor ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {\n\t\t\t\t// Always skip document fragments\n\t\t\t\tif ( cur.nodeType < 11 && (pos ?\n\t\t\t\t\tpos.index(cur) > -1 :\n\n\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\tjQuery.find.matchesSelector(cur, selectors)) ) {\n\n\t\t\t\t\tcur = matched.push( cur );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within\n\t// the matched set of elements\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn core_indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn core_indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\tvar set = typeof selector === \"string\" ?\n\t\t\t\tjQuery( selector, context ) :\n\t\t\t\tjQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),\n\t\t\tall = jQuery.merge( this.get(), set );\n\n\t\treturn this.pushStack( jQuery.unique(all) );\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter(selector)\n\t\t);\n\t}\n});\n\nfunction sibling( cur, dir ) {\n\twhile ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}\n\n\treturn cur;\n}\n\njQuery.each({\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn jQuery.dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn jQuery.sibling( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\treturn elem.contentDocument || jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.unique( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n});\n\njQuery.extend({\n\tfilter: function( expr, elems, not ) {\n\t\tvar elem = elems[ 0 ];\n\n\t\tif ( not ) {\n\t\t\texpr = \":not(\" + expr + \")\";\n\t\t}\n\n\t\treturn elems.length === 1 && elem.nodeType === 1 ?\n\t\t\tjQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :\n\t\t\tjQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\t\t\treturn elem.nodeType === 1;\n\t\t\t}));\n\t},\n\n\tdir: function( elem, dir, until ) {\n\t\tvar matched = [],\n\t\t\ttruncate = until !== undefined;\n\n\t\twhile ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmatched.push( elem );\n\t\t\t}\n\t\t}\n\t\treturn matched;\n\t},\n\n\tsibling: function( n, elem ) {\n\t\tvar matched = [];\n\n\t\tfor ( ; n; n = n.nextSibling ) {\n\t\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\t\tmatched.push( n );\n\t\t\t}\n\t\t}\n\n\t\treturn matched;\n\t}\n});\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( jQuery.isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\t/* jshint -W018 */\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t});\n\n\t}\n\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t});\n\n\t}\n\n\tif ( typeof qualifier === \"string\" ) {\n\t\tif ( isSimple.test( qualifier ) ) {\n\t\t\treturn jQuery.filter( qualifier, elements, not );\n\t\t}\n\n\t\tqualifier = jQuery.filter( qualifier, elements );\n\t}\n\n\treturn jQuery.grep( elements, function( elem ) {\n\t\treturn ( core_indexOf.call( qualifier, elem ) >= 0 ) !== not;\n\t});\n}\nvar rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,\n\trtagName = /<([\\w:]+)/,\n\trhtml = /<|&#?\\w+;/,\n\trnoInnerhtml = /<(?:script|style|link)/i,\n\tmanipulation_rcheckableType = /^(?:checkbox|radio)$/i,\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trscriptType = /^$|\\/(?:java|ecma)script/i,\n\trscriptTypeMasked = /^true\\/(.*)/,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g,\n\n\t// We have to close these tags to support XHTML (#13200)\n\twrapMap = {\n\n\t\t// Support: IE 9\n\t\toption: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n\t\tthead: [ 1, \"<table>\", \"</table>\" ],\n\t\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\t\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\t\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t\t_default: [ 0, \"\", \"\" ]\n\t};\n\n// Support: IE 9\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\njQuery.fn.extend({\n\ttext: function( value ) {\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t});\n\t},\n\n\tprepend: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t});\n\t},\n\n\tbefore: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t});\n\t},\n\n\tafter: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t});\n\t},\n\n\t// keepData is for internal use only--do not document\n\tremove: function( selector, keepData ) {\n\t\tvar elem,\n\t\t\telems = selector ? jQuery.filter( selector, this ) : this,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\tif ( !keepData && elem.nodeType === 1 ) {\n\t\t\t\tjQuery.cleanData( getAll( elem ) );\n\t\t\t}\n\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\tif ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\t\t\tsetGlobalEval( getAll( elem, \"script\" ) );\n\t\t\t\t}\n\t\t\t\telem.parentNode.removeChild( elem );\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = this[i]) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function () {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t});\n\t},\n\n\thtml: function( value ) {\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = value.replace( rxhtmlTag, \"<$1></$2>\" );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar\n\t\t\t// Snapshot the DOM in case .domManip sweeps something relevant into its fragment\n\t\t\targs = jQuery.map( this, function( elem ) {\n\t\t\t\treturn [ elem.nextSibling, elem.parentNode ];\n\t\t\t}),\n\t\t\ti = 0;\n\n\t\t// Make the changes, replacing each context element with the new content\n\t\tthis.domManip( arguments, function( elem ) {\n\t\t\tvar next = args[ i++ ],\n\t\t\t\tparent = args[ i++ ];\n\n\t\t\tif ( parent ) {\n\t\t\t\t// Don't use the snapshot next if it has moved (#13810)\n\t\t\t\tif ( next && next.parentNode !== parent ) {\n\t\t\t\t\tnext = this.nextSibling;\n\t\t\t\t}\n\t\t\t\tjQuery( this ).remove();\n\t\t\t\tparent.insertBefore( elem, next );\n\t\t\t}\n\t\t// Allow new content to include elements from the context set\n\t\t}, true );\n\n\t\t// Force removal if there was no new content (e.g., from empty arguments)\n\t\treturn i ? this : this.remove();\n\t},\n\n\tdetach: function( selector ) {\n\t\treturn this.remove( selector, true );\n\t},\n\n\tdomManip: function( args, callback, allowIntersection ) {\n\n\t\t// Flatten any nested arrays\n\t\targs = core_concat.apply( [], args );\n\n\t\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tset = this,\n\t\t\tiNoClone = l - 1,\n\t\t\tvalue = args[ 0 ],\n\t\t\tisFunction = jQuery.isFunction( value );\n\n\t\t// We can't cloneNode fragments that contain checked, in WebKit\n\t\tif ( isFunction || !( l <= 1 || typeof value !== \"string\" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {\n\t\t\treturn this.each(function( index ) {\n\t\t\t\tvar self = set.eq( index );\n\t\t\t\tif ( isFunction ) {\n\t\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t\t}\n\t\t\t\tself.domManip( args, callback, allowIntersection );\n\t\t\t});\n\t\t}\n\n\t\tif ( l ) {\n\t\t\tfragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );\n\t\t\tfirst = fragment.firstChild;\n\n\t\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\t\tfragment = first;\n\t\t\t}\n\n\t\t\tif ( first ) {\n\t\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\t\thasScripts = scripts.length;\n\n\t\t\t\t// Use the original fragment for the last item instead of the first because it can end up\n\t\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\tnode = fragment;\n\n\t\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback.call( this[ i ], node, i );\n\t\t\t\t}\n\n\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t\t// Reenable scripts\n\t\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t\t!data_priv.access( node, \"globalEval\" ) && jQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\t\tif ( node.src ) {\n\t\t\t\t\t\t\t\t// Hope ajax is available...\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.globalEval( node.textContent.replace( rcleanScript, \"\" ) );\n\t\t\t\t\t\t\t}\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\treturn this;\n\t}\n});\n\njQuery.each({\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: QtWebKit\n\t\t\t// .get() because core_push.apply(_, arraylike) throws\n\t\t\tcore_push.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n});\n\njQuery.extend({\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t// Support: IE >= 9\n\t\t// Fix Cloning issues\n\t\tif ( !jQuery.support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tbuildFragment: function( elems, context, scripts, selection ) {\n\t\tvar elem, tmp, tag, wrap, contains, j,\n\t\t\ti = 0,\n\t\t\tl = elems.length,\n\t\t\tfragment = context.createDocumentFragment(),\n\t\t\tnodes = [];\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\telem = elems[ i ];\n\n\t\t\tif ( elem || elem === 0 ) {\n\n\t\t\t\t// Add nodes directly\n\t\t\t\tif ( jQuery.type( elem ) === \"object\" ) {\n\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t\t// Convert non-html into a text node\n\t\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t\t// Convert html into DOM nodes\n\t\t\t\t} else {\n\t\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement(\"div\") );\n\n\t\t\t\t\t// Deserialize a standard representation\n\t\t\t\t\ttag = ( rtagName.exec( elem ) || [\"\", \"\"] )[ 1 ].toLowerCase();\n\t\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\t\ttmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, \"<$1></$2>\" ) + wrap[ 2 ];\n\n\t\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\t\tj = wrap[ 0 ];\n\t\t\t\t\twhile ( j-- ) {\n\t\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t\t// Remember the top-level container\n\t\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t\t// Fixes #12346\n\t\t\t\t\t// Support: Webkit, IE\n\t\t\t\t\ttmp.textContent = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove wrapper from fragment\n\t\tfragment.textContent = \"\";\n\n\t\ti = 0;\n\t\twhile ( (elem = nodes[ i++ ]) ) {\n\n\t\t\t// #4087 - If origin and destination elements are the same, and this is\n\t\t\t// that element, do not do anything\n\t\t\tif ( selection && jQuery.inArray( elem, selection ) !== -1 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcontains = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t\t// Append to fragment\n\t\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t\t// Preserve script evaluation history\n\t\t\tif ( contains ) {\n\t\t\t\tsetGlobalEval( tmp );\n\t\t\t}\n\n\t\t\t// Capture executables\n\t\t\tif ( scripts ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (elem = tmp[ j++ ]) ) {\n\t\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\t\tscripts.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn fragment;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, events, type, key, j,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = elems[ i ]) !== undefined; i++ ) {\n\t\t\tif ( Data.accepts( elem ) ) {\n\t\t\t\tkey = elem[ data_priv.expando ];\n\n\t\t\t\tif ( key && (data = data_priv.cache[ key ]) ) {\n\t\t\t\t\tevents = Object.keys( data.events || {} );\n\t\t\t\t\tif ( events.length ) {\n\t\t\t\t\t\tfor ( j = 0; (type = events[j]) !== undefined; j++ ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( data_priv.cache[ key ] ) {\n\t\t\t\t\t\t// Discard any remaining `private` data\n\t\t\t\t\t\tdelete data_priv.cache[ key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Discard any remaining `user` data\n\t\t\tdelete data_user.cache[ elem[ data_user.expando ] ];\n\t\t}\n\t},\n\n\t_evalUrl: function( url ) {\n\t\treturn jQuery.ajax({\n\t\t\turl: url,\n\t\t\ttype: \"GET\",\n\t\t\tdataType: \"script\",\n\t\t\tasync: false,\n\t\t\tglobal: false,\n\t\t\t\"throws\": true\n\t\t});\n\t}\n});\n\n// Support: 1.x compatibility\n// Manipulating tables requires a tbody\nfunction manipulationTarget( elem, content ) {\n\treturn jQuery.nodeName( elem, \"table\" ) &&\n\t\tjQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, \"tr\" ) ?\n\n\t\telem.getElementsByTagName(\"tbody\")[0] ||\n\t\t\telem.appendChild( elem.ownerDocument.createElement(\"tbody\") ) :\n\t\telem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = (elem.getAttribute(\"type\") !== null) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tvar match = rscriptTypeMasked.exec( elem.type );\n\n\tif ( match ) {\n\t\telem.type = match[ 1 ];\n\t} else {\n\t\telem.removeAttribute(\"type\");\n\t}\n\n\treturn elem;\n}\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar l = elems.length,\n\t\ti = 0;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdata_priv.set(\n\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( data_priv.hasData( src ) ) {\n\t\tpdataOld = data_priv.access( src );\n\t\tpdataCur = data_priv.set( dest, pdataOld );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdelete pdataCur.handle;\n\t\t\tpdataCur.events = {};\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( data_user.hasData( src ) ) {\n\t\tudataOld = data_user.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdata_user.set( dest, udataCur );\n\t}\n}\n\n\nfunction getAll( context, tag ) {\n\tvar ret = context.getElementsByTagName ? context.getElementsByTagName( tag || \"*\" ) :\n\t\t\tcontext.querySelectorAll ? context.querySelectorAll( tag || \"*\" ) :\n\t\t\t[];\n\n\treturn tag === undefined || tag && jQuery.nodeName( context, tag ) ?\n\t\tjQuery.merge( [ context ], ret ) :\n\t\tret;\n}\n\n// Support: IE >= 9\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && manipulation_rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\njQuery.fn.extend({\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).wrapAll( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\tif ( this[ 0 ] ) {\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map(function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t}).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t});\n\t},\n\n\twrap: function( html ) {\n\t\tvar isFunction = jQuery.isFunction( html );\n\n\t\treturn this.each(function( i ) {\n\t\t\tjQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );\n\t\t});\n\t},\n\n\tunwrap: function() {\n\t\treturn this.parent().each(function() {\n\t\t\tif ( !jQuery.nodeName( this, \"body\" ) ) {\n\t\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t\t}\n\t\t}).end();\n\t}\n});\nvar curCSS, iframe,\n\t// swappable if display is none or starts with table except \"table\", \"table-cell\", or \"table-caption\"\n\t// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trmargin = /^margin/,\n\trnumsplit = new RegExp( \"^(\" + core_pnum + \")(.*)$\", \"i\" ),\n\trnumnonpx = new RegExp( \"^(\" + core_pnum + \")(?!px)[a-z%]+$\", \"i\" ),\n\trrelNum = new RegExp( \"^([+-])=(\" + core_pnum + \")\", \"i\" ),\n\telemdisplay = { BODY: \"block\" },\n\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: 0,\n\t\tfontWeight: 400\n\t},\n\n\tcssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ],\n\tcssPrefixes = [ \"Webkit\", \"O\", \"Moz\", \"ms\" ];\n\n// return a css property mapped to a potentially vendor prefixed property\nfunction vendorPropName( style, name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in style ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt(0).toUpperCase() + name.slice(1),\n\t\torigName = name,\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in style ) {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\treturn origName;\n}\n\nfunction isHidden( elem, el ) {\n\t// isHidden might be called from jQuery#filter function;\n\t// in that case, element will be second argument\n\telem = el || elem;\n\treturn jQuery.css( elem, \"display\" ) === \"none\" || !jQuery.contains( elem.ownerDocument, elem );\n}\n\n// NOTE: we've included the \"window\" in window.getComputedStyle\n// because jsdom on node.js will break without it.\nfunction getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem, hidden,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalues[ index ] = data_priv.get( elem, \"olddisplay\" );\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\t\t\t// Reset the inline display of this element to learn if it is\n\t\t\t// being hidden by cascaded rules or not\n\t\t\tif ( !values[ index ] && display === \"none\" ) {\n\t\t\t\telem.style.display = \"\";\n\t\t\t}\n\n\t\t\t// Set elements which have been overridden with display: none\n\t\t\t// in a stylesheet to whatever the default browser style is\n\t\t\t// for such an element\n\t\t\tif ( elem.style.display === \"\" && isHidden( elem ) ) {\n\t\t\t\tvalues[ index ] = data_priv.access( elem, \"olddisplay\", css_defaultDisplay(elem.nodeName) );\n\t\t\t}\n\t\t} else {\n\n\t\t\tif ( !values[ index ] ) {\n\t\t\t\thidden = isHidden( elem );\n\n\t\t\t\tif ( display && display !== \"none\" || !hidden ) {\n\t\t\t\t\tdata_priv.set( elem, \"olddisplay\", hidden ? display : jQuery.css(elem, \"display\") );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of most of the elements in a second loop\n\t// to avoid the constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( !show || elem.style.display === \"none\" || elem.style.display === \"\" ) {\n\t\t\telem.style.display = show ? values[ index ] || \"\" : \"none\";\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend({\n\tcss: function( name, value ) {\n\t\treturn jQuery.access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( jQuery.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t},\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( isHidden( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"fontWeight\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {\n\t\t// normalize float css property\n\t\t\"float\": \"cssFloat\"\n\t},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = jQuery.camelCase( name ),\n\t\t\tstyle = elem.style;\n\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );\n\n\t\t// gets hook for the prefixed version\n\t\t// followed by the unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// convert relative number strings (+= or -=) to relative numbers. #7345\n\t\t\tif ( type === \"string\" && (ret = rrelNum.exec( value )) ) {\n\t\t\t\tvalue = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that NaN and null values aren't set. See: #7116\n\t\t\tif ( value == null || type === \"number\" && isNaN( value ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add 'px' to the (except for certain CSS properties)\n\t\t\tif ( type === \"number\" && !jQuery.cssNumber[ origName ] ) {\n\t\t\t\tvalue += \"px\";\n\t\t\t}\n\n\t\t\t// Fixes #8908, it can be done more correctly by specifying setters in cssHooks,\n\t\t\t// but it would mean to define eight (for every problematic property) identical functions\n\t\t\tif ( !jQuery.support.clearCloneStyle && value === \"\" && name.indexOf(\"background\") === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !(\"set\" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {\n\t\t\t\tstyle[ name ] = value;\n\t\t\t}\n\n\t\t} else {\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = jQuery.camelCase( name );\n\n\t\t// Make sure that we're working with the right name\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );\n\n\t\t// gets hook for the prefixed version\n\t\t// followed by the unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t//convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Return, converting to number if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || jQuery.isNumeric( num ) ? num || 0 : val;\n\t\t}\n\t\treturn val;\n\t}\n});\n\ncurCSS = function( elem, name, _computed ) {\n\tvar width, minWidth, maxWidth,\n\t\tcomputed = _computed || getStyles( elem ),\n\n\t\t// Support: IE9\n\t\t// getPropertyValue is only needed for .css('filter') in IE9, see #12537\n\t\tret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,\n\t\tstyle = elem.style;\n\n\tif ( computed ) {\n\n\t\tif ( ret === \"\" && !jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// Support: Safari 5.1\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels\n\t\t// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values\n\t\tif ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret;\n};\n\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\tvar matches = rnumsplit.exec( value );\n\treturn matches ?\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {\n\tvar i = extra === ( isBorderBox ? \"border\" : \"content\" ) ?\n\t\t// If we already have the right measurement, avoid augmentation\n\t\t4 :\n\t\t// Otherwise initialize for horizontal or vertical properties\n\t\tname === \"width\" ? 1 : 0,\n\n\t\tval = 0;\n\n\tfor ( ; i < 4; i += 2 ) {\n\t\t// both box models exclude margin, so add it if we want it\n\t\tif ( extra === \"margin\" ) {\n\t\t\tval += jQuery.css( elem, extra + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\tif ( isBorderBox ) {\n\t\t\t// border-box includes padding, so remove it if we want content\n\t\t\tif ( extra === \"content\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// at this point, extra isn't border nor margin, so remove border\n\t\t\tif ( extra !== \"margin\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t} else {\n\t\t\t// at this point, extra isn't content, so add padding\n\t\t\tval += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// at this point, extra isn't content nor padding, so add border\n\t\t\tif ( extra !== \"padding\" ) {\n\t\t\t\tval += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn val;\n}\n\nfunction getWidthOrHeight( elem, name, extra ) {\n\n\t// Start with offset property, which is equivalent to the border-box value\n\tvar valueIsBorderBox = true,\n\t\tval = name === \"width\" ? elem.offsetWidth : elem.offsetHeight,\n\t\tstyles = getStyles( elem ),\n\t\tisBorderBox = jQuery.support.boxSizing && jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t// some non-html elements return undefined for offsetWidth, so check for null/undefined\n\t// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285\n\t// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668\n\tif ( val <= 0 || val == null ) {\n\t\t// Fall back to computed then uncomputed css if necessary\n\t\tval = curCSS( elem, name, styles );\n\t\tif ( val < 0 || val == null ) {\n\t\t\tval = elem.style[ name ];\n\t\t}\n\n\t\t// Computed unit is not pixels. Stop here and return.\n\t\tif ( rnumnonpx.test(val) ) {\n\t\t\treturn val;\n\t\t}\n\n\t\t// we need the check for style in case a browser which returns unreliable values\n\t\t// for getComputedStyle silently falls back to the reliable elem.style\n\t\tvalueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );\n\n\t\t// Normalize \"\", auto, and prepare for extra\n\t\tval = parseFloat( val ) || 0;\n\t}\n\n\t// use the active box-sizing model to add/subtract irrelevant styles\n\treturn ( val +\n\t\taugmentWidthOrHeight(\n\t\t\telem,\n\t\t\tname,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles\n\t\t)\n\t) + \"px\";\n}\n\n// Try to determine the default display value of an element\nfunction css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}\n\n// Called ONLY from within css_defaultDisplay\nfunction actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}\n\njQuery.each([ \"height\", \"width\" ], function( i, name ) {\n\tjQuery.cssHooks[ name ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\t\t\t\t// certain elements can have dimension info if we invisibly show them\n\t\t\t\t// however, it must have a current display style that would benefit from this\n\t\t\t\treturn elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, \"display\" ) ) ?\n\t\t\t\t\tjQuery.swap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, name, extra );\n\t\t\t\t\t}) :\n\t\t\t\t\tgetWidthOrHeight( elem, name, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar styles = extra && getStyles( elem );\n\t\t\treturn setPositiveNumber( elem, value, extra ?\n\t\t\t\taugmentWidthOrHeight(\n\t\t\t\t\telem,\n\t\t\t\t\tname,\n\t\t\t\t\textra,\n\t\t\t\t\tjQuery.support.boxSizing && jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\t\tstyles\n\t\t\t\t) : 0\n\t\t\t);\n\t\t}\n\t};\n});\n\n// These hooks cannot be added until DOM ready because the support test\n// for it is not run until after DOM ready\njQuery(function() {\n\t// Support: Android 2.3\n\tif ( !jQuery.support.reliableMarginRight ) {\n\t\tjQuery.cssHooks.marginRight = {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\t// Support: Android 2.3\n\t\t\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\t\t\t// Work around by temporarily setting element display to inline-block\n\t\t\t\t\treturn jQuery.swap( elem, { \"display\": \"inline-block\" },\n\t\t\t\t\t\tcurCSS, [ elem, \"marginRight\" ] );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n\t// getComputedStyle returns percent when specified for top/left/bottom/right\n\t// rather than make the css module depend on the offset module, we just check for it here\n\tif ( !jQuery.support.pixelPosition && jQuery.fn.position ) {\n\t\tjQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\t\t\tjQuery.cssHooks[ prop ] = {\n\t\t\t\tget: function( elem, computed ) {\n\t\t\t\t\tif ( computed ) {\n\t\t\t\t\t\tcomputed = curCSS( elem, prop );\n\t\t\t\t\t\t// if curCSS returns percentage, fallback to offset\n\t\t\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\t\t\tcomputed;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\n});\n\nif ( jQuery.expr && jQuery.expr.filters ) {\n\tjQuery.expr.filters.hidden = function( elem ) {\n\t\t// Support: Opera <= 12.12\n\t\t// Opera reports offsetWidths and offsetHeights less than zero on some elements\n\t\treturn elem.offsetWidth <= 0 && elem.offsetHeight <= 0;\n\t};\n\n\tjQuery.expr.filters.visible = function( elem ) {\n\t\treturn !jQuery.expr.filters.hidden( elem );\n\t};\n}\n\n// These hooks are used by animate to expand properties\njQuery.each({\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split(\" \") : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( !rmargin.test( prefix ) ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n});\nvar r20 = /%20/g,\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\njQuery.fn.extend({\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map(function(){\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t})\n\t\t.filter(function(){\n\t\t\tvar type = this.type;\n\t\t\t// Use .is(\":disabled\") so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !manipulation_rcheckableType.test( type ) );\n\t\t})\n\t\t.map(function( i, elem ){\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\treturn val == null ?\n\t\t\t\tnull :\n\t\t\t\tjQuery.isArray( val ) ?\n\t\t\t\t\tjQuery.map( val, function( val ){\n\t\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t\t}) :\n\t\t\t\t\t{ name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t}).get();\n\t}\n});\n\n//Serialize an array of form elements or a set of\n//key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, value ) {\n\t\t\t// If value is a function, invoke it and return its value\n\t\t\tvalue = jQuery.isFunction( value ) ? value() : ( value == null ? \"\" : value );\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" + encodeURIComponent( value );\n\t\t};\n\n\t// Set traditional to true for jQuery <= 1.3.2 behavior.\n\tif ( traditional === undefined ) {\n\t\ttraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t});\n\n\t} else {\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" ).replace( r20, \"+\" );\n};\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( jQuery.isArray( obj ) ) {\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams( prefix + \"[\" + ( typeof v === \"object\" ? i : \"\" ) + \"]\", v, traditional, add );\n\t\t\t}\n\t\t});\n\n\t} else if ( !traditional && jQuery.type( obj ) === \"object\" ) {\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\njQuery.each( (\"blur focus focusin focusout load resize scroll unload click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup error contextmenu\").split(\" \"), function( i, name ) {\n\n\t// Handle event binding\n\tjQuery.fn[ name ] = function( data, fn ) {\n\t\treturn arguments.length > 0 ?\n\t\t\tthis.on( name, null, data, fn ) :\n\t\t\tthis.trigger( name );\n\t};\n});\n\njQuery.fn.extend({\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t},\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ? this.off( selector, \"**\" ) : this.off( types, selector || \"**\", fn );\n\t}\n});\nvar\n\t// Document location\n\tajaxLocParts,\n\tajaxLocation,\n\n\tajax_nonce = jQuery.now(),\n\n\tajax_rquery = /\\?/,\n\trhash = /#.*$/,\n\trts = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\trurl = /^([\\w.+-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+)|)|)/,\n\n\t// Keep a copy of the old load method\n\t_load = jQuery.fn.load,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat(\"*\");\n\n// #8138, IE may throw an exception when accessing\n// a field from window.location if document.domain has been set\ntry {\n\tajaxLocation = location.href;\n} catch( e ) {\n\t// Use the href attribute of an A element\n\t// since IE will modify it given document.location\n\tajaxLocation = document.createElement( \"a\" );\n\tajaxLocation.href = \"\";\n\tajaxLocation = ajaxLocation.href;\n}\n\n// Segment location into parts\najaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];\n\n\t\tif ( jQuery.isFunction( func ) ) {\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( (dataType = dataTypes[i++]) ) {\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[0] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\njQuery.fn.load = function( url, params, callback ) {\n\tif ( typeof url !== \"string\" && _load ) {\n\t\treturn _load.apply( this, arguments );\n\t}\n\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf(\" \");\n\n\tif ( off >= 0 ) {\n\t\tselector = url.slice( off );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( jQuery.isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax({\n\t\t\turl: url,\n\n\t\t\t// if \"type\" variable is undefined, then \"GET\" method will be used\n\t\t\ttype: type,\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t}).done(function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery(\"<div>\").append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t}).complete( callback && function( jqXHR, status ) {\n\t\t\tself.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t});\n\t}\n\n\treturn this;\n};\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [ \"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\" ], function( i, type ){\n\tjQuery.fn[ type ] = function( fn ){\n\t\treturn this.on( type, fn );\n\t};\n});\n\njQuery.extend({\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: ajaxLocation,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /xml/,\n\t\t\thtml: /html/,\n\t\t\tjson: /json/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": jQuery.parseJSON,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\t\t\t// Cross-domain detection vars\n\t\t\tparts,\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\t\t\t// Loop variable\n\t\t\ti,\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks(\"once memory\"),\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\t\t\t// The jqXHR state\n\t\t\tstate = 0,\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( state === 2 ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( (match = rheaders.exec( responseHeadersString )) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[1].toLowerCase() ] = match[ 2 ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match;\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn state === 2 ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tvar lname = name.toLowerCase();\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\tname = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\t// Lazy-add the new callback in a way that preserves old ones\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR ).complete = completeDeferred.add;\n\t\tjqXHR.success = jqXHR.done;\n\t\tjqXHR.error = jqXHR.fail;\n\n\t\t// Remove hash character (#7531: and string promotion)\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || ajaxLocation ) + \"\" ).replace( rhash, \"\" )\n\t\t\t.replace( rprotocol, ajaxLocParts[ 1 ] + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = jQuery.trim( s.dataType || \"*\" ).toLowerCase().match( core_rnotwhite ) || [\"\"];\n\n\t\t// A cross-domain request is in order when we have a protocol:host:port mismatch\n\t\tif ( s.crossDomain == null ) {\n\t\t\tparts = rurl.exec( s.url.toLowerCase() );\n\t\t\ts.crossDomain = !!( parts &&\n\t\t\t\t( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||\n\t\t\t\t\t( parts[ 3 ] || ( parts[ 1 ] === \"http:\" ? \"80\" : \"443\" ) ) !==\n\t\t\t\t\t\t( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === \"http:\" ? \"80\" : \"443\" ) ) )\n\t\t\t);\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( state === 2 ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\tfireGlobals = s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger(\"ajaxStart\");\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\tcacheURL = s.url;\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// If data is available, append data to url\n\t\t\tif ( s.data ) {\n\t\t\t\tcacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data );\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add anti-cache in url if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\ts.url = rts.test( cacheURL ) ?\n\n\t\t\t\t\t// If there is already a '_' parameter, set its value\n\t\t\t\t\tcacheURL.replace( rts, \"$1_=\" + ajax_nonce++ ) :\n\n\t\t\t\t\t// Otherwise add one to the end\n\t\t\t\t\tcacheURL + ( ajax_rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ajax_nonce++;\n\t\t\t}\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tfor ( i in { success: 1, error: 1, complete: 1 } ) {\n\t\t\tjqXHR[ i ]( s[ i ] );\n\t\t}\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = setTimeout(function() {\n\t\t\t\t\tjqXHR.abort(\"timeout\");\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tstate = 1;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\t\t\t\t// Propagate exception as error if not done\n\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\tdone( -1, e );\n\t\t\t\t// Simply rethrow otherwise\n\t\t\t\t} else {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"Last-Modified\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"etag\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger(\"ajaxStop\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n});\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\t\t// shift arguments if data argument was omitted\n\t\tif ( jQuery.isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\treturn jQuery.ajax({\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t});\n\t};\n});\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t}\n\n\treturn { state: \"success\", data: response };\n}\n// Install script dataType\njQuery.ajaxSetup({\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /(?:java|ecma)script/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n});\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n});\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\t// This transport only deals with cross domain requests\n\tif ( s.crossDomain ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery(\"<script>\").prop({\n\t\t\t\t\tasync: true,\n\t\t\t\t\tcharset: s.scriptCharset,\n\t\t\t\t\tsrc: s.url\n\t\t\t\t}).on(\n\t\t\t\t\t\"load error\",\n\t\t\t\t\tcallback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup({\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( ajax_nonce++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n});\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" && !( s.contentType || \"\" ).indexOf(\"application/x-www-form-urlencoded\") && rjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( ajax_rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[\"script json\"] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always(function() {\n\t\t\t// Restore preexisting value\n\t\t\twindow[ callbackName ] = overwritten;\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\t\t\t\t// make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && jQuery.isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t});\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n});\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new XMLHttpRequest();\n\t} catch( e ) {}\n};\n\nvar xhrSupported = jQuery.ajaxSettings.xhr(),\n\txhrSuccessStatus = {\n\t\t// file protocol always yields status code 0, assume 200\n\t\t0: 200,\n\t\t// Support: IE9\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\t// Support: IE9\n\t// We need to keep track of outbound xhr and abort them manually\n\t// because IE is not smart enough to do it all by itself\n\txhrId = 0,\n\txhrCallbacks = {};\n\nif ( window.ActiveXObject ) {\n\tjQuery( window ).on( \"unload\", function() {\n\t\tfor( var key in xhrCallbacks ) {\n\t\t\txhrCallbacks[ key ]();\n\t\t}\n\t\txhrCallbacks = undefined;\n\t});\n}\n\njQuery.support.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\njQuery.support.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport(function( options ) {\n\tvar callback;\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( jQuery.support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i, id,\n\t\t\t\t\txhr = options.xhr();\n\t\t\t\txhr.open( options.type, options.url, options.async, options.username, options.password );\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[\"X-Requested-With\"] ) {\n\t\t\t\t\theaders[\"X-Requested-With\"] = \"XMLHttpRequest\";\n\t\t\t\t}\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tdelete xhrCallbacks[ id ];\n\t\t\t\t\t\t\tcallback = xhr.onload = xhr.onerror = null;\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\t// file protocol always yields status 0, assume 404\n\t\t\t\t\t\t\t\t\txhr.status || 404,\n\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\t\t\t\t\t\t\t\t\t// Support: IE9\n\t\t\t\t\t\t\t\t\t// #11426: When requesting binary data, IE9 will throw an exception\n\t\t\t\t\t\t\t\t\t// on any attempt to access responseText\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText === \"string\" ? {\n\t\t\t\t\t\t\t\t\t\ttext: xhr.responseText\n\t\t\t\t\t\t\t\t\t} : undefined,\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\txhr.onerror = callback(\"error\");\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = xhrCallbacks[( id = xhrId++ )] = callback(\"abort\");\n\t\t\t\t// Do send the request\n\t\t\t\t// This may raise an exception which is actually\n\t\t\t\t// handled in jQuery.ajax (so no try/catch here)\n\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\nvar fxNow, timerId,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trfxnum = new RegExp( \"^(?:([+-])=|)(\" + core_pnum + \")([a-z%]*)$\", \"i\" ),\n\trrun = /queueHooks$/,\n\tanimationPrefilters = [ defaultPrefilter ],\n\ttweeners = {\n\t\t\"*\": [function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value ),\n\t\t\t\ttarget = tween.cur(),\n\t\t\t\tparts = rfxnum.exec( value ),\n\t\t\t\tunit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t\t\t// Starting value computation is required for potential unit mismatches\n\t\t\t\tstart = ( jQuery.cssNumber[ prop ] || unit !== \"px\" && +target ) &&\n\t\t\t\t\trfxnum.exec( jQuery.css( tween.elem, prop ) ),\n\t\t\t\tscale = 1,\n\t\t\t\tmaxIterations = 20;\n\n\t\t\tif ( start && start[ 3 ] !== unit ) {\n\t\t\t\t// Trust units reported by jQuery.css\n\t\t\t\tunit = unit || start[ 3 ];\n\n\t\t\t\t// Make sure we update the tween properties later on\n\t\t\t\tparts = parts || [];\n\n\t\t\t\t// Iteratively approximate from a nonzero starting point\n\t\t\t\tstart = +target || 1;\n\n\t\t\t\tdo {\n\t\t\t\t\t// If previous iteration zeroed out, double until we get *something*\n\t\t\t\t\t// Use a string for doubling factor so we don't accidentally see scale as unchanged below\n\t\t\t\t\tscale = scale || \".5\";\n\n\t\t\t\t\t// Adjust and apply\n\t\t\t\t\tstart = start / scale;\n\t\t\t\t\tjQuery.style( tween.elem, prop, start + unit );\n\n\t\t\t\t// Update scale, tolerating zero or NaN from tween.cur()\n\t\t\t\t// And breaking the loop if scale is unchanged or perfect, or if we've just had enough\n\t\t\t\t} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );\n\t\t\t}\n\n\t\t\t// Update tween properties\n\t\t\tif ( parts ) {\n\t\t\t\tstart = tween.start = +start || +target || 0;\n\t\t\t\ttween.unit = unit;\n\t\t\t\t// If a +=/-= token was provided, we're doing a relative animation\n\t\t\t\ttween.end = parts[ 1 ] ?\n\t\t\t\t\tstart + ( parts[ 1 ] + 1 ) * parts[ 2 ] :\n\t\t\t\t\t+parts[ 2 ];\n\t\t\t}\n\n\t\t\treturn tween;\n\t\t}]\n\t};\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\tsetTimeout(function() {\n\t\tfxNow = undefined;\n\t});\n\treturn ( fxNow = jQuery.now() );\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( tweeners[ prop ] || [] ).concat( tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( (tween = collection[ index ].call( animation, prop, value )) ) {\n\n\t\t\t// we're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = animationPrefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\t\t\t// don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t}),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\t\t\t\t// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ]);\n\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t} else {\n\t\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tanimation = deferred.promise({\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, { specialEasing: {} }, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\t\t\t\t\t// if we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// resolve when we played the last frame\n\t\t\t\t// otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length ; index++ ) {\n\t\tresult = animationPrefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( jQuery.isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t})\n\t);\n\n\t// attach callbacks from options\n\treturn animation.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = jQuery.camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( jQuery.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// not quite $.extend, this wont overwrite keys already present.\n\t\t\t// also - reusing 'index' from above because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweener: function( props, callback ) {\n\t\tif ( jQuery.isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.split(\" \");\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length ; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\ttweeners[ prop ] = tweeners[ prop ] || [];\n\t\t\ttweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tanimationPrefilters.unshift( callback );\n\t\t} else {\n\t\t\tanimationPrefilters.push( callback );\n\t\t}\n\t}\n});\n\nfunction defaultPrefilter( elem, props, opts ) {\n\t/* jshint validthis: true */\n\tvar prop, value, toggle, tween, hooks, oldfire,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHidden( elem ),\n\t\tdataShow = data_priv.get( elem, \"fxshow\" );\n\n\t// handle queue: false promises\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always(function() {\n\t\t\t// doing this makes sure that the complete handler will be called\n\t\t\t// before this completes\n\t\t\tanim.always(function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t// height/width overflow pass\n\tif ( elem.nodeType === 1 && ( \"height\" in props || \"width\" in props ) ) {\n\t\t// Make sure that nothing sneaks out\n\t\t// Record all 3 overflow attributes because IE9-10 do not\n\t\t// change the overflow attribute when overflowX and\n\t\t// overflowY are set to the same value\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Set display property to inline-block for height/width\n\t\t// animations on inline elements that are having width/height animated\n\t\tif ( jQuery.css( elem, \"display\" ) === \"inline\" &&\n\t\t\t\tjQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\tstyle.display = \"inline-block\";\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always(function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t});\n\t}\n\n\n\t// show/hide pass\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.exec( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\tif ( !jQuery.isEmptyObject( orig ) ) {\n\t\tif ( dataShow ) {\n\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\thidden = dataShow.hidden;\n\t\t\t}\n\t\t} else {\n\t\t\tdataShow = data_priv.access( elem, \"fxshow\", {} );\n\t\t}\n\n\t\t// store state if its toggle - enables .stop().toggle() to \"reverse\"\n\t\tif ( toggle ) {\n\t\t\tdataShow.hidden = !hidden;\n\t\t}\n\t\tif ( hidden ) {\n\t\t\tjQuery( elem ).show();\n\t\t} else {\n\t\t\tanim.done(function() {\n\t\t\t\tjQuery( elem ).hide();\n\t\t\t});\n\t\t}\n\t\tanim.done(function() {\n\t\t\tvar prop;\n\n\t\t\tdata_priv.remove( elem, \"fxshow\" );\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t}\n\t\t});\n\t\tfor ( prop in orig ) {\n\t\t\ttween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\n\t\t\tif ( !( prop in dataShow ) ) {\n\t\t\t\tdataShow[ prop ] = tween.start;\n\t\t\t\tif ( hidden ) {\n\t\t\t\t\ttween.end = tween.start;\n\t\t\t\t\ttween.start = prop === \"width\" || prop === \"height\" ? 1 : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || \"swing\";\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\tif ( tween.elem[ tween.prop ] != null &&\n\t\t\t\t(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails\n\t\t\t// so, simple values such as \"10px\" are parsed to Float.\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\t\t\t// use step hook for back compat - use cssHook if its there - use .style if its\n\t\t\t// available and use plain properties where available\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE9\n// Panic based approach to setting things on disconnected nodes\n\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.each([ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n});\n\njQuery.fn.extend({\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHidden ).css( \"opacity\", 0 ).show()\n\n\t\t\t// animate to the value specified\n\t\t\t.end().animate({ opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || data_priv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue && type !== false ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = data_priv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// start the next in the queue if the last step wasn't forced\n\t\t\t// timers currently will call their complete callbacks, which will dequeue\n\t\t\t// but only if they were gotoEnd\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t});\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tvar index,\n\t\t\t\tdata = data_priv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t});\n\t}\n});\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\tattrs = { height: type },\n\t\ti = 0;\n\n\t// if we include width, step value is 1 to do all cssExpand values,\n\t// if we don't include width, step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth? 1 : 0;\n\tfor( ; i < 4 ; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\n// Generate shortcuts for custom animations\njQuery.each({\n\tslideDown: genFx(\"show\"),\n\tslideUp: genFx(\"hide\"),\n\tslideToggle: genFx(\"toggle\"),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n});\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tjQuery.isFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !jQuery.isFunction( easing ) && easing\n\t};\n\n\topt.duration = jQuery.fx.off ? 0 : typeof opt.duration === \"number\" ? opt.duration :\n\t\topt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;\n\n\t// normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( jQuery.isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p*Math.PI ) / 2;\n\t}\n};\n\njQuery.timers = [];\njQuery.fx = Tween.prototype.init;\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ttimers = jQuery.timers,\n\t\ti = 0;\n\n\tfxNow = jQuery.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\t\t// Checks the timer has not already been removed\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tif ( timer() && jQuery.timers.push( timer ) ) {\n\t\tjQuery.fx.start();\n\t}\n};\n\njQuery.fx.interval = 13;\n\njQuery.fx.start = function() {\n\tif ( !timerId ) {\n\t\ttimerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );\n\t}\n};\n\njQuery.fx.stop = function() {\n\tclearInterval( timerId );\n\ttimerId = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\t// Default speed\n\t_default: 400\n};\n\n// Back Compat <1.8 extension point\njQuery.fx.step = {};\n\nif ( jQuery.expr && jQuery.expr.filters ) {\n\tjQuery.expr.filters.animated = function( elem ) {\n\t\treturn jQuery.grep(jQuery.timers, function( fn ) {\n\t\t\treturn elem === fn.elem;\n\t\t}).length;\n\t};\n}\njQuery.fn.offset = function( options ) {\n\tif ( arguments.length ) {\n\t\treturn options === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function( i ) {\n\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t});\n\t}\n\n\tvar docElem, win,\n\t\telem = this[ 0 ],\n\t\tbox = { top: 0, left: 0 },\n\t\tdoc = elem && elem.ownerDocument;\n\n\tif ( !doc ) {\n\t\treturn;\n\t}\n\n\tdocElem = doc.documentElement;\n\n\t// Make sure it's not a disconnected DOM node\n\tif ( !jQuery.contains( docElem, elem ) ) {\n\t\treturn box;\n\t}\n\n\t// If we don't have gBCR, just use 0,0 rather than error\n\t// BlackBerry 5, iOS 3 (original iPhone)\n\tif ( typeof elem.getBoundingClientRect !== core_strundefined ) {\n\t\tbox = elem.getBoundingClientRect();\n\t}\n\twin = getWindow( doc );\n\treturn {\n\t\ttop: box.top + win.pageYOffset - docElem.clientTop,\n\t\tleft: box.left + win.pageXOffset - docElem.clientLeft\n\t};\n};\n\njQuery.offset = {\n\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) && ( curCSSTop + curCSSLeft ).indexOf(\"auto\") > -1;\n\n\t\t// Need to be able to calculate position if either top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( jQuery.isFunction( options ) ) {\n\t\t\toptions = options.call( elem, i, curOffset );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\n\njQuery.fn.extend({\n\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\t\t\t// We assume that getBoundingClientRect is available when computed position is fixed\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\t// Get *real* offsetParent\n\t\t\toffsetParent = this.offsetParent();\n\n\t\t\t// Get correct offsets\n\t\t\toffset = this.offset();\n\t\t\tif ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n\t\t\t\tparentOffset = offsetParent.offset();\n\t\t\t}\n\n\t\t\t// Add offsetParent borders\n\t\t\tparentOffset.top += jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true );\n\t\t\tparentOffset.left += jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true );\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\toffsetParent: function() {\n\t\treturn this.map(function() {\n\t\t\tvar offsetParent = this.offsetParent || docElem;\n\n\t\t\twhile ( offsetParent && ( !jQuery.nodeName( offsetParent, \"html\" ) && jQuery.css( offsetParent, \"position\") === \"static\" ) ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || docElem;\n\t\t});\n\t}\n});\n\n\n// Create scrollLeft and scrollTop methods\njQuery.each( {scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\"}, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn jQuery.access( this, function( elem, method, val ) {\n\t\t\tvar win = getWindow( elem );\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : window.pageXOffset,\n\t\t\t\t\ttop ? val : window.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length, null );\n\t};\n});\n\nfunction getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name }, function( defaultExtra, funcName ) {\n\t\t// margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn jQuery.access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( jQuery.isWindow( elem ) ) {\n\t\t\t\t\t// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there\n\t\t\t\t\t// isn't a whole lot we can do. See pull request at this URL for discussion:\n\t\t\t\t\t// https://github.com/jquery/jquery/pull/764\n\t\t\t\t\treturn elem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable, null );\n\t\t};\n\t});\n});\n// Limit scope pollution from any deprecated API\n// (function() {\n\n// The number of elements contained in the matched element set\njQuery.fn.size = function() {\n\treturn this.length;\n};\n\njQuery.fn.andSelf = jQuery.fn.addBack;\n\n// })();\nif ( typeof module === \"object\" && module && typeof module.exports === \"object\" ) {\n\t// Expose jQuery as module.exports in loaders that implement the Node\n\t// module pattern (including browserify). Do not create the global, since\n\t// the user will be storing it themselves locally, and globals are frowned\n\t// upon in the Node module world.\n\tmodule.exports = jQuery;\n} else {\n\t// Register as a named AMD module, since jQuery can be concatenated with other\n\t// files that may use define, but not via a proper concatenation script that\n\t// understands anonymous AMD modules. A named AMD is safest and most robust\n\t// way to register. Lowercase jquery is used because AMD module names are\n\t// derived from file names, and jQuery is normally delivered in a lowercase\n\t// file name. Do this after creating the global so that if an AMD module wants\n\t// to call noConflict to hide this version of jQuery, it will work.\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\tdefine( \"jquery\", [], function () { return jQuery; } );\n\t}\n}\n\n// If there is a window object, that at least has a document property,\n// define jQuery and $ identifiers\nif ( typeof window === \"object\" && typeof window.document === \"object\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n})( window );\n"
  },
  {
    "path": "editor/scripts/ki.js",
    "content": "\n(function (root, factory) {\n  if (typeof exports === 'object') {\n    factory(exports, require('sweet.js'));\n  }\n  else if (typeof define === 'function' && define.amd) {\n    define([\n      'exports',\n      'sweet'\n      ], factory);\n  }\n\n}(this, function(exports, sweet) {\n\n  var getNSExprs = function(s,n) {\n    var nesting = 0;\n    var sexpr = \"\";\n    var res = {matches: [], end: -1};\n    for (var i = 0; i < s.length; ++i)\n    {\n      c = s[i];\n      switch (c) {\n        case '(':\n          nesting++;\n          break;\n        case ')':\n          nesting--;\n          if (nesting < 0) {\n            return null;\n          }\n          if (nesting == 0) {\n            res.matches.push(sexpr + c);\n            sexpr = \"\";\n          }\n          if (res.matches.length == n) {\n            res.end = i+1;\n            return res;\n          }\n          break;\n      }\n      if (nesting > 0) {\n        sexpr += c;\n      }\n    }\n    return null;\n  }\n  \n  var parseMacros = function(code) {\n    var re = /ki *macro/\n    \n    var current = code;\n    var start = current.search(re);\n    var ret;\n    var macros = [];\n    while (start != -1) {\n      current = current.substr(start);\n      ret = getNSExprs(current,2);\n      macros.push(ret.matches);\n      current = current.substr(ret.end);\n      start = current.search(re);\n    }\n    \n    var rules = macros.map(function(macro) { \n      return 'rule { ' + macro[0] + ' } => { _sexpr ' + macro[1] + ' }' \n    });\n  \n    return rules.join('\\n');\n  }\n\n  var joinModule = function(src, ki_core, additionalRules) {\n    rules = additionalRules || [];\n    rules.push(parseMacros(src));\n    return ki_core.replace('/*__macros__*/',rules.join('\\n'));\n  }\n\n  var compile = function(src, options, uglify, fs) {\n    if (!options.modules && options.ki_core) {\n      var module = joinModule(src,options.ki_core,options.rules);\n      options.modules = sweet.loadModule(module);\n    }\n    var result = sweet.compile(src, options);\n    if (options.autonomous) {\n      result.code += '\\nvar mori = ' + options.moriSrc;\n    }\n    if (options.sourceMap) {\n      var code = result.code + '\\n//# sourceMappingURL=' + options.mapfile;\n      var sourceMap = result.sourceMap;\n      var tmpfile = options.mapfile + \".tmp\";\n      if (options.minify && fs) {\n        fs.writeFileSync(tmpfile, sourceMap, 'utf8');\n        result = uglify.minify(code, {\n          fromString: true,\n          inSourceMap: tmpfile,\n          outSourceMap: options.mapfile,\n          compress: options.compress\n        });\n        fs.unlinkSync(tmpfile);\n        return { code: result.code, sourceMap: result.map };\n      }\n\n      return { code: code, sourceMap: sourceMap };\n    }\n    else if (options.minify) {\n      var result = uglify.minify(result.code, {fromString: true, compress: options.compress});\n      return { code: result.code };\n    }\n    return { code: result.code };\n  }\n\n  exports.compile = compile;\n  exports.joinModule = joinModule;\n  exports.parseMacros = parseMacros;\n}))\n\n"
  },
  {
    "path": "editor/scripts/ki.sjs",
    "content": "/**\n * ki: the lisp that macroexpands to JavaScript\n * MIT license http://www.opensource.org/licenses/mit-license.php/\n * Copyright (C) 2014 Luca Antiga http://lantiga.github.io\n */\n\nmacro _arr {\n  rule { () } => {\n  }\n\n  rule { ($arg) } => {\n    _sexpr $arg\n  }\n\n  rule { ($arg $args ...) } => {\n    _sexpr $arg, _arr ($args ...)\n  }\n}\n\nmacro _obj {\n  rule { () } => {\n  }\n  \n  rule { ((keyword $k) $v) } => {\n    _sexpr $k: _sexpr $v\n  }\n\n  rule { ((keyword $k) $v $args ...) } => {\n    _sexpr $k: _sexpr $v, _obj ($args ...)\n  }\n\n  rule { ($k $v) } => {\n    _sexpr $k: _sexpr $v\n  }\n\n  rule { ($k $v $args ...) } => {\n    _sexpr $k: _sexpr $v, _obj ($args ...)\n  }\n}\n\nmacro _args {\n  rule { () } => {\n  }\n\n  rule { ($arg) } => {\n    _sexpr $arg\n  }\n\n  rule { ($arg $args ...) } => {\n    _sexpr $arg, _args ($args ...)\n  }\n}\n\nmacro _x {\n  case { $ctx null } => {\n    throwSyntaxError('ki','<null> is not a valid literal, use nil',#{$ctx})\n  }\n  case { $ctx undefined } => {\n    throwSyntaxError('ki','<undefined> is not a valid literal, use nil',#{$ctx})\n  }\n  case { _ nil } => {\n    return #{null}\n  }\n  case { _ $x} => {\n    return #{$x}\n  }\n}\n\nmacro _throw {\n  case { $ctx + } => {\n    throwSyntaxError('Unexpected token +','(+ ...) unsupported, use (add ...) instead',#{$ctx})\n  }\n  case { $ctx - } => {\n    throwSyntaxError('Unexpected token -','(- ...) unsupported, use (sub ...) instead',#{$ctx})\n  }\n  case { $ctx * } => {\n    throwSyntaxError('Unexpected token *','(* ...) unsupported, use (mul ...) instead',#{$ctx})\n  }\n  //case { $ctx / } => {\n  //  throwSyntaxError('Unexpected token /','(/ ...) unsupported, use (div ...) instead',#{$ctx})\n  //}\n}\n\nmacro _ns {\n  case { _ $ns $sexprs ... } => {\n    var nsname = unwrapSyntax(#{$ns});\n    letstx $nsname = [makeValue(nsname,#{$ns})];\n    return #{\n      (function () {\n        _ki.init(this,$nsname);\n        _return_sexprs ($sexprs ...);\n      }())\n    }\n  }\n}\n\nmacro _def {\n  case { _ $n $sexpr } => {\n    var varname = unwrapSyntax(#{$n});\n    letstx $varname = [makeValue(varname,#{$n})];\n    return #{\n      (function () {\n        _ki_ns_ctx[$varname] = _sexpr $sexpr;\n        _ki.namespaces[_ki_ns_name].vars.$n = _ki_ns_ctx[$varname]\n        return _ki_ns_ctx[$varname];\n      }())\n    };\n  }\n}\n\nmacro _count {\n  case { $m ($x(,) ...) } => {\n    var n = #{$x ...}.length;\n    letstx $n = [makeValue(n,#{$m})];\n    return #{$n};\n  }\n}\n\nmacro _fnmap {\n  rule { ([$args ...] $sexprs ...), $rest(,)... } => {\n    _count ($args(,)...): _sexpr (fn [$args ...] $sexprs ...), _fnmap $rest(,)...\n  }\n  rule { ([$args ...] $sexprs ...) } => {\n    _count ($args(,)...): _sexpr (fn [$args ...] $sexprs ...)\n  }\n}\n\nmacro _destr { \n  rule { ([$ $a], $v) } => {\n    var f = $v[0];\n    _destr($a, f)\n  }\n  rule { ([$ $a $b ...], $v) } => {\n    var f = $v[0];\n    _destr($a, f)\n    var r = $v.slice(1);\n    _destr([$ $b ...], r)\n  }\n\n  rule { ({$ $a $b}, $v) } => {\n    var f = $v[$b];\n    _destr($a, f)\n  }\n  rule { ({$ $a $b $c $d ...}, $v) } => {\n    var f = $v[$b];\n    _destr($a, f)\n    _destr({$ $c $d ...}, $v)\n  }\n\n  rule { ([$a], $v) } => {\n    var f = _sexpr(first $v);\n    _destr($a, f)\n  }\n  rule { ([$a $b ...], $v) } => {\n    var f = _sexpr(first $v);\n    _destr($a, f)\n    var r = _sexpr(rest $v)\n    _destr([$b ...], r)\n  }\n\n  rule { ({$a $b}, $v) } => {\n    var f = _sexpr(get $v $b);\n    _destr($a, f)\n  }\n  rule { ({$a $b $c $d ...}, $v) } => {\n    var f = _sexpr(get $v $b);\n    _destr($a, f)\n    _destr({$c $d ...}, $v)\n  }\n\n  rule { ($a, $v) } => {\n    var $a = $v;\n  }\n}\n\nmacro _let {\n  rule { ([$k $v $rest ...] $sexprs ...) } => {\n    return (function (v) {\n      _destr($k, v)\n      _let ([$rest ...] $sexprs ...)\n    }.call(this,_sexpr $v));\n  }\n  rule { ([] $sexprs ...) } => {\n    _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _letc {\n  rule { ([[$ks ...] ($fn ...)] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$ks ...] $sexprs ... nil))\n  }\n  rule { ([$k ($fn ...)] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$k] $sexprs ... nil))\n  }\n  rule { ([[$ks ...] ($fn ...) $rest ...] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$ks ...] \n                     (letc [$rest ...] $sexprs ...) nil))\n  }\n  rule { ([$k ($fn ...) $rest ...] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$k] \n                     (letc [$rest ...] $sexprs ...) nil))\n  }\n}\n\nmacro _loop_let {\n  rule { ([$k $v $rest ...] $i $vals $sexprs ...) } => {\n    return (function (v) {\n      _destr($k, v)\n      _loop_let ([$rest ...] ($i+1) $vals $sexprs ...)\n    }($vals === undefined ? _sexpr $v : $vals[$i]));\n  }\n  rule { ([] $i $vals $sexprs ...) } => {\n    _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _chain {\n  rule { (($method $args ...)) } => {\n    . _sexpr $method (_args ($args ...))\n  }\n  rule { ($property) } => {\n    . _sexpr $property\n  }\n  rule { (($method $args ...) $rest ...) } => {\n    . _sexpr $method (_args ($args ...)) _chain ($rest ...)\n  }\n  rule { ($property $rest ...) } => {\n    . _sexpr $property _chain ($rest ...)\n  }\n}\n\nmacro _doto {\n  rule { ($obj ($method $args ...)) } => {\n    $obj.$method(_args ($args ...));\n  }\n  rule { ($obj ($method $args ...) $rest ...) } => {\n    $obj.$method(_args ($args ...));\n    _doto ($obj $rest ...)\n  }\n}\n\nmacro _sexpr {\n\n  rule { () } => { \n  }\n  \n  /*__macros__*/\n\n  rule { (ns $ns:ident $sexprs ...) } => {\n    _ns $ns $sexprs ...\n  }\n\n  rule { (use ) } => {\n  }\n  rule { (use $module $modules ...) } => {\n    (function () {\n      _ki.intern.bind(_ki_ns_ctx)(_ki.modules.$module);\n      _sexpr (use $modules ...);\n    }())\n  }\n\n  rule { (ns_get $ns:ident $x) } => {\n    _sexpr _ki.namespaces.$ns.vars.$x\n  }\n\n  rule { (js $body ...) } => {\n    $body ...\n  }\n\n  rule { (fn $name:ident [$args ...] $sexprs ...) } => {\n    function $name($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }\n  }\n\n  rule { (fn [$args ...] $sexprs ...) } => {\n    function ($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }\n  }\n\n  rule { (fnth $name:ident [$args ...] $sexprs ...) } => {\n    function $name($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }.bind(this)\n  }\n\n  rule { (fnth [$args ...] $sexprs ...) } => {\n    function ($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }.bind(this)\n  }\n\n  rule { (fn $name:ident $sexprs ...) } => {\n    function $name() {\n      var fnmap = {_fnmap $sexprs(,) ...};\n      var max_arity = 0;\n      for (var a in fnmap) {\n        max_arity = a > max_arity ? a : max_arity;\n      }\n      fnmap[null] = fnmap[max_arity];\n      var f = fnmap[arguments.length] || fnmap[null];\n      return f.apply(this,arguments);\n    }\n  }\n\n  rule { (fn $sexprs ...) } => {\n    (function () {\n      var fnmap = {_fnmap $sexprs(,) ...};\n      var max_arity = 0;\n      for (var a in fnmap) {\n        max_arity = a > max_arity ? a : max_arity;\n      }\n      fnmap[null] = fnmap[max_arity];\n      return function () {\n        var f = fnmap[arguments.length] || fnmap[null];\n        return f.apply(this,arguments);\n      }\n    }.call(this))\n  }\n\n  rule { (if $cond $sthen $selse) } => {\n    (function () {\n      if (_sexpr (truthy $cond)) {\n        return _sexpr $sthen;\n      }\n      return _sexpr $selse;\n    }.call(this))\n  }\n\n  rule { (ifNot $cond $sthen $selse) } => {\n    _sexpr (if (not $cond) $sthen $selse)\n  }\n\n  rule { (when $cond $sthen) } => {\n    (function () {\n      if (_sexpr (truthy $cond)) {\n        return _sexpr $sthen;\n      }\n      return;\n    }.call(this))\n  }\n\n  rule { (whenNot $cond $sthen) } => {\n    _sexpr (when (not $cond) $sthen)\n  }\n\n  rule { (cond $cond1 $body1 $rest ...) } => {\n    (function () {\n      if (_sexpr (truthy $cond1)) {\n        return _sexpr $body1;\n      }\n      return _sexpr (cond $rest ...);\n    }.call(this))\n  }\n  rule { (cond) } => {\n    undefined\n  }\n\n  rule { (and $sexpr) } => {\n    _sexpr (truthy $sexpr)\n  }\n  rule { (and $sexpr $sexprs ...) } => {\n    _sexpr (truthy $sexpr) && _sexpr (and $sexprs ...)\n  }\n\n  rule { (or $sexpr) } => {\n    _sexpr (truthy $sexpr)\n  }\n  rule { (or $sexpr $sexprs ...) } => {\n    _sexpr (truthy $sexpr) || _sexpr (or $sexprs ...)\n  }\n\n  rule { ($[let] [$bindings ...] $sexprs ...) } => {\n    (function () {\n      _let ([$bindings ...] $sexprs ...)\n    }.call(this))\n  }\n\n  rule { (letc [$bindings ...] $sexprs ...) } => {\n    _letc ([$bindings ...] $sexprs ...)\n  }\n\n  rule { (do $sexprs ...) } => {\n    (function () {\n      _return_sexprs ($sexprs ...)\n    }.call(this))\n  }\n\n  rule { (while $cond $sexpr) } => {\n    (function () {\n      while (_sexpr (truthy $cond)) {\n        _sexpr $sexpr;\n      }\n    }.call(this))\n  }\n\n  rule { (loop [$bindings ...] $sexprs ...) } => {\n    (function () {\n      var res = {};\n      do {\n        res = (function () {\n          _loop_let ([$bindings ...] 0 (res._ki_vals) $sexprs ...);\n        }());\n      }\n      while ((res || 0)._ki_recur);\n      return res;\n    }.call(this))\n  }\n\n  rule { (recur $args ...) } => {\n    {_ki_recur: true, _ki_vals: [_args ($args ...)]}\n  }\n\n  rule { (def $n:ident $sexpr) } => {\n    _def $n $sexpr\n  }\n\n  // TODO: docstring\n  rule { (defn $n:ident [$args ...] $sexprs ...) } => {\n    _sexpr (def $n (fn [$args ...] $sexprs ...))\n  }\n \n  rule { (defn $n:ident ([$args ...] $sexprs ...) $rest ...) } => {\n    _sexpr (def $n (fn ([$args ...] $sexprs ...) $rest ...))\n  }\n\n  rule { (bind $obj $fn) } => {\n    _sexpr $fn.bind($obj)\n  }\n\n  rule { (defmulti $n:ident $dispatch_fn) } => {\n    _sexpr \n       (defn $n [] \n        (js\n         if ($n._ki_methods === undefined || $n._ki_methods.length == 0) {\n           return undefined;\n         }\n         var dispatch_fn = _sexpr $dispatch_fn;\n         for (var i=0; i<$n._ki_methods.length; i++) {\n           var dispatch_value = $n._ki_methods[i][0];\n           var fn = $n._ki_methods[i][1];\n           if (equals(dispatch_fn.apply(this,arguments),dispatch_value)) {\n             return fn.apply(this,arguments);\n           }\n         }) nil)\n  }\n \n  rule { (defmethod $n:ident $dispatch_val [$args ...] $sexprs ...) } => {\n    (function () {\n      if ($n._ki_methods === undefined) {\n        $n._ki_methods = [];\n      }\n      $n._ki_methods.push([_sexpr $dispatch_val,_sexpr (fn [$args ...] $sexprs ...)])\n    }())\n  }\n\n  rule { (threadf $v ($[.]$fn $args ...)) } => {\n    _sexpr (.$fn $v $args ...)\n  }\n  rule { (threadf $v ($[.]$fn $args ...) $x ...) } => {\n    _sexpr (threadf (.$fn $v $args ...) $x ...)\n  }\n \n  rule { (threadf $v ($fn $args ...)) } => {\n    _sexpr ($fn $v $args ...)\n  }\n  rule { (threadf $v ($fn $args ...) $x ...) } => {\n    _sexpr (threadf ($fn $v $args ...) $x ...)\n  }\n  rule { (threadf $v $el) } => {\n    _sexpr ($el $v)\n  }\n  rule { (threadf $v $el $x ...) } => {\n    _sexpr (threadf ($el $v) $x ...)\n  }\n\n  //rule { (threadl $v ($[.]$fn $args ...)) } => {\n  //  _sexpr (.$fn $args ... $v)\n  //}\n  //rule { (threadl $v ($[.]$fn $args ...) $x ...) } => {\n  //  _sexpr (threadl (.$fn $args ... $v) $x ...)\n  //}\n\n  rule { (threadl $v ($fn $args ...)) } => {\n    _sexpr ($fn $args ... $v)\n  }\n  rule { (threadl $v ($fn $args ...) $x ...) } => {\n    _sexpr (threadl ($fn $args ... $v) $x ...)\n  }\n  rule { (threadl $v $el) } => {\n    _sexpr ($el $v)\n  }\n  rule { (threadl $v $el $x ...) } => {\n    _sexpr (threadl ($el $v) $x ...)\n  }\n\n  rule { (chain $obj $rest ...) } => {\n    _sexpr $obj _chain ($rest ...)\n  }\n\n  rule { (doto $obj $rest ...) } => {\n    (function () {\n      _doto ($obj $rest ...)\n      return $obj;\n    }.call(this))\n  }\n\n  rule { (atom $val) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: null, \n      _ki_rcb: null }\n  }\n\n  rule { (atom $val $write_cb) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: _sexpr $write_cb, \n      _ki_rcb: null }\n  }\n\n  rule { (atom $val $write_cb $read_cb) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: _sexpr $write_cb, \n      _ki_rcb: _sexpr $read_cb }\n  }\n\n  rule { (reset $ref $val) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      var val = _sexpr $val;\n      var prev_val = ref._ki_val;\n      ref._ki_val = val;\n      if (ref._ki_wcb) {\n        ref._ki_wcb(val, prev_val);\n      }\n      return val;\n    }.call(this))\n  }\n\n  rule { (swap $ref $fn $args ...) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      var val = ref._ki_val;\n      return _sexpr (reset ref ($fn val $args ...))\n    }.call(this))\n  }\n\n  rule { (deref $ref) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      if (ref._ki_rcb) {\n        ref._ki_rcb(ref._ki_val);\n      }\n      return ref._ki_val;\n    }.call(this))\n  }\n\n  rule { (try $body (catch $e $catch_expr)) } => {\n    (function () {\n      try {\n        _sexpr $body\n      }\n      catch ($e) {\n        _sexpr $catch_expr\n      }\n    }.call(this))\n  }\n\n  rule { (try $body (catch $e $catch_expr) (finally $finally_expr)) } => {\n    (function () {\n      var ret;\n      try {\n        ret = _sexpr $body;\n      }\n      catch ($e) {\n        ret = _sexpr $catch_expr;\n      }\n      finally {\n        _sexpr $finally_expr;\n      }\n      return ret;\n    }.call(this))\n  }\n\n  rule { (throw $x) } => {\n    (function () {\n      throw(_sexpr $x);\n    }.call(this))\n  }\n  \n  rule { (+ $args ...) } => {\n    _throw +\n  }\n\n  rule { (- $args ...) } => {\n    _throw -\n  }\n\n  rule { (* $args ...) } => {\n    _throw *\n  }\n\n  //rule { (/ $args ...) } => {\n  //  _throw /\n  //}\n\n  rule { ($[.] $fn $obj $args ...) } => {\n    _sexpr $obj . $fn (_args ($args ...))\n  }\n\n  rule { ($fn $args ...) } => {\n    _sexpr $fn (_args ($args ...))\n  }\n\n  rule { [$ $x ...] } => {\n    [_arr ($x ...)]\n  }\n\n  rule { {$ $x ...} } => {\n    {_obj ($x ...)}\n  }\n\n  rule { [$x ...] } => {\n    _sexpr (vector $x ...)\n  }\n\n  rule { {$x ...} } => {\n    _sexpr (hashMap $x ...)\n  }\n\n  rule { $x } => { \n    _x $x\n  }\n\n}\n\nmacro _return_sexprs {\n  rule { ($sexpr) } => {\n    return _sexpr $sexpr\n  }\n  rule { ($sexpr $sexprs ...) } => {\n    _sexpr $sexpr; _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _sexprs {\n  rule { ($sexpr) } => {\n    _sexpr $sexpr\n  }\n  rule { ($sexpr $sexprs ...) } => {\n    _sexpr $sexpr _sexprs ($sexprs ...)\n  }\n}\n\nmacro ki {\n  case { _ require core} => {\n    return #{\n      _ki = {\n        init: function (self, ns_name) {\n          if (_ki.namespaces[ns_name] === undefined) {\n            _ki.namespaces[ns_name] = { vars: {} };\n          }\n          self._ki_ns_name = ns_name;\n          self._ki_ns_ctx = self;\n          _ki.intern.bind(self)(_ki.modules.core);\n          _ki.intern.bind(self)(_ki.modules.mori);\n          _ki.intern.bind(self)(_ki.modules);\n          _ki.intern.bind(self)(_ki.namespaces[_ki_ns_name].vars);\n        },\n        intern: function (obj) {\n          for (var e in obj) {\n            this[e] = obj[e];\n          }\n        },\n        namespaces: {},\n        modules: {\n          core: {\n            truthy: function(x) {\n              return x === false || x == null ? false : true;\n            },\n            falsey: function(x) {\n              return !truthy(x);\n            },\n            not: function(x) {\n              return !truthy(x);\n            },\n            eq: function() { \n              return equals.apply(null,arguments); \n            },\n            neq: function() {\n              return !equals.apply(null,arguments); \n            },\n            add: function() {\n              var res = 0.0;\n              for (var i=0; i<arguments.length; i++) {\n                res += arguments[i];\n              }\n              return res;\n            },\n            sub: function() {\n              var res = arguments[0];\n              for (var i=1; i<arguments.length; i++) {\n                res -= arguments[i];\n              }\n              return res;\n            },\n            mul: function() {\n              var res = 1.0;\n              for (var i=0; i<arguments.length; i++) {\n                res *= arguments[i];\n              }\n              return res;\n            },\n            div: function() {\n              var res = arguments[0];\n              for (var i=1; i<arguments.length; i++) {\n                res /= arguments[i];\n              }\n              return res;\n            },\n            mod: function(a,b) {\n              return a % b;\n            },\n            lt: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] < arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            gt: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] > arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            leq: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] <= arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            geq: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] >= arguments[i+1];\n              }\n              return res;\n            },\n            prn: function() {\n              console.log.apply(console,arguments);\n            },\n            str: function() {\n              return String.prototype.concat.apply('',arguments);\n            }\n          },\n          mori: (function () { \n            try {\n              return require('ki/node_modules/mori') \n            }\n            catch (e) {\n              try {\n                return require('mori') \n              }\n              catch (e) {\n                return mori;\n              }\n            }\n          }())\n        }\n      }; \n    }\n  }\n  case { _ require $module as $name} => {\n    var module_name = unwrapSyntax(#{$module});\n    letstx $module_name = [makeValue(module_name,#{$module})];\n    return #{_ki.modules.$name = (function () { \n      try { return require($module_name) } \n      catch (e) { return $name }\n    }());}\n  }\n  case { _ require $module} => {\n    var module_name = unwrapSyntax(#{$module});\n    letstx $module_name = [makeValue(module_name,#{$module})];\n    return #{_ki.modules.$module = (function () { \n      try { return require($module_name) } \n      catch (e) { return $module }\n    }());}\n  }\n\n  case {_ macro ($x ...) ($y ...)} => {\n    return #{};\n  }\n\n  case { $ki ($x ...) } => {\n    \n    var Token = {\n      BooleanLiteral: 1,\n      EOF: 2,\n      Identifier: 3,\n      Keyword: 4,\n      NullLiteral: 5,\n      NumericLiteral: 6,\n      Punctuator: 7,\n      StringLiteral: 8,\n      RegularExpression: 9,\n      Template: 10,\n      Delimiter: 11\n    }\n    \n    function transform(ki_ast, inner) {\n      var content = inner.map(function (el) { return el; });\n      if (content[0].token.type == Token.Punctuator && \n          content[0].token.value == ':') {\n        content.shift();\n        var name = content.shift();\n        content.forEach(function (el,i) {\n          name.token.value += el.token.value;\n        });\n        name.token.type = Token.StringLiteral;\n        content = [{\n          token: {\n            type: Token.Identifier,\n            value: 'keyword',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext},\n          name];\n        }\n      else if (content.length == 3 && \n          content[1].token.type == Token.Punctuator && \n          content[1].token.value == '/') {\n        content = [{\n          token: {\n            type: Token.Identifier,\n            value: 'ns_get',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext},\n          content[0], content[2]];\n        }\n      else {\n        content.unshift({\n          token: {\n            type: Token.Identifier,\n            value: 'js',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext});\n      }\n      ki_ast.push({\n        token: {\n          type: Token.Delimiter,\n          value: '()',\n          startLineNumber: inner[0].token.lineNumber,\n          startLineStart: inner[0].token.lineStart,\n          startRange: inner[0].token.range,\n          inner: content,\n          endLineNumber: inner[0].token.lineNumber,\n          endLineStart: inner[0].token.lineStart,\n          endRange: inner[0].token.range\n        }\n      });\n    }\n    \n    function ast_js_to_ki(ast) {\n    \n      var ki_ast = [];\n      var acc = [];\n      var next = null;\n    \n      ast.forEach(function (el,i) {\n    \n        switch (el.token.type) {\n          case Token.Punctuator:\n            if (i == 0 && el.token.value != ':') {\n              ki_ast.push(el);\n            }\n            else {\n              acc.push(el);\n            }\n            break;\n          case Token.Identifier:\n          case Token.Keyword:\n            next = ast[i+1];\n            if (next === undefined || next.token.type != Token.Punctuator ||\n                (next.token.type == Token.Punctuator && next.token.value == ':')) {\n              if (acc.length == 0) {\n                ki_ast.push(el);\n              }\n              else {\n                acc.push(el);\n                transform(ki_ast, acc);\n                acc = [];\n              }\n            }\n            else {\n              acc.push(el);\n            }\n            break;\n          case Token.Delimiter:\n            // FIXME: here we're modifying el in place.\n            // We should probably avoid it.\n            if (!(el.token.inner.length > 0 && \n                  (el.token.inner[0].token.type == Token.Identifier &&\n                   el.token.inner[0].token.value == 'js'))) {\n                     el.token.inner = ast_js_to_ki(el.token.inner);\n                   }\n            ki_ast.push(el);\n            break;\n          default:\n            ki_ast.push(el);\n            break;\n        }\n      });\n    \n      return ki_ast;\n    }\n\n    var x = #{$x ...};\n    var ki_x = ast_js_to_ki(x);\n    letstx $ki_x ... = ki_x;\n\n    return #{\n      (function () { \n        _ki.init(this,'_ki');\n        return (_sexpr ($ki_x ...)); \n      }())\n    }\n  }\n}\n\nexport ki;\n\n"
  },
  {
    "path": "editor/scripts/main.js",
    "content": "\nrequirejs.config({\n  shim: {\n    'underscore': {\n      exports: '_'\n    }  \n  }\n});\n\nrequire(['./ki','text!ki.sjs','./mori'], function(ki,ki_core,mori) {\n\n  var result = ki.compile('ki require core; var a = ki (range 1 10); console.log(ki (first a));',{ki_core: ki_core});\n  eval(result.code);\n\n});\n\n"
  },
  {
    "path": "editor/scripts/mori.js",
    "content": "(function(definition){if(typeof exports===\"object\"){module.exports=definition();}else if(typeof define===\"function\"&&define.amd){define(definition);}else{mori=definition();}})(function(){return function(){\nif(typeof Math.imul == \"undefined\" || (Math.imul(0xffffffff,5) == 0)) {\n    Math.imul = function (a, b) {\n        var ah  = (a >>> 16) & 0xffff;\n        var al = a & 0xffff;\n        var bh  = (b >>> 16) & 0xffff;\n        var bl = b & 0xffff;\n        // the shift by 0 fixes the sign on the high part\n        // the final |0 converts the unsigned value into a signed value\n        return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);\n    }\n}\n\nvar k,aa=this;\nfunction n(a){var b=typeof a;if(\"object\"==b)if(a){if(a instanceof Array)return\"array\";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);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 Function]\"==c||\"undefined\"!=typeof a.call&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"call\"))return\"function\"}else return\"null\";else if(\"function\"==\nb&&\"undefined\"==typeof a.call)return\"object\";return b}var ba=\"closure_uid_\"+(1E9*Math.random()>>>0),ca=0;function r(a,b){var c=a.split(\".\"),d=aa;c[0]in d||!d.execScript||d.execScript(\"var \"+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]?d[e]:d[e]={}:d[e]=b};function da(a){return Array.prototype.join.call(arguments,\"\")};function ea(a,b){for(var c in a)b.call(void 0,a[c],c,a)};function fa(a,b){null!=a&&this.append.apply(this,arguments)}fa.prototype.Za=\"\";fa.prototype.append=function(a,b,c){this.Za+=a;if(null!=b)for(var d=1;d<arguments.length;d++)this.Za+=arguments[d];return this};fa.prototype.clear=function(){this.Za=\"\"};fa.prototype.toString=function(){return this.Za};function ga(a,b){a.sort(b||ha)}function ia(a,b){for(var c=0;c<a.length;c++)a[c]={index:c,value:a[c]};var d=b||ha;ga(a,function(a,b){return d(a.value,b.value)||a.index-b.index});for(c=0;c<a.length;c++)a[c]=a[c].value}function ha(a,b){return a>b?1:a<b?-1:0};var ja;if(\"undefined\"===typeof ka)var ka=function(){throw Error(\"No *print-fn* fn set for evaluation environment\");};var la=null,ma=null;if(\"undefined\"===typeof na)var na=null;function oa(){return new pa(null,5,[sa,!0,ua,!0,wa,!1,ya,!1,za,la],null)}function t(a){return null!=a&&!1!==a}function Aa(a){return t(a)?!1:!0}function w(a,b){return a[n(null==b?null:b)]?!0:a._?!0:!1}function Ba(a){return null==a?null:a.constructor}\nfunction x(a,b){var c=Ba(b),c=t(t(c)?c.Yb:c)?c.Xb:n(b);return Error([\"No protocol method \",a,\" defined for type \",c,\": \",b].join(\"\"))}function Da(a){var b=a.Xb;return t(b)?b:\"\"+z(a)}var Ea=\"undefined\"!==typeof Symbol&&\"function\"===n(Symbol)?Symbol.Cc:\"@@iterator\";function Fa(a){for(var b=a.length,c=Array(b),d=0;;)if(d<b)c[d]=a[d],d+=1;else break;return c}function Ha(a){for(var b=Array(arguments.length),c=0;;)if(c<b.length)b[c]=arguments[c],c+=1;else return b}\nvar Ia=function(){function a(a,b){function c(a,b){a.push(b);return a}var g=[];return A.c?A.c(c,g,b):A.call(null,c,g,b)}function b(a){return c.a(null,a)}var c=null,c=function(d,c){switch(arguments.length){case 1:return b.call(this,d);case 2:return a.call(this,0,c)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Ja={},La={};function Ma(a){if(a?a.L:a)return a.L(a);var b;b=Ma[n(null==a?null:a)];if(!b&&(b=Ma._,!b))throw x(\"ICounted.-count\",a);return b.call(null,a)}\nfunction Na(a){if(a?a.J:a)return a.J(a);var b;b=Na[n(null==a?null:a)];if(!b&&(b=Na._,!b))throw x(\"IEmptyableCollection.-empty\",a);return b.call(null,a)}var Qa={};function Ra(a,b){if(a?a.G:a)return a.G(a,b);var c;c=Ra[n(null==a?null:a)];if(!c&&(c=Ra._,!c))throw x(\"ICollection.-conj\",a);return c.call(null,a,b)}\nvar Ta={},C=function(){function a(a,b,c){if(a?a.$:a)return a.$(a,b,c);var g;g=C[n(null==a?null:a)];if(!g&&(g=C._,!g))throw x(\"IIndexed.-nth\",a);return g.call(null,a,b,c)}function b(a,b){if(a?a.Q:a)return a.Q(a,b);var c;c=C[n(null==a?null:a)];if(!c&&(c=C._,!c))throw x(\"IIndexed.-nth\",a);return c.call(null,a,b)}var c=null,c=function(d,c,f){switch(arguments.length){case 2:return b.call(this,d,c);case 3:return a.call(this,d,c,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}(),\nUa={};function Va(a){if(a?a.N:a)return a.N(a);var b;b=Va[n(null==a?null:a)];if(!b&&(b=Va._,!b))throw x(\"ISeq.-first\",a);return b.call(null,a)}function Wa(a){if(a?a.S:a)return a.S(a);var b;b=Wa[n(null==a?null:a)];if(!b&&(b=Wa._,!b))throw x(\"ISeq.-rest\",a);return b.call(null,a)}\nvar Xa={},Za={},$a=function(){function a(a,b,c){if(a?a.s:a)return a.s(a,b,c);var g;g=$a[n(null==a?null:a)];if(!g&&(g=$a._,!g))throw x(\"ILookup.-lookup\",a);return g.call(null,a,b,c)}function b(a,b){if(a?a.t:a)return a.t(a,b);var c;c=$a[n(null==a?null:a)];if(!c&&(c=$a._,!c))throw x(\"ILookup.-lookup\",a);return c.call(null,a,b)}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=\na;return c}(),ab={};function bb(a,b){if(a?a.rb:a)return a.rb(a,b);var c;c=bb[n(null==a?null:a)];if(!c&&(c=bb._,!c))throw x(\"IAssociative.-contains-key?\",a);return c.call(null,a,b)}function cb(a,b,c){if(a?a.Ka:a)return a.Ka(a,b,c);var d;d=cb[n(null==a?null:a)];if(!d&&(d=cb._,!d))throw x(\"IAssociative.-assoc\",a);return d.call(null,a,b,c)}var db={};function eb(a,b){if(a?a.wb:a)return a.wb(a,b);var c;c=eb[n(null==a?null:a)];if(!c&&(c=eb._,!c))throw x(\"IMap.-dissoc\",a);return c.call(null,a,b)}var fb={};\nfunction hb(a){if(a?a.hb:a)return a.hb(a);var b;b=hb[n(null==a?null:a)];if(!b&&(b=hb._,!b))throw x(\"IMapEntry.-key\",a);return b.call(null,a)}function ib(a){if(a?a.ib:a)return a.ib(a);var b;b=ib[n(null==a?null:a)];if(!b&&(b=ib._,!b))throw x(\"IMapEntry.-val\",a);return b.call(null,a)}var jb={};function kb(a,b){if(a?a.Eb:a)return a.Eb(a,b);var c;c=kb[n(null==a?null:a)];if(!c&&(c=kb._,!c))throw x(\"ISet.-disjoin\",a);return c.call(null,a,b)}\nfunction lb(a){if(a?a.La:a)return a.La(a);var b;b=lb[n(null==a?null:a)];if(!b&&(b=lb._,!b))throw x(\"IStack.-peek\",a);return b.call(null,a)}function mb(a){if(a?a.Ma:a)return a.Ma(a);var b;b=mb[n(null==a?null:a)];if(!b&&(b=mb._,!b))throw x(\"IStack.-pop\",a);return b.call(null,a)}var nb={};function pb(a,b,c){if(a?a.Ua:a)return a.Ua(a,b,c);var d;d=pb[n(null==a?null:a)];if(!d&&(d=pb._,!d))throw x(\"IVector.-assoc-n\",a);return d.call(null,a,b,c)}\nfunction qb(a){if(a?a.Ra:a)return a.Ra(a);var b;b=qb[n(null==a?null:a)];if(!b&&(b=qb._,!b))throw x(\"IDeref.-deref\",a);return b.call(null,a)}var rb={};function sb(a){if(a?a.H:a)return a.H(a);var b;b=sb[n(null==a?null:a)];if(!b&&(b=sb._,!b))throw x(\"IMeta.-meta\",a);return b.call(null,a)}var tb={};function ub(a,b){if(a?a.F:a)return a.F(a,b);var c;c=ub[n(null==a?null:a)];if(!c&&(c=ub._,!c))throw x(\"IWithMeta.-with-meta\",a);return c.call(null,a,b)}\nvar vb={},wb=function(){function a(a,b,c){if(a?a.O:a)return a.O(a,b,c);var g;g=wb[n(null==a?null:a)];if(!g&&(g=wb._,!g))throw x(\"IReduce.-reduce\",a);return g.call(null,a,b,c)}function b(a,b){if(a?a.R:a)return a.R(a,b);var c;c=wb[n(null==a?null:a)];if(!c&&(c=wb._,!c))throw x(\"IReduce.-reduce\",a);return c.call(null,a,b)}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}();\nfunction xb(a,b,c){if(a?a.gb:a)return a.gb(a,b,c);var d;d=xb[n(null==a?null:a)];if(!d&&(d=xb._,!d))throw x(\"IKVReduce.-kv-reduce\",a);return d.call(null,a,b,c)}function yb(a,b){if(a?a.A:a)return a.A(a,b);var c;c=yb[n(null==a?null:a)];if(!c&&(c=yb._,!c))throw x(\"IEquiv.-equiv\",a);return c.call(null,a,b)}function zb(a){if(a?a.B:a)return a.B(a);var b;b=zb[n(null==a?null:a)];if(!b&&(b=zb._,!b))throw x(\"IHash.-hash\",a);return b.call(null,a)}var Bb={};\nfunction Cb(a){if(a?a.D:a)return a.D(a);var b;b=Cb[n(null==a?null:a)];if(!b&&(b=Cb._,!b))throw x(\"ISeqable.-seq\",a);return b.call(null,a)}var Db={},Eb={},Fb={};function Gb(a){if(a?a.ab:a)return a.ab(a);var b;b=Gb[n(null==a?null:a)];if(!b&&(b=Gb._,!b))throw x(\"IReversible.-rseq\",a);return b.call(null,a)}function Hb(a,b){if(a?a.Hb:a)return a.Hb(a,b);var c;c=Hb[n(null==a?null:a)];if(!c&&(c=Hb._,!c))throw x(\"ISorted.-sorted-seq\",a);return c.call(null,a,b)}\nfunction Ib(a,b,c){if(a?a.Ib:a)return a.Ib(a,b,c);var d;d=Ib[n(null==a?null:a)];if(!d&&(d=Ib._,!d))throw x(\"ISorted.-sorted-seq-from\",a);return d.call(null,a,b,c)}function Jb(a,b){if(a?a.Gb:a)return a.Gb(a,b);var c;c=Jb[n(null==a?null:a)];if(!c&&(c=Jb._,!c))throw x(\"ISorted.-entry-key\",a);return c.call(null,a,b)}function Kb(a){if(a?a.Fb:a)return a.Fb(a);var b;b=Kb[n(null==a?null:a)];if(!b&&(b=Kb._,!b))throw x(\"ISorted.-comparator\",a);return b.call(null,a)}\nfunction Lb(a,b){if(a?a.Wb:a)return a.Wb(0,b);var c;c=Lb[n(null==a?null:a)];if(!c&&(c=Lb._,!c))throw x(\"IWriter.-write\",a);return c.call(null,a,b)}var Mb={};function Nb(a,b,c){if(a?a.v:a)return a.v(a,b,c);var d;d=Nb[n(null==a?null:a)];if(!d&&(d=Nb._,!d))throw x(\"IPrintWithWriter.-pr-writer\",a);return d.call(null,a,b,c)}function Ob(a){if(a?a.$a:a)return a.$a(a);var b;b=Ob[n(null==a?null:a)];if(!b&&(b=Ob._,!b))throw x(\"IEditableCollection.-as-transient\",a);return b.call(null,a)}\nfunction Pb(a,b){if(a?a.Sa:a)return a.Sa(a,b);var c;c=Pb[n(null==a?null:a)];if(!c&&(c=Pb._,!c))throw x(\"ITransientCollection.-conj!\",a);return c.call(null,a,b)}function Qb(a){if(a?a.Ta:a)return a.Ta(a);var b;b=Qb[n(null==a?null:a)];if(!b&&(b=Qb._,!b))throw x(\"ITransientCollection.-persistent!\",a);return b.call(null,a)}function Rb(a,b,c){if(a?a.kb:a)return a.kb(a,b,c);var d;d=Rb[n(null==a?null:a)];if(!d&&(d=Rb._,!d))throw x(\"ITransientAssociative.-assoc!\",a);return d.call(null,a,b,c)}\nfunction Sb(a,b){if(a?a.Jb:a)return a.Jb(a,b);var c;c=Sb[n(null==a?null:a)];if(!c&&(c=Sb._,!c))throw x(\"ITransientMap.-dissoc!\",a);return c.call(null,a,b)}function Tb(a,b,c){if(a?a.Ub:a)return a.Ub(0,b,c);var d;d=Tb[n(null==a?null:a)];if(!d&&(d=Tb._,!d))throw x(\"ITransientVector.-assoc-n!\",a);return d.call(null,a,b,c)}function Ub(a){if(a?a.Vb:a)return a.Vb();var b;b=Ub[n(null==a?null:a)];if(!b&&(b=Ub._,!b))throw x(\"ITransientVector.-pop!\",a);return b.call(null,a)}\nfunction Vb(a,b){if(a?a.Tb:a)return a.Tb(0,b);var c;c=Vb[n(null==a?null:a)];if(!c&&(c=Vb._,!c))throw x(\"ITransientSet.-disjoin!\",a);return c.call(null,a,b)}function Xb(a){if(a?a.Pb:a)return a.Pb();var b;b=Xb[n(null==a?null:a)];if(!b&&(b=Xb._,!b))throw x(\"IChunk.-drop-first\",a);return b.call(null,a)}function Yb(a){if(a?a.Cb:a)return a.Cb(a);var b;b=Yb[n(null==a?null:a)];if(!b&&(b=Yb._,!b))throw x(\"IChunkedSeq.-chunked-first\",a);return b.call(null,a)}\nfunction Zb(a){if(a?a.Db:a)return a.Db(a);var b;b=Zb[n(null==a?null:a)];if(!b&&(b=Zb._,!b))throw x(\"IChunkedSeq.-chunked-rest\",a);return b.call(null,a)}function $b(a){if(a?a.Bb:a)return a.Bb(a);var b;b=$b[n(null==a?null:a)];if(!b&&(b=$b._,!b))throw x(\"IChunkedNext.-chunked-next\",a);return b.call(null,a)}function ac(a,b){if(a?a.bb:a)return a.bb(0,b);var c;c=ac[n(null==a?null:a)];if(!c&&(c=ac._,!c))throw x(\"IVolatile.-vreset!\",a);return c.call(null,a,b)}var bc={};\nfunction cc(a){if(a?a.fb:a)return a.fb(a);var b;b=cc[n(null==a?null:a)];if(!b&&(b=cc._,!b))throw x(\"IIterable.-iterator\",a);return b.call(null,a)}function dc(a){this.qc=a;this.q=0;this.j=1073741824}dc.prototype.Wb=function(a,b){return this.qc.append(b)};function ec(a){var b=new fa;a.v(null,new dc(b),oa());return\"\"+z(b)}\nvar fc=\"undefined\"!==typeof Math.imul&&0!==(Math.imul.a?Math.imul.a(4294967295,5):Math.imul.call(null,4294967295,5))?function(a,b){return Math.imul.a?Math.imul.a(a,b):Math.imul.call(null,a,b)}:function(a,b){var c=a&65535,d=b&65535;return c*d+((a>>>16&65535)*d+c*(b>>>16&65535)<<16>>>0)|0};function gc(a){a=fc(a,3432918353);return fc(a<<15|a>>>-15,461845907)}function hc(a,b){var c=a^b;return fc(c<<13|c>>>-13,5)+3864292196}\nfunction ic(a,b){var c=a^b,c=fc(c^c>>>16,2246822507),c=fc(c^c>>>13,3266489909);return c^c>>>16}var kc={},lc=0;function mc(a){255<lc&&(kc={},lc=0);var b=kc[a];if(\"number\"!==typeof b){a:if(null!=a)if(b=a.length,0<b){for(var c=0,d=0;;)if(c<b)var e=c+1,d=fc(31,d)+a.charCodeAt(c),c=e;else{b=d;break a}b=void 0}else b=0;else b=0;kc[a]=b;lc+=1}return a=b}\nfunction nc(a){a&&(a.j&4194304||a.vc)?a=a.B(null):\"number\"===typeof a?a=(Math.floor.b?Math.floor.b(a):Math.floor.call(null,a))%2147483647:!0===a?a=1:!1===a?a=0:\"string\"===typeof a?(a=mc(a),0!==a&&(a=gc(a),a=hc(0,a),a=ic(a,4))):a=a instanceof Date?a.valueOf():null==a?0:zb(a);return a}\nfunction oc(a){var b;b=a.name;var c;a:{c=1;for(var d=0;;)if(c<b.length){var e=c+2,d=hc(d,gc(b.charCodeAt(c-1)|b.charCodeAt(c)<<16));c=e}else{c=d;break a}c=void 0}c=1===(b.length&1)?c^gc(b.charCodeAt(b.length-1)):c;b=ic(c,fc(2,b.length));a=mc(a.ba);return b^a+2654435769+(b<<6)+(b>>2)}function pc(a,b){if(a.ta===b.ta)return 0;var c=Aa(a.ba);if(t(c?b.ba:c))return-1;if(t(a.ba)){if(Aa(b.ba))return 1;c=ha(a.ba,b.ba);return 0===c?ha(a.name,b.name):c}return ha(a.name,b.name)}\nfunction qc(a,b,c,d,e){this.ba=a;this.name=b;this.ta=c;this.Ya=d;this.Z=e;this.j=2154168321;this.q=4096}k=qc.prototype;k.v=function(a,b){return Lb(b,this.ta)};k.B=function(){var a=this.Ya;return null!=a?a:this.Ya=a=oc(this)};k.F=function(a,b){return new qc(this.ba,this.name,this.ta,this.Ya,b)};k.H=function(){return this.Z};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return $a.c(c,this,null);case 3:return $a.c(c,this,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return $a.c(c,this,null)};a.c=function(a,c,d){return $a.c(c,this,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return $a.c(a,this,null)};k.a=function(a,b){return $a.c(a,this,b)};k.A=function(a,b){return b instanceof qc?this.ta===b.ta:!1};\nk.toString=function(){return this.ta};var rc=function(){function a(a,b){var c=null!=a?[z(a),z(\"/\"),z(b)].join(\"\"):b;return new qc(a,b,c,null,null)}function b(a){return a instanceof qc?a:c.a(null,a)}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}();\nfunction D(a){if(null==a)return null;if(a&&(a.j&8388608||a.mc))return a.D(null);if(a instanceof Array||\"string\"===typeof a)return 0===a.length?null:new F(a,0);if(w(Bb,a))return Cb(a);throw Error([z(a),z(\" is not ISeqable\")].join(\"\"));}function G(a){if(null==a)return null;if(a&&(a.j&64||a.jb))return a.N(null);a=D(a);return null==a?null:Va(a)}function H(a){return null!=a?a&&(a.j&64||a.jb)?a.S(null):(a=D(a))?Wa(a):J:J}function K(a){return null==a?null:a&&(a.j&128||a.xb)?a.T(null):D(H(a))}\nvar sc=function(){function a(a,b){return null==a?null==b:a===b||yb(a,b)}var b=null,c=function(){function a(b,d,h){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 F(m,0)}return c.call(this,b,d,l)}function c(a,d,e){for(;;)if(b.a(a,d))if(K(e))a=d,d=G(e),e=K(e);else return b.a(d,G(e));else return!1}a.i=2;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=H(a);return c(b,d,a)};a.d=c;return a}(),b=function(b,e,f){switch(arguments.length){case 1:return!0;\ncase 2:return a.call(this,b,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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.b=function(){return!0};b.a=a;b.d=c.d;return b}();function tc(a){this.C=a}tc.prototype.next=function(){if(null!=this.C){var a=G(this.C);this.C=K(this.C);return{done:!1,value:a}}return{done:!0,value:null}};function uc(a){return new tc(D(a))}\nfunction vc(a,b){var c=gc(a),c=hc(0,c);return ic(c,b)}function wc(a){var b=0,c=1;for(a=D(a);;)if(null!=a)b+=1,c=fc(31,c)+nc(G(a))|0,a=K(a);else return vc(c,b)}function xc(a){var b=0,c=0;for(a=D(a);;)if(null!=a)b+=1,c=c+nc(G(a))|0,a=K(a);else return vc(c,b)}La[\"null\"]=!0;Ma[\"null\"]=function(){return 0};Date.prototype.A=function(a,b){return b instanceof Date&&this.toString()===b.toString()};yb.number=function(a,b){return a===b};rb[\"function\"]=!0;sb[\"function\"]=function(){return null};\nJa[\"function\"]=!0;zb._=function(a){return a[ba]||(a[ba]=++ca)};function yc(a){this.o=a;this.q=0;this.j=32768}yc.prototype.Ra=function(){return this.o};function Ac(a){return a instanceof yc}function Bc(a){return Ac(a)?L.b?L.b(a):L.call(null,a):a}function L(a){return qb(a)}\nvar Cc=function(){function a(a,b,c,d){for(var l=Ma(a);;)if(d<l){var m=C.a(a,d);c=b.a?b.a(c,m):b.call(null,c,m);if(Ac(c))return qb(c);d+=1}else return c}function b(a,b,c){var d=Ma(a),l=c;for(c=0;;)if(c<d){var m=C.a(a,c),l=b.a?b.a(l,m):b.call(null,l,m);if(Ac(l))return qb(l);c+=1}else return l}function c(a,b){var c=Ma(a);if(0===c)return b.l?b.l():b.call(null);for(var d=C.a(a,0),l=1;;)if(l<c){var m=C.a(a,l),d=b.a?b.a(d,m):b.call(null,d,m);if(Ac(d))return qb(d);l+=1}else return d}var d=null,d=function(d,\nf,g,h){switch(arguments.length){case 2:return c.call(this,d,f);case 3:return b.call(this,d,f,g);case 4:return a.call(this,d,f,g,h)}throw Error(\"Invalid arity: \"+arguments.length);};d.a=c;d.c=b;d.n=a;return d}(),Dc=function(){function a(a,b,c,d){for(var l=a.length;;)if(d<l){var m=a[d];c=b.a?b.a(c,m):b.call(null,c,m);if(Ac(c))return qb(c);d+=1}else return c}function b(a,b,c){var d=a.length,l=c;for(c=0;;)if(c<d){var m=a[c],l=b.a?b.a(l,m):b.call(null,l,m);if(Ac(l))return qb(l);c+=1}else return l}function c(a,\nb){var c=a.length;if(0===a.length)return b.l?b.l():b.call(null);for(var d=a[0],l=1;;)if(l<c){var m=a[l],d=b.a?b.a(d,m):b.call(null,d,m);if(Ac(d))return qb(d);l+=1}else return d}var d=null,d=function(d,f,g,h){switch(arguments.length){case 2:return c.call(this,d,f);case 3:return b.call(this,d,f,g);case 4:return a.call(this,d,f,g,h)}throw Error(\"Invalid arity: \"+arguments.length);};d.a=c;d.c=b;d.n=a;return d}();function Ec(a){return a?a.j&2||a.cc?!0:a.j?!1:w(La,a):w(La,a)}\nfunction Fc(a){return a?a.j&16||a.Qb?!0:a.j?!1:w(Ta,a):w(Ta,a)}function Gc(a,b){this.e=a;this.m=b}Gc.prototype.ga=function(){return this.m<this.e.length};Gc.prototype.next=function(){var a=this.e[this.m];this.m+=1;return a};function F(a,b){this.e=a;this.m=b;this.j=166199550;this.q=8192}k=F.prototype;k.toString=function(){return ec(this)};k.Q=function(a,b){var c=b+this.m;return c<this.e.length?this.e[c]:null};k.$=function(a,b,c){a=b+this.m;return a<this.e.length?this.e[a]:c};k.vb=!0;\nk.fb=function(){return new Gc(this.e,this.m)};k.T=function(){return this.m+1<this.e.length?new F(this.e,this.m+1):null};k.L=function(){return this.e.length-this.m};k.ab=function(){var a=Ma(this);return 0<a?new Hc(this,a-1,null):null};k.B=function(){return wc(this)};k.A=function(a,b){return Ic.a?Ic.a(this,b):Ic.call(null,this,b)};k.J=function(){return J};k.R=function(a,b){return Dc.n(this.e,b,this.e[this.m],this.m+1)};k.O=function(a,b,c){return Dc.n(this.e,b,c,this.m)};k.N=function(){return this.e[this.m]};\nk.S=function(){return this.m+1<this.e.length?new F(this.e,this.m+1):J};k.D=function(){return this};k.G=function(a,b){return M.a?M.a(b,this):M.call(null,b,this)};F.prototype[Ea]=function(){return uc(this)};\nvar Jc=function(){function a(a,b){return b<a.length?new F(a,b):null}function b(a){return c.a(a,0)}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Kc=function(){function a(a,b){return Jc.a(a,b)}function b(a){return Jc.a(a,0)}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+\narguments.length);};c.b=b;c.a=a;return c}();function Hc(a,b,c){this.qb=a;this.m=b;this.k=c;this.j=32374990;this.q=8192}k=Hc.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};k.T=function(){return 0<this.m?new Hc(this.qb,this.m-1,null):null};k.L=function(){return this.m+1};k.B=function(){return wc(this)};k.A=function(a,b){return Ic.a?Ic.a(this,b):Ic.call(null,this,b)};k.J=function(){var a=this.k;return O.a?O.a(J,a):O.call(null,J,a)};\nk.R=function(a,b){return P.a?P.a(b,this):P.call(null,b,this)};k.O=function(a,b,c){return P.c?P.c(b,c,this):P.call(null,b,c,this)};k.N=function(){return C.a(this.qb,this.m)};k.S=function(){return 0<this.m?new Hc(this.qb,this.m-1,null):J};k.D=function(){return this};k.F=function(a,b){return new Hc(this.qb,this.m,b)};k.G=function(a,b){return M.a?M.a(b,this):M.call(null,b,this)};Hc.prototype[Ea]=function(){return uc(this)};function Lc(a){return G(K(a))}yb._=function(a,b){return a===b};\nvar Nc=function(){function a(a,b){return null!=a?Ra(a,b):Ra(J,b)}var b=null,c=function(){function a(b,d,h){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 F(m,0)}return c.call(this,b,d,l)}function c(a,d,e){for(;;)if(t(e))a=b.a(a,d),d=G(e),e=K(e);else return b.a(a,d)}a.i=2;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=H(a);return c(b,d,a)};a.d=c;return a}(),b=function(b,e,f){switch(arguments.length){case 0:return Mc;case 1:return b;\ncase 2:return a.call(this,b,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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.l=function(){return Mc};b.b=function(a){return a};b.a=a;b.d=c.d;return b}();function Oc(a){return null==a?null:Na(a)}\nfunction Q(a){if(null!=a)if(a&&(a.j&2||a.cc))a=a.L(null);else if(a instanceof Array)a=a.length;else if(\"string\"===typeof a)a=a.length;else if(w(La,a))a=Ma(a);else a:{a=D(a);for(var b=0;;){if(Ec(a)){a=b+Ma(a);break a}a=K(a);b+=1}a=void 0}else a=0;return a}\nvar Pc=function(){function a(a,b,c){for(;;){if(null==a)return c;if(0===b)return D(a)?G(a):c;if(Fc(a))return C.c(a,b,c);if(D(a))a=K(a),b-=1;else return c}}function b(a,b){for(;;){if(null==a)throw Error(\"Index out of bounds\");if(0===b){if(D(a))return G(a);throw Error(\"Index out of bounds\");}if(Fc(a))return C.a(a,b);if(D(a)){var c=K(a),g=b-1;a=c;b=g}else throw Error(\"Index out of bounds\");}}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,\nc,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}(),R=function(){function a(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.j&16||a.Qb))return a.$(null,b,c);if(a instanceof Array||\"string\"===typeof a)return b<a.length?a[b]:c;if(w(Ta,a))return C.a(a,b);if(a?a.j&64||a.jb||(a.j?0:w(Ua,a)):w(Ua,a))return Pc.c(a,b,c);throw Error([z(\"nth not supported on this type \"),z(Da(Ba(a)))].join(\"\"));}function b(a,b){if(\"number\"!==\ntypeof b)throw Error(\"index argument to nth must be a number\");if(null==a)return a;if(a&&(a.j&16||a.Qb))return a.Q(null,b);if(a instanceof Array||\"string\"===typeof a)return b<a.length?a[b]:null;if(w(Ta,a))return C.a(a,b);if(a?a.j&64||a.jb||(a.j?0:w(Ua,a)):w(Ua,a))return Pc.a(a,b);throw Error([z(\"nth not supported on this type \"),z(Da(Ba(a)))].join(\"\"));}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+\narguments.length);};c.a=b;c.c=a;return c}(),S=function(){function a(a,b,c){return null!=a?a&&(a.j&256||a.Rb)?a.s(null,b,c):a instanceof Array?b<a.length?a[b]:c:\"string\"===typeof a?b<a.length?a[b]:c:w(Za,a)?$a.c(a,b,c):c:c}function b(a,b){return null==a?null:a&&(a.j&256||a.Rb)?a.t(null,b):a instanceof Array?b<a.length?a[b]:null:\"string\"===typeof a?b<a.length?a[b]:null:w(Za,a)?$a.a(a,b):null}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,\nc,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}(),Rc=function(){function a(a,b,c){if(null!=a)a=cb(a,b,c);else a:{a=[b];c=[c];b=a.length;for(var g=0,h=Ob(Qc);;)if(g<b)var l=g+1,h=h.kb(null,a[g],c[g]),g=l;else{a=Qb(h);break a}a=void 0}return a}var b=null,c=function(){function a(b,d,h,l){var m=null;if(3<arguments.length){for(var m=0,p=Array(arguments.length-3);m<p.length;)p[m]=arguments[m+3],++m;m=new F(p,0)}return c.call(this,b,d,h,m)}function c(a,d,e,l){for(;;)if(a=b.c(a,\nd,e),t(l))d=G(l),e=Lc(l),l=K(K(l));else return a}a.i=3;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=K(a);var l=G(a);a=H(a);return c(b,d,l,a)};a.d=c;return a}(),b=function(b,e,f,g){switch(arguments.length){case 3:return a.call(this,b,e,f);default:var h=null;if(3<arguments.length){for(var h=0,l=Array(arguments.length-3);h<l.length;)l[h]=arguments[h+3],++h;h=new F(l,0)}return c.d(b,e,f,h)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=3;b.f=c.f;b.c=a;b.d=c.d;return b}(),Sc=function(){function a(a,\nb){return null==a?null:eb(a,b)}var b=null,c=function(){function a(b,d,h){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 F(m,0)}return c.call(this,b,d,l)}function c(a,d,e){for(;;){if(null==a)return null;a=b.a(a,d);if(t(e))d=G(e),e=K(e);else return a}}a.i=2;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=H(a);return c(b,d,a)};a.d=c;return a}(),b=function(b,e,f){switch(arguments.length){case 1:return b;case 2:return a.call(this,b,e);\ndefault: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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.b=function(a){return a};b.a=a;b.d=c.d;return b}();function Tc(a){var b=\"function\"==n(a);return t(b)?b:a?t(t(null)?null:a.bc)?!0:a.yb?!1:w(Ja,a):w(Ja,a)}function Uc(a,b){this.h=a;this.k=b;this.q=0;this.j=393217}k=Uc.prototype;\nk.call=function(){function a(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,Y,ra,I){a=this.h;return T.ub?T.ub(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,Y,ra,I):T.call(null,a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,Y,ra,I)}function b(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,Y,ra){a=this;return a.h.Fa?a.h.Fa(b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,Y,ra):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,Y,ra)}function c(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,Y){a=this;return a.h.Ea?a.h.Ea(b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,\nY):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N,Y)}function d(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N){a=this;return a.h.Da?a.h.Da(b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E,N)}function e(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E){a=this;return a.h.Ca?a.h.Ca(b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B,E)}function f(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B){a=this;return a.h.Ba?a.h.Ba(b,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B):a.h.call(null,\nb,c,d,e,f,g,h,l,m,p,q,u,s,v,y,B)}function g(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y){a=this;return a.h.Aa?a.h.Aa(b,c,d,e,f,g,h,l,m,p,q,u,s,v,y):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q,u,s,v,y)}function h(a,b,c,d,e,f,g,h,l,m,p,q,u,s,v){a=this;return a.h.za?a.h.za(b,c,d,e,f,g,h,l,m,p,q,u,s,v):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q,u,s,v)}function l(a,b,c,d,e,f,g,h,l,m,p,q,u,s){a=this;return a.h.ya?a.h.ya(b,c,d,e,f,g,h,l,m,p,q,u,s):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q,u,s)}function m(a,b,c,d,e,f,g,h,l,m,p,q,u){a=this;\nreturn a.h.xa?a.h.xa(b,c,d,e,f,g,h,l,m,p,q,u):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q,u)}function p(a,b,c,d,e,f,g,h,l,m,p,q){a=this;return a.h.wa?a.h.wa(b,c,d,e,f,g,h,l,m,p,q):a.h.call(null,b,c,d,e,f,g,h,l,m,p,q)}function q(a,b,c,d,e,f,g,h,l,m,p){a=this;return a.h.va?a.h.va(b,c,d,e,f,g,h,l,m,p):a.h.call(null,b,c,d,e,f,g,h,l,m,p)}function s(a,b,c,d,e,f,g,h,l,m){a=this;return a.h.Ha?a.h.Ha(b,c,d,e,f,g,h,l,m):a.h.call(null,b,c,d,e,f,g,h,l,m)}function u(a,b,c,d,e,f,g,h,l){a=this;return a.h.Ga?a.h.Ga(b,c,\nd,e,f,g,h,l):a.h.call(null,b,c,d,e,f,g,h,l)}function v(a,b,c,d,e,f,g,h){a=this;return a.h.ia?a.h.ia(b,c,d,e,f,g,h):a.h.call(null,b,c,d,e,f,g,h)}function y(a,b,c,d,e,f,g){a=this;return a.h.P?a.h.P(b,c,d,e,f,g):a.h.call(null,b,c,d,e,f,g)}function B(a,b,c,d,e,f){a=this;return a.h.r?a.h.r(b,c,d,e,f):a.h.call(null,b,c,d,e,f)}function E(a,b,c,d,e){a=this;return a.h.n?a.h.n(b,c,d,e):a.h.call(null,b,c,d,e)}function N(a,b,c,d){a=this;return a.h.c?a.h.c(b,c,d):a.h.call(null,b,c,d)}function Y(a,b,c){a=this;\nreturn a.h.a?a.h.a(b,c):a.h.call(null,b,c)}function ra(a,b){a=this;return a.h.b?a.h.b(b):a.h.call(null,b)}function Pa(a){a=this;return a.h.l?a.h.l():a.h.call(null)}var I=null,I=function(I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab,Wb,jc,zc,Zc,Gd,De,Wf,dh){switch(arguments.length){case 1:return Pa.call(this,I);case 2:return ra.call(this,I,qa);case 3:return Y.call(this,I,qa,ta);case 4:return N.call(this,I,qa,ta,va);case 5:return E.call(this,I,qa,ta,va,xa);case 6:return B.call(this,I,qa,ta,va,xa,Ca);case 7:return y.call(this,\nI,qa,ta,va,xa,Ca,Ga);case 8:return v.call(this,I,qa,ta,va,xa,Ca,Ga,Ka);case 9:return u.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa);case 10:return s.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa);case 11:return q.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya);case 12:return p.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb);case 13:return m.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob);case 14:return l.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab);case 15:return h.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,\nob,Ab,Wb);case 16:return g.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab,Wb,jc);case 17:return f.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab,Wb,jc,zc);case 18:return e.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab,Wb,jc,zc,Zc);case 19:return d.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab,Wb,jc,zc,Zc,Gd);case 20:return c.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab,Wb,jc,zc,Zc,Gd,De);case 21:return b.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab,Wb,jc,zc,Zc,Gd,De,\nWf);case 22:return a.call(this,I,qa,ta,va,xa,Ca,Ga,Ka,Oa,Sa,Ya,gb,ob,Ab,Wb,jc,zc,Zc,Gd,De,Wf,dh)}throw Error(\"Invalid arity: \"+arguments.length);};I.b=Pa;I.a=ra;I.c=Y;I.n=N;I.r=E;I.P=B;I.ia=y;I.Ga=v;I.Ha=u;I.va=s;I.wa=q;I.xa=p;I.ya=m;I.za=l;I.Aa=h;I.Ba=g;I.Ca=f;I.Da=e;I.Ea=d;I.Fa=c;I.hc=b;I.ub=a;return I}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.l=function(){return this.h.l?this.h.l():this.h.call(null)};\nk.b=function(a){return this.h.b?this.h.b(a):this.h.call(null,a)};k.a=function(a,b){return this.h.a?this.h.a(a,b):this.h.call(null,a,b)};k.c=function(a,b,c){return this.h.c?this.h.c(a,b,c):this.h.call(null,a,b,c)};k.n=function(a,b,c,d){return this.h.n?this.h.n(a,b,c,d):this.h.call(null,a,b,c,d)};k.r=function(a,b,c,d,e){return this.h.r?this.h.r(a,b,c,d,e):this.h.call(null,a,b,c,d,e)};k.P=function(a,b,c,d,e,f){return this.h.P?this.h.P(a,b,c,d,e,f):this.h.call(null,a,b,c,d,e,f)};\nk.ia=function(a,b,c,d,e,f,g){return this.h.ia?this.h.ia(a,b,c,d,e,f,g):this.h.call(null,a,b,c,d,e,f,g)};k.Ga=function(a,b,c,d,e,f,g,h){return this.h.Ga?this.h.Ga(a,b,c,d,e,f,g,h):this.h.call(null,a,b,c,d,e,f,g,h)};k.Ha=function(a,b,c,d,e,f,g,h,l){return this.h.Ha?this.h.Ha(a,b,c,d,e,f,g,h,l):this.h.call(null,a,b,c,d,e,f,g,h,l)};k.va=function(a,b,c,d,e,f,g,h,l,m){return this.h.va?this.h.va(a,b,c,d,e,f,g,h,l,m):this.h.call(null,a,b,c,d,e,f,g,h,l,m)};\nk.wa=function(a,b,c,d,e,f,g,h,l,m,p){return this.h.wa?this.h.wa(a,b,c,d,e,f,g,h,l,m,p):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p)};k.xa=function(a,b,c,d,e,f,g,h,l,m,p,q){return this.h.xa?this.h.xa(a,b,c,d,e,f,g,h,l,m,p,q):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q)};k.ya=function(a,b,c,d,e,f,g,h,l,m,p,q,s){return this.h.ya?this.h.ya(a,b,c,d,e,f,g,h,l,m,p,q,s):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q,s)};\nk.za=function(a,b,c,d,e,f,g,h,l,m,p,q,s,u){return this.h.za?this.h.za(a,b,c,d,e,f,g,h,l,m,p,q,s,u):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q,s,u)};k.Aa=function(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v){return this.h.Aa?this.h.Aa(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q,s,u,v)};k.Ba=function(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y){return this.h.Ba?this.h.Ba(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y)};\nk.Ca=function(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B){return this.h.Ca?this.h.Ca(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B)};k.Da=function(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E){return this.h.Da?this.h.Da(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E)};\nk.Ea=function(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N){return this.h.Ea?this.h.Ea(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N)};k.Fa=function(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y){return this.h.Fa?this.h.Fa(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y):this.h.call(null,a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y)};\nk.hc=function(a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra){var Pa=this.h;return T.ub?T.ub(Pa,a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra):T.call(null,Pa,a,b,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra)};k.bc=!0;k.F=function(a,b){return new Uc(this.h,b)};k.H=function(){return this.k};function O(a,b){return Tc(a)&&!(a?a.j&262144||a.Bc||(a.j?0:w(tb,a)):w(tb,a))?new Uc(a,b):null==a?null:ub(a,b)}function Vc(a){var b=null!=a;return(b?a?a.j&131072||a.kc||(a.j?0:w(rb,a)):w(rb,a):b)?sb(a):null}\nfunction Wc(a){return null==a?null:lb(a)}\nvar Xc=function(){function a(a,b){return null==a?null:kb(a,b)}var b=null,c=function(){function a(b,d,h){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 F(m,0)}return c.call(this,b,d,l)}function c(a,d,e){for(;;){if(null==a)return null;a=b.a(a,d);if(t(e))d=G(e),e=K(e);else return a}}a.i=2;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=H(a);return c(b,d,a)};a.d=c;return a}(),b=function(b,e,f){switch(arguments.length){case 1:return b;case 2:return a.call(this,\nb,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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.b=function(a){return a};b.a=a;b.d=c.d;return b}();function Yc(a){return null==a||Aa(D(a))}function $c(a){return null==a?!1:a?a.j&8||a.tc?!0:a.j?!1:w(Qa,a):w(Qa,a)}function ad(a){return null==a?!1:a?a.j&4096||a.zc?!0:a.j?!1:w(jb,a):w(jb,a)}\nfunction bd(a){return a?a.j&512||a.rc?!0:a.j?!1:w(ab,a):w(ab,a)}function cd(a){return a?a.j&16777216||a.yc?!0:a.j?!1:w(Db,a):w(Db,a)}function dd(a){return null==a?!1:a?a.j&1024||a.ic?!0:a.j?!1:w(db,a):w(db,a)}function ed(a){return a?a.j&16384||a.Ac?!0:a.j?!1:w(nb,a):w(nb,a)}function fd(a){return a?a.q&512||a.sc?!0:!1:!1}function gd(a){var b=[];ea(a,function(a,b){return function(a,c){return b.push(c)}}(a,b));return b}function hd(a,b,c,d,e){for(;0!==e;)c[d]=a[b],d+=1,e-=1,b+=1}\nfunction id(a,b,c,d,e){b+=e-1;for(d+=e-1;0!==e;)c[d]=a[b],d-=1,e-=1,b-=1}var jd={};function kd(a){return null==a?!1:a?a.j&64||a.jb?!0:a.j?!1:w(Ua,a):w(Ua,a)}function ld(a){return a?a.j&8388608||a.mc?!0:a.j?!1:w(Bb,a):w(Bb,a)}function md(a){return t(a)?!0:!1}function nd(a,b){return S.c(a,b,jd)===jd?!1:!0}\nfunction od(a,b){if(a===b)return 0;if(null==a)return-1;if(null==b)return 1;if(Ba(a)===Ba(b))return a&&(a.q&2048||a.sb)?a.tb(null,b):ha(a,b);throw Error(\"compare on non-nil objects of different types\");}\nvar pd=function(){function a(a,b,c,g){for(;;){var h=od(R.a(a,g),R.a(b,g));if(0===h&&g+1<c)g+=1;else return h}}function b(a,b){var f=Q(a),g=Q(b);return f<g?-1:f>g?1:c.n(a,b,f,0)}var c=null,c=function(c,e,f,g){switch(arguments.length){case 2:return b.call(this,c,e);case 4:return a.call(this,c,e,f,g)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.n=a;return c}();\nfunction qd(a){return sc.a(a,od)?od:function(b,c){var d=a.a?a.a(b,c):a.call(null,b,c);return\"number\"===typeof d?d:t(d)?-1:t(a.a?a.a(c,b):a.call(null,c,b))?1:0}}\nvar sd=function(){function a(a,b){if(D(b)){var c=rd.b?rd.b(b):rd.call(null,b),g=qd(a);ia(c,g);return D(c)}return J}function b(a){return c.a(od,a)}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),td=function(){function a(a,b,c){return sd.a(function(c,f){return qd(b).call(null,a.b?a.b(c):a.call(null,c),a.b?a.b(f):a.call(null,f))},c)}function b(a,b){return c.c(a,od,\nb)}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}(),P=function(){function a(a,b,c){for(c=D(c);;)if(c){var g=G(c);b=a.a?a.a(b,g):a.call(null,b,g);if(Ac(b))return qb(b);c=K(c)}else return b}function b(a,b){var c=D(b);if(c){var g=G(c),c=K(c);return A.c?A.c(a,g,c):A.call(null,a,g,c)}return a.l?a.l():a.call(null)}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,\nc,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}(),A=function(){function a(a,b,c){return c&&(c.j&524288||c.Sb)?c.O(null,a,b):c instanceof Array?Dc.c(c,a,b):\"string\"===typeof c?Dc.c(c,a,b):w(vb,c)?wb.c(c,a,b):P.c(a,b,c)}function b(a,b){return b&&(b.j&524288||b.Sb)?b.R(null,a):b instanceof Array?Dc.a(b,a):\"string\"===typeof b?Dc.a(b,a):w(vb,b)?wb.a(b,a):P.a(a,b)}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,\nc,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}();function ud(a){return a}\nvar vd=function(){function a(a,b){return function(){function c(b,e){return a.a?a.a(b,e):a.call(null,b,e)}function g(a){return b.b?b.b(a):b.call(null,a)}function h(){return a.l?a.l():a.call(null)}var l=null,l=function(a,b){switch(arguments.length){case 0:return h.call(this);case 1:return g.call(this,a);case 2:return c.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};l.l=h;l.b=g;l.a=c;return l}()}function b(a){return c.a(a,ud)}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,\nc);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),wd=function(){function a(a,b,c,g){a=a.b?a.b(b):a.call(null,b);c=A.c(a,c,g);return a.b?a.b(c):a.call(null,c)}function b(a,b,f){return c.n(a,b,b.l?b.l():b.call(null),f)}var c=null,c=function(c,e,f,g){switch(arguments.length){case 3:return b.call(this,c,e,f);case 4:return a.call(this,c,e,f,g)}throw Error(\"Invalid arity: \"+arguments.length);};c.c=b;c.n=a;return c}(),xd=function(){var a=null,b=function(){function b(a,\nc,g){var h=null;if(2<arguments.length){for(var h=0,l=Array(arguments.length-2);h<l.length;)l[h]=arguments[h+2],++h;h=new F(l,0)}return d.call(this,a,c,h)}function d(b,c,d){return A.c(a,b+c,d)}b.i=2;b.f=function(a){var b=G(a);a=K(a);var c=G(a);a=H(a);return d(b,c,a)};b.d=d;return b}(),a=function(a,d,e){switch(arguments.length){case 0:return 0;case 1:return 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 F(g,\n0)}return b.d(a,d,f)}throw Error(\"Invalid arity: \"+arguments.length);};a.i=2;a.f=b.f;a.l=function(){return 0};a.b=function(a){return a};a.a=function(a,b){return a+b};a.d=b.d;return a}(),yd=function(){var a=null,b=function(){function a(c,f,g){var h=null;if(2<arguments.length){for(var h=0,l=Array(arguments.length-2);h<l.length;)l[h]=arguments[h+2],++h;h=new F(l,0)}return b.call(this,c,f,h)}function b(a,c,d){for(;;)if(a<c)if(K(d))a=c,c=G(d),d=K(d);else return c<G(d);else return!1}a.i=2;a.f=function(a){var c=\nG(a);a=K(a);var g=G(a);a=H(a);return b(c,g,a)};a.d=b;return a}(),a=function(a,d,e){switch(arguments.length){case 1:return!0;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 F(g,0)}return b.d(a,d,f)}throw Error(\"Invalid arity: \"+arguments.length);};a.i=2;a.f=b.f;a.b=function(){return!0};a.a=function(a,b){return a<b};a.d=b.d;return a}(),zd=function(){var a=null,b=function(){function a(c,f,g){var h=null;if(2<\narguments.length){for(var h=0,l=Array(arguments.length-2);h<l.length;)l[h]=arguments[h+2],++h;h=new F(l,0)}return b.call(this,c,f,h)}function b(a,c,d){for(;;)if(a<=c)if(K(d))a=c,c=G(d),d=K(d);else return c<=G(d);else return!1}a.i=2;a.f=function(a){var c=G(a);a=K(a);var g=G(a);a=H(a);return b(c,g,a)};a.d=b;return a}(),a=function(a,d,e){switch(arguments.length){case 1:return!0;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+\n2],++f;f=new F(g,0)}return b.d(a,d,f)}throw Error(\"Invalid arity: \"+arguments.length);};a.i=2;a.f=b.f;a.b=function(){return!0};a.a=function(a,b){return a<=b};a.d=b.d;return a}(),Ad=function(){var a=null,b=function(){function a(c,f,g){var h=null;if(2<arguments.length){for(var h=0,l=Array(arguments.length-2);h<l.length;)l[h]=arguments[h+2],++h;h=new F(l,0)}return b.call(this,c,f,h)}function b(a,c,d){for(;;)if(a>c)if(K(d))a=c,c=G(d),d=K(d);else return c>G(d);else return!1}a.i=2;a.f=function(a){var c=\nG(a);a=K(a);var g=G(a);a=H(a);return b(c,g,a)};a.d=b;return a}(),a=function(a,d,e){switch(arguments.length){case 1:return!0;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 F(g,0)}return b.d(a,d,f)}throw Error(\"Invalid arity: \"+arguments.length);};a.i=2;a.f=b.f;a.b=function(){return!0};a.a=function(a,b){return a>b};a.d=b.d;return a}(),Bd=function(){var a=null,b=function(){function a(c,f,g){var h=null;if(2<\narguments.length){for(var h=0,l=Array(arguments.length-2);h<l.length;)l[h]=arguments[h+2],++h;h=new F(l,0)}return b.call(this,c,f,h)}function b(a,c,d){for(;;)if(a>=c)if(K(d))a=c,c=G(d),d=K(d);else return c>=G(d);else return!1}a.i=2;a.f=function(a){var c=G(a);a=K(a);var g=G(a);a=H(a);return b(c,g,a)};a.d=b;return a}(),a=function(a,d,e){switch(arguments.length){case 1:return!0;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+\n2],++f;f=new F(g,0)}return b.d(a,d,f)}throw Error(\"Invalid arity: \"+arguments.length);};a.i=2;a.f=b.f;a.b=function(){return!0};a.a=function(a,b){return a>=b};a.d=b.d;return a}();function Cd(a,b){var c=(a-a%b)/b;return 0<=c?Math.floor.b?Math.floor.b(c):Math.floor.call(null,c):Math.ceil.b?Math.ceil.b(c):Math.ceil.call(null,c)}function Dd(a){a-=a>>1&1431655765;a=(a&858993459)+(a>>2&858993459);return 16843009*(a+(a>>4)&252645135)>>24}\nfunction Ed(a){var b=1;for(a=D(a);;)if(a&&0<b)b-=1,a=K(a);else return a}\nvar z=function(){function a(a){return null==a?\"\":da(a)}var b=null,c=function(){function a(b,d){var h=null;if(1<arguments.length){for(var h=0,l=Array(arguments.length-1);h<l.length;)l[h]=arguments[h+1],++h;h=new F(l,0)}return c.call(this,b,h)}function c(a,d){for(var e=new fa(b.b(a)),l=d;;)if(t(l))e=e.append(b.b(G(l))),l=K(l);else return e.toString()}a.i=1;a.f=function(a){var b=G(a);a=H(a);return c(b,a)};a.d=c;return a}(),b=function(b,e){switch(arguments.length){case 0:return\"\";case 1:return a.call(this,\nb);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 F(g,0)}return c.d(b,f)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=1;b.f=c.f;b.l=function(){return\"\"};b.b=a;b.d=c.d;return b}();function Ic(a,b){var c;if(cd(b))if(Ec(a)&&Ec(b)&&Q(a)!==Q(b))c=!1;else a:{c=D(a);for(var d=D(b);;){if(null==c){c=null==d;break a}if(null!=d&&sc.a(G(c),G(d)))c=K(c),d=K(d);else{c=!1;break a}}c=void 0}else c=null;return md(c)}\nfunction Fd(a,b,c,d,e){this.k=a;this.first=b;this.M=c;this.count=d;this.p=e;this.j=65937646;this.q=8192}k=Fd.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};k.T=function(){return 1===this.count?null:this.M};k.L=function(){return this.count};k.La=function(){return this.first};k.Ma=function(){return Wa(this)};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return ub(J,this.k)};\nk.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return this.first};k.S=function(){return 1===this.count?J:this.M};k.D=function(){return this};k.F=function(a,b){return new Fd(b,this.first,this.M,this.count,this.p)};k.G=function(a,b){return new Fd(this.k,b,this,this.count+1,null)};Fd.prototype[Ea]=function(){return uc(this)};function Hd(a){this.k=a;this.j=65937614;this.q=8192}k=Hd.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};\nk.T=function(){return null};k.L=function(){return 0};k.La=function(){return null};k.Ma=function(){throw Error(\"Can't pop empty list\");};k.B=function(){return 0};k.A=function(a,b){return Ic(this,b)};k.J=function(){return this};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return null};k.S=function(){return J};k.D=function(){return null};k.F=function(a,b){return new Hd(b)};k.G=function(a,b){return new Fd(this.k,b,null,1,null)};var J=new Hd(null);\nHd.prototype[Ea]=function(){return uc(this)};function Id(a){return a?a.j&134217728||a.xc?!0:a.j?!1:w(Fb,a):w(Fb,a)}function Jd(a){return Id(a)?Gb(a):A.c(Nc,J,a)}\nvar Kd=function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){var b;if(a instanceof F&&0===a.m)b=a.e;else a:{for(b=[];;)if(null!=a)b.push(a.N(null)),a=a.T(null);else break a;b=void 0}a=b.length;for(var e=J;;)if(0<a){var f=a-1,e=e.G(null,b[a-1]);a=f}else return e}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}();\nfunction Ld(a,b,c,d){this.k=a;this.first=b;this.M=c;this.p=d;this.j=65929452;this.q=8192}k=Ld.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};k.T=function(){return null==this.M?null:D(this.M)};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.k)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return this.first};\nk.S=function(){return null==this.M?J:this.M};k.D=function(){return this};k.F=function(a,b){return new Ld(b,this.first,this.M,this.p)};k.G=function(a,b){return new Ld(null,b,this,this.p)};Ld.prototype[Ea]=function(){return uc(this)};function M(a,b){var c=null==b;return(c?c:b&&(b.j&64||b.jb))?new Ld(null,a,b,null):new Ld(null,a,D(b),null)}\nfunction Md(a,b){if(a.pa===b.pa)return 0;var c=Aa(a.ba);if(t(c?b.ba:c))return-1;if(t(a.ba)){if(Aa(b.ba))return 1;c=ha(a.ba,b.ba);return 0===c?ha(a.name,b.name):c}return ha(a.name,b.name)}function U(a,b,c,d){this.ba=a;this.name=b;this.pa=c;this.Ya=d;this.j=2153775105;this.q=4096}k=U.prototype;k.v=function(a,b){return Lb(b,[z(\":\"),z(this.pa)].join(\"\"))};k.B=function(){var a=this.Ya;return null!=a?a:this.Ya=a=oc(this)+2654435769|0};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return S.a(c,this);case 3:return S.c(c,this,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return S.a(c,this)};a.c=function(a,c,d){return S.c(c,this,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return S.a(a,this)};k.a=function(a,b){return S.c(a,this,b)};k.A=function(a,b){return b instanceof U?this.pa===b.pa:!1};\nk.toString=function(){return[z(\":\"),z(this.pa)].join(\"\")};function Nd(a,b){return a===b?!0:a instanceof U&&b instanceof U?a.pa===b.pa:!1}\nvar Pd=function(){function a(a,b){return new U(a,b,[z(t(a)?[z(a),z(\"/\")].join(\"\"):null),z(b)].join(\"\"),null)}function b(a){if(a instanceof U)return a;if(a instanceof qc){var b;if(a&&(a.q&4096||a.lc))b=a.ba;else throw Error([z(\"Doesn't support namespace: \"),z(a)].join(\"\"));return new U(b,Od.b?Od.b(a):Od.call(null,a),a.ta,null)}return\"string\"===typeof a?(b=a.split(\"/\"),2===b.length?new U(b[0],b[1],a,null):new U(null,b[0],a,null)):null}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,\nc);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}();function V(a,b,c,d){this.k=a;this.cb=b;this.C=c;this.p=d;this.q=0;this.j=32374988}k=V.prototype;k.toString=function(){return ec(this)};function Qd(a){null!=a.cb&&(a.C=a.cb.l?a.cb.l():a.cb.call(null),a.cb=null);return a.C}k.H=function(){return this.k};k.T=function(){Cb(this);return null==this.C?null:K(this.C)};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};\nk.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.k)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){Cb(this);return null==this.C?null:G(this.C)};k.S=function(){Cb(this);return null!=this.C?H(this.C):J};k.D=function(){Qd(this);if(null==this.C)return null;for(var a=this.C;;)if(a instanceof V)a=Qd(a);else return this.C=a,D(this.C)};k.F=function(a,b){return new V(b,this.cb,this.C,this.p)};k.G=function(a,b){return M(b,this)};\nV.prototype[Ea]=function(){return uc(this)};function Rd(a,b){this.Ab=a;this.end=b;this.q=0;this.j=2}Rd.prototype.L=function(){return this.end};Rd.prototype.add=function(a){this.Ab[this.end]=a;return this.end+=1};Rd.prototype.ca=function(){var a=new Sd(this.Ab,0,this.end);this.Ab=null;return a};function Td(a){return new Rd(Array(a),0)}function Sd(a,b,c){this.e=a;this.V=b;this.end=c;this.q=0;this.j=524306}k=Sd.prototype;k.R=function(a,b){return Dc.n(this.e,b,this.e[this.V],this.V+1)};\nk.O=function(a,b,c){return Dc.n(this.e,b,c,this.V)};k.Pb=function(){if(this.V===this.end)throw Error(\"-drop-first of empty chunk\");return new Sd(this.e,this.V+1,this.end)};k.Q=function(a,b){return this.e[this.V+b]};k.$=function(a,b,c){return 0<=b&&b<this.end-this.V?this.e[this.V+b]:c};k.L=function(){return this.end-this.V};\nvar Ud=function(){function a(a,b,c){return new Sd(a,b,c)}function b(a,b){return new Sd(a,b,a.length)}function c(a){return new Sd(a,0,a.length)}var d=null,d=function(d,f,g){switch(arguments.length){case 1:return c.call(this,d);case 2:return b.call(this,d,f);case 3:return a.call(this,d,f,g)}throw Error(\"Invalid arity: \"+arguments.length);};d.b=c;d.a=b;d.c=a;return d}();function Vd(a,b,c,d){this.ca=a;this.ra=b;this.k=c;this.p=d;this.j=31850732;this.q=1536}k=Vd.prototype;k.toString=function(){return ec(this)};\nk.H=function(){return this.k};k.T=function(){if(1<Ma(this.ca))return new Vd(Xb(this.ca),this.ra,this.k,null);var a=Cb(this.ra);return null==a?null:a};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.k)};k.N=function(){return C.a(this.ca,0)};k.S=function(){return 1<Ma(this.ca)?new Vd(Xb(this.ca),this.ra,this.k,null):null==this.ra?J:this.ra};k.D=function(){return this};k.Cb=function(){return this.ca};\nk.Db=function(){return null==this.ra?J:this.ra};k.F=function(a,b){return new Vd(this.ca,this.ra,b,this.p)};k.G=function(a,b){return M(b,this)};k.Bb=function(){return null==this.ra?null:this.ra};Vd.prototype[Ea]=function(){return uc(this)};function Wd(a,b){return 0===Ma(a)?b:new Vd(a,b,null,null)}function Xd(a,b){a.add(b)}function rd(a){for(var b=[];;)if(D(a))b.push(G(a)),a=K(a);else return b}function Yd(a,b){if(Ec(a))return Q(a);for(var c=a,d=b,e=0;;)if(0<d&&D(c))c=K(c),d-=1,e+=1;else return e}\nvar $d=function Zd(b){return null==b?null:null==K(b)?D(G(b)):M(G(b),Zd(K(b)))},ae=function(){function a(a,b){return new V(null,function(){var c=D(a);return c?fd(c)?Wd(Yb(c),d.a(Zb(c),b)):M(G(c),d.a(H(c),b)):b},null,null)}function b(a){return new V(null,function(){return a},null,null)}function c(){return new V(null,function(){return null},null,null)}var d=null,e=function(){function a(c,d,e){var f=null;if(2<arguments.length){for(var f=0,q=Array(arguments.length-2);f<q.length;)q[f]=arguments[f+2],++f;\nf=new F(q,0)}return b.call(this,c,d,f)}function b(a,c,e){return function q(a,b){return new V(null,function(){var c=D(a);return c?fd(c)?Wd(Yb(c),q(Zb(c),b)):M(G(c),q(H(c),b)):t(b)?q(G(b),K(b)):null},null,null)}(d.a(a,c),e)}a.i=2;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=H(a);return b(c,d,a)};a.d=b;return a}(),d=function(d,g,h){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,d);case 2:return a.call(this,d,g);default:var l=null;if(2<arguments.length){for(var l=0,m=\nArray(arguments.length-2);l<m.length;)m[l]=arguments[l+2],++l;l=new F(m,0)}return e.d(d,g,l)}throw Error(\"Invalid arity: \"+arguments.length);};d.i=2;d.f=e.f;d.l=c;d.b=b;d.a=a;d.d=e.d;return d}(),be=function(){function a(a,b,c,d){return M(a,M(b,M(c,d)))}function b(a,b,c){return M(a,M(b,c))}var c=null,d=function(){function a(c,d,e,m,p){var q=null;if(4<arguments.length){for(var q=0,s=Array(arguments.length-4);q<s.length;)s[q]=arguments[q+4],++q;q=new F(s,0)}return b.call(this,c,d,e,m,q)}function b(a,\nc,d,e,f){return M(a,M(c,M(d,M(e,$d(f)))))}a.i=4;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=K(a);var e=G(a);a=K(a);var p=G(a);a=H(a);return b(c,d,e,p,a)};a.d=b;return a}(),c=function(c,f,g,h,l){switch(arguments.length){case 1:return D(c);case 2:return M(c,f);case 3:return b.call(this,c,f,g);case 4:return a.call(this,c,f,g,h);default:var m=null;if(4<arguments.length){for(var m=0,p=Array(arguments.length-4);m<p.length;)p[m]=arguments[m+4],++m;m=new F(p,0)}return d.d(c,f,g,h,m)}throw Error(\"Invalid arity: \"+\narguments.length);};c.i=4;c.f=d.f;c.b=function(a){return D(a)};c.a=function(a,b){return M(a,b)};c.c=b;c.n=a;c.d=d.d;return c}();function ce(a){return Qb(a)}\nvar de=function(){function a(){return Ob(Mc)}var b=null,c=function(){function a(c,d,h){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 F(m,0)}return b.call(this,c,d,l)}function b(a,c,d){for(;;)if(a=Pb(a,c),t(d))c=G(d),d=K(d);else return a}a.i=2;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=H(a);return b(c,d,a)};a.d=b;return a}(),b=function(b,e,f){switch(arguments.length){case 0:return a.call(this);case 1:return b;case 2:return Pb(b,\ne);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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.l=a;b.b=function(a){return a};b.a=function(a,b){return Pb(a,b)};b.d=c.d;return b}(),ee=function(){var a=null,b=function(){function a(c,f,g,h){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 F(m,0)}return b.call(this,\nc,f,g,l)}function b(a,c,d,h){for(;;)if(a=Rb(a,c,d),t(h))c=G(h),d=Lc(h),h=K(K(h));else return a}a.i=3;a.f=function(a){var c=G(a);a=K(a);var g=G(a);a=K(a);var h=G(a);a=H(a);return b(c,g,h,a)};a.d=b;return a}(),a=function(a,d,e,f){switch(arguments.length){case 3:return Rb(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 F(h,0)}return b.d(a,d,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};a.i=3;a.f=b.f;a.c=function(a,\nb,e){return Rb(a,b,e)};a.d=b.d;return a}(),fe=function(){var a=null,b=function(){function a(c,f,g){var h=null;if(2<arguments.length){for(var h=0,l=Array(arguments.length-2);h<l.length;)l[h]=arguments[h+2],++h;h=new F(l,0)}return b.call(this,c,f,h)}function b(a,c,d){for(;;)if(a=Sb(a,c),t(d))c=G(d),d=K(d);else return a}a.i=2;a.f=function(a){var c=G(a);a=K(a);var g=G(a);a=H(a);return b(c,g,a)};a.d=b;return a}(),a=function(a,d,e){switch(arguments.length){case 2:return Sb(a,d);default:var f=null;if(2<\narguments.length){for(var f=0,g=Array(arguments.length-2);f<g.length;)g[f]=arguments[f+2],++f;f=new F(g,0)}return b.d(a,d,f)}throw Error(\"Invalid arity: \"+arguments.length);};a.i=2;a.f=b.f;a.a=function(a,b){return Sb(a,b)};a.d=b.d;return a}(),ge=function(){var a=null,b=function(){function a(c,f,g){var h=null;if(2<arguments.length){for(var h=0,l=Array(arguments.length-2);h<l.length;)l[h]=arguments[h+2],++h;h=new F(l,0)}return b.call(this,c,f,h)}function b(a,c,d){for(;;)if(a=Vb(a,c),t(d))c=G(d),d=K(d);\nelse return a}a.i=2;a.f=function(a){var c=G(a);a=K(a);var g=G(a);a=H(a);return b(c,g,a)};a.d=b;return a}(),a=function(a,d,e){switch(arguments.length){case 2:return Vb(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 F(g,0)}return b.d(a,d,f)}throw Error(\"Invalid arity: \"+arguments.length);};a.i=2;a.f=b.f;a.a=function(a,b){return Vb(a,b)};a.d=b.d;return a}();\nfunction he(a,b,c){var d=D(c);if(0===b)return a.l?a.l():a.call(null);c=Va(d);var e=Wa(d);if(1===b)return a.b?a.b(c):a.b?a.b(c):a.call(null,c);var d=Va(e),f=Wa(e);if(2===b)return a.a?a.a(c,d):a.a?a.a(c,d):a.call(null,c,d);var e=Va(f),g=Wa(f);if(3===b)return a.c?a.c(c,d,e):a.c?a.c(c,d,e):a.call(null,c,d,e);var f=Va(g),h=Wa(g);if(4===b)return a.n?a.n(c,d,e,f):a.n?a.n(c,d,e,f):a.call(null,c,d,e,f);var g=Va(h),l=Wa(h);if(5===b)return a.r?a.r(c,d,e,f,g):a.r?a.r(c,d,e,f,g):a.call(null,c,d,e,f,g);var h=Va(l),\nm=Wa(l);if(6===b)return a.P?a.P(c,d,e,f,g,h):a.P?a.P(c,d,e,f,g,h):a.call(null,c,d,e,f,g,h);var l=Va(m),p=Wa(m);if(7===b)return a.ia?a.ia(c,d,e,f,g,h,l):a.ia?a.ia(c,d,e,f,g,h,l):a.call(null,c,d,e,f,g,h,l);var m=Va(p),q=Wa(p);if(8===b)return a.Ga?a.Ga(c,d,e,f,g,h,l,m):a.Ga?a.Ga(c,d,e,f,g,h,l,m):a.call(null,c,d,e,f,g,h,l,m);var p=Va(q),s=Wa(q);if(9===b)return a.Ha?a.Ha(c,d,e,f,g,h,l,m,p):a.Ha?a.Ha(c,d,e,f,g,h,l,m,p):a.call(null,c,d,e,f,g,h,l,m,p);var q=Va(s),u=Wa(s);if(10===b)return a.va?a.va(c,d,e,\nf,g,h,l,m,p,q):a.va?a.va(c,d,e,f,g,h,l,m,p,q):a.call(null,c,d,e,f,g,h,l,m,p,q);var s=Va(u),v=Wa(u);if(11===b)return a.wa?a.wa(c,d,e,f,g,h,l,m,p,q,s):a.wa?a.wa(c,d,e,f,g,h,l,m,p,q,s):a.call(null,c,d,e,f,g,h,l,m,p,q,s);var u=Va(v),y=Wa(v);if(12===b)return a.xa?a.xa(c,d,e,f,g,h,l,m,p,q,s,u):a.xa?a.xa(c,d,e,f,g,h,l,m,p,q,s,u):a.call(null,c,d,e,f,g,h,l,m,p,q,s,u);var v=Va(y),B=Wa(y);if(13===b)return a.ya?a.ya(c,d,e,f,g,h,l,m,p,q,s,u,v):a.ya?a.ya(c,d,e,f,g,h,l,m,p,q,s,u,v):a.call(null,c,d,e,f,g,h,l,m,p,\nq,s,u,v);var y=Va(B),E=Wa(B);if(14===b)return a.za?a.za(c,d,e,f,g,h,l,m,p,q,s,u,v,y):a.za?a.za(c,d,e,f,g,h,l,m,p,q,s,u,v,y):a.call(null,c,d,e,f,g,h,l,m,p,q,s,u,v,y);var B=Va(E),N=Wa(E);if(15===b)return a.Aa?a.Aa(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B):a.Aa?a.Aa(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B):a.call(null,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B);var E=Va(N),Y=Wa(N);if(16===b)return a.Ba?a.Ba(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E):a.Ba?a.Ba(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E):a.call(null,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E);var N=\nVa(Y),ra=Wa(Y);if(17===b)return a.Ca?a.Ca(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N):a.Ca?a.Ca(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N):a.call(null,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N);var Y=Va(ra),Pa=Wa(ra);if(18===b)return a.Da?a.Da(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y):a.Da?a.Da(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y):a.call(null,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y);ra=Va(Pa);Pa=Wa(Pa);if(19===b)return a.Ea?a.Ea(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra):a.Ea?a.Ea(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra):a.call(null,\nc,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra);var I=Va(Pa);Wa(Pa);if(20===b)return a.Fa?a.Fa(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra,I):a.Fa?a.Fa(c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra,I):a.call(null,c,d,e,f,g,h,l,m,p,q,s,u,v,y,B,E,N,Y,ra,I);throw Error(\"Only up to 20 arguments supported on functions\");}\nvar T=function(){function a(a,b,c,d,e){b=be.n(b,c,d,e);c=a.i;return a.f?(d=Yd(b,c+1),d<=c?he(a,d,b):a.f(b)):a.apply(a,rd(b))}function b(a,b,c,d){b=be.c(b,c,d);c=a.i;return a.f?(d=Yd(b,c+1),d<=c?he(a,d,b):a.f(b)):a.apply(a,rd(b))}function c(a,b,c){b=be.a(b,c);c=a.i;if(a.f){var d=Yd(b,c+1);return d<=c?he(a,d,b):a.f(b)}return a.apply(a,rd(b))}function d(a,b){var c=a.i;if(a.f){var d=Yd(b,c+1);return d<=c?he(a,d,b):a.f(b)}return a.apply(a,rd(b))}var e=null,f=function(){function a(c,d,e,f,g,u){var v=null;\nif(5<arguments.length){for(var v=0,y=Array(arguments.length-5);v<y.length;)y[v]=arguments[v+5],++v;v=new F(y,0)}return b.call(this,c,d,e,f,g,v)}function b(a,c,d,e,f,g){c=M(c,M(d,M(e,M(f,$d(g)))));d=a.i;return a.f?(e=Yd(c,d+1),e<=d?he(a,e,c):a.f(c)):a.apply(a,rd(c))}a.i=5;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=K(a);var e=G(a);a=K(a);var f=G(a);a=K(a);var g=G(a);a=H(a);return b(c,d,e,f,g,a)};a.d=b;return a}(),e=function(e,h,l,m,p,q){switch(arguments.length){case 2:return d.call(this,e,h);case 3:return c.call(this,\ne,h,l);case 4:return b.call(this,e,h,l,m);case 5:return a.call(this,e,h,l,m,p);default:var s=null;if(5<arguments.length){for(var s=0,u=Array(arguments.length-5);s<u.length;)u[s]=arguments[s+5],++s;s=new F(u,0)}return f.d(e,h,l,m,p,s)}throw Error(\"Invalid arity: \"+arguments.length);};e.i=5;e.f=f.f;e.a=d;e.c=c;e.n=b;e.r=a;e.d=f.d;return e}(),ie=function(){function a(a,b,c,d,e,f){var g=O,v=Vc(a);b=b.r?b.r(v,c,d,e,f):b.call(null,v,c,d,e,f);return g(a,b)}function b(a,b,c,d,e){var f=O,g=Vc(a);b=b.n?b.n(g,\nc,d,e):b.call(null,g,c,d,e);return f(a,b)}function c(a,b,c,d){var e=O,f=Vc(a);b=b.c?b.c(f,c,d):b.call(null,f,c,d);return e(a,b)}function d(a,b,c){var d=O,e=Vc(a);b=b.a?b.a(e,c):b.call(null,e,c);return d(a,b)}function e(a,b){var c=O,d;d=Vc(a);d=b.b?b.b(d):b.call(null,d);return c(a,d)}var f=null,g=function(){function a(c,d,e,f,g,h,y){var B=null;if(6<arguments.length){for(var B=0,E=Array(arguments.length-6);B<E.length;)E[B]=arguments[B+6],++B;B=new F(E,0)}return b.call(this,c,d,e,f,g,h,B)}function b(a,\nc,d,e,f,g,h){return O(a,T.d(c,Vc(a),d,e,f,Kc([g,h],0)))}a.i=6;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=K(a);var e=G(a);a=K(a);var f=G(a);a=K(a);var g=G(a);a=K(a);var h=G(a);a=H(a);return b(c,d,e,f,g,h,a)};a.d=b;return a}(),f=function(f,l,m,p,q,s,u){switch(arguments.length){case 2:return e.call(this,f,l);case 3:return d.call(this,f,l,m);case 4:return c.call(this,f,l,m,p);case 5:return b.call(this,f,l,m,p,q);case 6:return a.call(this,f,l,m,p,q,s);default:var v=null;if(6<arguments.length){for(var v=\n0,y=Array(arguments.length-6);v<y.length;)y[v]=arguments[v+6],++v;v=new F(y,0)}return g.d(f,l,m,p,q,s,v)}throw Error(\"Invalid arity: \"+arguments.length);};f.i=6;f.f=g.f;f.a=e;f.c=d;f.n=c;f.r=b;f.P=a;f.d=g.d;return f}(),je=function(){function a(a,b){return!sc.a(a,b)}var b=null,c=function(){function a(c,d,h){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 F(m,0)}return b.call(this,c,d,l)}function b(a,c,d){return Aa(T.n(sc,a,c,d))}a.i=\n2;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=H(a);return b(c,d,a)};a.d=b;return a}(),b=function(b,e,f){switch(arguments.length){case 1:return!1;case 2:return a.call(this,b,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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.b=function(){return!1};b.a=a;b.d=c.d;return b}(),qe=function ke(){\"undefined\"===typeof ja&&(ja=function(b,c){this.pc=\nb;this.oc=c;this.q=0;this.j=393216},ja.prototype.ga=function(){return!1},ja.prototype.next=function(){return Error(\"No such element\")},ja.prototype.H=function(){return this.oc},ja.prototype.F=function(b,c){return new ja(this.pc,c)},ja.Yb=!0,ja.Xb=\"cljs.core/t12660\",ja.nc=function(b){return Lb(b,\"cljs.core/t12660\")});return new ja(ke,new pa(null,5,[le,54,me,2998,ne,3,oe,2994,pe,\"/Users/davidnolen/development/clojure/mori/out-mori-adv/cljs/core.cljs\"],null))};function re(a,b){this.C=a;this.m=b}\nre.prototype.ga=function(){return this.m<this.C.length};re.prototype.next=function(){var a=this.C.charAt(this.m);this.m+=1;return a};function se(a,b){this.e=a;this.m=b}se.prototype.ga=function(){return this.m<this.e.length};se.prototype.next=function(){var a=this.e[this.m];this.m+=1;return a};var te={},ue={};function ve(a,b){this.eb=a;this.Qa=b}ve.prototype.ga=function(){this.eb===te?(this.eb=ue,this.Qa=D(this.Qa)):this.eb===this.Qa&&(this.Qa=K(this.eb));return null!=this.Qa};\nve.prototype.next=function(){if(Aa(this.ga()))throw Error(\"No such element\");this.eb=this.Qa;return G(this.Qa)};function we(a){if(null==a)return qe();if(\"string\"===typeof a)return new re(a,0);if(a instanceof Array)return new se(a,0);if(a?t(t(null)?null:a.vb)||(a.yb?0:w(bc,a)):w(bc,a))return cc(a);if(ld(a))return new ve(te,a);throw Error([z(\"Cannot create iterator from \"),z(a)].join(\"\"));}function xe(a,b){this.fa=a;this.$b=b}\nxe.prototype.step=function(a){for(var b=this;;){if(t(function(){var c=null!=a.X;return c?b.$b.ga():c}()))if(Ac(function(){var c=b.$b.next();return b.fa.a?b.fa.a(a,c):b.fa.call(null,a,c)}()))null!=a.M&&(a.M.X=null);else continue;break}return null==a.X?null:b.fa.b?b.fa.b(a):b.fa.call(null,a)};\nfunction ye(a,b){var c=function(){function a(b,c){b.first=c;b.M=new ze(b.X,null,null,null);b.X=null;return b.M}function b(a){(Ac(a)?qb(a):a).X=null;return a}var c=null,c=function(c,f){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}();return new xe(a.b?a.b(c):a.call(null,c),b)}function Ae(a,b,c){this.fa=a;this.Kb=b;this.ac=c}\nAe.prototype.ga=function(){for(var a=D(this.Kb);;)if(null!=a){var b=G(a);if(Aa(b.ga()))return!1;a=K(a)}else return!0};Ae.prototype.next=function(){for(var a=this.Kb.length,b=0;;)if(b<a)this.ac[b]=this.Kb[b].next(),b+=1;else break;return Jc.a(this.ac,0)};Ae.prototype.step=function(a){for(;;){var b;b=(b=null!=a.X)?this.ga():b;if(t(b))if(Ac(T.a(this.fa,M(a,this.next()))))null!=a.M&&(a.M.X=null);else continue;break}return null==a.X?null:this.fa.b?this.fa.b(a):this.fa.call(null,a)};\nvar Be=function(){function a(a,b,c){var g=function(){function a(b,c){b.first=c;b.M=new ze(b.X,null,null,null);b.X=null;return b.M}function b(a){a=Ac(a)?qb(a):a;a.X=null;return a}var c=null,c=function(c,d){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}();return new Ae(a.b?a.b(g):a.call(null,g),b,c)}function b(a,b){return c.c(a,b,Array(b.length))}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,\nc,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}();function ze(a,b,c,d){this.X=a;this.first=b;this.M=c;this.k=d;this.q=0;this.j=31719628}k=ze.prototype;k.T=function(){null!=this.X&&Cb(this);return null==this.M?null:Cb(this.M)};k.N=function(){null!=this.X&&Cb(this);return null==this.M?null:this.first};k.S=function(){null!=this.X&&Cb(this);return null==this.M?J:this.M};\nk.D=function(){null!=this.X&&this.X.step(this);return null==this.M?null:this};k.B=function(){return wc(this)};k.A=function(a,b){return null!=Cb(this)?Ic(this,b):cd(b)&&null==D(b)};k.J=function(){return J};k.G=function(a,b){return M(b,Cb(this))};k.F=function(a,b){return new ze(this.X,this.first,this.M,b)};ze.prototype[Ea]=function(){return uc(this)};\nvar Ce=function(){function a(a){return kd(a)?a:(a=D(a))?a:J}var b=null,c=function(){function a(c,d,h){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 F(m,0)}return b.call(this,c,d,l)}function b(a,c,d){d=rd(M(c,d));c=[];d=D(d);for(var e=null,m=0,p=0;;)if(p<m){var q=e.Q(null,p);c.push(we(q));p+=1}else if(d=D(d))e=d,fd(e)?(d=Yb(e),p=Zb(e),e=d,m=Q(d),d=p):(d=G(e),c.push(we(d)),d=K(e),e=null,m=0),p=0;else break;return new ze(Be.c(a,c,\nArray(c.length)),null,null,null)}a.i=2;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=H(a);return b(c,d,a)};a.d=b;return a}(),b=function(b,e,f){switch(arguments.length){case 1:return a.call(this,b);case 2:return new ze(ye(b,we(e)),null,null,null);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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.b=a;b.a=function(a,b){return new ze(ye(a,\nwe(b)),null,null,null)};b.d=c.d;return b}();function Ee(a,b){for(;;){if(null==D(b))return!0;var c;c=G(b);c=a.b?a.b(c):a.call(null,c);if(t(c)){c=a;var d=K(b);a=c;b=d}else return!1}}function Fe(a,b){for(;;)if(D(b)){var c;c=G(b);c=a.b?a.b(c):a.call(null,c);if(t(c))return c;c=a;var d=K(b);a=c;b=d}else return null}function Ge(a){if(\"number\"===typeof a&&Aa(isNaN(a))&&Infinity!==a&&parseFloat(a)===parseInt(a,10))return 0===(a&1);throw Error([z(\"Argument must be an integer: \"),z(a)].join(\"\"));}\nfunction He(a){return function(){function b(b,c){return Aa(a.a?a.a(b,c):a.call(null,b,c))}function c(b){return Aa(a.b?a.b(b):a.call(null,b))}function d(){return Aa(a.l?a.l():a.call(null))}var e=null,f=function(){function b(a,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 F(g,0)}return c.call(this,a,d,f)}function c(b,d,e){return Aa(T.n(a,b,d,e))}b.i=2;b.f=function(a){var b=G(a);a=K(a);var d=G(a);a=H(a);return c(b,d,a)};b.d=c;\nreturn b}(),e=function(a,e,l){switch(arguments.length){case 0:return d.call(this);case 1:return c.call(this,a);case 2:return b.call(this,a,e);default:var m=null;if(2<arguments.length){for(var m=0,p=Array(arguments.length-2);m<p.length;)p[m]=arguments[m+2],++m;m=new F(p,0)}return f.d(a,e,m)}throw Error(\"Invalid arity: \"+arguments.length);};e.i=2;e.f=f.f;e.l=d;e.b=c;e.a=b;e.d=f.d;return e}()}\nvar Ie=function(){function a(a,b,c){return function(){function d(h,l,m){h=c.c?c.c(h,l,m):c.call(null,h,l,m);h=b.b?b.b(h):b.call(null,h);return a.b?a.b(h):a.call(null,h)}function l(d,h){var l;l=c.a?c.a(d,h):c.call(null,d,h);l=b.b?b.b(l):b.call(null,l);return a.b?a.b(l):a.call(null,l)}function m(d){d=c.b?c.b(d):c.call(null,d);d=b.b?b.b(d):b.call(null,d);return a.b?a.b(d):a.call(null,d)}function p(){var d;d=c.l?c.l():c.call(null);d=b.b?b.b(d):b.call(null,d);return a.b?a.b(d):a.call(null,d)}var q=null,\ns=function(){function d(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 F(g,0)}return h.call(this,a,b,c,f)}function h(d,l,m,p){d=T.r(c,d,l,m,p);d=b.b?b.b(d):b.call(null,d);return a.b?a.b(d):a.call(null,d)}d.i=3;d.f=function(a){var b=G(a);a=K(a);var c=G(a);a=K(a);var d=G(a);a=H(a);return h(b,c,d,a)};d.d=h;return d}(),q=function(a,b,c,e){switch(arguments.length){case 0:return p.call(this);case 1:return m.call(this,a);case 2:return l.call(this,\na,b);case 3:return d.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 F(g,0)}return s.d(a,b,c,f)}throw Error(\"Invalid arity: \"+arguments.length);};q.i=3;q.f=s.f;q.l=p;q.b=m;q.a=l;q.c=d;q.d=s.d;return q}()}function b(a,b){return function(){function c(d,g,h){d=b.c?b.c(d,g,h):b.call(null,d,g,h);return a.b?a.b(d):a.call(null,d)}function d(c,g){var h=b.a?b.a(c,g):b.call(null,c,g);return a.b?a.b(h):a.call(null,h)}\nfunction l(c){c=b.b?b.b(c):b.call(null,c);return a.b?a.b(c):a.call(null,c)}function m(){var c=b.l?b.l():b.call(null);return a.b?a.b(c):a.call(null,c)}var p=null,q=function(){function c(a,b,e,f){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 F(h,0)}return d.call(this,a,b,e,g)}function d(c,g,h,l){c=T.r(b,c,g,h,l);return a.b?a.b(c):a.call(null,c)}c.i=3;c.f=function(a){var b=G(a);a=K(a);var c=G(a);a=K(a);var e=G(a);a=H(a);return d(b,\nc,e,a)};c.d=d;return c}(),p=function(a,b,e,f){switch(arguments.length){case 0:return m.call(this);case 1:return l.call(this,a);case 2:return d.call(this,a,b);case 3:return c.call(this,a,b,e);default:var p=null;if(3<arguments.length){for(var p=0,E=Array(arguments.length-3);p<E.length;)E[p]=arguments[p+3],++p;p=new F(E,0)}return q.d(a,b,e,p)}throw Error(\"Invalid arity: \"+arguments.length);};p.i=3;p.f=q.f;p.l=m;p.b=l;p.a=d;p.c=c;p.d=q.d;return p}()}var c=null,d=function(){function a(c,d,e,m){var p=null;\nif(3<arguments.length){for(var p=0,q=Array(arguments.length-3);p<q.length;)q[p]=arguments[p+3],++p;p=new F(q,0)}return b.call(this,c,d,e,p)}function b(a,c,d,e){return function(a){return function(){function b(a){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 F(e,0)}return c.call(this,d)}function c(b){b=T.a(G(a),b);for(var d=K(a);;)if(d)b=G(d).call(null,b),d=K(d);else return b}b.i=0;b.f=function(a){a=D(a);return c(a)};b.d=c;return b}()}(Jd(be.n(a,\nc,d,e)))}a.i=3;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=K(a);var e=G(a);a=H(a);return b(c,d,e,a)};a.d=b;return a}(),c=function(c,f,g,h){switch(arguments.length){case 0:return ud;case 1:return c;case 2:return b.call(this,c,f);case 3:return a.call(this,c,f,g);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 F(m,0)}return d.d(c,f,g,l)}throw Error(\"Invalid arity: \"+arguments.length);};c.i=3;c.f=d.f;c.l=function(){return ud};\nc.b=function(a){return a};c.a=b;c.c=a;c.d=d.d;return c}(),Je=function(){function a(a,b,c,d){return function(){function e(m,p,q){return a.P?a.P(b,c,d,m,p,q):a.call(null,b,c,d,m,p,q)}function p(e,m){return a.r?a.r(b,c,d,e,m):a.call(null,b,c,d,e,m)}function q(e){return a.n?a.n(b,c,d,e):a.call(null,b,c,d,e)}function s(){return a.c?a.c(b,c,d):a.call(null,b,c,d)}var u=null,v=function(){function e(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+\n3],++f;f=new F(g,0)}return m.call(this,a,b,c,f)}function m(e,p,q,s){return T.d(a,b,c,d,e,Kc([p,q,s],0))}e.i=3;e.f=function(a){var b=G(a);a=K(a);var c=G(a);a=K(a);var d=G(a);a=H(a);return m(b,c,d,a)};e.d=m;return e}(),u=function(a,b,c,d){switch(arguments.length){case 0:return s.call(this);case 1:return q.call(this,a);case 2:return p.call(this,a,b);case 3:return e.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=\nnew F(g,0)}return v.d(a,b,c,f)}throw Error(\"Invalid arity: \"+arguments.length);};u.i=3;u.f=v.f;u.l=s;u.b=q;u.a=p;u.c=e;u.d=v.d;return u}()}function b(a,b,c){return function(){function d(e,l,m){return a.r?a.r(b,c,e,l,m):a.call(null,b,c,e,l,m)}function e(d,l){return a.n?a.n(b,c,d,l):a.call(null,b,c,d,l)}function p(d){return a.c?a.c(b,c,d):a.call(null,b,c,d)}function q(){return a.a?a.a(b,c):a.call(null,b,c)}var s=null,u=function(){function d(a,b,c,f){var g=null;if(3<arguments.length){for(var g=0,h=Array(arguments.length-\n3);g<h.length;)h[g]=arguments[g+3],++g;g=new F(h,0)}return e.call(this,a,b,c,g)}function e(d,l,m,p){return T.d(a,b,c,d,l,Kc([m,p],0))}d.i=3;d.f=function(a){var b=G(a);a=K(a);var c=G(a);a=K(a);var d=G(a);a=H(a);return e(b,c,d,a)};d.d=e;return d}(),s=function(a,b,c,f){switch(arguments.length){case 0:return q.call(this);case 1:return p.call(this,a);case 2:return e.call(this,a,b);case 3:return d.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]=\narguments[g+3],++g;g=new F(h,0)}return u.d(a,b,c,g)}throw Error(\"Invalid arity: \"+arguments.length);};s.i=3;s.f=u.f;s.l=q;s.b=p;s.a=e;s.c=d;s.d=u.d;return s}()}function c(a,b){return function(){function c(d,e,h){return a.n?a.n(b,d,e,h):a.call(null,b,d,e,h)}function d(c,e){return a.c?a.c(b,c,e):a.call(null,b,c,e)}function e(c){return a.a?a.a(b,c):a.call(null,b,c)}function p(){return a.b?a.b(b):a.call(null,b)}var q=null,s=function(){function c(a,b,e,f){var g=null;if(3<arguments.length){for(var g=0,\nh=Array(arguments.length-3);g<h.length;)h[g]=arguments[g+3],++g;g=new F(h,0)}return d.call(this,a,b,e,g)}function d(c,e,h,l){return T.d(a,b,c,e,h,Kc([l],0))}c.i=3;c.f=function(a){var b=G(a);a=K(a);var c=G(a);a=K(a);var e=G(a);a=H(a);return d(b,c,e,a)};c.d=d;return c}(),q=function(a,b,f,g){switch(arguments.length){case 0:return p.call(this);case 1:return e.call(this,a);case 2:return d.call(this,a,b);case 3:return c.call(this,a,b,f);default:var q=null;if(3<arguments.length){for(var q=0,N=Array(arguments.length-\n3);q<N.length;)N[q]=arguments[q+3],++q;q=new F(N,0)}return s.d(a,b,f,q)}throw Error(\"Invalid arity: \"+arguments.length);};q.i=3;q.f=s.f;q.l=p;q.b=e;q.a=d;q.c=c;q.d=s.d;return q}()}var d=null,e=function(){function a(c,d,e,f,q){var s=null;if(4<arguments.length){for(var s=0,u=Array(arguments.length-4);s<u.length;)u[s]=arguments[s+4],++s;s=new F(u,0)}return b.call(this,c,d,e,f,s)}function b(a,c,d,e,f){return function(){function b(a){var c=null;if(0<arguments.length){for(var c=0,d=Array(arguments.length-\n0);c<d.length;)d[c]=arguments[c+0],++c;c=new F(d,0)}return g.call(this,c)}function g(b){return T.r(a,c,d,e,ae.a(f,b))}b.i=0;b.f=function(a){a=D(a);return g(a)};b.d=g;return b}()}a.i=4;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=K(a);var e=G(a);a=K(a);var f=G(a);a=H(a);return b(c,d,e,f,a)};a.d=b;return a}(),d=function(d,g,h,l,m){switch(arguments.length){case 1:return d;case 2:return c.call(this,d,g);case 3:return b.call(this,d,g,h);case 4:return a.call(this,d,g,h,l);default:var p=null;if(4<arguments.length){for(var p=\n0,q=Array(arguments.length-4);p<q.length;)q[p]=arguments[p+4],++p;p=new F(q,0)}return e.d(d,g,h,l,p)}throw Error(\"Invalid arity: \"+arguments.length);};d.i=4;d.f=e.f;d.b=function(a){return a};d.a=c;d.c=b;d.n=a;d.d=e.d;return d}(),Ke=function(){function a(a,b,c,d){return function(){function l(l,m,p){l=null==l?b:l;m=null==m?c:m;p=null==p?d:p;return a.c?a.c(l,m,p):a.call(null,l,m,p)}function m(d,h){var l=null==d?b:d,m=null==h?c:h;return a.a?a.a(l,m):a.call(null,l,m)}var p=null,q=function(){function l(a,\nb,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 F(f,0)}return m.call(this,a,b,c,e)}function m(l,p,q,s){return T.r(a,null==l?b:l,null==p?c:p,null==q?d:q,s)}l.i=3;l.f=function(a){var b=G(a);a=K(a);var c=G(a);a=K(a);var d=G(a);a=H(a);return m(b,c,d,a)};l.d=m;return l}(),p=function(a,b,c,d){switch(arguments.length){case 2:return m.call(this,a,b);case 3:return l.call(this,a,b,c);default:var e=null;if(3<arguments.length){for(var e=\n0,f=Array(arguments.length-3);e<f.length;)f[e]=arguments[e+3],++e;e=new F(f,0)}return q.d(a,b,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};p.i=3;p.f=q.f;p.a=m;p.c=l;p.d=q.d;return p}()}function b(a,b,c){return function(){function d(h,l,m){h=null==h?b:h;l=null==l?c:l;return a.c?a.c(h,l,m):a.call(null,h,l,m)}function l(d,h){var l=null==d?b:d,m=null==h?c:h;return a.a?a.a(l,m):a.call(null,l,m)}var m=null,p=function(){function d(a,b,c,e){var f=null;if(3<arguments.length){for(var f=0,g=Array(arguments.length-\n3);f<g.length;)g[f]=arguments[f+3],++f;f=new F(g,0)}return h.call(this,a,b,c,f)}function h(d,l,m,p){return T.r(a,null==d?b:d,null==l?c:l,m,p)}d.i=3;d.f=function(a){var b=G(a);a=K(a);var c=G(a);a=K(a);var d=G(a);a=H(a);return h(b,c,d,a)};d.d=h;return d}(),m=function(a,b,c,e){switch(arguments.length){case 2:return l.call(this,a,b);case 3:return d.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 F(g,0)}return p.d(a,\nb,c,f)}throw Error(\"Invalid arity: \"+arguments.length);};m.i=3;m.f=p.f;m.a=l;m.c=d;m.d=p.d;return m}()}function c(a,b){return function(){function c(d,g,h){d=null==d?b:d;return a.c?a.c(d,g,h):a.call(null,d,g,h)}function d(c,g){var h=null==c?b:c;return a.a?a.a(h,g):a.call(null,h,g)}function l(c){c=null==c?b:c;return a.b?a.b(c):a.call(null,c)}var m=null,p=function(){function c(a,b,e,f){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 F(h,\n0)}return d.call(this,a,b,e,g)}function d(c,g,h,l){return T.r(a,null==c?b:c,g,h,l)}c.i=3;c.f=function(a){var b=G(a);a=K(a);var c=G(a);a=K(a);var e=G(a);a=H(a);return d(b,c,e,a)};c.d=d;return c}(),m=function(a,b,e,f){switch(arguments.length){case 1:return l.call(this,a);case 2:return d.call(this,a,b);case 3:return c.call(this,a,b,e);default:var m=null;if(3<arguments.length){for(var m=0,B=Array(arguments.length-3);m<B.length;)B[m]=arguments[m+3],++m;m=new F(B,0)}return p.d(a,b,e,m)}throw Error(\"Invalid arity: \"+\narguments.length);};m.i=3;m.f=p.f;m.b=l;m.a=d;m.c=c;m.d=p.d;return m}()}var d=null,d=function(d,f,g,h){switch(arguments.length){case 2:return c.call(this,d,f);case 3:return b.call(this,d,f,g);case 4:return a.call(this,d,f,g,h)}throw Error(\"Invalid arity: \"+arguments.length);};d.a=c;d.c=b;d.n=a;return d}(),Le=function(){function a(a,b){return new V(null,function(){var f=D(b);if(f){if(fd(f)){for(var g=Yb(f),h=Q(g),l=Td(h),m=0;;)if(m<h){var p=function(){var b=C.a(g,m);return a.b?a.b(b):a.call(null,b)}();\nnull!=p&&l.add(p);m+=1}else break;return Wd(l.ca(),c.a(a,Zb(f)))}h=function(){var b=G(f);return a.b?a.b(b):a.call(null,b)}();return null==h?c.a(a,H(f)):M(h,c.a(a,H(f)))}return null},null,null)}function b(a){return function(b){return function(){function c(f,g){var h=a.b?a.b(g):a.call(null,g);return null==h?f:b.a?b.a(f,h):b.call(null,f,h)}function g(a){return b.b?b.b(a):b.call(null,a)}function h(){return b.l?b.l():b.call(null)}var l=null,l=function(a,b){switch(arguments.length){case 0:return h.call(this);\ncase 1:return g.call(this,a);case 2:return c.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};l.l=h;l.b=g;l.a=c;return l}()}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}();function Me(a){this.state=a;this.q=0;this.j=32768}Me.prototype.Ra=function(){return this.state};Me.prototype.bb=function(a,b){return this.state=b};\nvar Ne=function(){function a(a,b){return function g(b,c){return new V(null,function(){var e=D(c);if(e){if(fd(e)){for(var p=Yb(e),q=Q(p),s=Td(q),u=0;;)if(u<q){var v=function(){var c=b+u,e=C.a(p,u);return a.a?a.a(c,e):a.call(null,c,e)}();null!=v&&s.add(v);u+=1}else break;return Wd(s.ca(),g(b+q,Zb(e)))}q=function(){var c=G(e);return a.a?a.a(b,c):a.call(null,b,c)}();return null==q?g(b+1,H(e)):M(q,g(b+1,H(e)))}return null},null,null)}(0,b)}function b(a){return function(b){return function(c){return function(){function g(g,\nh){var l=c.bb(0,c.Ra(null)+1),l=a.a?a.a(l,h):a.call(null,l,h);return null==l?g:b.a?b.a(g,l):b.call(null,g,l)}function h(a){return b.b?b.b(a):b.call(null,a)}function l(){return b.l?b.l():b.call(null)}var m=null,m=function(a,b){switch(arguments.length){case 0:return l.call(this);case 1:return h.call(this,a);case 2:return g.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};m.l=l;m.b=h;m.a=g;return m}()}(new Me(-1))}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,\nc);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Oe=function(){function a(a,b,c,d){return new V(null,function(){var f=D(b),q=D(c),s=D(d);if(f&&q&&s){var u=M,v;v=G(f);var y=G(q),B=G(s);v=a.c?a.c(v,y,B):a.call(null,v,y,B);f=u(v,e.n(a,H(f),H(q),H(s)))}else f=null;return f},null,null)}function b(a,b,c){return new V(null,function(){var d=D(b),f=D(c);if(d&&f){var q=M,s;s=G(d);var u=G(f);s=a.a?a.a(s,u):a.call(null,s,u);d=q(s,e.c(a,H(d),H(f)))}else d=\nnull;return d},null,null)}function c(a,b){return new V(null,function(){var c=D(b);if(c){if(fd(c)){for(var d=Yb(c),f=Q(d),q=Td(f),s=0;;)if(s<f)Xd(q,function(){var b=C.a(d,s);return a.b?a.b(b):a.call(null,b)}()),s+=1;else break;return Wd(q.ca(),e.a(a,Zb(c)))}return M(function(){var b=G(c);return a.b?a.b(b):a.call(null,b)}(),e.a(a,H(c)))}return null},null,null)}function d(a){return function(b){return function(){function c(d,e){var f=a.b?a.b(e):a.call(null,e);return b.a?b.a(d,f):b.call(null,d,f)}function d(a){return b.b?\nb.b(a):b.call(null,a)}function e(){return b.l?b.l():b.call(null)}var f=null,s=function(){function c(a,b,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 F(g,0)}return d.call(this,a,b,f)}function d(c,e,f){e=T.c(a,e,f);return b.a?b.a(c,e):b.call(null,c,e)}c.i=2;c.f=function(a){var b=G(a);a=K(a);var c=G(a);a=H(a);return d(b,c,a)};c.d=d;return c}(),f=function(a,b,f){switch(arguments.length){case 0:return e.call(this);case 1:return d.call(this,\na);case 2:return c.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 F(h,0)}return s.d(a,b,g)}throw Error(\"Invalid arity: \"+arguments.length);};f.i=2;f.f=s.f;f.l=e;f.b=d;f.a=c;f.d=s.d;return f}()}}var e=null,f=function(){function a(c,d,e,f,g){var u=null;if(4<arguments.length){for(var u=0,v=Array(arguments.length-4);u<v.length;)v[u]=arguments[u+4],++u;u=new F(v,0)}return b.call(this,c,d,e,f,u)}function b(a,c,d,\nf,g){var h=function y(a){return new V(null,function(){var b=e.a(D,a);return Ee(ud,b)?M(e.a(G,b),y(e.a(H,b))):null},null,null)};return e.a(function(){return function(b){return T.a(a,b)}}(h),h(Nc.d(g,f,Kc([d,c],0))))}a.i=4;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=K(a);var e=G(a);a=K(a);var f=G(a);a=H(a);return b(c,d,e,f,a)};a.d=b;return a}(),e=function(e,h,l,m,p){switch(arguments.length){case 1:return d.call(this,e);case 2:return c.call(this,e,h);case 3:return b.call(this,e,h,l);case 4:return a.call(this,\ne,h,l,m);default:var q=null;if(4<arguments.length){for(var q=0,s=Array(arguments.length-4);q<s.length;)s[q]=arguments[q+4],++q;q=new F(s,0)}return f.d(e,h,l,m,q)}throw Error(\"Invalid arity: \"+arguments.length);};e.i=4;e.f=f.f;e.b=d;e.a=c;e.c=b;e.n=a;e.d=f.d;return e}(),Pe=function(){function a(a,b){return new V(null,function(){if(0<a){var f=D(b);return f?M(G(f),c.a(a-1,H(f))):null}return null},null,null)}function b(a){return function(b){return function(a){return function(){function c(d,g){var h=qb(a),\nl=a.bb(0,a.Ra(null)-1),h=0<h?b.a?b.a(d,g):b.call(null,d,g):d;return 0<l?h:Ac(h)?h:new yc(h)}function d(a){return b.b?b.b(a):b.call(null,a)}function l(){return b.l?b.l():b.call(null)}var m=null,m=function(a,b){switch(arguments.length){case 0:return l.call(this);case 1:return d.call(this,a);case 2:return c.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};m.l=l;m.b=d;m.a=c;return m}()}(new Me(a))}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,\nc,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Qe=function(){function a(a,b){return new V(null,function(c){return function(){return c(a,b)}}(function(a,b){for(;;){var c=D(b);if(0<a&&c){var d=a-1,c=H(c);a=d;b=c}else return c}}),null,null)}function b(a){return function(b){return function(a){return function(){function c(d,g){var h=qb(a);a.bb(0,a.Ra(null)-1);return 0<h?d:b.a?b.a(d,g):b.call(null,d,g)}function d(a){return b.b?b.b(a):b.call(null,a)}function l(){return b.l?\nb.l():b.call(null)}var m=null,m=function(a,b){switch(arguments.length){case 0:return l.call(this);case 1:return d.call(this,a);case 2:return c.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};m.l=l;m.b=d;m.a=c;return m}()}(new Me(a))}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Re=function(){function a(a,b){return new V(null,function(c){return function(){return c(a,\nb)}}(function(a,b){for(;;){var c=D(b),d;if(d=c)d=G(c),d=a.b?a.b(d):a.call(null,d);if(t(d))d=a,c=H(c),a=d,b=c;else return c}}),null,null)}function b(a){return function(b){return function(c){return function(){function g(g,h){var l=qb(c);if(t(t(l)?a.b?a.b(h):a.call(null,h):l))return g;ac(c,null);return b.a?b.a(g,h):b.call(null,g,h)}function h(a){return b.b?b.b(a):b.call(null,a)}function l(){return b.l?b.l():b.call(null)}var m=null,m=function(a,b){switch(arguments.length){case 0:return l.call(this);case 1:return h.call(this,\na);case 2:return g.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};m.l=l;m.b=h;m.a=g;return m}()}(new Me(!0))}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Se=function(){function a(a,b){return Pe.a(a,c.b(b))}function b(a){return new V(null,function(){return M(a,c.b(a))},null,null)}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,\nc);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Te=function(){function a(a,b){return Pe.a(a,c.b(b))}function b(a){return new V(null,function(){return M(a.l?a.l():a.call(null),c.b(a))},null,null)}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Ue=function(){function a(a,c){return new V(null,function(){var f=\nD(a),g=D(c);return f&&g?M(G(f),M(G(g),b.a(H(f),H(g)))):null},null,null)}var b=null,c=function(){function a(b,d,h){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 F(m,0)}return c.call(this,b,d,l)}function c(a,d,e){return new V(null,function(){var c=Oe.a(D,Nc.d(e,d,Kc([a],0)));return Ee(ud,c)?ae.a(Oe.a(G,c),T.a(b,Oe.a(H,c))):null},null,null)}a.i=2;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=H(a);return c(b,d,a)};a.d=c;return a}(),\nb=function(b,e,f){switch(arguments.length){case 2:return a.call(this,b,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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.a=a;b.d=c.d;return b}(),We=function(){function a(a){return Ie.a(Oe.b(a),Ve)}var b=null,c=function(){function a(c,d){var h=null;if(1<arguments.length){for(var h=0,l=Array(arguments.length-1);h<l.length;)l[h]=arguments[h+\n1],++h;h=new F(l,0)}return b.call(this,c,h)}function b(a,c){return T.a(ae,T.c(Oe,a,c))}a.i=1;a.f=function(a){var c=G(a);a=H(a);return b(c,a)};a.d=b;return a}(),b=function(b,e){switch(arguments.length){case 1:return a.call(this,b);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 F(g,0)}return c.d(b,f)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=1;b.f=c.f;b.b=a;b.d=c.d;return b}(),Xe=function(){function a(a,b){return new V(null,\nfunction(){var f=D(b);if(f){if(fd(f)){for(var g=Yb(f),h=Q(g),l=Td(h),m=0;;)if(m<h){var p;p=C.a(g,m);p=a.b?a.b(p):a.call(null,p);t(p)&&(p=C.a(g,m),l.add(p));m+=1}else break;return Wd(l.ca(),c.a(a,Zb(f)))}g=G(f);f=H(f);return t(a.b?a.b(g):a.call(null,g))?M(g,c.a(a,f)):c.a(a,f)}return null},null,null)}function b(a){return function(b){return function(){function c(f,g){return t(a.b?a.b(g):a.call(null,g))?b.a?b.a(f,g):b.call(null,f,g):f}function g(a){return b.b?b.b(a):b.call(null,a)}function h(){return b.l?\nb.l():b.call(null)}var l=null,l=function(a,b){switch(arguments.length){case 0:return h.call(this);case 1:return g.call(this,a);case 2:return c.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};l.l=h;l.b=g;l.a=c;return l}()}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),Ye=function(){function a(a,b){return Xe.a(He(a),b)}function b(a){return Xe.b(He(a))}\nvar c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}();function Ze(a){var b=$e;return function d(a){return new V(null,function(){return M(a,t(b.b?b.b(a):b.call(null,a))?We.d(d,Kc([D.b?D.b(a):D.call(null,a)],0)):null)},null,null)}(a)}\nvar af=function(){function a(a,b,c){return a&&(a.q&4||a.dc)?O(ce(wd.n(b,de,Ob(a),c)),Vc(a)):wd.n(b,Nc,a,c)}function b(a,b){return null!=a?a&&(a.q&4||a.dc)?O(ce(A.c(Pb,Ob(a),b)),Vc(a)):A.c(Ra,a,b):A.c(Nc,J,b)}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}(),bf=function(){function a(a,b,c,h){return new V(null,function(){var l=D(h);if(l){var m=Pe.a(a,l);return a===\nQ(m)?M(m,d.n(a,b,c,Qe.a(b,l))):Ra(J,Pe.a(a,ae.a(m,c)))}return null},null,null)}function b(a,b,c){return new V(null,function(){var h=D(c);if(h){var l=Pe.a(a,h);return a===Q(l)?M(l,d.c(a,b,Qe.a(b,h))):null}return null},null,null)}function c(a,b){return d.c(a,a,b)}var d=null,d=function(d,f,g,h){switch(arguments.length){case 2:return c.call(this,d,f);case 3:return b.call(this,d,f,g);case 4:return a.call(this,d,f,g,h)}throw Error(\"Invalid arity: \"+arguments.length);};d.a=c;d.c=b;d.n=a;return d}(),cf=function(){function a(a,\nb,c){var g=jd;for(b=D(b);;)if(b){var h=a;if(h?h.j&256||h.Rb||(h.j?0:w(Za,h)):w(Za,h)){a=S.c(a,G(b),g);if(g===a)return c;b=K(b)}else return c}else return a}function b(a,b){return c.c(a,b,null)}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}(),df=function(){function a(a,b,c,d,f,q){var s=R.c(b,0,null);return(b=Ed(b))?Rc.c(a,s,e.P(S.a(a,s),b,c,d,f,q)):Rc.c(a,s,\nfunction(){var b=S.a(a,s);return c.n?c.n(b,d,f,q):c.call(null,b,d,f,q)}())}function b(a,b,c,d,f){var q=R.c(b,0,null);return(b=Ed(b))?Rc.c(a,q,e.r(S.a(a,q),b,c,d,f)):Rc.c(a,q,function(){var b=S.a(a,q);return c.c?c.c(b,d,f):c.call(null,b,d,f)}())}function c(a,b,c,d){var f=R.c(b,0,null);return(b=Ed(b))?Rc.c(a,f,e.n(S.a(a,f),b,c,d)):Rc.c(a,f,function(){var b=S.a(a,f);return c.a?c.a(b,d):c.call(null,b,d)}())}function d(a,b,c){var d=R.c(b,0,null);return(b=Ed(b))?Rc.c(a,d,e.c(S.a(a,d),b,c)):Rc.c(a,d,function(){var b=\nS.a(a,d);return c.b?c.b(b):c.call(null,b)}())}var e=null,f=function(){function a(c,d,e,f,g,u,v){var y=null;if(6<arguments.length){for(var y=0,B=Array(arguments.length-6);y<B.length;)B[y]=arguments[y+6],++y;y=new F(B,0)}return b.call(this,c,d,e,f,g,u,y)}function b(a,c,d,f,g,h,v){var y=R.c(c,0,null);return(c=Ed(c))?Rc.c(a,y,T.d(e,S.a(a,y),c,d,f,Kc([g,h,v],0))):Rc.c(a,y,T.d(d,S.a(a,y),f,g,h,Kc([v],0)))}a.i=6;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=K(a);var e=G(a);a=K(a);var f=G(a);a=K(a);var g=\nG(a);a=K(a);var v=G(a);a=H(a);return b(c,d,e,f,g,v,a)};a.d=b;return a}(),e=function(e,h,l,m,p,q,s){switch(arguments.length){case 3:return d.call(this,e,h,l);case 4:return c.call(this,e,h,l,m);case 5:return b.call(this,e,h,l,m,p);case 6:return a.call(this,e,h,l,m,p,q);default:var u=null;if(6<arguments.length){for(var u=0,v=Array(arguments.length-6);u<v.length;)v[u]=arguments[u+6],++u;u=new F(v,0)}return f.d(e,h,l,m,p,q,u)}throw Error(\"Invalid arity: \"+arguments.length);};e.i=6;e.f=f.f;e.c=d;e.n=c;\ne.r=b;e.P=a;e.d=f.d;return e}();function ef(a,b){this.u=a;this.e=b}function ff(a){return new ef(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])}function gf(a){return new ef(a.u,Fa(a.e))}function hf(a){a=a.g;return 32>a?0:a-1>>>5<<5}function jf(a,b,c){for(;;){if(0===b)return c;var d=ff(a);d.e[0]=c;c=d;b-=5}}\nvar lf=function kf(b,c,d,e){var f=gf(d),g=b.g-1>>>c&31;5===c?f.e[g]=e:(d=d.e[g],b=null!=d?kf(b,c-5,d,e):jf(null,c-5,e),f.e[g]=b);return f};function mf(a,b){throw Error([z(\"No item \"),z(a),z(\" in vector of length \"),z(b)].join(\"\"));}function nf(a,b){if(b>=hf(a))return a.W;for(var c=a.root,d=a.shift;;)if(0<d)var e=d-5,c=c.e[b>>>d&31],d=e;else return c.e}function of(a,b){return 0<=b&&b<a.g?nf(a,b):mf(b,a.g)}\nvar qf=function pf(b,c,d,e,f){var g=gf(d);if(0===c)g.e[e&31]=f;else{var h=e>>>c&31;b=pf(b,c-5,d.e[h],e,f);g.e[h]=b}return g},sf=function rf(b,c,d){var e=b.g-2>>>c&31;if(5<c){b=rf(b,c-5,d.e[e]);if(null==b&&0===e)return null;d=gf(d);d.e[e]=b;return d}if(0===e)return null;d=gf(d);d.e[e]=null;return d};function tf(a,b,c,d,e,f){this.m=a;this.zb=b;this.e=c;this.oa=d;this.start=e;this.end=f}tf.prototype.ga=function(){return this.m<this.end};\ntf.prototype.next=function(){32===this.m-this.zb&&(this.e=nf(this.oa,this.m),this.zb+=32);var a=this.e[this.m&31];this.m+=1;return a};function W(a,b,c,d,e,f){this.k=a;this.g=b;this.shift=c;this.root=d;this.W=e;this.p=f;this.j=167668511;this.q=8196}k=W.prototype;k.toString=function(){return ec(this)};k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){return\"number\"===typeof b?C.c(this,b,c):c};\nk.gb=function(a,b,c){a=0;for(var d=c;;)if(a<this.g){var e=nf(this,a);c=e.length;a:{for(var f=0;;)if(f<c){var g=f+a,h=e[f],d=b.c?b.c(d,g,h):b.call(null,d,g,h);if(Ac(d)){e=d;break a}f+=1}else{e=d;break a}e=void 0}if(Ac(e))return b=e,L.b?L.b(b):L.call(null,b);a+=c;d=e}else return d};k.Q=function(a,b){return of(this,b)[b&31]};k.$=function(a,b,c){return 0<=b&&b<this.g?nf(this,b)[b&31]:c};\nk.Ua=function(a,b,c){if(0<=b&&b<this.g)return hf(this)<=b?(a=Fa(this.W),a[b&31]=c,new W(this.k,this.g,this.shift,this.root,a,null)):new W(this.k,this.g,this.shift,qf(this,this.shift,this.root,b,c),this.W,null);if(b===this.g)return Ra(this,c);throw Error([z(\"Index \"),z(b),z(\" out of bounds  [0,\"),z(this.g),z(\"]\")].join(\"\"));};k.vb=!0;k.fb=function(){var a=this.g;return new tf(0,0,0<Q(this)?nf(this,0):null,this,0,a)};k.H=function(){return this.k};k.L=function(){return this.g};\nk.hb=function(){return C.a(this,0)};k.ib=function(){return C.a(this,1)};k.La=function(){return 0<this.g?C.a(this,this.g-1):null};\nk.Ma=function(){if(0===this.g)throw Error(\"Can't pop empty vector\");if(1===this.g)return ub(Mc,this.k);if(1<this.g-hf(this))return new W(this.k,this.g-1,this.shift,this.root,this.W.slice(0,-1),null);var a=nf(this,this.g-2),b=sf(this,this.shift,this.root),b=null==b?uf:b,c=this.g-1;return 5<this.shift&&null==b.e[1]?new W(this.k,c,this.shift-5,b.e[0],a,null):new W(this.k,c,this.shift,b,a,null)};k.ab=function(){return 0<this.g?new Hc(this,this.g-1,null):null};\nk.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){if(b instanceof W)if(this.g===Q(b))for(var c=cc(this),d=cc(b);;)if(t(c.ga())){var e=c.next(),f=d.next();if(!sc.a(e,f))return!1}else return!0;else return!1;else return Ic(this,b)};k.$a=function(){var a=this;return new vf(a.g,a.shift,function(){var b=a.root;return wf.b?wf.b(b):wf.call(null,b)}(),function(){var b=a.W;return xf.b?xf.b(b):xf.call(null,b)}())};k.J=function(){return O(Mc,this.k)};\nk.R=function(a,b){return Cc.a(this,b)};k.O=function(a,b,c){a=0;for(var d=c;;)if(a<this.g){var e=nf(this,a);c=e.length;a:{for(var f=0;;)if(f<c){var g=e[f],d=b.a?b.a(d,g):b.call(null,d,g);if(Ac(d)){e=d;break a}f+=1}else{e=d;break a}e=void 0}if(Ac(e))return b=e,L.b?L.b(b):L.call(null,b);a+=c;d=e}else return d};k.Ka=function(a,b,c){if(\"number\"===typeof b)return pb(this,b,c);throw Error(\"Vector's key for assoc must be a number.\");};\nk.D=function(){if(0===this.g)return null;if(32>=this.g)return new F(this.W,0);var a;a:{a=this.root;for(var b=this.shift;;)if(0<b)b-=5,a=a.e[0];else{a=a.e;break a}a=void 0}return yf.n?yf.n(this,a,0,0):yf.call(null,this,a,0,0)};k.F=function(a,b){return new W(b,this.g,this.shift,this.root,this.W,this.p)};\nk.G=function(a,b){if(32>this.g-hf(this)){for(var c=this.W.length,d=Array(c+1),e=0;;)if(e<c)d[e]=this.W[e],e+=1;else break;d[c]=b;return new W(this.k,this.g+1,this.shift,this.root,d,null)}c=(d=this.g>>>5>1<<this.shift)?this.shift+5:this.shift;d?(d=ff(null),d.e[0]=this.root,e=jf(null,this.shift,new ef(null,this.W)),d.e[1]=e):d=lf(this,this.shift,this.root,new ef(null,this.W));return new W(this.k,this.g+1,c,d,[b],null)};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.Q(null,c);case 3:return this.$(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.Q(null,c)};a.c=function(a,c,d){return this.$(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.Q(null,a)};k.a=function(a,b){return this.$(null,a,b)};\nvar uf=new ef(null,[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]),Mc=new W(null,0,5,uf,[],0);W.prototype[Ea]=function(){return uc(this)};function zf(a){return Qb(A.c(Pb,Ob(Mc),a))}\nvar Af=function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){if(a instanceof F&&0===a.m)a:{a=a.e;var b=a.length;if(32>b)a=new W(null,b,5,uf,a,null);else{for(var e=32,f=(new W(null,32,5,uf,a.slice(0,32),null)).$a(null);;)if(e<b)var g=e+1,f=de.a(f,a[e]),e=g;else{a=Qb(f);break a}a=void 0}}else a=zf(a);return a}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}();\nfunction Bf(a,b,c,d,e,f){this.ha=a;this.Ja=b;this.m=c;this.V=d;this.k=e;this.p=f;this.j=32375020;this.q=1536}k=Bf.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};k.T=function(){if(this.V+1<this.Ja.length){var a;a=this.ha;var b=this.Ja,c=this.m,d=this.V+1;a=yf.n?yf.n(a,b,c,d):yf.call(null,a,b,c,d);return null==a?null:a}return $b(this)};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(Mc,this.k)};\nk.R=function(a,b){var c=this;return Cc.a(function(){var a=c.ha,b=c.m+c.V,f=Q(c.ha);return Cf.c?Cf.c(a,b,f):Cf.call(null,a,b,f)}(),b)};k.O=function(a,b,c){var d=this;return Cc.c(function(){var a=d.ha,b=d.m+d.V,c=Q(d.ha);return Cf.c?Cf.c(a,b,c):Cf.call(null,a,b,c)}(),b,c)};k.N=function(){return this.Ja[this.V]};k.S=function(){if(this.V+1<this.Ja.length){var a;a=this.ha;var b=this.Ja,c=this.m,d=this.V+1;a=yf.n?yf.n(a,b,c,d):yf.call(null,a,b,c,d);return null==a?J:a}return Zb(this)};k.D=function(){return this};\nk.Cb=function(){return Ud.a(this.Ja,this.V)};k.Db=function(){var a=this.m+this.Ja.length;if(a<Ma(this.ha)){var b=this.ha,c=nf(this.ha,a);return yf.n?yf.n(b,c,a,0):yf.call(null,b,c,a,0)}return J};k.F=function(a,b){var c=this.ha,d=this.Ja,e=this.m,f=this.V;return yf.r?yf.r(c,d,e,f,b):yf.call(null,c,d,e,f,b)};k.G=function(a,b){return M(b,this)};k.Bb=function(){var a=this.m+this.Ja.length;if(a<Ma(this.ha)){var b=this.ha,c=nf(this.ha,a);return yf.n?yf.n(b,c,a,0):yf.call(null,b,c,a,0)}return null};\nBf.prototype[Ea]=function(){return uc(this)};var yf=function(){function a(a,b,c,d,l){return new Bf(a,b,c,d,l,null)}function b(a,b,c,d){return new Bf(a,b,c,d,null,null)}function c(a,b,c){return new Bf(a,of(a,b),b,c,null,null)}var d=null,d=function(d,f,g,h,l){switch(arguments.length){case 3:return c.call(this,d,f,g);case 4:return b.call(this,d,f,g,h);case 5:return a.call(this,d,f,g,h,l)}throw Error(\"Invalid arity: \"+arguments.length);};d.c=c;d.n=b;d.r=a;return d}();\nfunction Df(a,b,c,d,e){this.k=a;this.oa=b;this.start=c;this.end=d;this.p=e;this.j=166617887;this.q=8192}k=Df.prototype;k.toString=function(){return ec(this)};k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){return\"number\"===typeof b?C.c(this,b,c):c};k.Q=function(a,b){return 0>b||this.end<=this.start+b?mf(b,this.end-this.start):C.a(this.oa,this.start+b)};k.$=function(a,b,c){return 0>b||this.end<=this.start+b?c:C.c(this.oa,this.start+b,c)};\nk.Ua=function(a,b,c){var d=this.start+b;a=this.k;c=Rc.c(this.oa,d,c);b=this.start;var e=this.end,d=d+1,d=e>d?e:d;return Ef.r?Ef.r(a,c,b,d,null):Ef.call(null,a,c,b,d,null)};k.H=function(){return this.k};k.L=function(){return this.end-this.start};k.La=function(){return C.a(this.oa,this.end-1)};k.Ma=function(){if(this.start===this.end)throw Error(\"Can't pop empty vector\");var a=this.k,b=this.oa,c=this.start,d=this.end-1;return Ef.r?Ef.r(a,b,c,d,null):Ef.call(null,a,b,c,d,null)};\nk.ab=function(){return this.start!==this.end?new Hc(this,this.end-this.start-1,null):null};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(Mc,this.k)};k.R=function(a,b){return Cc.a(this,b)};k.O=function(a,b,c){return Cc.c(this,b,c)};k.Ka=function(a,b,c){if(\"number\"===typeof b)return pb(this,b,c);throw Error(\"Subvec's key for assoc must be a number.\");};\nk.D=function(){var a=this;return function(b){return function d(e){return e===a.end?null:M(C.a(a.oa,e),new V(null,function(){return function(){return d(e+1)}}(b),null,null))}}(this)(a.start)};k.F=function(a,b){var c=this.oa,d=this.start,e=this.end,f=this.p;return Ef.r?Ef.r(b,c,d,e,f):Ef.call(null,b,c,d,e,f)};k.G=function(a,b){var c=this.k,d=pb(this.oa,this.end,b),e=this.start,f=this.end+1;return Ef.r?Ef.r(c,d,e,f,null):Ef.call(null,c,d,e,f,null)};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.Q(null,c);case 3:return this.$(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.Q(null,c)};a.c=function(a,c,d){return this.$(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.Q(null,a)};k.a=function(a,b){return this.$(null,a,b)};Df.prototype[Ea]=function(){return uc(this)};\nfunction Ef(a,b,c,d,e){for(;;)if(b instanceof Df)c=b.start+c,d=b.start+d,b=b.oa;else{var f=Q(b);if(0>c||0>d||c>f||d>f)throw Error(\"Index out of bounds\");return new Df(a,b,c,d,e)}}var Cf=function(){function a(a,b,c){return Ef(null,a,b,c,null)}function b(a,b){return c.c(a,b,Q(a))}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}();\nfunction Ff(a,b){return a===b.u?b:new ef(a,Fa(b.e))}function wf(a){return new ef({},Fa(a.e))}function xf(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];hd(a,0,b,0,a.length);return b}\nvar Hf=function Gf(b,c,d,e){d=Ff(b.root.u,d);var f=b.g-1>>>c&31;if(5===c)b=e;else{var g=d.e[f];b=null!=g?Gf(b,c-5,g,e):jf(b.root.u,c-5,e)}d.e[f]=b;return d},Jf=function If(b,c,d){d=Ff(b.root.u,d);var e=b.g-2>>>c&31;if(5<c){b=If(b,c-5,d.e[e]);if(null==b&&0===e)return null;d.e[e]=b;return d}if(0===e)return null;d.e[e]=null;return d};function vf(a,b,c,d){this.g=a;this.shift=b;this.root=c;this.W=d;this.j=275;this.q=88}k=vf.prototype;\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.t(null,c);case 3:return this.s(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.t(null,c)};a.c=function(a,c,d){return this.s(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.t(null,a)};k.a=function(a,b){return this.s(null,a,b)};k.t=function(a,b){return $a.c(this,b,null)};\nk.s=function(a,b,c){return\"number\"===typeof b?C.c(this,b,c):c};k.Q=function(a,b){if(this.root.u)return of(this,b)[b&31];throw Error(\"nth after persistent!\");};k.$=function(a,b,c){return 0<=b&&b<this.g?C.a(this,b):c};k.L=function(){if(this.root.u)return this.g;throw Error(\"count after persistent!\");};\nk.Ub=function(a,b,c){var d=this;if(d.root.u){if(0<=b&&b<d.g)return hf(this)<=b?d.W[b&31]=c:(a=function(){return function f(a,h){var l=Ff(d.root.u,h);if(0===a)l.e[b&31]=c;else{var m=b>>>a&31,p=f(a-5,l.e[m]);l.e[m]=p}return l}}(this).call(null,d.shift,d.root),d.root=a),this;if(b===d.g)return Pb(this,c);throw Error([z(\"Index \"),z(b),z(\" out of bounds for TransientVector of length\"),z(d.g)].join(\"\"));}throw Error(\"assoc! after persistent!\");};\nk.Vb=function(){if(this.root.u){if(0===this.g)throw Error(\"Can't pop empty vector\");if(1===this.g)this.g=0;else if(0<(this.g-1&31))this.g-=1;else{var a;a:if(a=this.g-2,a>=hf(this))a=this.W;else{for(var b=this.root,c=b,d=this.shift;;)if(0<d)c=Ff(b.u,c.e[a>>>d&31]),d-=5;else{a=c.e;break a}a=void 0}b=Jf(this,this.shift,this.root);b=null!=b?b:new ef(this.root.u,[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,\nnull,null,null,null]);5<this.shift&&null==b.e[1]?(this.root=Ff(this.root.u,b.e[0]),this.shift-=5):this.root=b;this.g-=1;this.W=a}return this}throw Error(\"pop! after persistent!\");};k.kb=function(a,b,c){if(\"number\"===typeof b)return Tb(this,b,c);throw Error(\"TransientVector's key for assoc! must be a number.\");};\nk.Sa=function(a,b){if(this.root.u){if(32>this.g-hf(this))this.W[this.g&31]=b;else{var c=new ef(this.root.u,this.W),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.W=d;if(this.g>>>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+\n5;d[0]=this.root;d[1]=jf(this.root.u,this.shift,c);this.root=new ef(this.root.u,d);this.shift=e}else this.root=Hf(this,this.shift,this.root,c)}this.g+=1;return this}throw Error(\"conj! after persistent!\");};k.Ta=function(){if(this.root.u){this.root.u=null;var a=this.g-hf(this),b=Array(a);hd(this.W,0,b,0,a);return new W(null,this.g,this.shift,this.root,b,null)}throw Error(\"persistent! called twice\");};function Kf(a,b,c,d){this.k=a;this.ea=b;this.sa=c;this.p=d;this.q=0;this.j=31850572}k=Kf.prototype;\nk.toString=function(){return ec(this)};k.H=function(){return this.k};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.k)};k.N=function(){return G(this.ea)};k.S=function(){var a=K(this.ea);return a?new Kf(this.k,a,this.sa,null):null==this.sa?Na(this):new Kf(this.k,this.sa,null,null)};k.D=function(){return this};k.F=function(a,b){return new Kf(b,this.ea,this.sa,this.p)};k.G=function(a,b){return M(b,this)};\nKf.prototype[Ea]=function(){return uc(this)};function Lf(a,b,c,d,e){this.k=a;this.count=b;this.ea=c;this.sa=d;this.p=e;this.j=31858766;this.q=8192}k=Lf.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};k.L=function(){return this.count};k.La=function(){return G(this.ea)};k.Ma=function(){if(t(this.ea)){var a=K(this.ea);return a?new Lf(this.k,this.count-1,a,this.sa,null):new Lf(this.k,this.count-1,D(this.sa),Mc,null)}return this};\nk.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(Mf,this.k)};k.N=function(){return G(this.ea)};k.S=function(){return H(D(this))};k.D=function(){var a=D(this.sa),b=this.ea;return t(t(b)?b:a)?new Kf(null,this.ea,D(a),null):null};k.F=function(a,b){return new Lf(b,this.count,this.ea,this.sa,this.p)};\nk.G=function(a,b){var c;t(this.ea)?(c=this.sa,c=new Lf(this.k,this.count+1,this.ea,Nc.a(t(c)?c:Mc,b),null)):c=new Lf(this.k,this.count+1,Nc.a(this.ea,b),Mc,null);return c};var Mf=new Lf(null,0,null,Mc,0);Lf.prototype[Ea]=function(){return uc(this)};function Nf(){this.q=0;this.j=2097152}Nf.prototype.A=function(){return!1};var Of=new Nf;function Pf(a,b){return md(dd(b)?Q(a)===Q(b)?Ee(ud,Oe.a(function(a){return sc.a(S.c(b,G(a),Of),Lc(a))},a)):null:null)}\nfunction Qf(a,b){var c=a.e;if(b instanceof U)a:{for(var d=c.length,e=b.pa,f=0;;){if(d<=f){c=-1;break a}var g=c[f];if(g instanceof U&&e===g.pa){c=f;break a}f+=2}c=void 0}else if(d=\"string\"==typeof b,t(t(d)?d:\"number\"===typeof b))a:{d=c.length;for(e=0;;){if(d<=e){c=-1;break a}if(b===c[e]){c=e;break a}e+=2}c=void 0}else if(b instanceof qc)a:{d=c.length;e=b.ta;for(f=0;;){if(d<=f){c=-1;break a}g=c[f];if(g instanceof qc&&e===g.ta){c=f;break a}f+=2}c=void 0}else if(null==b)a:{d=c.length;for(e=0;;){if(d<=\ne){c=-1;break a}if(null==c[e]){c=e;break a}e+=2}c=void 0}else a:{d=c.length;for(e=0;;){if(d<=e){c=-1;break a}if(sc.a(b,c[e])){c=e;break a}e+=2}c=void 0}return c}function Rf(a,b,c){this.e=a;this.m=b;this.Z=c;this.q=0;this.j=32374990}k=Rf.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.Z};k.T=function(){return this.m<this.e.length-2?new Rf(this.e,this.m+2,this.Z):null};k.L=function(){return(this.e.length-this.m)/2};k.B=function(){return wc(this)};\nk.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.Z)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return new W(null,2,5,uf,[this.e[this.m],this.e[this.m+1]],null)};k.S=function(){return this.m<this.e.length-2?new Rf(this.e,this.m+2,this.Z):J};k.D=function(){return this};k.F=function(a,b){return new Rf(this.e,this.m,b)};k.G=function(a,b){return M(b,this)};Rf.prototype[Ea]=function(){return uc(this)};\nfunction Sf(a,b,c){this.e=a;this.m=b;this.g=c}Sf.prototype.ga=function(){return this.m<this.g};Sf.prototype.next=function(){var a=new W(null,2,5,uf,[this.e[this.m],this.e[this.m+1]],null);this.m+=2;return a};function pa(a,b,c,d){this.k=a;this.g=b;this.e=c;this.p=d;this.j=16647951;this.q=8196}k=pa.prototype;k.toString=function(){return ec(this)};k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){a=Qf(this,b);return-1===a?c:this.e[a+1]};\nk.gb=function(a,b,c){a=this.e.length;for(var d=0;;)if(d<a){var e=this.e[d],f=this.e[d+1];c=b.c?b.c(c,e,f):b.call(null,c,e,f);if(Ac(c))return b=c,L.b?L.b(b):L.call(null,b);d+=2}else return c};k.vb=!0;k.fb=function(){return new Sf(this.e,0,2*this.g)};k.H=function(){return this.k};k.L=function(){return this.g};k.B=function(){var a=this.p;return null!=a?a:this.p=a=xc(this)};\nk.A=function(a,b){if(b&&(b.j&1024||b.ic)){var c=this.e.length;if(this.g===b.L(null))for(var d=0;;)if(d<c){var e=b.s(null,this.e[d],jd);if(e!==jd)if(sc.a(this.e[d+1],e))d+=2;else return!1;else return!1}else return!0;else return!1}else return Pf(this,b)};k.$a=function(){return new Tf({},this.e.length,Fa(this.e))};k.J=function(){return ub(Uf,this.k)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};\nk.wb=function(a,b){if(0<=Qf(this,b)){var c=this.e.length,d=c-2;if(0===d)return Na(this);for(var d=Array(d),e=0,f=0;;){if(e>=c)return new pa(this.k,this.g-1,d,null);sc.a(b,this.e[e])||(d[f]=this.e[e],d[f+1]=this.e[e+1],f+=2);e+=2}}else return this};\nk.Ka=function(a,b,c){a=Qf(this,b);if(-1===a){if(this.g<Vf){a=this.e;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 new pa(this.k,this.g+1,e,null)}return ub(cb(af.a(Qc,this),b,c),this.k)}if(c===this.e[a+1])return this;b=Fa(this.e);b[a+1]=c;return new pa(this.k,this.g,b,null)};k.rb=function(a,b){return-1!==Qf(this,b)};k.D=function(){var a=this.e;return 0<=a.length-2?new Rf(a,0,null):null};k.F=function(a,b){return new pa(b,this.g,this.e,this.p)};\nk.G=function(a,b){if(ed(b))return cb(this,C.a(b,0),C.a(b,1));for(var c=this,d=D(b);;){if(null==d)return c;var e=G(d);if(ed(e))c=cb(c,C.a(e,0),C.a(e,1)),d=K(d);else throw Error(\"conj on a map takes map entries or seqables of map entries\");}};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.t(null,c);case 3:return this.s(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.t(null,c)};a.c=function(a,c,d){return this.s(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.t(null,a)};k.a=function(a,b){return this.s(null,a,b)};var Uf=new pa(null,0,[],null),Vf=8;pa.prototype[Ea]=function(){return uc(this)};\nfunction Tf(a,b,c){this.Va=a;this.qa=b;this.e=c;this.q=56;this.j=258}k=Tf.prototype;k.Jb=function(a,b){if(t(this.Va)){var c=Qf(this,b);0<=c&&(this.e[c]=this.e[this.qa-2],this.e[c+1]=this.e[this.qa-1],c=this.e,c.pop(),c.pop(),this.qa-=2);return this}throw Error(\"dissoc! after persistent!\");};\nk.kb=function(a,b,c){var d=this;if(t(d.Va)){a=Qf(this,b);if(-1===a)return d.qa+2<=2*Vf?(d.qa+=2,d.e.push(b),d.e.push(c),this):ee.c(function(){var a=d.qa,b=d.e;return Xf.a?Xf.a(a,b):Xf.call(null,a,b)}(),b,c);c!==d.e[a+1]&&(d.e[a+1]=c);return this}throw Error(\"assoc! after persistent!\");};\nk.Sa=function(a,b){if(t(this.Va)){if(b?b.j&2048||b.jc||(b.j?0:w(fb,b)):w(fb,b))return Rb(this,Yf.b?Yf.b(b):Yf.call(null,b),Zf.b?Zf.b(b):Zf.call(null,b));for(var c=D(b),d=this;;){var e=G(c);if(t(e))var f=e,c=K(c),d=Rb(d,function(){var a=f;return Yf.b?Yf.b(a):Yf.call(null,a)}(),function(){var a=f;return Zf.b?Zf.b(a):Zf.call(null,a)}());else return d}}else throw Error(\"conj! after persistent!\");};\nk.Ta=function(){if(t(this.Va))return this.Va=!1,new pa(null,Cd(this.qa,2),this.e,null);throw Error(\"persistent! called twice\");};k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){if(t(this.Va))return a=Qf(this,b),-1===a?c:this.e[a+1];throw Error(\"lookup after persistent!\");};k.L=function(){if(t(this.Va))return Cd(this.qa,2);throw Error(\"count after persistent!\");};function Xf(a,b){for(var c=Ob(Qc),d=0;;)if(d<a)c=ee.c(c,b[d],b[d+1]),d+=2;else return c}function $f(){this.o=!1}\nfunction ag(a,b){return a===b?!0:Nd(a,b)?!0:sc.a(a,b)}var bg=function(){function a(a,b,c,g,h){a=Fa(a);a[b]=c;a[g]=h;return a}function b(a,b,c){a=Fa(a);a[b]=c;return a}var c=null,c=function(c,e,f,g,h){switch(arguments.length){case 3:return b.call(this,c,e,f);case 5:return a.call(this,c,e,f,g,h)}throw Error(\"Invalid arity: \"+arguments.length);};c.c=b;c.r=a;return c}();function cg(a,b){var c=Array(a.length-2);hd(a,0,c,0,2*b);hd(a,2*(b+1),c,2*b,c.length-2*b);return c}\nvar dg=function(){function a(a,b,c,g,h,l){a=a.Na(b);a.e[c]=g;a.e[h]=l;return a}function b(a,b,c,g){a=a.Na(b);a.e[c]=g;return a}var c=null,c=function(c,e,f,g,h,l){switch(arguments.length){case 4:return b.call(this,c,e,f,g);case 6:return a.call(this,c,e,f,g,h,l)}throw Error(\"Invalid arity: \"+arguments.length);};c.n=b;c.P=a;return c}();\nfunction eg(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.c?b.c(f,c,g):b.call(null,f,c,g)}else c=a[e+1],c=null!=c?c.Xa(b,f):f;if(Ac(c))return a=c,L.b?L.b(a):L.call(null,a);e+=2;f=c}else return f}function fg(a,b,c){this.u=a;this.w=b;this.e=c}k=fg.prototype;k.Na=function(a){if(a===this.u)return this;var b=Dd(this.w),c=Array(0>b?4:2*(b+1));hd(this.e,0,c,0,2*b);return new fg(a,this.w,c)};\nk.nb=function(a,b,c,d,e){var f=1<<(c>>>b&31);if(0===(this.w&f))return this;var g=Dd(this.w&f-1),h=this.e[2*g],l=this.e[2*g+1];return null==h?(b=l.nb(a,b+5,c,d,e),b===l?this:null!=b?dg.n(this,a,2*g+1,b):this.w===f?null:gg(this,a,f,g)):ag(d,h)?(e[0]=!0,gg(this,a,f,g)):this};function gg(a,b,c,d){if(a.w===c)return null;a=a.Na(b);b=a.e;var e=b.length;a.w^=c;hd(b,2*(d+1),b,2*d,e-2*(d+1));b[e-2]=null;b[e-1]=null;return a}k.lb=function(){var a=this.e;return hg.b?hg.b(a):hg.call(null,a)};\nk.Xa=function(a,b){return eg(this.e,a,b)};k.Oa=function(a,b,c,d){var e=1<<(b>>>a&31);if(0===(this.w&e))return d;var f=Dd(this.w&e-1),e=this.e[2*f],f=this.e[2*f+1];return null==e?f.Oa(a+5,b,c,d):ag(c,e)?f:d};\nk.la=function(a,b,c,d,e,f){var g=1<<(c>>>b&31),h=Dd(this.w&g-1);if(0===(this.w&g)){var l=Dd(this.w);if(2*l<this.e.length){var m=this.Na(a),p=m.e;f.o=!0;id(p,2*h,p,2*(h+1),2*(l-h));p[2*h]=d;p[2*h+1]=e;m.w|=g;return m}if(16<=l){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]=ig.la(a,b+5,c,d,e,f);for(m=h=0;;)if(32>h)0!==(this.w>>>h&1)&&(g[h]=null!=this.e[m]?ig.la(a,b+5,nc(this.e[m]),\nthis.e[m],this.e[m+1],f):this.e[m+1],m+=2),h+=1;else break;return new jg(a,l+1,g)}p=Array(2*(l+4));hd(this.e,0,p,0,2*h);p[2*h]=d;p[2*h+1]=e;hd(this.e,2*h,p,2*(h+1),2*(l-h));f.o=!0;m=this.Na(a);m.e=p;m.w|=g;return m}var q=this.e[2*h],s=this.e[2*h+1];if(null==q)return l=s.la(a,b+5,c,d,e,f),l===s?this:dg.n(this,a,2*h+1,l);if(ag(d,q))return e===s?this:dg.n(this,a,2*h+1,e);f.o=!0;return dg.P(this,a,2*h,null,2*h+1,function(){var f=b+5;return kg.ia?kg.ia(a,f,q,s,c,d,e):kg.call(null,a,f,q,s,c,d,e)}())};\nk.ka=function(a,b,c,d,e){var f=1<<(b>>>a&31),g=Dd(this.w&f-1);if(0===(this.w&f)){var h=Dd(this.w);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]=ig.ka(a+5,b,c,d,e);for(var l=g=0;;)if(32>g)0!==(this.w>>>g&1)&&(f[g]=null!=this.e[l]?ig.ka(a+5,nc(this.e[l]),this.e[l],this.e[l+1],e):this.e[l+1],l+=2),g+=1;else break;return new jg(null,h+1,f)}l=Array(2*(h+1));hd(this.e,\n0,l,0,2*g);l[2*g]=c;l[2*g+1]=d;hd(this.e,2*g,l,2*(g+1),2*(h-g));e.o=!0;return new fg(null,this.w|f,l)}var m=this.e[2*g],p=this.e[2*g+1];if(null==m)return h=p.ka(a+5,b,c,d,e),h===p?this:new fg(null,this.w,bg.c(this.e,2*g+1,h));if(ag(c,m))return d===p?this:new fg(null,this.w,bg.c(this.e,2*g+1,d));e.o=!0;return new fg(null,this.w,bg.r(this.e,2*g,null,2*g+1,function(){var e=a+5;return kg.P?kg.P(e,m,p,b,c,d):kg.call(null,e,m,p,b,c,d)}()))};\nk.mb=function(a,b,c){var d=1<<(b>>>a&31);if(0===(this.w&d))return this;var e=Dd(this.w&d-1),f=this.e[2*e],g=this.e[2*e+1];return null==f?(a=g.mb(a+5,b,c),a===g?this:null!=a?new fg(null,this.w,bg.c(this.e,2*e+1,a)):this.w===d?null:new fg(null,this.w^d,cg(this.e,e))):ag(c,f)?new fg(null,this.w^d,cg(this.e,e)):this};var ig=new fg(null,0,[]);\nfunction lg(a,b,c){var d=a.e,e=d.length;a=Array(2*(a.g-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 fg(b,h,a)}function jg(a,b,c){this.u=a;this.g=b;this.e=c}k=jg.prototype;k.Na=function(a){return a===this.u?this:new jg(a,this.g,Fa(this.e))};\nk.nb=function(a,b,c,d,e){var f=c>>>b&31,g=this.e[f];if(null==g)return this;b=g.nb(a,b+5,c,d,e);if(b===g)return this;if(null==b){if(8>=this.g)return lg(this,a,f);a=dg.n(this,a,f,b);a.g-=1;return a}return dg.n(this,a,f,b)};k.lb=function(){var a=this.e;return mg.b?mg.b(a):mg.call(null,a)};k.Xa=function(a,b){for(var c=this.e.length,d=0,e=b;;)if(d<c){var f=this.e[d];if(null!=f&&(e=f.Xa(a,e),Ac(e)))return c=e,L.b?L.b(c):L.call(null,c);d+=1}else return e};\nk.Oa=function(a,b,c,d){var e=this.e[b>>>a&31];return null!=e?e.Oa(a+5,b,c,d):d};k.la=function(a,b,c,d,e,f){var g=c>>>b&31,h=this.e[g];if(null==h)return a=dg.n(this,a,g,ig.la(a,b+5,c,d,e,f)),a.g+=1,a;b=h.la(a,b+5,c,d,e,f);return b===h?this:dg.n(this,a,g,b)};k.ka=function(a,b,c,d,e){var f=b>>>a&31,g=this.e[f];if(null==g)return new jg(null,this.g+1,bg.c(this.e,f,ig.ka(a+5,b,c,d,e)));a=g.ka(a+5,b,c,d,e);return a===g?this:new jg(null,this.g,bg.c(this.e,f,a))};\nk.mb=function(a,b,c){var d=b>>>a&31,e=this.e[d];return null!=e?(a=e.mb(a+5,b,c),a===e?this:null==a?8>=this.g?lg(this,null,d):new jg(null,this.g-1,bg.c(this.e,d,a)):new jg(null,this.g,bg.c(this.e,d,a))):this};function ng(a,b,c){b*=2;for(var d=0;;)if(d<b){if(ag(c,a[d]))return d;d+=2}else return-1}function og(a,b,c,d){this.u=a;this.Ia=b;this.g=c;this.e=d}k=og.prototype;k.Na=function(a){if(a===this.u)return this;var b=Array(2*(this.g+1));hd(this.e,0,b,0,2*this.g);return new og(a,this.Ia,this.g,b)};\nk.nb=function(a,b,c,d,e){b=ng(this.e,this.g,d);if(-1===b)return this;e[0]=!0;if(1===this.g)return null;a=this.Na(a);e=a.e;e[b]=e[2*this.g-2];e[b+1]=e[2*this.g-1];e[2*this.g-1]=null;e[2*this.g-2]=null;a.g-=1;return a};k.lb=function(){var a=this.e;return hg.b?hg.b(a):hg.call(null,a)};k.Xa=function(a,b){return eg(this.e,a,b)};k.Oa=function(a,b,c,d){a=ng(this.e,this.g,c);return 0>a?d:ag(c,this.e[a])?this.e[a+1]:d};\nk.la=function(a,b,c,d,e,f){if(c===this.Ia){b=ng(this.e,this.g,d);if(-1===b){if(this.e.length>2*this.g)return a=dg.P(this,a,2*this.g,d,2*this.g+1,e),f.o=!0,a.g+=1,a;c=this.e.length;b=Array(c+2);hd(this.e,0,b,0,c);b[c]=d;b[c+1]=e;f.o=!0;f=this.g+1;a===this.u?(this.e=b,this.g=f,a=this):a=new og(this.u,this.Ia,f,b);return a}return this.e[b+1]===e?this:dg.n(this,a,b+1,e)}return(new fg(a,1<<(this.Ia>>>b&31),[null,this,null,null])).la(a,b,c,d,e,f)};\nk.ka=function(a,b,c,d,e){return b===this.Ia?(a=ng(this.e,this.g,c),-1===a?(a=2*this.g,b=Array(a+2),hd(this.e,0,b,0,a),b[a]=c,b[a+1]=d,e.o=!0,new og(null,this.Ia,this.g+1,b)):sc.a(this.e[a],d)?this:new og(null,this.Ia,this.g,bg.c(this.e,a+1,d))):(new fg(null,1<<(this.Ia>>>a&31),[null,this])).ka(a,b,c,d,e)};k.mb=function(a,b,c){a=ng(this.e,this.g,c);return-1===a?this:1===this.g?null:new og(null,this.Ia,this.g-1,cg(this.e,Cd(a,2)))};\nvar kg=function(){function a(a,b,c,g,h,l,m){var p=nc(c);if(p===h)return new og(null,p,2,[c,g,l,m]);var q=new $f;return ig.la(a,b,p,c,g,q).la(a,b,h,l,m,q)}function b(a,b,c,g,h,l){var m=nc(b);if(m===g)return new og(null,m,2,[b,c,h,l]);var p=new $f;return ig.ka(a,m,b,c,p).ka(a,g,h,l,p)}var c=null,c=function(c,e,f,g,h,l,m){switch(arguments.length){case 6:return b.call(this,c,e,f,g,h,l);case 7:return a.call(this,c,e,f,g,h,l,m)}throw Error(\"Invalid arity: \"+arguments.length);};c.P=b;c.ia=a;return c}();\nfunction pg(a,b,c,d,e){this.k=a;this.Pa=b;this.m=c;this.C=d;this.p=e;this.q=0;this.j=32374860}k=pg.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.k)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return null==this.C?new W(null,2,5,uf,[this.Pa[this.m],this.Pa[this.m+1]],null):G(this.C)};\nk.S=function(){if(null==this.C){var a=this.Pa,b=this.m+2;return hg.c?hg.c(a,b,null):hg.call(null,a,b,null)}var a=this.Pa,b=this.m,c=K(this.C);return hg.c?hg.c(a,b,c):hg.call(null,a,b,c)};k.D=function(){return this};k.F=function(a,b){return new pg(b,this.Pa,this.m,this.C,this.p)};k.G=function(a,b){return M(b,this)};pg.prototype[Ea]=function(){return uc(this)};\nvar hg=function(){function a(a,b,c){if(null==c)for(c=a.length;;)if(b<c){if(null!=a[b])return new pg(null,a,b,null,null);var g=a[b+1];if(t(g)&&(g=g.lb(),t(g)))return new pg(null,a,b+2,g,null);b+=2}else return null;else return new pg(null,a,b,c,null)}function b(a){return c.c(a,0,null)}var c=null,c=function(c,e,f){switch(arguments.length){case 1:return b.call(this,c);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.c=a;return c}();\nfunction qg(a,b,c,d,e){this.k=a;this.Pa=b;this.m=c;this.C=d;this.p=e;this.q=0;this.j=32374860}k=qg.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.k)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return G(this.C)};\nk.S=function(){var a=this.Pa,b=this.m,c=K(this.C);return mg.n?mg.n(null,a,b,c):mg.call(null,null,a,b,c)};k.D=function(){return this};k.F=function(a,b){return new qg(b,this.Pa,this.m,this.C,this.p)};k.G=function(a,b){return M(b,this)};qg.prototype[Ea]=function(){return uc(this)};\nvar mg=function(){function a(a,b,c,g){if(null==g)for(g=b.length;;)if(c<g){var h=b[c];if(t(h)&&(h=h.lb(),t(h)))return new qg(a,b,c+1,h,null);c+=1}else return null;else return new qg(a,b,c,g,null)}function b(a){return c.n(null,a,0,null)}var c=null,c=function(c,e,f,g){switch(arguments.length){case 1:return b.call(this,c);case 4:return a.call(this,c,e,f,g)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.n=a;return c}();\nfunction rg(a,b,c,d,e,f){this.k=a;this.g=b;this.root=c;this.U=d;this.da=e;this.p=f;this.j=16123663;this.q=8196}k=rg.prototype;k.toString=function(){return ec(this)};k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){return null==b?this.U?this.da:c:null==this.root?c:this.root.Oa(0,nc(b),b,c)};k.gb=function(a,b,c){this.U&&(a=this.da,c=b.c?b.c(c,null,a):b.call(null,c,null,a));return Ac(c)?L.b?L.b(c):L.call(null,c):null!=this.root?this.root.Xa(b,c):c};k.H=function(){return this.k};k.L=function(){return this.g};\nk.B=function(){var a=this.p;return null!=a?a:this.p=a=xc(this)};k.A=function(a,b){return Pf(this,b)};k.$a=function(){return new sg({},this.root,this.g,this.U,this.da)};k.J=function(){return ub(Qc,this.k)};k.wb=function(a,b){if(null==b)return this.U?new rg(this.k,this.g-1,this.root,!1,null,null):this;if(null==this.root)return this;var c=this.root.mb(0,nc(b),b);return c===this.root?this:new rg(this.k,this.g-1,c,this.U,this.da,null)};\nk.Ka=function(a,b,c){if(null==b)return this.U&&c===this.da?this:new rg(this.k,this.U?this.g:this.g+1,this.root,!0,c,null);a=new $f;b=(null==this.root?ig:this.root).ka(0,nc(b),b,c,a);return b===this.root?this:new rg(this.k,a.o?this.g+1:this.g,b,this.U,this.da,null)};k.rb=function(a,b){return null==b?this.U:null==this.root?!1:this.root.Oa(0,nc(b),b,jd)!==jd};k.D=function(){if(0<this.g){var a=null!=this.root?this.root.lb():null;return this.U?M(new W(null,2,5,uf,[null,this.da],null),a):a}return null};\nk.F=function(a,b){return new rg(b,this.g,this.root,this.U,this.da,this.p)};k.G=function(a,b){if(ed(b))return cb(this,C.a(b,0),C.a(b,1));for(var c=this,d=D(b);;){if(null==d)return c;var e=G(d);if(ed(e))c=cb(c,C.a(e,0),C.a(e,1)),d=K(d);else throw Error(\"conj on a map takes map entries or seqables of map entries\");}};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.t(null,c);case 3:return this.s(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.t(null,c)};a.c=function(a,c,d){return this.s(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.t(null,a)};k.a=function(a,b){return this.s(null,a,b)};var Qc=new rg(null,0,null,!1,null,0);rg.prototype[Ea]=function(){return uc(this)};\nfunction sg(a,b,c,d,e){this.u=a;this.root=b;this.count=c;this.U=d;this.da=e;this.q=56;this.j=258}k=sg.prototype;k.Jb=function(a,b){if(this.u)if(null==b)this.U&&(this.U=!1,this.da=null,this.count-=1);else{if(null!=this.root){var c=new $f,d=this.root.nb(this.u,0,nc(b),b,c);d!==this.root&&(this.root=d);t(c[0])&&(this.count-=1)}}else throw Error(\"dissoc! after persistent!\");return this};k.kb=function(a,b,c){return tg(this,b,c)};k.Sa=function(a,b){return ug(this,b)};\nk.Ta=function(){var a;if(this.u)this.u=null,a=new rg(null,this.count,this.root,this.U,this.da,null);else throw Error(\"persistent! called twice\");return a};k.t=function(a,b){return null==b?this.U?this.da:null:null==this.root?null:this.root.Oa(0,nc(b),b)};k.s=function(a,b,c){return null==b?this.U?this.da:c:null==this.root?c:this.root.Oa(0,nc(b),b,c)};k.L=function(){if(this.u)return this.count;throw Error(\"count after persistent!\");};\nfunction ug(a,b){if(a.u){if(b?b.j&2048||b.jc||(b.j?0:w(fb,b)):w(fb,b))return tg(a,Yf.b?Yf.b(b):Yf.call(null,b),Zf.b?Zf.b(b):Zf.call(null,b));for(var c=D(b),d=a;;){var e=G(c);if(t(e))var f=e,c=K(c),d=tg(d,function(){var a=f;return Yf.b?Yf.b(a):Yf.call(null,a)}(),function(){var a=f;return Zf.b?Zf.b(a):Zf.call(null,a)}());else return d}}else throw Error(\"conj! after persistent\");}\nfunction tg(a,b,c){if(a.u){if(null==b)a.da!==c&&(a.da=c),a.U||(a.count+=1,a.U=!0);else{var d=new $f;b=(null==a.root?ig:a.root).la(a.u,0,nc(b),b,c,d);b!==a.root&&(a.root=b);d.o&&(a.count+=1)}return a}throw Error(\"assoc! after persistent!\");}function vg(a,b,c){for(var d=b;;)if(null!=a)b=c?a.left:a.right,d=Nc.a(d,a),a=b;else return d}function wg(a,b,c,d,e){this.k=a;this.stack=b;this.pb=c;this.g=d;this.p=e;this.q=0;this.j=32374862}k=wg.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.k};\nk.L=function(){return 0>this.g?Q(K(this))+1:this.g};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.k)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return Wc(this.stack)};k.S=function(){var a=G(this.stack),a=vg(this.pb?a.right:a.left,K(this.stack),this.pb);return null!=a?new wg(null,a,this.pb,this.g-1,null):J};k.D=function(){return this};\nk.F=function(a,b){return new wg(b,this.stack,this.pb,this.g,this.p)};k.G=function(a,b){return M(b,this)};wg.prototype[Ea]=function(){return uc(this)};function xg(a,b,c){return new wg(null,vg(a,null,b),b,c,null)}\nfunction yg(a,b,c,d){return c instanceof X?c.left instanceof X?new X(c.key,c.o,c.left.ua(),new Z(a,b,c.right,d,null),null):c.right instanceof X?new X(c.right.key,c.right.o,new Z(c.key,c.o,c.left,c.right.left,null),new Z(a,b,c.right.right,d,null),null):new Z(a,b,c,d,null):new Z(a,b,c,d,null)}\nfunction zg(a,b,c,d){return d instanceof X?d.right instanceof X?new X(d.key,d.o,new Z(a,b,c,d.left,null),d.right.ua(),null):d.left instanceof X?new X(d.left.key,d.left.o,new Z(a,b,c,d.left.left,null),new Z(d.key,d.o,d.left.right,d.right,null),null):new Z(a,b,c,d,null):new Z(a,b,c,d,null)}\nfunction Ag(a,b,c,d){if(c instanceof X)return new X(a,b,c.ua(),d,null);if(d instanceof Z)return zg(a,b,c,d.ob());if(d instanceof X&&d.left instanceof Z)return new X(d.left.key,d.left.o,new Z(a,b,c,d.left.left,null),zg(d.key,d.o,d.left.right,d.right.ob()),null);throw Error(\"red-black tree invariant violation\");}\nvar Cg=function Bg(b,c,d){d=null!=b.left?Bg(b.left,c,d):d;if(Ac(d))return L.b?L.b(d):L.call(null,d);var e=b.key,f=b.o;d=c.c?c.c(d,e,f):c.call(null,d,e,f);if(Ac(d))return L.b?L.b(d):L.call(null,d);b=null!=b.right?Bg(b.right,c,d):d;return Ac(b)?L.b?L.b(b):L.call(null,b):b};function Z(a,b,c,d,e){this.key=a;this.o=b;this.left=c;this.right=d;this.p=e;this.q=0;this.j=32402207}k=Z.prototype;k.Mb=function(a){return a.Ob(this)};k.ob=function(){return new X(this.key,this.o,this.left,this.right,null)};\nk.ua=function(){return this};k.Lb=function(a){return a.Nb(this)};k.replace=function(a,b,c,d){return new Z(a,b,c,d,null)};k.Nb=function(a){return new Z(a.key,a.o,this,a.right,null)};k.Ob=function(a){return new Z(a.key,a.o,a.left,this,null)};k.Xa=function(a,b){return Cg(this,a,b)};k.t=function(a,b){return C.c(this,b,null)};k.s=function(a,b,c){return C.c(this,b,c)};k.Q=function(a,b){return 0===b?this.key:1===b?this.o:null};k.$=function(a,b,c){return 0===b?this.key:1===b?this.o:c};\nk.Ua=function(a,b,c){return(new W(null,2,5,uf,[this.key,this.o],null)).Ua(null,b,c)};k.H=function(){return null};k.L=function(){return 2};k.hb=function(){return this.key};k.ib=function(){return this.o};k.La=function(){return this.o};k.Ma=function(){return new W(null,1,5,uf,[this.key],null)};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return Mc};k.R=function(a,b){return Cc.a(this,b)};k.O=function(a,b,c){return Cc.c(this,b,c)};\nk.Ka=function(a,b,c){return Rc.c(new W(null,2,5,uf,[this.key,this.o],null),b,c)};k.D=function(){return Ra(Ra(J,this.o),this.key)};k.F=function(a,b){return O(new W(null,2,5,uf,[this.key,this.o],null),b)};k.G=function(a,b){return new W(null,3,5,uf,[this.key,this.o,b],null)};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.t(null,c);case 3:return this.s(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.t(null,c)};a.c=function(a,c,d){return this.s(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.t(null,a)};k.a=function(a,b){return this.s(null,a,b)};Z.prototype[Ea]=function(){return uc(this)};\nfunction X(a,b,c,d,e){this.key=a;this.o=b;this.left=c;this.right=d;this.p=e;this.q=0;this.j=32402207}k=X.prototype;k.Mb=function(a){return new X(this.key,this.o,this.left,a,null)};k.ob=function(){throw Error(\"red-black tree invariant violation\");};k.ua=function(){return new Z(this.key,this.o,this.left,this.right,null)};k.Lb=function(a){return new X(this.key,this.o,a,this.right,null)};k.replace=function(a,b,c,d){return new X(a,b,c,d,null)};\nk.Nb=function(a){return this.left instanceof X?new X(this.key,this.o,this.left.ua(),new Z(a.key,a.o,this.right,a.right,null),null):this.right instanceof X?new X(this.right.key,this.right.o,new Z(this.key,this.o,this.left,this.right.left,null),new Z(a.key,a.o,this.right.right,a.right,null),null):new Z(a.key,a.o,this,a.right,null)};\nk.Ob=function(a){return this.right instanceof X?new X(this.key,this.o,new Z(a.key,a.o,a.left,this.left,null),this.right.ua(),null):this.left instanceof X?new X(this.left.key,this.left.o,new Z(a.key,a.o,a.left,this.left.left,null),new Z(this.key,this.o,this.left.right,this.right,null),null):new Z(a.key,a.o,a.left,this,null)};k.Xa=function(a,b){return Cg(this,a,b)};k.t=function(a,b){return C.c(this,b,null)};k.s=function(a,b,c){return C.c(this,b,c)};\nk.Q=function(a,b){return 0===b?this.key:1===b?this.o:null};k.$=function(a,b,c){return 0===b?this.key:1===b?this.o:c};k.Ua=function(a,b,c){return(new W(null,2,5,uf,[this.key,this.o],null)).Ua(null,b,c)};k.H=function(){return null};k.L=function(){return 2};k.hb=function(){return this.key};k.ib=function(){return this.o};k.La=function(){return this.o};k.Ma=function(){return new W(null,1,5,uf,[this.key],null)};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};\nk.A=function(a,b){return Ic(this,b)};k.J=function(){return Mc};k.R=function(a,b){return Cc.a(this,b)};k.O=function(a,b,c){return Cc.c(this,b,c)};k.Ka=function(a,b,c){return Rc.c(new W(null,2,5,uf,[this.key,this.o],null),b,c)};k.D=function(){return Ra(Ra(J,this.o),this.key)};k.F=function(a,b){return O(new W(null,2,5,uf,[this.key,this.o],null),b)};k.G=function(a,b){return new W(null,3,5,uf,[this.key,this.o,b],null)};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.t(null,c);case 3:return this.s(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.t(null,c)};a.c=function(a,c,d){return this.s(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.t(null,a)};k.a=function(a,b){return this.s(null,a,b)};X.prototype[Ea]=function(){return uc(this)};\nvar Eg=function Dg(b,c,d,e,f){if(null==c)return new X(d,e,null,null,null);var g;g=c.key;g=b.a?b.a(d,g):b.call(null,d,g);if(0===g)return f[0]=c,null;if(0>g)return b=Dg(b,c.left,d,e,f),null!=b?c.Lb(b):null;b=Dg(b,c.right,d,e,f);return null!=b?c.Mb(b):null},Gg=function Fg(b,c){if(null==b)return c;if(null==c)return b;if(b instanceof X){if(c instanceof X){var d=Fg(b.right,c.left);return d instanceof X?new X(d.key,d.o,new X(b.key,b.o,b.left,d.left,null),new X(c.key,c.o,d.right,c.right,null),null):new X(b.key,\nb.o,b.left,new X(c.key,c.o,d,c.right,null),null)}return new X(b.key,b.o,b.left,Fg(b.right,c),null)}if(c instanceof X)return new X(c.key,c.o,Fg(b,c.left),c.right,null);d=Fg(b.right,c.left);return d instanceof X?new X(d.key,d.o,new Z(b.key,b.o,b.left,d.left,null),new Z(c.key,c.o,d.right,c.right,null),null):Ag(b.key,b.o,b.left,new Z(c.key,c.o,d,c.right,null))},Ig=function Hg(b,c,d,e){if(null!=c){var f;f=c.key;f=b.a?b.a(d,f):b.call(null,d,f);if(0===f)return e[0]=c,Gg(c.left,c.right);if(0>f)return b=Hg(b,\nc.left,d,e),null!=b||null!=e[0]?c.left instanceof Z?Ag(c.key,c.o,b,c.right):new X(c.key,c.o,b,c.right,null):null;b=Hg(b,c.right,d,e);if(null!=b||null!=e[0])if(c.right instanceof Z)if(e=c.key,d=c.o,c=c.left,b instanceof X)c=new X(e,d,c,b.ua(),null);else if(c instanceof Z)c=yg(e,d,c.ob(),b);else if(c instanceof X&&c.right instanceof Z)c=new X(c.right.key,c.right.o,yg(c.key,c.o,c.left.ob(),c.right.left),new Z(e,d,c.right.right,b,null),null);else throw Error(\"red-black tree invariant violation\");else c=\nnew X(c.key,c.o,c.left,b,null);else c=null;return c}return null},Kg=function Jg(b,c,d,e){var f=c.key,g=b.a?b.a(d,f):b.call(null,d,f);return 0===g?c.replace(f,e,c.left,c.right):0>g?c.replace(f,c.o,Jg(b,c.left,d,e),c.right):c.replace(f,c.o,c.left,Jg(b,c.right,d,e))};function Lg(a,b,c,d,e){this.aa=a;this.na=b;this.g=c;this.k=d;this.p=e;this.j=418776847;this.q=8192}k=Lg.prototype;k.toString=function(){return ec(this)};\nfunction Mg(a,b){for(var c=a.na;;)if(null!=c){var d;d=c.key;d=a.aa.a?a.aa.a(b,d):a.aa.call(null,b,d);if(0===d)return c;c=0>d?c.left:c.right}else return null}k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){a=Mg(this,b);return null!=a?a.o:c};k.gb=function(a,b,c){return null!=this.na?Cg(this.na,b,c):c};k.H=function(){return this.k};k.L=function(){return this.g};k.ab=function(){return 0<this.g?xg(this.na,!1,this.g):null};k.B=function(){var a=this.p;return null!=a?a:this.p=a=xc(this)};\nk.A=function(a,b){return Pf(this,b)};k.J=function(){return new Lg(this.aa,null,0,this.k,0)};k.wb=function(a,b){var c=[null],d=Ig(this.aa,this.na,b,c);return null==d?null==R.a(c,0)?this:new Lg(this.aa,null,0,this.k,null):new Lg(this.aa,d.ua(),this.g-1,this.k,null)};k.Ka=function(a,b,c){a=[null];var d=Eg(this.aa,this.na,b,c,a);return null==d?(a=R.a(a,0),sc.a(c,a.o)?this:new Lg(this.aa,Kg(this.aa,this.na,b,c),this.g,this.k,null)):new Lg(this.aa,d.ua(),this.g+1,this.k,null)};\nk.rb=function(a,b){return null!=Mg(this,b)};k.D=function(){return 0<this.g?xg(this.na,!0,this.g):null};k.F=function(a,b){return new Lg(this.aa,this.na,this.g,b,this.p)};k.G=function(a,b){if(ed(b))return cb(this,C.a(b,0),C.a(b,1));for(var c=this,d=D(b);;){if(null==d)return c;var e=G(d);if(ed(e))c=cb(c,C.a(e,0),C.a(e,1)),d=K(d);else throw Error(\"conj on a map takes map entries or seqables of map entries\");}};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.t(null,c);case 3:return this.s(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.t(null,c)};a.c=function(a,c,d){return this.s(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.t(null,a)};k.a=function(a,b){return this.s(null,a,b)};k.Hb=function(a,b){return 0<this.g?xg(this.na,b,this.g):null};\nk.Ib=function(a,b,c){if(0<this.g){a=null;for(var d=this.na;;)if(null!=d){var e;e=d.key;e=this.aa.a?this.aa.a(b,e):this.aa.call(null,b,e);if(0===e)return new wg(null,Nc.a(a,d),c,-1,null);t(c)?0>e?(a=Nc.a(a,d),d=d.left):d=d.right:0<e?(a=Nc.a(a,d),d=d.right):d=d.left}else return null==a?null:new wg(null,a,c,-1,null)}else return null};k.Gb=function(a,b){return Yf.b?Yf.b(b):Yf.call(null,b)};k.Fb=function(){return this.aa};var Ng=new Lg(od,null,0,null,0);Lg.prototype[Ea]=function(){return uc(this)};\nvar Og=function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){a=D(a);for(var b=Ob(Qc);;)if(a){var e=K(K(a)),b=ee.c(b,G(a),Lc(a));a=e}else return Qb(b)}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}(),Pg=function(){function a(a){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 F(e,0)}return b.call(this,\nd)}function b(a){a:{a=T.a(Ha,a);for(var b=a.length,e=0,f=Ob(Uf);;)if(e<b)var g=e+2,f=Rb(f,a[e],a[e+1]),e=g;else{a=Qb(f);break a}a=void 0}return a}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}(),Qg=function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){a=D(a);for(var b=Ng;;)if(a){var e=K(K(a)),b=Rc.c(b,G(a),Lc(a));a=e}else return b}a.i=0;a.f=function(a){a=D(a);\nreturn b(a)};a.d=b;return a}(),Rg=function(){function a(a,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 F(f,0)}return b.call(this,a,e)}function b(a,b){for(var e=D(b),f=new Lg(qd(a),null,0,null,0);;)if(e)var g=K(K(e)),f=Rc.c(f,G(e),Lc(e)),e=g;else return f}a.i=1;a.f=function(a){var d=G(a);a=H(a);return b(d,a)};a.d=b;return a}();function Sg(a,b){this.Y=a;this.Z=b;this.q=0;this.j=32374988}k=Sg.prototype;k.toString=function(){return ec(this)};\nk.H=function(){return this.Z};k.T=function(){var a=this.Y,a=(a?a.j&128||a.xb||(a.j?0:w(Xa,a)):w(Xa,a))?this.Y.T(null):K(this.Y);return null==a?null:new Sg(a,this.Z)};k.B=function(){return wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.Z)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return this.Y.N(null).hb(null)};\nk.S=function(){var a=this.Y,a=(a?a.j&128||a.xb||(a.j?0:w(Xa,a)):w(Xa,a))?this.Y.T(null):K(this.Y);return null!=a?new Sg(a,this.Z):J};k.D=function(){return this};k.F=function(a,b){return new Sg(this.Y,b)};k.G=function(a,b){return M(b,this)};Sg.prototype[Ea]=function(){return uc(this)};function Tg(a){return(a=D(a))?new Sg(a,null):null}function Yf(a){return hb(a)}function Ug(a,b){this.Y=a;this.Z=b;this.q=0;this.j=32374988}k=Ug.prototype;k.toString=function(){return ec(this)};k.H=function(){return this.Z};\nk.T=function(){var a=this.Y,a=(a?a.j&128||a.xb||(a.j?0:w(Xa,a)):w(Xa,a))?this.Y.T(null):K(this.Y);return null==a?null:new Ug(a,this.Z)};k.B=function(){return wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.Z)};k.R=function(a,b){return P.a(b,this)};k.O=function(a,b,c){return P.c(b,c,this)};k.N=function(){return this.Y.N(null).ib(null)};k.S=function(){var a=this.Y,a=(a?a.j&128||a.xb||(a.j?0:w(Xa,a)):w(Xa,a))?this.Y.T(null):K(this.Y);return null!=a?new Ug(a,this.Z):J};\nk.D=function(){return this};k.F=function(a,b){return new Ug(this.Y,b)};k.G=function(a,b){return M(b,this)};Ug.prototype[Ea]=function(){return uc(this)};function Vg(a){return(a=D(a))?new Ug(a,null):null}function Zf(a){return ib(a)}\nvar Wg=function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){return t(Fe(ud,a))?A.a(function(a,b){return Nc.a(t(a)?a:Uf,b)},a):null}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}(),Xg=function(){function a(a,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 F(f,0)}return b.call(this,a,e)}function b(a,\nb){return t(Fe(ud,b))?A.a(function(a){return function(b,c){return A.c(a,t(b)?b:Uf,D(c))}}(function(b,d){var g=G(d),h=Lc(d);return nd(b,g)?Rc.c(b,g,function(){var d=S.a(b,g);return a.a?a.a(d,h):a.call(null,d,h)}()):Rc.c(b,g,h)}),b):null}a.i=1;a.f=function(a){var d=G(a);a=H(a);return b(d,a)};a.d=b;return a}();function Yg(a,b){for(var c=Uf,d=D(b);;)if(d)var e=G(d),f=S.c(a,e,Zg),c=je.a(f,Zg)?Rc.c(c,e,f):c,d=K(d);else return O(c,Vc(a))}\nfunction $g(a,b,c){this.k=a;this.Wa=b;this.p=c;this.j=15077647;this.q=8196}k=$g.prototype;k.toString=function(){return ec(this)};k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){return bb(this.Wa,b)?b:c};k.H=function(){return this.k};k.L=function(){return Ma(this.Wa)};k.B=function(){var a=this.p;return null!=a?a:this.p=a=xc(this)};k.A=function(a,b){return ad(b)&&Q(this)===Q(b)&&Ee(function(a){return function(b){return nd(a,b)}}(this),b)};k.$a=function(){return new ah(Ob(this.Wa))};\nk.J=function(){return O(bh,this.k)};k.Eb=function(a,b){return new $g(this.k,eb(this.Wa,b),null)};k.D=function(){return Tg(this.Wa)};k.F=function(a,b){return new $g(b,this.Wa,this.p)};k.G=function(a,b){return new $g(this.k,Rc.c(this.Wa,b,null),null)};\nk.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.t(null,c);case 3:return this.s(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.t(null,c)};a.c=function(a,c,d){return this.s(null,c,d)};return a}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.t(null,a)};k.a=function(a,b){return this.s(null,a,b)};var bh=new $g(null,Uf,0);$g.prototype[Ea]=function(){return uc(this)};\nfunction ah(a){this.ma=a;this.j=259;this.q=136}k=ah.prototype;k.call=function(){function a(a,b,c){return $a.c(this.ma,b,jd)===jd?c:b}function b(a,b){return $a.c(this.ma,b,jd)===jd?null:b}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+arguments.length);};c.a=b;c.c=a;return c}();k.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};\nk.b=function(a){return $a.c(this.ma,a,jd)===jd?null:a};k.a=function(a,b){return $a.c(this.ma,a,jd)===jd?b:a};k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){return $a.c(this.ma,b,jd)===jd?c:b};k.L=function(){return Q(this.ma)};k.Tb=function(a,b){this.ma=fe.a(this.ma,b);return this};k.Sa=function(a,b){this.ma=ee.c(this.ma,b,null);return this};k.Ta=function(){return new $g(null,Qb(this.ma),null)};function ch(a,b,c){this.k=a;this.ja=b;this.p=c;this.j=417730831;this.q=8192}k=ch.prototype;\nk.toString=function(){return ec(this)};k.t=function(a,b){return $a.c(this,b,null)};k.s=function(a,b,c){a=Mg(this.ja,b);return null!=a?a.key:c};k.H=function(){return this.k};k.L=function(){return Q(this.ja)};k.ab=function(){return 0<Q(this.ja)?Oe.a(Yf,Gb(this.ja)):null};k.B=function(){var a=this.p;return null!=a?a:this.p=a=xc(this)};k.A=function(a,b){return ad(b)&&Q(this)===Q(b)&&Ee(function(a){return function(b){return nd(a,b)}}(this),b)};k.J=function(){return new ch(this.k,Na(this.ja),0)};\nk.Eb=function(a,b){return new ch(this.k,Sc.a(this.ja,b),null)};k.D=function(){return Tg(this.ja)};k.F=function(a,b){return new ch(b,this.ja,this.p)};k.G=function(a,b){return new ch(this.k,Rc.c(this.ja,b,null),null)};k.call=function(){var a=null,a=function(a,c,d){switch(arguments.length){case 2:return this.t(null,c);case 3:return this.s(null,c,d)}throw Error(\"Invalid arity: \"+arguments.length);};a.a=function(a,c){return this.t(null,c)};a.c=function(a,c,d){return this.s(null,c,d)};return a}();\nk.apply=function(a,b){return this.call.apply(this,[this].concat(Fa(b)))};k.b=function(a){return this.t(null,a)};k.a=function(a,b){return this.s(null,a,b)};k.Hb=function(a,b){return Oe.a(Yf,Hb(this.ja,b))};k.Ib=function(a,b,c){return Oe.a(Yf,Ib(this.ja,b,c))};k.Gb=function(a,b){return b};k.Fb=function(){return Kb(this.ja)};var eh=new ch(null,Ng,0);ch.prototype[Ea]=function(){return uc(this)};\nfunction fh(a){a=D(a);if(null==a)return bh;if(a instanceof F&&0===a.m){a=a.e;a:{for(var b=0,c=Ob(bh);;)if(b<a.length)var d=b+1,c=c.Sa(null,a[b]),b=d;else{a=c;break a}a=void 0}return a.Ta(null)}for(d=Ob(bh);;)if(null!=a)b=a.T(null),d=d.Sa(null,a.N(null)),a=b;else return d.Ta(null)}\nvar gh=function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){return A.c(Ra,eh,a)}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}(),hh=function(){function a(a,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 F(f,0)}return b.call(this,a,e)}function b(a,b){return A.c(Ra,new ch(null,Rg(a),0),b)}\na.i=1;a.f=function(a){var d=G(a);a=H(a);return b(d,a)};a.d=b;return a}();function Od(a){if(a&&(a.q&4096||a.lc))return a.name;if(\"string\"===typeof a)return a;throw Error([z(\"Doesn't support name: \"),z(a)].join(\"\"));}\nvar ih=function(){function a(a,b,c){return(a.b?a.b(b):a.call(null,b))>(a.b?a.b(c):a.call(null,c))?b:c}var b=null,c=function(){function a(b,d,h,l){var m=null;if(3<arguments.length){for(var m=0,p=Array(arguments.length-3);m<p.length;)p[m]=arguments[m+3],++m;m=new F(p,0)}return c.call(this,b,d,h,m)}function c(a,d,e,l){return A.c(function(c,d){return b.c(a,c,d)},b.c(a,d,e),l)}a.i=3;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=K(a);var l=G(a);a=H(a);return c(b,d,l,a)};a.d=c;return a}(),b=function(b,\ne,f,g){switch(arguments.length){case 2:return e;case 3:return a.call(this,b,e,f);default:var h=null;if(3<arguments.length){for(var h=0,l=Array(arguments.length-3);h<l.length;)l[h]=arguments[h+3],++h;h=new F(l,0)}return c.d(b,e,f,h)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=3;b.f=c.f;b.a=function(a,b){return b};b.c=a;b.d=c.d;return b}();function jh(a){this.e=a}jh.prototype.add=function(a){return this.e.push(a)};jh.prototype.size=function(){return this.e.length};\njh.prototype.clear=function(){return this.e=[]};\nvar kh=function(){function a(a,b,c){return new V(null,function(){var h=D(c);return h?M(Pe.a(a,h),d.c(a,b,Qe.a(b,h))):null},null,null)}function b(a,b){return d.c(a,a,b)}function c(a){return function(b){return function(c){return function(){function d(h,l){c.add(l);if(a===c.size()){var m=zf(c.e);c.clear();return b.a?b.a(h,m):b.call(null,h,m)}return h}function l(a){if(!t(0===c.e.length)){var d=zf(c.e);c.clear();a=Bc(b.a?b.a(a,d):b.call(null,a,d))}return b.b?b.b(a):b.call(null,a)}function m(){return b.l?\nb.l():b.call(null)}var p=null,p=function(a,b){switch(arguments.length){case 0:return m.call(this);case 1:return l.call(this,a);case 2:return d.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};p.l=m;p.b=l;p.a=d;return p}()}(new jh([]))}}var d=null,d=function(d,f,g){switch(arguments.length){case 1:return c.call(this,d);case 2:return b.call(this,d,f);case 3:return a.call(this,d,f,g)}throw Error(\"Invalid arity: \"+arguments.length);};d.b=c;d.a=b;d.c=a;return d}(),lh=function(){function a(a,\nb){return new V(null,function(){var f=D(b);if(f){var g;g=G(f);g=a.b?a.b(g):a.call(null,g);f=t(g)?M(G(f),c.a(a,H(f))):null}else f=null;return f},null,null)}function b(a){return function(b){return function(){function c(f,g){return t(a.b?a.b(g):a.call(null,g))?b.a?b.a(f,g):b.call(null,f,g):new yc(f)}function g(a){return b.b?b.b(a):b.call(null,a)}function h(){return b.l?b.l():b.call(null)}var l=null,l=function(a,b){switch(arguments.length){case 0:return h.call(this);case 1:return g.call(this,a);case 2:return c.call(this,\na,b)}throw Error(\"Invalid arity: \"+arguments.length);};l.l=h;l.b=g;l.a=c;return l}()}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}();function mh(a,b,c){return function(d){var e=Kb(a);d=Jb(a,d);e=e.a?e.a(d,c):e.call(null,d,c);return b.a?b.a(e,0):b.call(null,e,0)}}\nvar nh=function(){function a(a,b,c,g,h){var l=Ib(a,c,!0);if(t(l)){var m=R.c(l,0,null);return lh.a(mh(a,g,h),t(mh(a,b,c).call(null,m))?l:K(l))}return null}function b(a,b,c){var g=mh(a,b,c),h;a:{h=[Ad,Bd];var l=h.length;if(l<=Vf)for(var m=0,p=Ob(Uf);;)if(m<l)var q=m+1,p=Rb(p,h[m],null),m=q;else{h=new $g(null,Qb(p),null);break a}else for(m=0,p=Ob(bh);;)if(m<l)q=m+1,p=Pb(p,h[m]),m=q;else{h=Qb(p);break a}h=void 0}return t(h.call(null,b))?(a=Ib(a,c,!0),t(a)?(b=R.c(a,0,null),t(g.b?g.b(b):g.call(null,b))?\na:K(a)):null):lh.a(g,Hb(a,!0))}var c=null,c=function(c,e,f,g,h){switch(arguments.length){case 3:return b.call(this,c,e,f);case 5:return a.call(this,c,e,f,g,h)}throw Error(\"Invalid arity: \"+arguments.length);};c.c=b;c.r=a;return c}();function oh(a,b,c){this.m=a;this.end=b;this.step=c}oh.prototype.ga=function(){return 0<this.step?this.m<this.end:this.m>this.end};oh.prototype.next=function(){var a=this.m;this.m+=this.step;return a};\nfunction ph(a,b,c,d,e){this.k=a;this.start=b;this.end=c;this.step=d;this.p=e;this.j=32375006;this.q=8192}k=ph.prototype;k.toString=function(){return ec(this)};k.Q=function(a,b){if(b<Ma(this))return this.start+b*this.step;if(this.start>this.end&&0===this.step)return this.start;throw Error(\"Index out of bounds\");};k.$=function(a,b,c){return b<Ma(this)?this.start+b*this.step:this.start>this.end&&0===this.step?this.start:c};k.vb=!0;k.fb=function(){return new oh(this.start,this.end,this.step)};k.H=function(){return this.k};\nk.T=function(){return 0<this.step?this.start+this.step<this.end?new ph(this.k,this.start+this.step,this.end,this.step,null):null:this.start+this.step>this.end?new ph(this.k,this.start+this.step,this.end,this.step,null):null};k.L=function(){if(Aa(Cb(this)))return 0;var a=(this.end-this.start)/this.step;return Math.ceil.b?Math.ceil.b(a):Math.ceil.call(null,a)};k.B=function(){var a=this.p;return null!=a?a:this.p=a=wc(this)};k.A=function(a,b){return Ic(this,b)};k.J=function(){return O(J,this.k)};\nk.R=function(a,b){return Cc.a(this,b)};k.O=function(a,b,c){for(a=this.start;;)if(0<this.step?a<this.end:a>this.end){var d=a;c=b.a?b.a(c,d):b.call(null,c,d);if(Ac(c))return b=c,L.b?L.b(b):L.call(null,b);a+=this.step}else return c};k.N=function(){return null==Cb(this)?null:this.start};k.S=function(){return null!=Cb(this)?new ph(this.k,this.start+this.step,this.end,this.step,null):J};k.D=function(){return 0<this.step?this.start<this.end?this:null:this.start>this.end?this:null};\nk.F=function(a,b){return new ph(b,this.start,this.end,this.step,this.p)};k.G=function(a,b){return M(b,this)};ph.prototype[Ea]=function(){return uc(this)};\nvar qh=function(){function a(a,b,c){return new ph(null,a,b,c,null)}function b(a,b){return e.c(a,b,1)}function c(a){return e.c(0,a,1)}function d(){return e.c(0,Number.MAX_VALUE,1)}var e=null,e=function(e,g,h){switch(arguments.length){case 0:return d.call(this);case 1:return c.call(this,e);case 2:return b.call(this,e,g);case 3:return a.call(this,e,g,h)}throw Error(\"Invalid arity: \"+arguments.length);};e.l=d;e.b=c;e.a=b;e.c=a;return e}(),rh=function(){function a(a,b){return new V(null,function(){var f=\nD(b);return f?M(G(f),c.a(a,Qe.a(a,f))):null},null,null)}function b(a){return function(b){return function(c){return function(){function g(g,h){var l=c.bb(0,c.Ra(null)+1),m=Cd(l,a);return 0===l-a*m?b.a?b.a(g,h):b.call(null,g,h):g}function h(a){return b.b?b.b(a):b.call(null,a)}function l(){return b.l?b.l():b.call(null)}var m=null,m=function(a,b){switch(arguments.length){case 0:return l.call(this);case 1:return h.call(this,a);case 2:return g.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);\n};m.l=l;m.b=h;m.a=g;return m}()}(new Me(-1))}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),th=function(){function a(a,b){return new V(null,function(){var f=D(b);if(f){var g=G(f),h=a.b?a.b(g):a.call(null,g),g=M(g,lh.a(function(b,c){return function(b){return sc.a(c,a.b?a.b(b):a.call(null,b))}}(g,h,f,f),K(f)));return M(g,c.a(a,D(Qe.a(Q(g),f))))}return null},null,\nnull)}function b(a){return function(b){return function(c,g){return function(){function h(h,l){var m=L.b?L.b(g):L.call(null,g),p=a.b?a.b(l):a.call(null,l);ac(g,p);if(Nd(m,sh)||sc.a(p,m))return c.add(l),h;m=zf(c.e);c.clear();m=b.a?b.a(h,m):b.call(null,h,m);Ac(m)||c.add(l);return m}function l(a){if(!t(0===c.e.length)){var d=zf(c.e);c.clear();a=Bc(b.a?b.a(a,d):b.call(null,a,d))}return b.b?b.b(a):b.call(null,a)}function m(){return b.l?b.l():b.call(null)}var p=null,p=function(a,b){switch(arguments.length){case 0:return m.call(this);\ncase 1:return l.call(this,a);case 2:return h.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};p.l=m;p.b=l;p.a=h;return p}()}(new jh([]),new Me(sh))}}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),uh=function(){function a(a,b){for(;;)if(D(b)&&0<a){var c=a-1,g=K(b);a=c;b=g}else return null}function b(a){for(;;)if(D(a))a=K(a);else return null}var c=\nnull,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}(),vh=function(){function a(a,b){uh.a(a,b);return b}function b(a){uh.b(a);return a}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}();\nfunction wh(a,b,c,d,e,f,g){var h=ma;try{ma=null==ma?null:ma-1;if(null!=ma&&0>ma)return Lb(a,\"#\");Lb(a,c);if(D(g)){var l=G(g);b.c?b.c(l,a,f):b.call(null,l,a,f)}for(var m=K(g),p=za.b(f)-1;;)if(!m||null!=p&&0===p){D(m)&&0===p&&(Lb(a,d),Lb(a,\"...\"));break}else{Lb(a,d);var q=G(m);c=a;g=f;b.c?b.c(q,c,g):b.call(null,q,c,g);var s=K(m);c=p-1;m=s;p=c}return Lb(a,e)}finally{ma=h}}\nvar xh=function(){function a(a,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 F(f,0)}return b.call(this,a,e)}function b(a,b){for(var e=D(b),f=null,g=0,h=0;;)if(h<g){var l=f.Q(null,h);Lb(a,l);h+=1}else if(e=D(e))f=e,fd(f)?(e=Yb(f),g=Zb(f),f=e,l=Q(e),e=g,g=l):(l=G(f),Lb(a,l),e=K(f),f=null,g=0),h=0;else return null}a.i=1;a.f=function(a){var d=G(a);a=H(a);return b(d,a)};a.d=b;return a}(),yh={'\"':'\\\\\"',\"\\\\\":\"\\\\\\\\\",\"\\b\":\"\\\\b\",\"\\f\":\"\\\\f\",\n\"\\n\":\"\\\\n\",\"\\r\":\"\\\\r\",\"\\t\":\"\\\\t\"};function zh(a){return[z('\"'),z(a.replace(RegExp('[\\\\\\\\\"\\b\\f\\n\\r\\t]',\"g\"),function(a){return yh[a]})),z('\"')].join(\"\")}\nvar $=function Ah(b,c,d){if(null==b)return Lb(c,\"nil\");if(void 0===b)return Lb(c,\"#\\x3cundefined\\x3e\");t(function(){var c=S.a(d,wa);return t(c)?(c=b?b.j&131072||b.kc?!0:b.j?!1:w(rb,b):w(rb,b))?Vc(b):c:c}())&&(Lb(c,\"^\"),Ah(Vc(b),c,d),Lb(c,\" \"));if(null==b)return Lb(c,\"nil\");if(b.Yb)return b.nc(c);if(b&&(b.j&2147483648||b.I))return b.v(null,c,d);if(Ba(b)===Boolean||\"number\"===typeof b)return Lb(c,\"\"+z(b));if(null!=b&&b.constructor===Object){Lb(c,\"#js \");var e=Oe.a(function(c){return new W(null,2,5,\nuf,[Pd.b(c),b[c]],null)},gd(b));return Bh.n?Bh.n(e,Ah,c,d):Bh.call(null,e,Ah,c,d)}return b instanceof Array?wh(c,Ah,\"#js [\",\" \",\"]\",d,b):t(\"string\"==typeof b)?t(ua.b(d))?Lb(c,zh(b)):Lb(c,b):Tc(b)?xh.d(c,Kc([\"#\\x3c\",\"\"+z(b),\"\\x3e\"],0)):b instanceof Date?(e=function(b,c){for(var d=\"\"+z(b);;)if(Q(d)<c)d=[z(\"0\"),z(d)].join(\"\");else return d},xh.d(c,Kc(['#inst \"',\"\"+z(b.getUTCFullYear()),\"-\",e(b.getUTCMonth()+1,2),\"-\",e(b.getUTCDate(),2),\"T\",e(b.getUTCHours(),2),\":\",e(b.getUTCMinutes(),2),\":\",e(b.getUTCSeconds(),\n2),\".\",e(b.getUTCMilliseconds(),3),\"-\",'00:00\"'],0))):b instanceof RegExp?xh.d(c,Kc(['#\"',b.source,'\"'],0)):(b?b.j&2147483648||b.I||(b.j?0:w(Mb,b)):w(Mb,b))?Nb(b,c,d):xh.d(c,Kc([\"#\\x3c\",\"\"+z(b),\"\\x3e\"],0))},Ch=function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){var b=oa();if(Yc(a))b=\"\";else{var e=z,f=new fa;a:{var g=new dc(f);$(G(a),g,b);a=D(K(a));for(var h=null,l=0,\nm=0;;)if(m<l){var p=h.Q(null,m);Lb(g,\" \");$(p,g,b);m+=1}else if(a=D(a))h=a,fd(h)?(a=Yb(h),l=Zb(h),h=a,p=Q(a),a=l,l=p):(p=G(h),Lb(g,\" \"),$(p,g,b),a=K(h),h=null,l=0),m=0;else break a}b=\"\"+e(f)}return b}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}();function Bh(a,b,c,d){return wh(c,function(a,c,d){var h=hb(a);b.c?b.c(h,c,d):b.call(null,h,c,d);Lb(c,\" \");a=ib(a);return b.c?b.c(a,c,d):b.call(null,a,c,d)},\"{\",\", \",\"}\",d,D(a))}Me.prototype.I=!0;\nMe.prototype.v=function(a,b,c){Lb(b,\"#\\x3cVolatile: \");$(this.state,b,c);return Lb(b,\"\\x3e\")};F.prototype.I=!0;F.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};V.prototype.I=!0;V.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};wg.prototype.I=!0;wg.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};pg.prototype.I=!0;pg.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Z.prototype.I=!0;\nZ.prototype.v=function(a,b,c){return wh(b,$,\"[\",\" \",\"]\",c,this)};Rf.prototype.I=!0;Rf.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};ch.prototype.I=!0;ch.prototype.v=function(a,b,c){return wh(b,$,\"#{\",\" \",\"}\",c,this)};Bf.prototype.I=!0;Bf.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Ld.prototype.I=!0;Ld.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Hc.prototype.I=!0;Hc.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};\nrg.prototype.I=!0;rg.prototype.v=function(a,b,c){return Bh(this,$,b,c)};qg.prototype.I=!0;qg.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Df.prototype.I=!0;Df.prototype.v=function(a,b,c){return wh(b,$,\"[\",\" \",\"]\",c,this)};Lg.prototype.I=!0;Lg.prototype.v=function(a,b,c){return Bh(this,$,b,c)};$g.prototype.I=!0;$g.prototype.v=function(a,b,c){return wh(b,$,\"#{\",\" \",\"}\",c,this)};Vd.prototype.I=!0;Vd.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Ug.prototype.I=!0;\nUg.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};X.prototype.I=!0;X.prototype.v=function(a,b,c){return wh(b,$,\"[\",\" \",\"]\",c,this)};W.prototype.I=!0;W.prototype.v=function(a,b,c){return wh(b,$,\"[\",\" \",\"]\",c,this)};Kf.prototype.I=!0;Kf.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Hd.prototype.I=!0;Hd.prototype.v=function(a,b){return Lb(b,\"()\")};ze.prototype.I=!0;ze.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Lf.prototype.I=!0;\nLf.prototype.v=function(a,b,c){return wh(b,$,\"#queue [\",\" \",\"]\",c,D(this))};pa.prototype.I=!0;pa.prototype.v=function(a,b,c){return Bh(this,$,b,c)};ph.prototype.I=!0;ph.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Sg.prototype.I=!0;Sg.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Fd.prototype.I=!0;Fd.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};W.prototype.sb=!0;W.prototype.tb=function(a,b){return pd.a(this,b)};Df.prototype.sb=!0;\nDf.prototype.tb=function(a,b){return pd.a(this,b)};U.prototype.sb=!0;U.prototype.tb=function(a,b){return Md(this,b)};qc.prototype.sb=!0;qc.prototype.tb=function(a,b){return pc(this,b)};var Dh=function(){function a(a,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 F(g,0)}return b.call(this,a,d,f)}function b(a,b,e){return a.k=T.c(b,a.k,e)}a.i=2;a.f=function(a){var d=G(a);a=K(a);var e=G(a);a=H(a);return b(d,e,a)};a.d=b;return a}();\nfunction Eh(a){return function(b,c){var d=a.a?a.a(b,c):a.call(null,b,c);return Ac(d)?new yc(d):d}}\nfunction Ve(a){return function(b){return function(){function c(a,c){return A.c(b,a,c)}function d(b){return a.b?a.b(b):a.call(null,b)}function e(){return a.l?a.l():a.call(null)}var f=null,f=function(a,b){switch(arguments.length){case 0:return e.call(this);case 1:return d.call(this,a);case 2:return c.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);};f.l=e;f.b=d;f.a=c;return f}()}(Eh(a))}\nvar Fh=function(){function a(a){return Ce.a(c.l(),a)}function b(){return function(a){return function(b){return function(){function c(f,g){var h=L.b?L.b(b):L.call(null,b);ac(b,g);return sc.a(h,g)?f:a.a?a.a(f,g):a.call(null,f,g)}function g(b){return a.b?a.b(b):a.call(null,b)}function h(){return a.l?a.l():a.call(null)}var l=null,l=function(a,b){switch(arguments.length){case 0:return h.call(this);case 1:return g.call(this,a);case 2:return c.call(this,a,b)}throw Error(\"Invalid arity: \"+arguments.length);\n};l.l=h;l.b=g;l.a=c;return l}()}(new Me(sh))}}var c=null,c=function(c){switch(arguments.length){case 0:return b.call(this);case 1:return a.call(this,c)}throw Error(\"Invalid arity: \"+arguments.length);};c.l=b;c.b=a;return c}();function Gh(a,b){this.fa=a;this.Zb=b;this.q=0;this.j=2173173760}Gh.prototype.v=function(a,b,c){return wh(b,$,\"(\",\" \",\")\",c,this)};Gh.prototype.O=function(a,b,c){return wd.n(this.fa,b,c,this.Zb)};Gh.prototype.D=function(){return D(Ce.a(this.fa,this.Zb))};Gh.prototype[Ea]=function(){return uc(this)};\nvar Hh={};function Ih(a){if(a?a.gc:a)return a.gc(a);var b;b=Ih[n(null==a?null:a)];if(!b&&(b=Ih._,!b))throw x(\"IEncodeJS.-clj-\\x3ejs\",a);return b.call(null,a)}function Jh(a){return(a?t(t(null)?null:a.fc)||(a.yb?0:w(Hh,a)):w(Hh,a))?Ih(a):\"string\"===typeof a||\"number\"===typeof a||a instanceof U||a instanceof qc?Kh.b?Kh.b(a):Kh.call(null,a):Ch.d(Kc([a],0))}\nvar Kh=function Lh(b){if(null==b)return null;if(b?t(t(null)?null:b.fc)||(b.yb?0:w(Hh,b)):w(Hh,b))return Ih(b);if(b instanceof U)return Od(b);if(b instanceof qc)return\"\"+z(b);if(dd(b)){var c={};b=D(b);for(var d=null,e=0,f=0;;)if(f<e){var g=d.Q(null,f),h=R.c(g,0,null),g=R.c(g,1,null);c[Jh(h)]=Lh(g);f+=1}else if(b=D(b))fd(b)?(e=Yb(b),b=Zb(b),d=e,e=Q(e)):(e=G(b),d=R.c(e,0,null),e=R.c(e,1,null),c[Jh(d)]=Lh(e),b=K(b),d=null,e=0),f=0;else break;return c}if($c(b)){c=[];b=D(Oe.a(Lh,b));d=null;for(f=e=0;;)if(f<\ne)h=d.Q(null,f),c.push(h),f+=1;else if(b=D(b))d=b,fd(d)?(b=Yb(d),f=Zb(d),d=b,e=Q(b),b=f):(b=G(d),c.push(b),b=K(d),d=null,e=0),f=0;else break;return c}return b},Mh={};function Nh(a,b){if(a?a.ec:a)return a.ec(a,b);var c;c=Nh[n(null==a?null:a)];if(!c&&(c=Nh._,!c))throw x(\"IEncodeClojure.-js-\\x3eclj\",a);return c.call(null,a,b)}\nvar Ph=function(){function a(a){return b.d(a,Kc([new pa(null,1,[Oh,!1],null)],0))}var b=null,c=function(){function a(c,d){var h=null;if(1<arguments.length){for(var h=0,l=Array(arguments.length-1);h<l.length;)l[h]=arguments[h+1],++h;h=new F(l,0)}return b.call(this,c,h)}function b(a,c){var d=kd(c)?T.a(Og,c):c,e=S.a(d,Oh);return function(a,b,d,e){return function v(f){return(f?t(t(null)?null:f.uc)||(f.yb?0:w(Mh,f)):w(Mh,f))?Nh(f,T.a(Pg,c)):kd(f)?vh.b(Oe.a(v,f)):$c(f)?af.a(Oc(f),Oe.a(v,f)):f instanceof\nArray?zf(Oe.a(v,f)):Ba(f)===Object?af.a(Uf,function(){return function(a,b,c,d){return function Pa(e){return new V(null,function(a,b,c,d){return function(){for(;;){var a=D(e);if(a){if(fd(a)){var b=Yb(a),c=Q(b),g=Td(c);return function(){for(var a=0;;)if(a<c){var e=C.a(b,a),h=g,l=uf,m;m=e;m=d.b?d.b(m):d.call(null,m);e=new W(null,2,5,l,[m,v(f[e])],null);h.add(e);a+=1}else return!0}()?Wd(g.ca(),Pa(Zb(a))):Wd(g.ca(),null)}var h=G(a);return M(new W(null,2,5,uf,[function(){var a=h;return d.b?d.b(a):d.call(null,\na)}(),v(f[h])],null),Pa(H(a)))}return null}}}(a,b,c,d),null,null)}}(a,b,d,e)(gd(f))}()):f}}(c,d,e,t(e)?Pd:z)(a)}a.i=1;a.f=function(a){var c=G(a);a=H(a);return b(c,a)};a.d=b;return a}(),b=function(b,e){switch(arguments.length){case 1:return a.call(this,b);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 F(g,0)}return c.d(b,f)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=1;b.f=c.f;b.b=a;b.d=c.d;return b}();var wa=new U(null,\"meta\",\"meta\",1499536964),ya=new U(null,\"dup\",\"dup\",556298533),sh=new U(\"cljs.core\",\"none\",\"cljs.core/none\",926646439),pe=new U(null,\"file\",\"file\",-1269645878),le=new U(null,\"end-column\",\"end-column\",1425389514),sa=new U(null,\"flush-on-newline\",\"flush-on-newline\",-151457939),ne=new U(null,\"column\",\"column\",2078222095),ua=new U(null,\"readably\",\"readably\",1129599760),oe=new U(null,\"line\",\"line\",212345235),za=new U(null,\"print-length\",\"print-length\",1931866356),me=new U(null,\"end-line\",\n\"end-line\",1837326455),Oh=new U(null,\"keywordize-keys\",\"keywordize-keys\",1310784252),Zg=new U(\"cljs.core\",\"not-found\",\"cljs.core/not-found\",-1572889185);function Qh(a,b){var c=T.c(ih,a,b);return M(c,Ye.a(function(a){return function(b){return a===b}}(c),b))}\nvar Rh=function(){function a(a,b){return Q(a)<Q(b)?A.c(Nc,b,a):A.c(Nc,a,b)}var b=null,c=function(){function a(c,d,h){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 F(m,0)}return b.call(this,c,d,l)}function b(a,c,d){a=Qh(Q,Nc.d(d,c,Kc([a],0)));return A.c(af,G(a),H(a))}a.i=2;a.f=function(a){var c=G(a);a=K(a);var d=G(a);a=H(a);return b(c,d,a)};a.d=b;return a}(),b=function(b,e,f){switch(arguments.length){case 0:return bh;case 1:return b;\ncase 2:return a.call(this,b,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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.l=function(){return bh};b.b=function(a){return a};b.a=a;b.d=c.d;return b}(),Sh=function(){function a(a,b){for(;;)if(Q(b)<Q(a)){var c=a;a=b;b=c}else return A.c(function(a,b){return function(a,c){return nd(b,c)?a:Xc.a(a,c)}}(a,b),a,a)}var b=null,c=function(){function a(b,\nd,h){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 F(m,0)}return c.call(this,b,d,l)}function c(a,d,e){a=Qh(function(a){return-Q(a)},Nc.d(e,d,Kc([a],0)));return A.c(b,G(a),H(a))}a.i=2;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=H(a);return c(b,d,a)};a.d=c;return a}(),b=function(b,e,f){switch(arguments.length){case 1:return b;case 2:return a.call(this,b,e);default:var g=null;if(2<arguments.length){for(var g=0,h=Array(arguments.length-\n2);g<h.length;)h[g]=arguments[g+2],++g;g=new F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.b=function(a){return a};b.a=a;b.d=c.d;return b}(),Th=function(){function a(a,b){return Q(a)<Q(b)?A.c(function(a,c){return nd(b,c)?Xc.a(a,c):a},a,a):A.c(Xc,a,b)}var b=null,c=function(){function a(b,d,h){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 F(m,0)}return c.call(this,b,d,l)}function c(a,d,\ne){return A.c(b,a,Nc.a(e,d))}a.i=2;a.f=function(a){var b=G(a);a=K(a);var d=G(a);a=H(a);return c(b,d,a)};a.d=c;return a}(),b=function(b,e,f){switch(arguments.length){case 1:return b;case 2:return a.call(this,b,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 F(h,0)}return c.d(b,e,g)}throw Error(\"Invalid arity: \"+arguments.length);};b.i=2;b.f=c.f;b.b=function(a){return a};b.a=a;b.d=c.d;return b}();\nfunction Uh(a,b){return A.c(function(b,d){var e=R.c(d,0,null),f=R.c(d,1,null);return nd(a,e)?Rc.c(b,f,S.a(a,e)):b},T.c(Sc,a,Tg(b)),b)}function Vh(a,b){return A.c(function(a,d){var e=Yg(d,b);return Rc.c(a,e,Nc.a(S.c(a,e,bh),d))},Uf,a)}function Wh(a){return A.c(function(a,c){var d=R.c(c,0,null),e=R.c(c,1,null);return Rc.c(a,e,d)},Uf,a)}\nvar Xh=function(){function a(a,b,c){a=Q(a)<=Q(b)?new W(null,3,5,uf,[a,b,Wh(c)],null):new W(null,3,5,uf,[b,a,c],null);b=R.c(a,0,null);c=R.c(a,1,null);var g=R.c(a,2,null),h=Vh(b,Vg(g));return A.c(function(a,b,c,d,e){return function(f,g){var h=function(){var a=Uh(Yg(g,Tg(d)),d);return e.b?e.b(a):e.call(null,a)}();return t(h)?A.c(function(){return function(a,b){return Nc.a(a,Wg.d(Kc([b,g],0)))}}(h,a,b,c,d,e),f,h):f}}(a,b,c,g,h),bh,c)}function b(a,b){if(D(a)&&D(b)){var c=Sh.a(fh(Tg(G(a))),fh(Tg(G(b)))),\ng=Q(a)<=Q(b)?new W(null,2,5,uf,[a,b],null):new W(null,2,5,uf,[b,a],null),h=R.c(g,0,null),l=R.c(g,1,null),m=Vh(h,c);return A.c(function(a,b,c,d,e){return function(f,g){var h=function(){var b=Yg(g,a);return e.b?e.b(b):e.call(null,b)}();return t(h)?A.c(function(){return function(a,b){return Nc.a(a,Wg.d(Kc([b,g],0)))}}(h,a,b,c,d,e),f,h):f}}(c,g,h,l,m),bh,l)}return bh}var c=null,c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,c,e);case 3:return a.call(this,c,e,f)}throw Error(\"Invalid arity: \"+\narguments.length);};c.a=b;c.c=a;return c}();r(\"mori.apply\",T);r(\"mori.apply.f2\",T.a);r(\"mori.apply.f3\",T.c);r(\"mori.apply.f4\",T.n);r(\"mori.apply.f5\",T.r);r(\"mori.apply.fn\",T.K);r(\"mori.count\",Q);r(\"mori.distinct\",function(a){return function c(a,e){return new V(null,function(){return function(a,d){for(;;){var e=a,l=R.c(e,0,null);if(e=D(e))if(nd(d,l))l=H(e),e=d,a=l,d=e;else return M(l,c(H(e),Nc.a(d,l)));else return null}}.call(null,a,e)},null,null)}(a,bh)});r(\"mori.empty\",Oc);r(\"mori.first\",G);r(\"mori.second\",Lc);r(\"mori.next\",K);\nr(\"mori.rest\",H);r(\"mori.seq\",D);r(\"mori.conj\",Nc);r(\"mori.conj.f0\",Nc.l);r(\"mori.conj.f1\",Nc.b);r(\"mori.conj.f2\",Nc.a);r(\"mori.conj.fn\",Nc.K);r(\"mori.cons\",M);r(\"mori.find\",function(a,b){return null!=a&&bd(a)&&nd(a,b)?new W(null,2,5,uf,[b,S.a(a,b)],null):null});r(\"mori.nth\",R);r(\"mori.nth.f2\",R.a);r(\"mori.nth.f3\",R.c);r(\"mori.last\",function(a){for(;;){var b=K(a);if(null!=b)a=b;else return G(a)}});r(\"mori.assoc\",Rc);r(\"mori.assoc.f3\",Rc.c);r(\"mori.assoc.fn\",Rc.K);r(\"mori.dissoc\",Sc);\nr(\"mori.dissoc.f1\",Sc.b);r(\"mori.dissoc.f2\",Sc.a);r(\"mori.dissoc.fn\",Sc.K);r(\"mori.getIn\",cf);r(\"mori.getIn.f2\",cf.a);r(\"mori.getIn.f3\",cf.c);r(\"mori.updateIn\",df);r(\"mori.updateIn.f3\",df.c);r(\"mori.updateIn.f4\",df.n);r(\"mori.updateIn.f5\",df.r);r(\"mori.updateIn.f6\",df.P);r(\"mori.updateIn.fn\",df.K);r(\"mori.assocIn\",function Yh(b,c,d){var e=R.c(c,0,null);return(c=Ed(c))?Rc.c(b,e,Yh(S.a(b,e),c,d)):Rc.c(b,e,d)});r(\"mori.fnil\",Ke);r(\"mori.fnil.f2\",Ke.a);r(\"mori.fnil.f3\",Ke.c);r(\"mori.fnil.f4\",Ke.n);\nr(\"mori.disj\",Xc);r(\"mori.disj.f1\",Xc.b);r(\"mori.disj.f2\",Xc.a);r(\"mori.disj.fn\",Xc.K);r(\"mori.pop\",function(a){return null==a?null:mb(a)});r(\"mori.peek\",Wc);r(\"mori.hash\",nc);r(\"mori.get\",S);r(\"mori.get.f2\",S.a);r(\"mori.get.f3\",S.c);r(\"mori.hasKey\",nd);r(\"mori.isEmpty\",Yc);r(\"mori.reverse\",Jd);r(\"mori.take\",Pe);r(\"mori.take.f1\",Pe.b);r(\"mori.take.f2\",Pe.a);r(\"mori.drop\",Qe);r(\"mori.drop.f1\",Qe.b);r(\"mori.drop.f2\",Qe.a);r(\"mori.takeNth\",rh);r(\"mori.takeNth.f1\",rh.b);r(\"mori.takeNth.f2\",rh.a);\nr(\"mori.partition\",bf);r(\"mori.partition.f2\",bf.a);r(\"mori.partition.f3\",bf.c);r(\"mori.partition.f4\",bf.n);r(\"mori.partitionAll\",kh);r(\"mori.partitionAll.f1\",kh.b);r(\"mori.partitionAll.f2\",kh.a);r(\"mori.partitionAll.f3\",kh.c);r(\"mori.partitionBy\",th);r(\"mori.partitionBy.f1\",th.b);r(\"mori.partitionBy.f2\",th.a);r(\"mori.iterate\",function Zh(b,c){return M(c,new V(null,function(){return Zh(b,b.b?b.b(c):b.call(null,c))},null,null))});r(\"mori.into\",af);r(\"mori.into.f2\",af.a);r(\"mori.into.f3\",af.c);\nr(\"mori.merge\",Wg);r(\"mori.mergeWith\",Xg);r(\"mori.subvec\",Cf);r(\"mori.subvec.f2\",Cf.a);r(\"mori.subvec.f3\",Cf.c);r(\"mori.takeWhile\",lh);r(\"mori.takeWhile.f1\",lh.b);r(\"mori.takeWhile.f2\",lh.a);r(\"mori.dropWhile\",Re);r(\"mori.dropWhile.f1\",Re.b);r(\"mori.dropWhile.f2\",Re.a);r(\"mori.groupBy\",function(a,b){return ce(A.c(function(b,d){var e=a.b?a.b(d):a.call(null,d);return ee.c(b,e,Nc.a(S.c(b,e,Mc),d))},Ob(Uf),b))});r(\"mori.interpose\",function(a,b){return Qe.a(1,Ue.a(Se.b(a),b))});r(\"mori.interleave\",Ue);\nr(\"mori.interleave.f2\",Ue.a);r(\"mori.interleave.fn\",Ue.K);r(\"mori.concat\",ae);r(\"mori.concat.f0\",ae.l);r(\"mori.concat.f1\",ae.b);r(\"mori.concat.f2\",ae.a);r(\"mori.concat.fn\",ae.K);function $e(a){return a instanceof Array||cd(a)}r(\"mori.flatten\",function(a){return Xe.a(function(a){return!$e(a)},H(Ze(a)))});r(\"mori.lazySeq\",function(a){return new V(null,a,null,null)});r(\"mori.keys\",Tg);r(\"mori.selectKeys\",Yg);r(\"mori.vals\",Vg);r(\"mori.primSeq\",Jc);r(\"mori.primSeq.f1\",Jc.b);r(\"mori.primSeq.f2\",Jc.a);\nr(\"mori.map\",Oe);r(\"mori.map.f1\",Oe.b);r(\"mori.map.f2\",Oe.a);r(\"mori.map.f3\",Oe.c);r(\"mori.map.f4\",Oe.n);r(\"mori.map.fn\",Oe.K);\nr(\"mori.mapIndexed\",function(a,b){return function d(b,f){return new V(null,function(){var g=D(f);if(g){if(fd(g)){for(var h=Yb(g),l=Q(h),m=Td(l),p=0;;)if(p<l)Xd(m,function(){var d=b+p,f=C.a(h,p);return a.a?a.a(d,f):a.call(null,d,f)}()),p+=1;else break;return Wd(m.ca(),d(b+l,Zb(g)))}return M(function(){var d=G(g);return a.a?a.a(b,d):a.call(null,b,d)}(),d(b+1,H(g)))}return null},null,null)}(0,b)});r(\"mori.mapcat\",We);r(\"mori.mapcat.f1\",We.b);r(\"mori.mapcat.fn\",We.K);r(\"mori.reduce\",A);\nr(\"mori.reduce.f2\",A.a);r(\"mori.reduce.f3\",A.c);r(\"mori.reduceKV\",function(a,b,c){return null!=c?xb(c,a,b):b});r(\"mori.keep\",Le);r(\"mori.keep.f1\",Le.b);r(\"mori.keep.f2\",Le.a);r(\"mori.keepIndexed\",Ne);r(\"mori.keepIndexed.f1\",Ne.b);r(\"mori.keepIndexed.f2\",Ne.a);r(\"mori.filter\",Xe);r(\"mori.filter.f1\",Xe.b);r(\"mori.filter.f2\",Xe.a);r(\"mori.remove\",Ye);r(\"mori.remove.f1\",Ye.b);r(\"mori.remove.f2\",Ye.a);r(\"mori.some\",Fe);r(\"mori.every\",Ee);r(\"mori.equals\",sc);r(\"mori.equals.f1\",sc.b);\nr(\"mori.equals.f2\",sc.a);r(\"mori.equals.fn\",sc.K);r(\"mori.range\",qh);r(\"mori.range.f0\",qh.l);r(\"mori.range.f1\",qh.b);r(\"mori.range.f2\",qh.a);r(\"mori.range.f3\",qh.c);r(\"mori.repeat\",Se);r(\"mori.repeat.f1\",Se.b);r(\"mori.repeat.f2\",Se.a);r(\"mori.repeatedly\",Te);r(\"mori.repeatedly.f1\",Te.b);r(\"mori.repeatedly.f2\",Te.a);r(\"mori.sort\",sd);r(\"mori.sort.f1\",sd.b);r(\"mori.sort.f2\",sd.a);r(\"mori.sortBy\",td);r(\"mori.sortBy.f2\",td.a);r(\"mori.sortBy.f3\",td.c);r(\"mori.intoArray\",Ia);r(\"mori.intoArray.f1\",Ia.b);\nr(\"mori.intoArray.f2\",Ia.a);r(\"mori.subseq\",nh);r(\"mori.subseq.f3\",nh.c);r(\"mori.subseq.f5\",nh.r);r(\"mori.dedupe\",Fh);r(\"mori.dedupe.f0\",Fh.l);r(\"mori.dedupe.f1\",Fh.b);r(\"mori.transduce\",wd);r(\"mori.transduce.f3\",wd.c);r(\"mori.transduce.f4\",wd.n);r(\"mori.eduction\",function(a,b){return new Gh(a,b)});r(\"mori.sequence\",Ce);r(\"mori.sequence.f1\",Ce.b);r(\"mori.sequence.f2\",Ce.a);r(\"mori.sequence.fn\",Ce.K);r(\"mori.completing\",vd);r(\"mori.completing.f1\",vd.b);r(\"mori.completing.f2\",vd.a);r(\"mori.list\",Kd);\nr(\"mori.vector\",Af);r(\"mori.hashMap\",Pg);r(\"mori.set\",fh);r(\"mori.sortedSet\",gh);r(\"mori.sortedSetBy\",hh);r(\"mori.sortedMap\",Qg);r(\"mori.sortedMapBy\",Rg);r(\"mori.queue\",function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){return af.a?af.a(Mf,a):af.call(null,Mf,a)}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}());r(\"mori.keyword\",Pd);r(\"mori.keyword.f1\",Pd.b);\nr(\"mori.keyword.f2\",Pd.a);r(\"mori.symbol\",rc);r(\"mori.symbol.f1\",rc.b);r(\"mori.symbol.f2\",rc.a);r(\"mori.zipmap\",function(a,b){for(var c=Ob(Uf),d=D(a),e=D(b);;)if(d&&e)c=ee.c(c,G(d),G(e)),d=K(d),e=K(e);else return Qb(c)});r(\"mori.isList\",function(a){return a?a.j&33554432||a.wc?!0:a.j?!1:w(Eb,a):w(Eb,a)});r(\"mori.isSeq\",kd);r(\"mori.isVector\",ed);r(\"mori.isMap\",dd);r(\"mori.isSet\",ad);r(\"mori.isKeyword\",function(a){return a instanceof U});r(\"mori.isSymbol\",function(a){return a instanceof qc});\nr(\"mori.isCollection\",$c);r(\"mori.isSequential\",cd);r(\"mori.isAssociative\",bd);r(\"mori.isCounted\",Ec);r(\"mori.isIndexed\",Fc);r(\"mori.isReduceable\",function(a){return a?a.j&524288||a.Sb?!0:a.j?!1:w(vb,a):w(vb,a)});r(\"mori.isSeqable\",ld);r(\"mori.isReversible\",Id);r(\"mori.union\",Rh);r(\"mori.union.f0\",Rh.l);r(\"mori.union.f1\",Rh.b);r(\"mori.union.f2\",Rh.a);r(\"mori.union.fn\",Rh.K);r(\"mori.intersection\",Sh);r(\"mori.intersection.f1\",Sh.b);r(\"mori.intersection.f2\",Sh.a);r(\"mori.intersection.fn\",Sh.K);\nr(\"mori.difference\",Th);r(\"mori.difference.f1\",Th.b);r(\"mori.difference.f2\",Th.a);r(\"mori.difference.fn\",Th.K);r(\"mori.join\",Xh);r(\"mori.join.f2\",Xh.a);r(\"mori.join.f3\",Xh.c);r(\"mori.index\",Vh);r(\"mori.project\",function(a,b){return fh(Oe.a(function(a){return Yg(a,b)},a))});r(\"mori.mapInvert\",Wh);r(\"mori.rename\",function(a,b){return fh(Oe.a(function(a){return Uh(a,b)},a))});r(\"mori.renameKeys\",Uh);r(\"mori.isSubset\",function(a,b){return Q(a)<=Q(b)&&Ee(function(a){return nd(b,a)},a)});\nr(\"mori.isSuperset\",function(a,b){return Q(a)>=Q(b)&&Ee(function(b){return nd(a,b)},b)});r(\"mori.notEquals\",je);r(\"mori.notEquals.f1\",je.b);r(\"mori.notEquals.f2\",je.a);r(\"mori.notEquals.fn\",je.K);r(\"mori.gt\",Ad);r(\"mori.gt.f1\",Ad.b);r(\"mori.gt.f2\",Ad.a);r(\"mori.gt.fn\",Ad.K);r(\"mori.gte\",Bd);r(\"mori.gte.f1\",Bd.b);r(\"mori.gte.f2\",Bd.a);r(\"mori.gte.fn\",Bd.K);r(\"mori.lt\",yd);r(\"mori.lt.f1\",yd.b);r(\"mori.lt.f2\",yd.a);r(\"mori.lt.fn\",yd.K);r(\"mori.lte\",zd);r(\"mori.lte.f1\",zd.b);r(\"mori.lte.f2\",zd.a);\nr(\"mori.lte.fn\",zd.K);r(\"mori.compare\",od);r(\"mori.partial\",Je);r(\"mori.partial.f1\",Je.b);r(\"mori.partial.f2\",Je.a);r(\"mori.partial.f3\",Je.c);r(\"mori.partial.f4\",Je.n);r(\"mori.partial.fn\",Je.K);r(\"mori.comp\",Ie);r(\"mori.comp.f0\",Ie.l);r(\"mori.comp.f1\",Ie.b);r(\"mori.comp.f2\",Ie.a);r(\"mori.comp.f3\",Ie.c);r(\"mori.comp.fn\",Ie.K);\nr(\"mori.pipeline\",function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){function b(a,c){return c.b?c.b(a):c.call(null,a)}return A.a?A.a(b,a):A.call(null,b,a)}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}());\nr(\"mori.curry\",function(){function a(a,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 F(f,0)}return b.call(this,a,e)}function b(a,b){return function(e){return T.a(a,M.a?M.a(e,b):M.call(null,e,b))}}a.i=1;a.f=function(a){var d=G(a);a=H(a);return b(d,a)};a.d=b;return a}());\nr(\"mori.juxt\",function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){return function(){function b(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 F(d,0)}return e.call(this,c)}function e(b){var d=function(){function d(a){return T.a(a,b)}return Oe.a?Oe.a(d,a):Oe.call(null,d,a)}();return Ia.b?Ia.b(d):Ia.call(null,\nd)}b.i=0;b.f=function(a){a=D(a);return e(a)};b.d=e;return b}()}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}());\nr(\"mori.knit\",function(){function a(a){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 F(e,0)}return b.call(this,d)}function b(a){return function(b){var e=function(){function e(a,b){return a.b?a.b(b):a.call(null,b)}return Oe.c?Oe.c(e,a,b):Oe.call(null,e,a,b)}();return Ia.b?Ia.b(e):Ia.call(null,e)}}a.i=0;a.f=function(a){a=D(a);return b(a)};a.d=b;return a}());r(\"mori.sum\",xd);r(\"mori.sum.f0\",xd.l);r(\"mori.sum.f1\",xd.b);\nr(\"mori.sum.f2\",xd.a);r(\"mori.sum.fn\",xd.K);r(\"mori.inc\",function(a){return a+1});r(\"mori.dec\",function(a){return a-1});r(\"mori.isEven\",Ge);r(\"mori.isOdd\",function(a){return!Ge(a)});r(\"mori.each\",function(a,b){for(var c=D(a),d=null,e=0,f=0;;)if(f<e){var g=d.Q(null,f);b.b?b.b(g):b.call(null,g);f+=1}else if(c=D(c))fd(c)?(e=Yb(c),c=Zb(c),d=e,e=Q(e)):(d=g=G(c),b.b?b.b(d):b.call(null,d),c=K(c),d=null,e=0),f=0;else return null});r(\"mori.identity\",ud);\nr(\"mori.constantly\",function(a){return function(){function b(b){if(0<arguments.length)for(var d=0,e=Array(arguments.length-0);d<e.length;)e[d]=arguments[d+0],++d;return a}b.i=0;b.f=function(b){D(b);return a};b.d=function(){return a};return b}()});r(\"mori.toJs\",Kh);\nr(\"mori.toClj\",function(){function a(a,b){return Ph.d(a,Kc([Oh,b],0))}function b(a){return Ph.b(a)}var c=null,c=function(c,e){switch(arguments.length){case 1:return b.call(this,c);case 2:return a.call(this,c,e)}throw Error(\"Invalid arity: \"+arguments.length);};c.b=b;c.a=a;return c}());r(\"mori.configure\",function(a,b){switch(a){case \"print-length\":return la=b;case \"print-level\":return ma=b;default:throw Error([z(\"No matching clause: \"),z(a)].join(\"\"));}});r(\"mori.meta\",Vc);r(\"mori.withMeta\",O);\nr(\"mori.varyMeta\",ie);r(\"mori.varyMeta.f2\",ie.a);r(\"mori.varyMeta.f3\",ie.c);r(\"mori.varyMeta.f4\",ie.n);r(\"mori.varyMeta.f5\",ie.r);r(\"mori.varyMeta.f6\",ie.P);r(\"mori.varyMeta.fn\",ie.K);r(\"mori.alterMeta\",Dh);r(\"mori.resetMeta\",function(a,b){return a.k=b});V.prototype.inspect=function(){return this.toString()};F.prototype.inspect=function(){return this.toString()};Hc.prototype.inspect=function(){return this.toString()};wg.prototype.inspect=function(){return this.toString()};pg.prototype.inspect=function(){return this.toString()};\nqg.prototype.inspect=function(){return this.toString()};Fd.prototype.inspect=function(){return this.toString()};Ld.prototype.inspect=function(){return this.toString()};Hd.prototype.inspect=function(){return this.toString()};W.prototype.inspect=function(){return this.toString()};Vd.prototype.inspect=function(){return this.toString()};Bf.prototype.inspect=function(){return this.toString()};Df.prototype.inspect=function(){return this.toString()};Z.prototype.inspect=function(){return this.toString()};\nX.prototype.inspect=function(){return this.toString()};pa.prototype.inspect=function(){return this.toString()};rg.prototype.inspect=function(){return this.toString()};Lg.prototype.inspect=function(){return this.toString()};$g.prototype.inspect=function(){return this.toString()};ch.prototype.inspect=function(){return this.toString()};ph.prototype.inspect=function(){return this.toString()};U.prototype.inspect=function(){return this.toString()};qc.prototype.inspect=function(){return this.toString()};\nLf.prototype.inspect=function(){return this.toString()};Kf.prototype.inspect=function(){return this.toString()};r(\"mori.mutable.thaw\",function(a){return Ob(a)});r(\"mori.mutable.freeze\",ce);r(\"mori.mutable.conj\",de);r(\"mori.mutable.conj.f0\",de.l);r(\"mori.mutable.conj.f1\",de.b);r(\"mori.mutable.conj.f2\",de.a);r(\"mori.mutable.conj.fn\",de.K);r(\"mori.mutable.assoc\",ee);r(\"mori.mutable.assoc.f3\",ee.c);r(\"mori.mutable.assoc.fn\",ee.K);r(\"mori.mutable.dissoc\",fe);r(\"mori.mutable.dissoc.f2\",fe.a);r(\"mori.mutable.dissoc.fn\",fe.K);r(\"mori.mutable.pop\",function(a){return Ub(a)});r(\"mori.mutable.disj\",ge);\nr(\"mori.mutable.disj.f2\",ge.a);r(\"mori.mutable.disj.fn\",ge.K);;return this.mori;}.call({});});\n"
  },
  {
    "path": "editor/scripts/parser.js",
    "content": "/*\n  Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>\n  Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>\n  Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>\n  Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>\n  Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>\n  Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>\n  Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>\n  Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>\n  Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/*global esprima:true, define:true, exports:true, window: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true,\nparseClassExpression: true, parseClassDeclaration: true, parseExpression: true,\nparseForStatement: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseImportSpecifier: true,\nparseLeftHandSideExpression: true, parseParams: true, validateParam: true,\nparseSpreadOrAssignmentExpression: true,\nparseStatement: true, parseSourceElement: true, parseModuleBlock: true, parseConciseBody: true,\nparseYieldExpression: true\n*/\n(function (root, factory) {\n    'use strict';\n    // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n    // Rhino, and plain browser loading.\n    if (typeof define === 'function' && define.amd) {\n        define([\n            'exports',\n            'expander'\n        ], factory);\n    } else if (typeof exports !== 'undefined') {\n        factory(exports, require('./expander'));\n    } else {\n        factory(root.esprima = {});\n    }\n}(this, function (exports$2, expander) {\n    'use strict';\n    var Token, TokenName, FnExprTokens, Syntax, PropertyKind, Messages, Regex, SyntaxTreeDelegate, ClassPropertyType, source, strict, index, lineNumber, lineStart, sm_lineNumber, sm_lineStart, sm_range, sm_index, length, delegate, tokenStream, streamIndex, lookahead, lookaheadIndex, state, extra;\n    Token = {\n        BooleanLiteral: 1,\n        EOF: 2,\n        Identifier: 3,\n        Keyword: 4,\n        NullLiteral: 5,\n        NumericLiteral: 6,\n        Punctuator: 7,\n        StringLiteral: 8,\n        RegularExpression: 9,\n        Template: 10,\n        Delimiter: 11\n    };\n    TokenName = {};\n    TokenName[Token.BooleanLiteral] = 'Boolean';\n    TokenName[Token.EOF] = '<end>';\n    TokenName[Token.Identifier] = 'Identifier';\n    TokenName[Token.Keyword] = 'Keyword';\n    TokenName[Token.NullLiteral] = 'Null';\n    TokenName[Token.NumericLiteral] = 'Numeric';\n    TokenName[Token.Punctuator] = 'Punctuator';\n    TokenName[Token.StringLiteral] = 'String';\n    TokenName[Token.RegularExpression] = 'RegularExpression';\n    TokenName[Token.Delimiter] = 'Delimiter';\n    // A function following one of those tokens is an expression.\n    FnExprTokens = [\n        '(',\n        '{',\n        '[',\n        'in',\n        'typeof',\n        'instanceof',\n        'new',\n        'return',\n        'case',\n        'delete',\n        'throw',\n        'void',\n        '=',\n        '+=',\n        '-=',\n        '*=',\n        '/=',\n        '%=',\n        '<<=',\n        '>>=',\n        '>>>=',\n        '&=',\n        '|=',\n        '^=',\n        ',',\n        '+',\n        '-',\n        '*',\n        '/',\n        '%',\n        '++',\n        '--',\n        '<<',\n        '>>',\n        '>>>',\n        '&',\n        '|',\n        '^',\n        '!',\n        '~',\n        '&&',\n        '||',\n        '?',\n        ':',\n        '===',\n        '==',\n        '>=',\n        '<=',\n        '<',\n        '>',\n        '!=',\n        '!=='\n    ];\n    Syntax = {\n        ArrayExpression: 'ArrayExpression',\n        ArrayPattern: 'ArrayPattern',\n        ArrowFunctionExpression: 'ArrowFunctionExpression',\n        AssignmentExpression: 'AssignmentExpression',\n        BinaryExpression: 'BinaryExpression',\n        BlockStatement: 'BlockStatement',\n        BreakStatement: 'BreakStatement',\n        CallExpression: 'CallExpression',\n        CatchClause: 'CatchClause',\n        ClassBody: 'ClassBody',\n        ClassDeclaration: 'ClassDeclaration',\n        ClassExpression: 'ClassExpression',\n        ClassHeritage: 'ClassHeritage',\n        ComprehensionBlock: 'ComprehensionBlock',\n        ComprehensionExpression: 'ComprehensionExpression',\n        ConditionalExpression: 'ConditionalExpression',\n        ContinueStatement: 'ContinueStatement',\n        DebuggerStatement: 'DebuggerStatement',\n        DoWhileStatement: 'DoWhileStatement',\n        EmptyStatement: 'EmptyStatement',\n        ExportDeclaration: 'ExportDeclaration',\n        ExportBatchSpecifier: 'ExportBatchSpecifier',\n        ExportSpecifier: 'ExportSpecifier',\n        ExpressionStatement: 'ExpressionStatement',\n        ForInStatement: 'ForInStatement',\n        ForOfStatement: 'ForOfStatement',\n        ForStatement: 'ForStatement',\n        FunctionDeclaration: 'FunctionDeclaration',\n        FunctionExpression: 'FunctionExpression',\n        Identifier: 'Identifier',\n        IfStatement: 'IfStatement',\n        ImportDeclaration: 'ImportDeclaration',\n        ImportSpecifier: 'ImportSpecifier',\n        LabeledStatement: 'LabeledStatement',\n        Literal: 'Literal',\n        LogicalExpression: 'LogicalExpression',\n        MemberExpression: 'MemberExpression',\n        MethodDefinition: 'MethodDefinition',\n        ModuleDeclaration: 'ModuleDeclaration',\n        NewExpression: 'NewExpression',\n        ObjectExpression: 'ObjectExpression',\n        ObjectPattern: 'ObjectPattern',\n        Program: 'Program',\n        Property: 'Property',\n        ReturnStatement: 'ReturnStatement',\n        SequenceExpression: 'SequenceExpression',\n        SpreadElement: 'SpreadElement',\n        SwitchCase: 'SwitchCase',\n        SwitchStatement: 'SwitchStatement',\n        TaggedTemplateExpression: 'TaggedTemplateExpression',\n        TemplateElement: 'TemplateElement',\n        TemplateLiteral: 'TemplateLiteral',\n        ThisExpression: 'ThisExpression',\n        ThrowStatement: 'ThrowStatement',\n        TryStatement: 'TryStatement',\n        UnaryExpression: 'UnaryExpression',\n        UpdateExpression: 'UpdateExpression',\n        VariableDeclaration: 'VariableDeclaration',\n        VariableDeclarator: 'VariableDeclarator',\n        WhileStatement: 'WhileStatement',\n        WithStatement: 'WithStatement',\n        YieldExpression: 'YieldExpression'\n    };\n    PropertyKind = {\n        Data: 1,\n        Get: 2,\n        Set: 4\n    };\n    ClassPropertyType = {\n        'static': 'static',\n        prototype: 'prototype'\n    };\n    // Error messages should be identical to V8.\n    Messages = {\n        UnexpectedToken: 'Unexpected token %0',\n        UnexpectedNumber: 'Unexpected number',\n        UnexpectedString: 'Unexpected string',\n        UnexpectedIdentifier: 'Unexpected identifier',\n        UnexpectedReserved: 'Unexpected reserved word',\n        UnexpectedTemplate: 'Unexpected quasi %0',\n        UnexpectedEOS: 'Unexpected end of input',\n        NewlineAfterThrow: 'Illegal newline after throw',\n        InvalidRegExp: 'Invalid regular expression',\n        UnterminatedRegExp: 'Invalid regular expression: missing /',\n        InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n        InvalidLHSInFormalsList: 'Invalid left-hand side in formals list',\n        InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n        MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n        NoCatchOrFinally: 'Missing catch or finally after try',\n        UnknownLabel: 'Undefined label \\'%0\\'',\n        Redeclaration: '%0 \\'%1\\' has already been declared',\n        IllegalContinue: 'Illegal continue statement',\n        IllegalBreak: 'Illegal break statement',\n        IllegalDuplicateClassProperty: 'Illegal duplicate property in class definition',\n        IllegalReturn: 'Illegal return statement',\n        IllegalYield: 'Illegal yield expression',\n        IllegalSpread: 'Illegal spread element',\n        StrictModeWith: 'Strict mode code may not include a with statement',\n        StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n        StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n        StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n        StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n        ParameterAfterRestParameter: 'Rest parameter must be final parameter of an argument list',\n        DefaultRestParameter: 'Rest parameter can not have a default value',\n        ElementAfterSpreadElement: 'Spread must be the final element of an element list',\n        ObjectPatternAsRestParameter: 'Invalid rest parameter',\n        ObjectPatternAsSpread: 'Invalid spread argument',\n        StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n        StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n        StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n        StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n        AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n        AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n        StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n        StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n        StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n        StrictReservedWord: 'Use of future reserved word in strict mode',\n        NewlineAfterModule: 'Illegal newline after module',\n        NoFromAfterImport: 'Missing from after import',\n        InvalidModuleSpecifier: 'Invalid module specifier',\n        NestedModule: 'Module declaration can not be nested',\n        NoYieldInGenerator: 'Missing yield in generator',\n        NoUnintializedConst: 'Const must be initialized',\n        ComprehensionRequiresBlock: 'Comprehension must have at least one block',\n        ComprehensionError: 'Comprehension Error',\n        EachNotAllowed: 'Each is not supported',\n        UnmatchedDelimiter: 'Unmatched Delimiter'\n    };\n    // See also tools/generate-unicode-regex.py.\n    Regex = {\n        NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n        NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C01-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C82\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D02\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n    };\n    // Ensure the condition is true, otherwise throw an error.\n    // This is only to have a better contract semantic, i.e. another safety net\n    // to catch a logic error. The condition shall be fulfilled in normal case.\n    // Do NOT use this to enforce a certain condition on any user input.\n    function assert(condition, message) {\n        if (!condition) {\n            throw new Error('ASSERT: ' + message);\n        }\n    }\n    function isIn(el, list) {\n        return list.indexOf(el) !== -1;\n    }\n    function isDecimalDigit(ch) {\n        return ch >= 48 && ch <= 57;\n    }    // 0..9\n    function isHexDigit(ch) {\n        return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n    }\n    function isOctalDigit(ch) {\n        return '01234567'.indexOf(ch) >= 0;\n    }\n    // 7.2 White Space\n    function isWhiteSpace(ch) {\n        return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch >= 5760 && '\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\uFEFF'.indexOf(String.fromCharCode(ch)) > 0;\n    }\n    // 7.3 Line Terminators\n    function isLineTerminator(ch) {\n        return ch === 10 || ch === 13 || ch === 8232 || ch === 8233;\n    }\n    // 7.6 Identifier Names and Identifiers\n    function isIdentifierStart(ch) {\n        return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 92 || ch >= 128 && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch));\n    }\n    function isIdentifierPart(ch) {\n        return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 92 || ch >= 128 && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch));\n    }\n    // 7.6.1.2 Future Reserved Words\n    function isFutureReservedWord(id) {\n        switch (id) {\n        case 'class':\n        case 'enum':\n        case 'export':\n        case 'extends':\n        case 'import':\n        case 'super':\n            return true;\n        default:\n            return false;\n        }\n    }\n    function isStrictModeReservedWord(id) {\n        switch (id) {\n        case 'implements':\n        case 'interface':\n        case 'package':\n        case 'private':\n        case 'protected':\n        case 'public':\n        case 'static':\n        case 'yield':\n        case 'let':\n            return true;\n        default:\n            return false;\n        }\n    }\n    function isRestrictedWord(id) {\n        return id === 'eval' || id === 'arguments';\n    }\n    // 7.6.1.1 Keywords\n    function isKeyword(id) {\n        if (strict && isStrictModeReservedWord(id)) {\n            return true;\n        }\n        // 'const' is specialized as Keyword in V8.\n        // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n        // Some others are from future reserved words.\n        switch (id.length) {\n        case 2:\n            return id === 'if' || id === 'in' || id === 'do';\n        case 3:\n            return id === 'var' || id === 'for' || id === 'new' || id === 'try' || id === 'let';\n        case 4:\n            return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum';\n        case 5:\n            return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super';\n        case 6:\n            return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import';\n        case 7:\n            return id === 'default' || id === 'finally' || id === 'extends';\n        case 8:\n            return id === 'function' || id === 'continue' || id === 'debugger';\n        case 10:\n            return id === 'instanceof';\n        default:\n            return false;\n        }\n    }\n    // 7.4 Comments\n    function skipComment() {\n        var ch, blockComment, lineComment;\n        blockComment = false;\n        lineComment = false;\n        while (index < length) {\n            ch = source.charCodeAt(index);\n            if (lineComment) {\n                ++index;\n                if (isLineTerminator(ch)) {\n                    lineComment = false;\n                    if (ch === 13 && source.charCodeAt(index) === 10) {\n                        ++index;\n                    }\n                    ++lineNumber;\n                    lineStart = index;\n                }\n            } else if (blockComment) {\n                if (isLineTerminator(ch)) {\n                    if (ch === 13 && source.charCodeAt(index + 1) === 10) {\n                        ++index;\n                    }\n                    ++lineNumber;\n                    ++index;\n                    lineStart = index;\n                    if (index >= length) {\n                        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                    }\n                } else {\n                    ch = source.charCodeAt(index++);\n                    if (index >= length) {\n                        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                    }\n                    // Block comment ends with '*/' (char #42, char #47).\n                    if (ch === 42) {\n                        ch = source.charCodeAt(index);\n                        if (ch === 47) {\n                            ++index;\n                            blockComment = false;\n                        }\n                    }\n                }\n            } else if (ch === 47) {\n                ch = source.charCodeAt(index + 1);\n                // Line comment starts with '//' (char #47, char #47).\n                if (ch === 47) {\n                    index += 2;\n                    lineComment = true;\n                } else if (ch === 42) {\n                    // Block comment starts with '/*' (char #47, char #42).\n                    index += 2;\n                    blockComment = true;\n                    if (index >= length) {\n                        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                    }\n                } else {\n                    break;\n                }\n            } else if (isWhiteSpace(ch)) {\n                ++index;\n            } else if (isLineTerminator(ch)) {\n                ++index;\n                if (ch === 13 && source.charCodeAt(index) === 10) {\n                    ++index;\n                }\n                ++lineNumber;\n                lineStart = index;\n            } else {\n                break;\n            }\n        }\n    }\n    function scanHexEscape(prefix) {\n        var i, len, ch, code = 0;\n        len = prefix === 'u' ? 4 : 2;\n        for (i = 0; i < len; ++i) {\n            if (index < length && isHexDigit(source[index])) {\n                ch = source[index++];\n                code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n            } else {\n                return '';\n            }\n        }\n        return String.fromCharCode(code);\n    }\n    function scanUnicodeCodePointEscape() {\n        var ch, code, cu1, cu2;\n        ch = source[index];\n        code = 0;\n        // At least, one hex digit is required.\n        if (ch === '}') {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        while (index < length) {\n            ch = source[index++];\n            if (!isHexDigit(ch)) {\n                break;\n            }\n            code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n        }\n        if (code > 1114111 || ch !== '}') {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        // UTF-16 Encoding\n        if (code <= 65535) {\n            return String.fromCharCode(code);\n        }\n        cu1 = (code - 65536 >> 10) + 55296;\n        cu2 = (code - 65536 & 1023) + 56320;\n        return String.fromCharCode(cu1, cu2);\n    }\n    function getEscapedIdentifier() {\n        var ch, id;\n        ch = source.charCodeAt(index++);\n        id = String.fromCharCode(ch);\n        // '\\u' (char #92, char #117) denotes an escaped character.\n        if (ch === 92) {\n            if (source.charCodeAt(index) !== 117) {\n                throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n            }\n            ++index;\n            ch = scanHexEscape('u');\n            if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n                throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n            }\n            id = ch;\n        }\n        while (index < length) {\n            ch = source.charCodeAt(index);\n            if (!isIdentifierPart(ch)) {\n                break;\n            }\n            ++index;\n            id += String.fromCharCode(ch);\n            // '\\u' (char #92, char #117) denotes an escaped character.\n            if (ch === 92) {\n                id = id.substr(0, id.length - 1);\n                if (source.charCodeAt(index) !== 117) {\n                    throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                }\n                ++index;\n                ch = scanHexEscape('u');\n                if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n                    throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                }\n                id += ch;\n            }\n        }\n        return id;\n    }\n    function getIdentifier() {\n        var start, ch;\n        start = index++;\n        while (index < length) {\n            ch = source.charCodeAt(index);\n            if (ch === 92) {\n                // Blackslash (char #92) marks Unicode escape sequence.\n                index = start;\n                return getEscapedIdentifier();\n            }\n            if (isIdentifierPart(ch)) {\n                ++index;\n            } else {\n                break;\n            }\n        }\n        return source.slice(start, index);\n    }\n    function scanIdentifier() {\n        var start, id, type;\n        start = index;\n        // Backslash (char #92) starts an escaped character.\n        id = source.charCodeAt(index) === 92 ? getEscapedIdentifier() : getIdentifier();\n        // There is no keyword or literal with only one character.\n        // Thus, it must be an identifier.\n        if (id.length === 1) {\n            type = Token.Identifier;\n        } else if (isKeyword(id)) {\n            type = Token.Keyword;\n        } else if (id === 'null') {\n            type = Token.NullLiteral;\n        } else if (id === 'true' || id === 'false') {\n            type = Token.BooleanLiteral;\n        } else {\n            type = Token.Identifier;\n        }\n        return {\n            type: type,\n            value: id,\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                start,\n                index\n            ]\n        };\n    }\n    // 7.7 Punctuators\n    function scanPunctuator() {\n        var start = index, code = source.charCodeAt(index), code2, ch1 = source[index], ch2, ch3, ch4;\n        switch (code) {\n        // Check for most common single-character punctuators.\n        case 40:\n        // ( open bracket\n        case 41:\n        // ) close bracket\n        case 59:\n        // ; semicolon\n        case 44:\n        // , comma\n        case 123:\n        // { open curly brace\n        case 125:\n        // } close curly brace\n        case 91:\n        // [\n        case 93:\n        // ]\n        case 58:\n        // :\n        case 63:\n        // ?\n        case 126:\n            // ~\n            ++index;\n            if (extra.tokenize) {\n                if (code === 40) {\n                    extra.openParenToken = extra.tokens.length;\n                } else if (code === 123) {\n                    extra.openCurlyToken = extra.tokens.length;\n                }\n            }\n            return {\n                type: Token.Punctuator,\n                value: String.fromCharCode(code),\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        default:\n            code2 = source.charCodeAt(index + 1);\n            // '=' (char #61) marks an assignment or comparison operator.\n            if (code2 === 61) {\n                switch (code) {\n                case 37:\n                // %\n                case 38:\n                // &\n                case 42:\n                // *:\n                case 43:\n                // +\n                case 45:\n                // -\n                case 47:\n                // /\n                case 60:\n                // <\n                case 62:\n                // >\n                case 94:\n                // ^\n                case 124:\n                    // |\n                    index += 2;\n                    return {\n                        type: Token.Punctuator,\n                        value: String.fromCharCode(code) + String.fromCharCode(code2),\n                        lineNumber: lineNumber,\n                        lineStart: lineStart,\n                        range: [\n                            start,\n                            index\n                        ]\n                    };\n                case 33:\n                // !\n                case 61:\n                    // =\n                    index += 2;\n                    // !== and ===\n                    if (source.charCodeAt(index) === 61) {\n                        ++index;\n                    }\n                    return {\n                        type: Token.Punctuator,\n                        value: source.slice(start, index),\n                        lineNumber: lineNumber,\n                        lineStart: lineStart,\n                        range: [\n                            start,\n                            index\n                        ]\n                    };\n                default:\n                    break;\n                }\n            }\n            break;\n        }\n        // Peek more characters.\n        ch2 = source[index + 1];\n        ch3 = source[index + 2];\n        ch4 = source[index + 3];\n        // 4-character punctuator: >>>=\n        if (ch1 === '>' && ch2 === '>' && ch3 === '>') {\n            if (ch4 === '=') {\n                index += 4;\n                return {\n                    type: Token.Punctuator,\n                    value: '>>>=',\n                    lineNumber: lineNumber,\n                    lineStart: lineStart,\n                    range: [\n                        start,\n                        index\n                    ]\n                };\n            }\n        }\n        // 3-character punctuators: === !== >>> <<= >>=\n        if (ch1 === '>' && ch2 === '>' && ch3 === '>') {\n            index += 3;\n            return {\n                type: Token.Punctuator,\n                value: '>>>',\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        if (ch1 === '<' && ch2 === '<' && ch3 === '=') {\n            index += 3;\n            return {\n                type: Token.Punctuator,\n                value: '<<=',\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        if (ch1 === '>' && ch2 === '>' && ch3 === '=') {\n            index += 3;\n            return {\n                type: Token.Punctuator,\n                value: '>>=',\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        if (ch1 === '.' && ch2 === '.' && ch3 === '.') {\n            index += 3;\n            return {\n                type: Token.Punctuator,\n                value: '...',\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        // Other 2-character punctuators: ++ -- << >> && ||\n        if (ch1 === ch2 && '+-<>&|'.indexOf(ch1) >= 0) {\n            index += 2;\n            return {\n                type: Token.Punctuator,\n                value: ch1 + ch2,\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        if (ch1 === '=' && ch2 === '>') {\n            index += 2;\n            return {\n                type: Token.Punctuator,\n                value: '=>',\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n            ++index;\n            return {\n                type: Token.Punctuator,\n                value: ch1,\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        if (ch1 === '.') {\n            ++index;\n            return {\n                type: Token.Punctuator,\n                value: ch1,\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n    }\n    // 7.8.3 Numeric Literals\n    function scanHexLiteral(start) {\n        var number = '';\n        while (index < length) {\n            if (!isHexDigit(source[index])) {\n                break;\n            }\n            number += source[index++];\n        }\n        if (number.length === 0) {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        if (isIdentifierStart(source.charCodeAt(index))) {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        return {\n            type: Token.NumericLiteral,\n            value: parseInt('0x' + number, 16),\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                start,\n                index\n            ]\n        };\n    }\n    function scanOctalLiteral(prefix, start) {\n        var number, octal;\n        if (isOctalDigit(prefix)) {\n            octal = true;\n            number = '0' + source[index++];\n        } else {\n            octal = false;\n            ++index;\n            number = '';\n        }\n        while (index < length) {\n            if (!isOctalDigit(source[index])) {\n                break;\n            }\n            number += source[index++];\n        }\n        if (!octal && number.length === 0) {\n            // only 0o or 0O\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        return {\n            type: Token.NumericLiteral,\n            value: parseInt(number, 8),\n            octal: octal,\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                start,\n                index\n            ]\n        };\n    }\n    function scanNumericLiteral() {\n        var number, start, ch, octal;\n        ch = source[index];\n        assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n        start = index;\n        number = '';\n        if (ch !== '.') {\n            number = source[index++];\n            ch = source[index];\n            // Hex number starts with '0x'.\n            // Octal number starts with '0'.\n            // Octal number in ES6 starts with '0o'.\n            // Binary number in ES6 starts with '0b'.\n            if (number === '0') {\n                if (ch === 'x' || ch === 'X') {\n                    ++index;\n                    return scanHexLiteral(start);\n                }\n                if (ch === 'b' || ch === 'B') {\n                    ++index;\n                    number = '';\n                    while (index < length) {\n                        ch = source[index];\n                        if (ch !== '0' && ch !== '1') {\n                            break;\n                        }\n                        number += source[index++];\n                    }\n                    if (number.length === 0) {\n                        // only 0b or 0B\n                        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                    }\n                    if (index < length) {\n                        ch = source.charCodeAt(index);\n                        if (isIdentifierStart(ch) || isDecimalDigit(ch)) {\n                            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                        }\n                    }\n                    return {\n                        type: Token.NumericLiteral,\n                        value: parseInt(number, 2),\n                        lineNumber: lineNumber,\n                        lineStart: lineStart,\n                        range: [\n                            start,\n                            index\n                        ]\n                    };\n                }\n                if (ch === 'o' || ch === 'O' || isOctalDigit(ch)) {\n                    return scanOctalLiteral(ch, start);\n                }\n                // decimal number starts with '0' such as '09' is illegal.\n                if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n                    throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                }\n            }\n            while (isDecimalDigit(source.charCodeAt(index))) {\n                number += source[index++];\n            }\n            ch = source[index];\n        }\n        if (ch === '.') {\n            number += source[index++];\n            while (isDecimalDigit(source.charCodeAt(index))) {\n                number += source[index++];\n            }\n            ch = source[index];\n        }\n        if (ch === 'e' || ch === 'E') {\n            number += source[index++];\n            ch = source[index];\n            if (ch === '+' || ch === '-') {\n                number += source[index++];\n            }\n            if (isDecimalDigit(source.charCodeAt(index))) {\n                while (isDecimalDigit(source.charCodeAt(index))) {\n                    number += source[index++];\n                }\n            } else {\n                throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n            }\n        }\n        if (isIdentifierStart(source.charCodeAt(index))) {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        return {\n            type: Token.NumericLiteral,\n            value: parseFloat(number),\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                start,\n                index\n            ]\n        };\n    }\n    // 7.8.4 String Literals\n    function scanStringLiteral() {\n        var str = '', quote, start, ch, code, unescaped, restore, octal = false;\n        quote = source[index];\n        assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n        start = index;\n        ++index;\n        while (index < length) {\n            ch = source[index++];\n            if (ch === quote) {\n                quote = '';\n                break;\n            } else if (ch === '\\\\') {\n                ch = source[index++];\n                if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n                    switch (ch) {\n                    case 'n':\n                        str += '\\n';\n                        break;\n                    case 'r':\n                        str += '\\r';\n                        break;\n                    case 't':\n                        str += '\\t';\n                        break;\n                    case 'u':\n                    case 'x':\n                        if (source[index] === '{') {\n                            ++index;\n                            str += scanUnicodeCodePointEscape();\n                        } else {\n                            restore = index;\n                            unescaped = scanHexEscape(ch);\n                            if (unescaped) {\n                                str += unescaped;\n                            } else {\n                                index = restore;\n                                str += ch;\n                            }\n                        }\n                        break;\n                    case 'b':\n                        str += '\\b';\n                        break;\n                    case 'f':\n                        str += '\\f';\n                        break;\n                    case 'v':\n                        str += '\\x0B';\n                        break;\n                    default:\n                        if (isOctalDigit(ch)) {\n                            code = '01234567'.indexOf(ch);\n                            // \\0 is not octal escape sequence\n                            if (code !== 0) {\n                                octal = true;\n                            }\n                            if (index < length && isOctalDigit(source[index])) {\n                                octal = true;\n                                code = code * 8 + '01234567'.indexOf(source[index++]);\n                                // 3 digits are only allowed when string starts\n                                // with 0, 1, 2, 3\n                                if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n                                    code = code * 8 + '01234567'.indexOf(source[index++]);\n                                }\n                            }\n                            str += String.fromCharCode(code);\n                        } else {\n                            str += ch;\n                        }\n                        break;\n                    }\n                } else {\n                    ++lineNumber;\n                    if (ch === '\\r' && source[index] === '\\n') {\n                        ++index;\n                    }\n                }\n            } else if (isLineTerminator(ch.charCodeAt(0))) {\n                break;\n            } else {\n                str += ch;\n            }\n        }\n        if (quote !== '') {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        return {\n            type: Token.StringLiteral,\n            value: str,\n            octal: octal,\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                start,\n                index\n            ]\n        };\n    }\n    function scanTemplate() {\n        var cooked = '', ch, start, terminated, tail, restore, unescaped, code, octal;\n        terminated = false;\n        tail = false;\n        start = index;\n        ++index;\n        while (index < length) {\n            ch = source[index++];\n            if (ch === '`') {\n                tail = true;\n                terminated = true;\n                break;\n            } else if (ch === '$') {\n                if (source[index] === '{') {\n                    ++index;\n                    terminated = true;\n                    break;\n                }\n                cooked += ch;\n            } else if (ch === '\\\\') {\n                ch = source[index++];\n                if (!isLineTerminator(ch.charCodeAt(0))) {\n                    switch (ch) {\n                    case 'n':\n                        cooked += '\\n';\n                        break;\n                    case 'r':\n                        cooked += '\\r';\n                        break;\n                    case 't':\n                        cooked += '\\t';\n                        break;\n                    case 'u':\n                    case 'x':\n                        if (source[index] === '{') {\n                            ++index;\n                            cooked += scanUnicodeCodePointEscape();\n                        } else {\n                            restore = index;\n                            unescaped = scanHexEscape(ch);\n                            if (unescaped) {\n                                cooked += unescaped;\n                            } else {\n                                index = restore;\n                                cooked += ch;\n                            }\n                        }\n                        break;\n                    case 'b':\n                        cooked += '\\b';\n                        break;\n                    case 'f':\n                        cooked += '\\f';\n                        break;\n                    case 'v':\n                        cooked += '\\x0B';\n                        break;\n                    default:\n                        if (isOctalDigit(ch)) {\n                            code = '01234567'.indexOf(ch);\n                            // \\0 is not octal escape sequence\n                            if (code !== 0) {\n                                octal = true;\n                            }\n                            if (index < length && isOctalDigit(source[index])) {\n                                octal = true;\n                                code = code * 8 + '01234567'.indexOf(source[index++]);\n                                // 3 digits are only allowed when string starts\n                                // with 0, 1, 2, 3\n                                if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n                                    code = code * 8 + '01234567'.indexOf(source[index++]);\n                                }\n                            }\n                            cooked += String.fromCharCode(code);\n                        } else {\n                            cooked += ch;\n                        }\n                        break;\n                    }\n                } else {\n                    ++lineNumber;\n                    if (ch === '\\r' && source[index] === '\\n') {\n                        ++index;\n                    }\n                }\n            } else if (isLineTerminator(ch.charCodeAt(0))) {\n                ++lineNumber;\n                if (ch === '\\r' && source[index] === '\\n') {\n                    ++index;\n                }\n                cooked += '\\n';\n            } else {\n                cooked += ch;\n            }\n        }\n        if (!terminated) {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        return {\n            type: Token.Template,\n            value: {\n                cooked: cooked,\n                raw: source.slice(start + 1, index - (tail ? 1 : 2))\n            },\n            tail: tail,\n            octal: octal,\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                start,\n                index\n            ]\n        };\n    }\n    function scanTemplateElement(option) {\n        var startsWith, template;\n        lookahead = null;\n        skipComment();\n        startsWith = option.head ? '`' : '}';\n        if (source[index] !== startsWith) {\n            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n        }\n        template = scanTemplate();\n        peek();\n        return template;\n    }\n    function scanRegExp() {\n        var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false;\n        lookahead = null;\n        skipComment();\n        start = index;\n        ch = source[index];\n        assert(ch === '/', 'Regular expression literal must start with a slash');\n        str = source[index++];\n        while (index < length) {\n            ch = source[index++];\n            str += ch;\n            if (classMarker) {\n                if (ch === ']') {\n                    classMarker = false;\n                }\n            } else {\n                if (ch === '\\\\') {\n                    ch = source[index++];\n                    // ECMA-262 7.8.5\n                    if (isLineTerminator(ch.charCodeAt(0))) {\n                        throwError({}, Messages.UnterminatedRegExp);\n                    }\n                    str += ch;\n                } else if (ch === '/') {\n                    terminated = true;\n                    break;\n                } else if (ch === '[') {\n                    classMarker = true;\n                } else if (isLineTerminator(ch.charCodeAt(0))) {\n                    throwError({}, Messages.UnterminatedRegExp);\n                }\n            }\n        }\n        if (!terminated) {\n            throwError({}, Messages.UnterminatedRegExp);\n        }\n        // Exclude leading and trailing slash.\n        pattern = str.substr(1, str.length - 2);\n        flags = '';\n        while (index < length) {\n            ch = source[index];\n            if (!isIdentifierPart(ch.charCodeAt(0))) {\n                break;\n            }\n            ++index;\n            if (ch === '\\\\' && index < length) {\n                ch = source[index];\n                if (ch === 'u') {\n                    ++index;\n                    restore = index;\n                    ch = scanHexEscape('u');\n                    if (ch) {\n                        flags += ch;\n                        for (str += '\\\\u'; restore < index; ++restore) {\n                            str += source[restore];\n                        }\n                    } else {\n                        index = restore;\n                        flags += 'u';\n                        str += '\\\\u';\n                    }\n                } else {\n                    str += '\\\\';\n                }\n            } else {\n                flags += ch;\n                str += ch;\n            }\n        }\n        try {\n            value = new RegExp(pattern, flags);\n        } catch (e) {\n            throwError({}, Messages.InvalidRegExp);\n        }\n        // peek();\n        if (extra.tokenize) {\n            return {\n                type: Token.RegularExpression,\n                value: value,\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    start,\n                    index\n                ]\n            };\n        }\n        return {\n            type: Token.RegularExpression,\n            literal: str,\n            value: value,\n            range: [\n                start,\n                index\n            ]\n        };\n    }\n    function isIdentifierName(token) {\n        return token.type === Token.Identifier || token.type === Token.Keyword || token.type === Token.BooleanLiteral || token.type === Token.NullLiteral;\n    }\n    function advanceSlash() {\n        var prevToken, checkToken;\n        // Using the following algorithm:\n        // https://github.com/mozilla/sweet.js/wiki/design\n        prevToken = extra.tokens[extra.tokens.length - 1];\n        if (!prevToken) {\n            // Nothing before that: it cannot be a division.\n            return scanRegExp();\n        }\n        if (prevToken.type === 'Punctuator') {\n            if (prevToken.value === ')') {\n                checkToken = extra.tokens[extra.openParenToken - 1];\n                if (checkToken && checkToken.type === 'Keyword' && (checkToken.value === 'if' || checkToken.value === 'while' || checkToken.value === 'for' || checkToken.value === 'with')) {\n                    return scanRegExp();\n                }\n                return scanPunctuator();\n            }\n            if (prevToken.value === '}') {\n                // Dividing a function by anything makes little sense,\n                // but we have to check for that.\n                if (extra.tokens[extra.openCurlyToken - 3] && extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n                    // Anonymous function.\n                    checkToken = extra.tokens[extra.openCurlyToken - 4];\n                    if (!checkToken) {\n                        return scanPunctuator();\n                    }\n                } else if (extra.tokens[extra.openCurlyToken - 4] && extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n                    // Named function.\n                    checkToken = extra.tokens[extra.openCurlyToken - 5];\n                    if (!checkToken) {\n                        return scanRegExp();\n                    }\n                } else {\n                    return scanPunctuator();\n                }\n                // checkToken determines whether the function is\n                // a declaration or an expression.\n                if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n                    // It is an expression.\n                    return scanPunctuator();\n                }\n                // It is a declaration.\n                return scanRegExp();\n            }\n            return scanRegExp();\n        }\n        if (prevToken.type === 'Keyword') {\n            return scanRegExp();\n        }\n        return scanPunctuator();\n    }\n    function advance() {\n        var ch;\n        skipComment();\n        if (index >= length) {\n            return {\n                type: Token.EOF,\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    index,\n                    index\n                ]\n            };\n        }\n        ch = source.charCodeAt(index);\n        // Very common: ( and ) and ;\n        if (ch === 40 || ch === 41 || ch === 58) {\n            return scanPunctuator();\n        }\n        // String literal starts with single quote (#39) or double quote (#34).\n        if (ch === 39 || ch === 34) {\n            return scanStringLiteral();\n        }\n        if (ch === 96) {\n            return scanTemplate();\n        }\n        if (isIdentifierStart(ch)) {\n            return scanIdentifier();\n        }\n        // # and @ are allowed for sweet.js\n        if (ch === 35 || ch === 64) {\n            ++index;\n            return {\n                type: Token.Punctuator,\n                value: String.fromCharCode(ch),\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    index - 1,\n                    index\n                ]\n            };\n        }\n        // Dot (.) char #46 can also start a floating-point number, hence the need\n        // to check the next character.\n        if (ch === 46) {\n            if (isDecimalDigit(source.charCodeAt(index + 1))) {\n                return scanNumericLiteral();\n            }\n            return scanPunctuator();\n        }\n        if (isDecimalDigit(ch)) {\n            return scanNumericLiteral();\n        }\n        // Slash (/) char #47 can also start a regex.\n        if (extra.tokenize && ch === 47) {\n            return advanceSlash();\n        }\n        return scanPunctuator();\n    }\n    function lex() {\n        var token;\n        token = lookahead;\n        streamIndex = lookaheadIndex;\n        lineNumber = token.lineNumber;\n        lineStart = token.lineStart;\n        sm_lineNumber = lookahead.sm_lineNumber;\n        sm_lineStart = lookahead.sm_lineStart;\n        sm_range = lookahead.sm_range;\n        sm_index = lookahead.sm_range[0];\n        lookahead = tokenStream[++streamIndex].token;\n        lookaheadIndex = streamIndex;\n        index = lookahead.range[0];\n        return token;\n    }\n    function peek() {\n        lookaheadIndex = streamIndex + 1;\n        if (lookaheadIndex >= length) {\n            lookahead = {\n                type: Token.EOF,\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    index,\n                    index\n                ]\n            };\n            return;\n        }\n        lookahead = tokenStream[lookaheadIndex].token;\n        index = lookahead.range[0];\n    }\n    function lookahead2() {\n        var adv, pos, line, start, result;\n        if (streamIndex + 1 >= length || streamIndex + 2 >= length) {\n            return {\n                type: Token.EOF,\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    index,\n                    index\n                ]\n            };\n        }\n        // Scan for the next immediate token.\n        if (lookahead === null) {\n            lookaheadIndex = streamIndex + 1;\n            lookahead = tokenStream[lookaheadIndex].token;\n            index = lookahead.range[0];\n        }\n        result = tokenStream[lookaheadIndex + 1].token;\n        return result;\n    }\n    SyntaxTreeDelegate = {\n        name: 'SyntaxTree',\n        postProcess: function (node) {\n            return node;\n        },\n        createArrayExpression: function (elements) {\n            return {\n                type: Syntax.ArrayExpression,\n                elements: elements\n            };\n        },\n        createAssignmentExpression: function (operator, left, right) {\n            return {\n                type: Syntax.AssignmentExpression,\n                operator: operator,\n                left: left,\n                right: right\n            };\n        },\n        createBinaryExpression: function (operator, left, right) {\n            var type = operator === '||' || operator === '&&' ? Syntax.LogicalExpression : Syntax.BinaryExpression;\n            return {\n                type: type,\n                operator: operator,\n                left: left,\n                right: right\n            };\n        },\n        createBlockStatement: function (body) {\n            return {\n                type: Syntax.BlockStatement,\n                body: body\n            };\n        },\n        createBreakStatement: function (label) {\n            return {\n                type: Syntax.BreakStatement,\n                label: label\n            };\n        },\n        createCallExpression: function (callee, args) {\n            return {\n                type: Syntax.CallExpression,\n                callee: callee,\n                'arguments': args\n            };\n        },\n        createCatchClause: function (param, body) {\n            return {\n                type: Syntax.CatchClause,\n                param: param,\n                body: body\n            };\n        },\n        createConditionalExpression: function (test, consequent, alternate) {\n            return {\n                type: Syntax.ConditionalExpression,\n                test: test,\n                consequent: consequent,\n                alternate: alternate\n            };\n        },\n        createContinueStatement: function (label) {\n            return {\n                type: Syntax.ContinueStatement,\n                label: label\n            };\n        },\n        createDebuggerStatement: function () {\n            return { type: Syntax.DebuggerStatement };\n        },\n        createDoWhileStatement: function (body, test) {\n            return {\n                type: Syntax.DoWhileStatement,\n                body: body,\n                test: test\n            };\n        },\n        createEmptyStatement: function () {\n            return { type: Syntax.EmptyStatement };\n        },\n        createExpressionStatement: function (expression) {\n            return {\n                type: Syntax.ExpressionStatement,\n                expression: expression\n            };\n        },\n        createForStatement: function (init, test, update, body) {\n            return {\n                type: Syntax.ForStatement,\n                init: init,\n                test: test,\n                update: update,\n                body: body\n            };\n        },\n        createForInStatement: function (left, right, body) {\n            return {\n                type: Syntax.ForInStatement,\n                left: left,\n                right: right,\n                body: body,\n                each: false\n            };\n        },\n        createForOfStatement: function (left, right, body) {\n            return {\n                type: Syntax.ForOfStatement,\n                left: left,\n                right: right,\n                body: body\n            };\n        },\n        createFunctionDeclaration: function (id, params, defaults, body, rest, generator, expression) {\n            return {\n                type: Syntax.FunctionDeclaration,\n                id: id,\n                params: params,\n                defaults: defaults,\n                body: body,\n                rest: rest,\n                generator: generator,\n                expression: expression\n            };\n        },\n        createFunctionExpression: function (id, params, defaults, body, rest, generator, expression) {\n            return {\n                type: Syntax.FunctionExpression,\n                id: id,\n                params: params,\n                defaults: defaults,\n                body: body,\n                rest: rest,\n                generator: generator,\n                expression: expression\n            };\n        },\n        createIdentifier: function (name) {\n            return {\n                type: Syntax.Identifier,\n                name: name\n            };\n        },\n        createIfStatement: function (test, consequent, alternate) {\n            return {\n                type: Syntax.IfStatement,\n                test: test,\n                consequent: consequent,\n                alternate: alternate\n            };\n        },\n        createLabeledStatement: function (label, body) {\n            return {\n                type: Syntax.LabeledStatement,\n                label: label,\n                body: body\n            };\n        },\n        createLiteral: function (token) {\n            return {\n                type: Syntax.Literal,\n                value: token.value,\n                raw: String(token.value)\n            };\n        },\n        createMemberExpression: function (accessor, object, property) {\n            return {\n                type: Syntax.MemberExpression,\n                computed: accessor === '[',\n                object: object,\n                property: property\n            };\n        },\n        createNewExpression: function (callee, args) {\n            return {\n                type: Syntax.NewExpression,\n                callee: callee,\n                'arguments': args\n            };\n        },\n        createObjectExpression: function (properties) {\n            return {\n                type: Syntax.ObjectExpression,\n                properties: properties\n            };\n        },\n        createPostfixExpression: function (operator, argument) {\n            return {\n                type: Syntax.UpdateExpression,\n                operator: operator,\n                argument: argument,\n                prefix: false\n            };\n        },\n        createProgram: function (body) {\n            return {\n                type: Syntax.Program,\n                body: body\n            };\n        },\n        createProperty: function (kind, key, value, method, shorthand) {\n            return {\n                type: Syntax.Property,\n                key: key,\n                value: value,\n                kind: kind,\n                method: method,\n                shorthand: shorthand\n            };\n        },\n        createReturnStatement: function (argument) {\n            return {\n                type: Syntax.ReturnStatement,\n                argument: argument\n            };\n        },\n        createSequenceExpression: function (expressions) {\n            return {\n                type: Syntax.SequenceExpression,\n                expressions: expressions\n            };\n        },\n        createSwitchCase: function (test, consequent) {\n            return {\n                type: Syntax.SwitchCase,\n                test: test,\n                consequent: consequent\n            };\n        },\n        createSwitchStatement: function (discriminant, cases) {\n            return {\n                type: Syntax.SwitchStatement,\n                discriminant: discriminant,\n                cases: cases\n            };\n        },\n        createThisExpression: function () {\n            return { type: Syntax.ThisExpression };\n        },\n        createThrowStatement: function (argument) {\n            return {\n                type: Syntax.ThrowStatement,\n                argument: argument\n            };\n        },\n        createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n            return {\n                type: Syntax.TryStatement,\n                block: block,\n                guardedHandlers: guardedHandlers,\n                handlers: handlers,\n                finalizer: finalizer\n            };\n        },\n        createUnaryExpression: function (operator, argument) {\n            if (operator === '++' || operator === '--') {\n                return {\n                    type: Syntax.UpdateExpression,\n                    operator: operator,\n                    argument: argument,\n                    prefix: true\n                };\n            }\n            return {\n                type: Syntax.UnaryExpression,\n                operator: operator,\n                argument: argument\n            };\n        },\n        createVariableDeclaration: function (declarations, kind) {\n            return {\n                type: Syntax.VariableDeclaration,\n                declarations: declarations,\n                kind: kind\n            };\n        },\n        createVariableDeclarator: function (id, init) {\n            return {\n                type: Syntax.VariableDeclarator,\n                id: id,\n                init: init\n            };\n        },\n        createWhileStatement: function (test, body) {\n            return {\n                type: Syntax.WhileStatement,\n                test: test,\n                body: body\n            };\n        },\n        createWithStatement: function (object, body) {\n            return {\n                type: Syntax.WithStatement,\n                object: object,\n                body: body\n            };\n        },\n        createTemplateElement: function (value, tail) {\n            return {\n                type: Syntax.TemplateElement,\n                value: value,\n                tail: tail\n            };\n        },\n        createTemplateLiteral: function (quasis, expressions) {\n            return {\n                type: Syntax.TemplateLiteral,\n                quasis: quasis,\n                expressions: expressions\n            };\n        },\n        createSpreadElement: function (argument) {\n            return {\n                type: Syntax.SpreadElement,\n                argument: argument\n            };\n        },\n        createTaggedTemplateExpression: function (tag, quasi) {\n            return {\n                type: Syntax.TaggedTemplateExpression,\n                tag: tag,\n                quasi: quasi\n            };\n        },\n        createArrowFunctionExpression: function (params, defaults, body, rest, expression) {\n            return {\n                type: Syntax.ArrowFunctionExpression,\n                id: null,\n                params: params,\n                defaults: defaults,\n                body: body,\n                rest: rest,\n                generator: false,\n                expression: expression\n            };\n        },\n        createMethodDefinition: function (propertyType, kind, key, value) {\n            return {\n                type: Syntax.MethodDefinition,\n                key: key,\n                value: value,\n                kind: kind,\n                'static': propertyType === ClassPropertyType.static\n            };\n        },\n        createClassBody: function (body) {\n            return {\n                type: Syntax.ClassBody,\n                body: body\n            };\n        },\n        createClassExpression: function (id, superClass, body) {\n            return {\n                type: Syntax.ClassExpression,\n                id: id,\n                superClass: superClass,\n                body: body\n            };\n        },\n        createClassDeclaration: function (id, superClass, body) {\n            return {\n                type: Syntax.ClassDeclaration,\n                id: id,\n                superClass: superClass,\n                body: body\n            };\n        },\n        createExportSpecifier: function (id, name) {\n            return {\n                type: Syntax.ExportSpecifier,\n                id: id,\n                name: name\n            };\n        },\n        createExportBatchSpecifier: function () {\n            return { type: Syntax.ExportBatchSpecifier };\n        },\n        createExportDeclaration: function (declaration, specifiers, source$2) {\n            return {\n                type: Syntax.ExportDeclaration,\n                declaration: declaration,\n                specifiers: specifiers,\n                source: source$2\n            };\n        },\n        createImportSpecifier: function (id, name) {\n            return {\n                type: Syntax.ImportSpecifier,\n                id: id,\n                name: name\n            };\n        },\n        createImportDeclaration: function (specifiers, kind, source$2) {\n            return {\n                type: Syntax.ImportDeclaration,\n                specifiers: specifiers,\n                kind: kind,\n                source: source$2\n            };\n        },\n        createYieldExpression: function (argument, delegate$2) {\n            return {\n                type: Syntax.YieldExpression,\n                argument: argument,\n                delegate: delegate$2\n            };\n        },\n        createModuleDeclaration: function (id, source$2, body) {\n            return {\n                type: Syntax.ModuleDeclaration,\n                id: id,\n                source: source$2,\n                body: body\n            };\n        }\n    };\n    // Return true if there is a line terminator before the next token.\n    function peekLineTerminator() {\n        return lookahead.lineNumber !== lineNumber;\n    }\n    // Throw an exception\n    function throwError(token, messageFormat) {\n        var error, args = Array.prototype.slice.call(arguments, 2), msg = messageFormat.replace(/%(\\d)/g, function (whole, index$2) {\n                assert(index$2 < args.length, 'Message reference must be in range');\n                return args[index$2];\n            });\n        var startIndex = streamIndex > 3 ? streamIndex - 3 : 0;\n        var toks = '', tailingMsg = '';\n        if (tokenStream) {\n            toks = tokenStream.slice(startIndex, streamIndex + 3).map(function (stx) {\n                return stx.token.value;\n            }).join(' ');\n            tailingMsg = '\\n[... ' + toks + ' ...]';\n        }\n        if (typeof token.lineNumber === 'number') {\n            error = new Error('Line ' + token.lineNumber + ': ' + msg + tailingMsg);\n            error.index = token.range[0];\n            error.lineNumber = token.lineNumber;\n            error.column = token.range[0] - lineStart + 1;\n        } else {\n            error = new Error('Line ' + lineNumber + ': ' + msg + tailingMsg);\n            error.index = index;\n            error.lineNumber = lineNumber;\n            error.column = index - lineStart + 1;\n        }\n        error.description = msg;\n        throw error;\n    }\n    function throwErrorTolerant() {\n        try {\n            throwError.apply(null, arguments);\n        } catch (e) {\n            if (extra.errors) {\n                extra.errors.push(e);\n            } else {\n                throw e;\n            }\n        }\n    }\n    // Throw an exception because of the token.\n    function throwUnexpected(token) {\n        if (token.type === Token.EOF) {\n            throwError(token, Messages.UnexpectedEOS);\n        }\n        if (token.type === Token.NumericLiteral) {\n            throwError(token, Messages.UnexpectedNumber);\n        }\n        if (token.type === Token.StringLiteral) {\n            throwError(token, Messages.UnexpectedString);\n        }\n        if (token.type === Token.Identifier) {\n            throwError(token, Messages.UnexpectedIdentifier);\n        }\n        if (token.type === Token.Keyword) {\n            if (isFutureReservedWord(token.value)) {\n            }    // sweet.js allows future reserved words\n                 // throwError(token, Messages.UnexpectedReserved);\n            else if (strict && isStrictModeReservedWord(token.value)) {\n                throwErrorTolerant(token, Messages.StrictReservedWord);\n                return;\n            }\n            throwError(token, Messages.UnexpectedToken, token.value);\n        }\n        if (token.type === Token.Template) {\n            throwError(token, Messages.UnexpectedTemplate, token.value.raw);\n        }\n        // BooleanLiteral, NullLiteral, or Punctuator.\n        throwError(token, Messages.UnexpectedToken, token.value);\n    }\n    // Expect the next token to match the specified punctuator.\n    // If not, an exception will be thrown.\n    function expect(value) {\n        var token = lex();\n        if (token.type !== Token.Punctuator || token.value !== value) {\n            throwUnexpected(token);\n        }\n    }\n    // Expect the next token to match the specified keyword.\n    // If not, an exception will be thrown.\n    function expectKeyword(keyword) {\n        var token = lex();\n        if (token.type !== Token.Keyword || token.value !== keyword) {\n            throwUnexpected(token);\n        }\n    }\n    // Return true if the next token matches the specified punctuator.\n    function match(value) {\n        return lookahead.type === Token.Punctuator && lookahead.value === value;\n    }\n    // Return true if the next token matches the specified keyword\n    function matchKeyword(keyword) {\n        return lookahead.type === Token.Keyword && lookahead.value === keyword;\n    }\n    // Return true if the next token matches the specified contextual keyword\n    function matchContextualKeyword(keyword) {\n        return lookahead.type === Token.Identifier && lookahead.value === keyword;\n    }\n    // Return true if the next token is an assignment operator\n    function matchAssign() {\n        var op;\n        if (lookahead.type !== Token.Punctuator) {\n            return false;\n        }\n        op = lookahead.value;\n        return op === '=' || op === '*=' || op === '/=' || op === '%=' || op === '+=' || op === '-=' || op === '<<=' || op === '>>=' || op === '>>>=' || op === '&=' || op === '^=' || op === '|=';\n    }\n    function consumeSemicolon() {\n        var line, ch;\n        ch = lookahead.value ? String(lookahead.value).charCodeAt(0) : -1;\n        // Catch the very common case first: immediately a semicolon (char #59).\n        if (ch === 59) {\n            lex();\n            return;\n        }\n        if (lookahead.lineNumber !== lineNumber) {\n            return;\n        }\n        if (match(';')) {\n            lex();\n            return;\n        }\n        if (lookahead.type !== Token.EOF && !match('}')) {\n            throwUnexpected(lookahead);\n        }\n    }\n    // Return true if provided expression is LeftHandSideExpression\n    function isLeftHandSide(expr) {\n        return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n    }\n    function isAssignableLeftHandSide(expr) {\n        return isLeftHandSide(expr) || expr.type === Syntax.ObjectPattern || expr.type === Syntax.ArrayPattern;\n    }\n    // 11.1.4 Array Initialiser\n    function parseArrayInitialiser() {\n        var elements = [], blocks = [], filter = null, tmp, possiblecomprehension = true, body;\n        expect('[');\n        while (!match(']')) {\n            if (lookahead.value === 'for' && lookahead.type === Token.Keyword) {\n                if (!possiblecomprehension) {\n                    throwError({}, Messages.ComprehensionError);\n                }\n                matchKeyword('for');\n                tmp = parseForStatement({ ignoreBody: true });\n                tmp.of = tmp.type === Syntax.ForOfStatement;\n                tmp.type = Syntax.ComprehensionBlock;\n                if (tmp.left.kind) {\n                    // can't be let or const\n                    throwError({}, Messages.ComprehensionError);\n                }\n                blocks.push(tmp);\n            } else if (lookahead.value === 'if' && lookahead.type === Token.Keyword) {\n                if (!possiblecomprehension) {\n                    throwError({}, Messages.ComprehensionError);\n                }\n                expectKeyword('if');\n                expect('(');\n                filter = parseExpression();\n                expect(')');\n            } else if (lookahead.value === ',' && lookahead.type === Token.Punctuator) {\n                possiblecomprehension = false;\n                // no longer allowed.\n                lex();\n                elements.push(null);\n            } else {\n                tmp = parseSpreadOrAssignmentExpression();\n                elements.push(tmp);\n                if (tmp && tmp.type === Syntax.SpreadElement) {\n                    if (!match(']')) {\n                        throwError({}, Messages.ElementAfterSpreadElement);\n                    }\n                } else if (!(match(']') || matchKeyword('for') || matchKeyword('if'))) {\n                    expect(',');\n                    // this lexes.\n                    possiblecomprehension = false;\n                }\n            }\n        }\n        expect(']');\n        if (filter && !blocks.length) {\n            throwError({}, Messages.ComprehensionRequiresBlock);\n        }\n        if (blocks.length) {\n            if (elements.length !== 1) {\n                throwError({}, Messages.ComprehensionError);\n            }\n            return {\n                type: Syntax.ComprehensionExpression,\n                filter: filter,\n                blocks: blocks,\n                body: elements[0]\n            };\n        }\n        return delegate.createArrayExpression(elements);\n    }\n    // 11.1.5 Object Initialiser\n    function parsePropertyFunction(options) {\n        var previousStrict, previousYieldAllowed, params, defaults, body;\n        previousStrict = strict;\n        previousYieldAllowed = state.yieldAllowed;\n        state.yieldAllowed = options.generator;\n        params = options.params || [];\n        defaults = options.defaults || [];\n        body = parseConciseBody();\n        if (options.name && strict && isRestrictedWord(params[0].name)) {\n            throwErrorTolerant(options.name, Messages.StrictParamName);\n        }\n        if (state.yieldAllowed && !state.yieldFound) {\n            throwErrorTolerant({}, Messages.NoYieldInGenerator);\n        }\n        strict = previousStrict;\n        state.yieldAllowed = previousYieldAllowed;\n        return delegate.createFunctionExpression(null, params, defaults, body, options.rest || null, options.generator, body.type !== Syntax.BlockStatement);\n    }\n    function parsePropertyMethodFunction(options) {\n        var previousStrict, tmp, method;\n        previousStrict = strict;\n        strict = true;\n        tmp = parseParams();\n        if (tmp.stricted) {\n            throwErrorTolerant(tmp.stricted, tmp.message);\n        }\n        method = parsePropertyFunction({\n            params: tmp.params,\n            defaults: tmp.defaults,\n            rest: tmp.rest,\n            generator: options.generator\n        });\n        strict = previousStrict;\n        return method;\n    }\n    function parseObjectPropertyKey() {\n        var token = lex();\n        // Note: This function is called only from parseObjectProperty(), where\n        // EOF and Punctuator tokens are already filtered out.\n        if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n            if (strict && token.octal) {\n                throwErrorTolerant(token, Messages.StrictOctalLiteral);\n            }\n            return delegate.createLiteral(token);\n        }\n        // SWEET.JS: object keys are not resolved\n        return delegate.createIdentifier(token.value);\n    }\n    function parseObjectProperty() {\n        var token, key, id, value, param;\n        token = lookahead;\n        if (token.type === Token.Identifier) {\n            id = parseObjectPropertyKey();\n            // Property Assignment: Getter and Setter.\n            if (token.value === 'get' && !(match(':') || match('('))) {\n                key = parseObjectPropertyKey();\n                expect('(');\n                expect(')');\n                return delegate.createProperty('get', key, parsePropertyFunction({ generator: false }), false, false);\n            }\n            if (token.value === 'set' && !(match(':') || match('('))) {\n                key = parseObjectPropertyKey();\n                expect('(');\n                token = lookahead;\n                param = [parseVariableIdentifier()];\n                expect(')');\n                return delegate.createProperty('set', key, parsePropertyFunction({\n                    params: param,\n                    generator: false,\n                    name: token\n                }), false, false);\n            }\n            if (match(':')) {\n                lex();\n                return delegate.createProperty('init', id, parseAssignmentExpression(), false, false);\n            }\n            if (match('(')) {\n                return delegate.createProperty('init', id, parsePropertyMethodFunction({ generator: false }), true, false);\n            }\n            return delegate.createProperty('init', id, id, false, true);\n        }\n        if (token.type === Token.EOF || token.type === Token.Punctuator) {\n            if (!match('*')) {\n                throwUnexpected(token);\n            }\n            lex();\n            id = parseObjectPropertyKey();\n            if (!match('(')) {\n                throwUnexpected(lex());\n            }\n            return delegate.createProperty('init', id, parsePropertyMethodFunction({ generator: true }), true, false);\n        }\n        key = parseObjectPropertyKey();\n        if (match(':')) {\n            lex();\n            return delegate.createProperty('init', key, parseAssignmentExpression(), false, false);\n        }\n        if (match('(')) {\n            return delegate.createProperty('init', key, parsePropertyMethodFunction({ generator: false }), true, false);\n        }\n        throwUnexpected(lex());\n    }\n    function parseObjectInitialiser() {\n        var properties = [], property, name, key, kind, map = {}, toString = String;\n        expect('{');\n        while (!match('}')) {\n            property = parseObjectProperty();\n            if (property.key.type === Syntax.Identifier) {\n                name = property.key.name;\n            } else {\n                name = toString(property.key.value);\n            }\n            kind = property.kind === 'init' ? PropertyKind.Data : property.kind === 'get' ? PropertyKind.Get : PropertyKind.Set;\n            key = '$' + name;\n            if (Object.prototype.hasOwnProperty.call(map, key)) {\n                if (map[key] === PropertyKind.Data) {\n                    if (strict && kind === PropertyKind.Data) {\n                        throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n                    } else if (kind !== PropertyKind.Data) {\n                        throwErrorTolerant({}, Messages.AccessorDataProperty);\n                    }\n                } else {\n                    if (kind === PropertyKind.Data) {\n                        throwErrorTolerant({}, Messages.AccessorDataProperty);\n                    } else if (map[key] & kind) {\n                        throwErrorTolerant({}, Messages.AccessorGetSet);\n                    }\n                }\n                map[key] |= kind;\n            } else {\n                map[key] = kind;\n            }\n            properties.push(property);\n            if (!match('}')) {\n                expect(',');\n            }\n        }\n        expect('}');\n        return delegate.createObjectExpression(properties);\n    }\n    function parseTemplateElement(option) {\n        var token = lex();\n        if (strict && token.octal) {\n            throwError(token, Messages.StrictOctalLiteral);\n        }\n        return delegate.createTemplateElement({\n            raw: token.value.raw,\n            cooked: token.value.cooked\n        }, token.tail);\n    }\n    function parseTemplateLiteral() {\n        var quasi, quasis, expressions;\n        quasi = parseTemplateElement({ head: true });\n        quasis = [quasi];\n        expressions = [];\n        while (!quasi.tail) {\n            expressions.push(parseExpression());\n            quasi = parseTemplateElement({ head: false });\n            quasis.push(quasi);\n        }\n        return delegate.createTemplateLiteral(quasis, expressions);\n    }\n    // 11.1.6 The Grouping Operator\n    function parseGroupExpression() {\n        var expr;\n        expect('(');\n        ++state.parenthesizedCount;\n        expr = parseExpression();\n        expect(')');\n        return expr;\n    }\n    // 11.1 Primary Expressions\n    function parsePrimaryExpression() {\n        var type, token, resolvedIdent;\n        token = lookahead;\n        type = lookahead.type;\n        if (type === Token.Identifier) {\n            resolvedIdent = expander.resolve(tokenStream[lookaheadIndex]);\n            lex();\n            return delegate.createIdentifier(resolvedIdent);\n        }\n        if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n            if (strict && lookahead.octal) {\n                throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n            }\n            return delegate.createLiteral(lex());\n        }\n        if (type === Token.Keyword) {\n            if (matchKeyword('this')) {\n                lex();\n                return delegate.createThisExpression();\n            }\n            if (matchKeyword('function')) {\n                return parseFunctionExpression();\n            }\n            if (matchKeyword('class')) {\n                return parseClassExpression();\n            }\n            if (matchKeyword('super')) {\n                lex();\n                return delegate.createIdentifier('super');\n            }\n        }\n        if (type === Token.BooleanLiteral) {\n            token = lex();\n            token.value = token.value === 'true';\n            return delegate.createLiteral(token);\n        }\n        if (type === Token.NullLiteral) {\n            token = lex();\n            token.value = null;\n            return delegate.createLiteral(token);\n        }\n        if (match('[')) {\n            return parseArrayInitialiser();\n        }\n        if (match('{')) {\n            return parseObjectInitialiser();\n        }\n        if (match('(')) {\n            return parseGroupExpression();\n        }\n        if (lookahead.type === Token.RegularExpression) {\n            return delegate.createLiteral(lex());\n        }\n        if (type === Token.Template) {\n            return parseTemplateLiteral();\n        }\n        return throwUnexpected(lex());\n    }\n    // 11.2 Left-Hand-Side Expressions\n    function parseArguments() {\n        var args = [], arg;\n        expect('(');\n        if (!match(')')) {\n            while (streamIndex < length) {\n                arg = parseSpreadOrAssignmentExpression();\n                args.push(arg);\n                if (match(')')) {\n                    break;\n                } else if (arg.type === Syntax.SpreadElement) {\n                    throwError({}, Messages.ElementAfterSpreadElement);\n                }\n                expect(',');\n            }\n        }\n        expect(')');\n        return args;\n    }\n    function parseSpreadOrAssignmentExpression() {\n        if (match('...')) {\n            lex();\n            return delegate.createSpreadElement(parseAssignmentExpression());\n        }\n        return parseAssignmentExpression();\n    }\n    function parseNonComputedProperty() {\n        var token = lex();\n        if (!isIdentifierName(token)) {\n            throwUnexpected(token);\n        }\n        return delegate.createIdentifier(token.value);\n    }\n    function parseNonComputedMember() {\n        expect('.');\n        return parseNonComputedProperty();\n    }\n    function parseComputedMember() {\n        var expr;\n        expect('[');\n        expr = parseExpression();\n        expect(']');\n        return expr;\n    }\n    function parseNewExpression() {\n        var callee, args;\n        expectKeyword('new');\n        callee = parseLeftHandSideExpression();\n        args = match('(') ? parseArguments() : [];\n        return delegate.createNewExpression(callee, args);\n    }\n    function parseLeftHandSideExpressionAllowCall() {\n        var expr, args, property;\n        expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n        while (match('.') || match('[') || match('(') || lookahead.type === Token.Template) {\n            if (match('(')) {\n                args = parseArguments();\n                expr = delegate.createCallExpression(expr, args);\n            } else if (match('[')) {\n                expr = delegate.createMemberExpression('[', expr, parseComputedMember());\n            } else if (match('.')) {\n                expr = delegate.createMemberExpression('.', expr, parseNonComputedMember());\n            } else {\n                expr = delegate.createTaggedTemplateExpression(expr, parseTemplateLiteral());\n            }\n        }\n        return expr;\n    }\n    function parseLeftHandSideExpression() {\n        var expr, property;\n        expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n        while (match('.') || match('[') || lookahead.type === Token.Template) {\n            if (match('[')) {\n                expr = delegate.createMemberExpression('[', expr, parseComputedMember());\n            } else if (match('.')) {\n                expr = delegate.createMemberExpression('.', expr, parseNonComputedMember());\n            } else {\n                expr = delegate.createTaggedTemplateExpression(expr, parseTemplateLiteral());\n            }\n        }\n        return expr;\n    }\n    // 11.3 Postfix Expressions\n    function parsePostfixExpression() {\n        var expr = parseLeftHandSideExpressionAllowCall(), token = lookahead;\n        if (lookahead.type !== Token.Punctuator) {\n            return expr;\n        }\n        if ((match('++') || match('--')) && !peekLineTerminator()) {\n            // 11.3.1, 11.3.2\n            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n                throwErrorTolerant({}, Messages.StrictLHSPostfix);\n            }\n            if (!isLeftHandSide(expr)) {\n                throwError({}, Messages.InvalidLHSInAssignment);\n            }\n            token = lex();\n            expr = delegate.createPostfixExpression(token.value, expr);\n        }\n        return expr;\n    }\n    // 11.4 Unary Operators\n    function parseUnaryExpression() {\n        var token, expr;\n        if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n            return parsePostfixExpression();\n        }\n        if (match('++') || match('--')) {\n            token = lex();\n            expr = parseUnaryExpression();\n            // 11.4.4, 11.4.5\n            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n                throwErrorTolerant({}, Messages.StrictLHSPrefix);\n            }\n            if (!isLeftHandSide(expr)) {\n                throwError({}, Messages.InvalidLHSInAssignment);\n            }\n            return delegate.createUnaryExpression(token.value, expr);\n        }\n        if (match('+') || match('-') || match('~') || match('!')) {\n            token = lex();\n            expr = parseUnaryExpression();\n            return delegate.createUnaryExpression(token.value, expr);\n        }\n        if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n            token = lex();\n            expr = parseUnaryExpression();\n            expr = delegate.createUnaryExpression(token.value, expr);\n            if (expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n                throwErrorTolerant({}, Messages.StrictDelete);\n            }\n            return expr;\n        }\n        return parsePostfixExpression();\n    }\n    function binaryPrecedence(token, allowIn) {\n        var prec = 0;\n        if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n            return 0;\n        }\n        switch (token.value) {\n        case '||':\n            prec = 1;\n            break;\n        case '&&':\n            prec = 2;\n            break;\n        case '|':\n            prec = 3;\n            break;\n        case '^':\n            prec = 4;\n            break;\n        case '&':\n            prec = 5;\n            break;\n        case '==':\n        case '!=':\n        case '===':\n        case '!==':\n            prec = 6;\n            break;\n        case '<':\n        case '>':\n        case '<=':\n        case '>=':\n        case 'instanceof':\n            prec = 7;\n            break;\n        case 'in':\n            prec = allowIn ? 7 : 0;\n            break;\n        case '<<':\n        case '>>':\n        case '>>>':\n            prec = 8;\n            break;\n        case '+':\n        case '-':\n            prec = 9;\n            break;\n        case '*':\n        case '/':\n        case '%':\n            prec = 11;\n            break;\n        default:\n            break;\n        }\n        return prec;\n    }\n    // 11.5 Multiplicative Operators\n    // 11.6 Additive Operators\n    // 11.7 Bitwise Shift Operators\n    // 11.8 Relational Operators\n    // 11.9 Equality Operators\n    // 11.10 Binary Bitwise Operators\n    // 11.11 Binary Logical Operators\n    function parseBinaryExpression() {\n        var expr, token, prec, previousAllowIn, stack, right, operator, left, i;\n        previousAllowIn = state.allowIn;\n        state.allowIn = true;\n        expr = parseUnaryExpression();\n        token = lookahead;\n        prec = binaryPrecedence(token, previousAllowIn);\n        if (prec === 0) {\n            return expr;\n        }\n        token.prec = prec;\n        lex();\n        stack = [\n            expr,\n            token,\n            parseUnaryExpression()\n        ];\n        while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) {\n            // Reduce: make a binary expression from the three topmost entries.\n            while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n                right = stack.pop();\n                operator = stack.pop().value;\n                left = stack.pop();\n                stack.push(delegate.createBinaryExpression(operator, left, right));\n            }\n            // Shift.\n            token = lex();\n            token.prec = prec;\n            stack.push(token);\n            stack.push(parseUnaryExpression());\n        }\n        state.allowIn = previousAllowIn;\n        // Final reduce to clean-up the stack.\n        i = stack.length - 1;\n        expr = stack[i];\n        while (i > 1) {\n            expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n            i -= 2;\n        }\n        return expr;\n    }\n    // 11.12 Conditional Operator\n    function parseConditionalExpression() {\n        var expr, previousAllowIn, consequent, alternate;\n        expr = parseBinaryExpression();\n        if (match('?')) {\n            lex();\n            previousAllowIn = state.allowIn;\n            state.allowIn = true;\n            consequent = parseAssignmentExpression();\n            state.allowIn = previousAllowIn;\n            expect(':');\n            alternate = parseAssignmentExpression();\n            expr = delegate.createConditionalExpression(expr, consequent, alternate);\n        }\n        return expr;\n    }\n    // 11.13 Assignment Operators\n    function reinterpretAsAssignmentBindingPattern(expr) {\n        var i, len, property, element;\n        if (expr.type === Syntax.ObjectExpression) {\n            expr.type = Syntax.ObjectPattern;\n            for (i = 0, len = expr.properties.length; i < len; i += 1) {\n                property = expr.properties[i];\n                if (property.kind !== 'init') {\n                    throwError({}, Messages.InvalidLHSInAssignment);\n                }\n                reinterpretAsAssignmentBindingPattern(property.value);\n            }\n        } else if (expr.type === Syntax.ArrayExpression) {\n            expr.type = Syntax.ArrayPattern;\n            for (i = 0, len = expr.elements.length; i < len; i += 1) {\n                element = expr.elements[i];\n                if (element) {\n                    reinterpretAsAssignmentBindingPattern(element);\n                }\n            }\n        } else if (expr.type === Syntax.Identifier) {\n            if (isRestrictedWord(expr.name)) {\n                throwError({}, Messages.InvalidLHSInAssignment);\n            }\n        } else if (expr.type === Syntax.SpreadElement) {\n            reinterpretAsAssignmentBindingPattern(expr.argument);\n            if (expr.argument.type === Syntax.ObjectPattern) {\n                throwError({}, Messages.ObjectPatternAsSpread);\n            }\n        } else {\n            if (expr.type !== Syntax.MemberExpression && expr.type !== Syntax.CallExpression && expr.type !== Syntax.NewExpression) {\n                throwError({}, Messages.InvalidLHSInAssignment);\n            }\n        }\n    }\n    function reinterpretAsDestructuredParameter(options, expr) {\n        var i, len, property, element;\n        if (expr.type === Syntax.ObjectExpression) {\n            expr.type = Syntax.ObjectPattern;\n            for (i = 0, len = expr.properties.length; i < len; i += 1) {\n                property = expr.properties[i];\n                if (property.kind !== 'init') {\n                    throwError({}, Messages.InvalidLHSInFormalsList);\n                }\n                reinterpretAsDestructuredParameter(options, property.value);\n            }\n        } else if (expr.type === Syntax.ArrayExpression) {\n            expr.type = Syntax.ArrayPattern;\n            for (i = 0, len = expr.elements.length; i < len; i += 1) {\n                element = expr.elements[i];\n                if (element) {\n                    reinterpretAsDestructuredParameter(options, element);\n                }\n            }\n        } else if (expr.type === Syntax.Identifier) {\n            validateParam(options, expr, expr.name);\n        } else {\n            if (expr.type !== Syntax.MemberExpression) {\n                throwError({}, Messages.InvalidLHSInFormalsList);\n            }\n        }\n    }\n    function reinterpretAsCoverFormalsList(expressions) {\n        var i, len, param, params, defaults, defaultCount, options, rest;\n        params = [];\n        defaults = [];\n        defaultCount = 0;\n        rest = null;\n        options = { paramSet: {} };\n        for (i = 0, len = expressions.length; i < len; i += 1) {\n            param = expressions[i];\n            if (param.type === Syntax.Identifier) {\n                params.push(param);\n                defaults.push(null);\n                validateParam(options, param, param.name);\n            } else if (param.type === Syntax.ObjectExpression || param.type === Syntax.ArrayExpression) {\n                reinterpretAsDestructuredParameter(options, param);\n                params.push(param);\n                defaults.push(null);\n            } else if (param.type === Syntax.SpreadElement) {\n                assert(i === len - 1, 'It is guaranteed that SpreadElement is last element by parseExpression');\n                reinterpretAsDestructuredParameter(options, param.argument);\n                rest = param.argument;\n            } else if (param.type === Syntax.AssignmentExpression) {\n                params.push(param.left);\n                defaults.push(param.right);\n                ++defaultCount;\n                validateParam(options, param.left, param.left.name);\n            } else {\n                return null;\n            }\n        }\n        if (options.message === Messages.StrictParamDupe) {\n            throwError(strict ? options.stricted : options.firstRestricted, options.message);\n        }\n        if (defaultCount === 0) {\n            defaults = [];\n        }\n        return {\n            params: params,\n            defaults: defaults,\n            rest: rest,\n            stricted: options.stricted,\n            firstRestricted: options.firstRestricted,\n            message: options.message\n        };\n    }\n    function parseArrowFunctionExpression(options) {\n        var previousStrict, previousYieldAllowed, body;\n        expect('=>');\n        previousStrict = strict;\n        previousYieldAllowed = state.yieldAllowed;\n        state.yieldAllowed = false;\n        body = parseConciseBody();\n        if (strict && options.firstRestricted) {\n            throwError(options.firstRestricted, options.message);\n        }\n        if (strict && options.stricted) {\n            throwErrorTolerant(options.stricted, options.message);\n        }\n        strict = previousStrict;\n        state.yieldAllowed = previousYieldAllowed;\n        return delegate.createArrowFunctionExpression(options.params, options.defaults, body, options.rest, body.type !== Syntax.BlockStatement);\n    }\n    function parseAssignmentExpression() {\n        var expr, token, params, oldParenthesizedCount;\n        if (matchKeyword('yield')) {\n            return parseYieldExpression();\n        }\n        oldParenthesizedCount = state.parenthesizedCount;\n        if (match('(')) {\n            token = lookahead2();\n            if (token.type === Token.Punctuator && token.value === ')' || token.value === '...') {\n                params = parseParams();\n                if (!match('=>')) {\n                    throwUnexpected(lex());\n                }\n                return parseArrowFunctionExpression(params);\n            }\n        }\n        token = lookahead;\n        expr = parseConditionalExpression();\n        if (match('=>') && (state.parenthesizedCount === oldParenthesizedCount || state.parenthesizedCount === oldParenthesizedCount + 1)) {\n            if (expr.type === Syntax.Identifier) {\n                params = reinterpretAsCoverFormalsList([expr]);\n            } else if (expr.type === Syntax.SequenceExpression) {\n                params = reinterpretAsCoverFormalsList(expr.expressions);\n            }\n            if (params) {\n                return parseArrowFunctionExpression(params);\n            }\n        }\n        if (matchAssign()) {\n            // 11.13.1\n            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n                throwErrorTolerant(token, Messages.StrictLHSAssignment);\n            }\n            // ES.next draf 11.13 Runtime Semantics step 1\n            if (match('=') && (expr.type === Syntax.ObjectExpression || expr.type === Syntax.ArrayExpression)) {\n                reinterpretAsAssignmentBindingPattern(expr);\n            } else if (!isLeftHandSide(expr)) {\n                throwError({}, Messages.InvalidLHSInAssignment);\n            }\n            expr = delegate.createAssignmentExpression(lex().value, expr, parseAssignmentExpression());\n        }\n        return expr;\n    }\n    // 11.14 Comma Operator\n    function parseExpression() {\n        var expr, expressions, sequence, coverFormalsList, spreadFound, oldParenthesizedCount;\n        oldParenthesizedCount = state.parenthesizedCount;\n        expr = parseAssignmentExpression();\n        expressions = [expr];\n        if (match(',')) {\n            while (streamIndex < length) {\n                if (!match(',')) {\n                    break;\n                }\n                lex();\n                expr = parseSpreadOrAssignmentExpression();\n                expressions.push(expr);\n                if (expr.type === Syntax.SpreadElement) {\n                    spreadFound = true;\n                    if (!match(')')) {\n                        throwError({}, Messages.ElementAfterSpreadElement);\n                    }\n                    break;\n                }\n            }\n            sequence = delegate.createSequenceExpression(expressions);\n        }\n        if (match('=>')) {\n            // Do not allow nested parentheses on the LHS of the =>.\n            if (state.parenthesizedCount === oldParenthesizedCount || state.parenthesizedCount === oldParenthesizedCount + 1) {\n                expr = expr.type === Syntax.SequenceExpression ? expr.expressions : expressions;\n                coverFormalsList = reinterpretAsCoverFormalsList(expr);\n                if (coverFormalsList) {\n                    return parseArrowFunctionExpression(coverFormalsList);\n                }\n            }\n            throwUnexpected(lex());\n        }\n        if (spreadFound && lookahead2().value !== '=>') {\n            throwError({}, Messages.IllegalSpread);\n        }\n        return sequence || expr;\n    }\n    // 12.1 Block\n    function parseStatementList() {\n        var list = [], statement;\n        while (streamIndex < length) {\n            if (match('}')) {\n                break;\n            }\n            statement = parseSourceElement();\n            if (typeof statement === 'undefined') {\n                break;\n            }\n            list.push(statement);\n        }\n        return list;\n    }\n    function parseBlock() {\n        var block;\n        expect('{');\n        block = parseStatementList();\n        expect('}');\n        return delegate.createBlockStatement(block);\n    }\n    // 12.2 Variable Statement\n    function parseVariableIdentifier() {\n        var token = lookahead, resolvedIdent;\n        if (token.type !== Token.Identifier) {\n            throwUnexpected(token);\n        }\n        resolvedIdent = expander.resolve(tokenStream[lookaheadIndex]);\n        lex();\n        return delegate.createIdentifier(resolvedIdent);\n    }\n    function parseVariableDeclaration(kind) {\n        var id, init = null;\n        if (match('{')) {\n            id = parseObjectInitialiser();\n            reinterpretAsAssignmentBindingPattern(id);\n        } else if (match('[')) {\n            id = parseArrayInitialiser();\n            reinterpretAsAssignmentBindingPattern(id);\n        } else {\n            id = state.allowKeyword ? parseNonComputedProperty() : parseVariableIdentifier();\n            // 12.2.1\n            if (strict && isRestrictedWord(id.name)) {\n                throwErrorTolerant({}, Messages.StrictVarName);\n            }\n        }\n        if (kind === 'const') {\n            if (!match('=')) {\n                throwError({}, Messages.NoUnintializedConst);\n            }\n            expect('=');\n            init = parseAssignmentExpression();\n        } else if (match('=')) {\n            lex();\n            init = parseAssignmentExpression();\n        }\n        return delegate.createVariableDeclarator(id, init);\n    }\n    function parseVariableDeclarationList(kind) {\n        var list = [];\n        do {\n            list.push(parseVariableDeclaration(kind));\n            if (!match(',')) {\n                break;\n            }\n            lex();\n        } while (streamIndex < length);\n        return list;\n    }\n    function parseVariableStatement() {\n        var declarations;\n        expectKeyword('var');\n        declarations = parseVariableDeclarationList();\n        consumeSemicolon();\n        return delegate.createVariableDeclaration(declarations, 'var');\n    }\n    // kind may be `const` or `let`\n    // Both are experimental and not in the specification yet.\n    // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n    // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n    function parseConstLetDeclaration(kind) {\n        var declarations;\n        expectKeyword(kind);\n        declarations = parseVariableDeclarationList(kind);\n        consumeSemicolon();\n        return delegate.createVariableDeclaration(declarations, kind);\n    }\n    // http://wiki.ecmascript.org/doku.php?id=harmony:modules\n    function parseModuleDeclaration() {\n        var id, src, body;\n        lex();\n        // 'module'\n        if (peekLineTerminator()) {\n            throwError({}, Messages.NewlineAfterModule);\n        }\n        switch (lookahead.type) {\n        case Token.StringLiteral:\n            id = parsePrimaryExpression();\n            body = parseModuleBlock();\n            src = null;\n            break;\n        case Token.Identifier:\n            id = parseVariableIdentifier();\n            body = null;\n            if (!matchContextualKeyword('from')) {\n                throwUnexpected(lex());\n            }\n            lex();\n            src = parsePrimaryExpression();\n            if (src.type !== Syntax.Literal) {\n                throwError({}, Messages.InvalidModuleSpecifier);\n            }\n            break;\n        }\n        consumeSemicolon();\n        return delegate.createModuleDeclaration(id, src, body);\n    }\n    function parseExportBatchSpecifier() {\n        expect('*');\n        return delegate.createExportBatchSpecifier();\n    }\n    function parseExportSpecifier() {\n        var id, name = null;\n        id = parseVariableIdentifier();\n        if (matchContextualKeyword('as')) {\n            lex();\n            name = parseNonComputedProperty();\n        }\n        return delegate.createExportSpecifier(id, name);\n    }\n    function parseExportDeclaration() {\n        var previousAllowKeyword, decl, def, src, specifiers;\n        expectKeyword('export');\n        if (lookahead.type === Token.Keyword) {\n            switch (lookahead.value) {\n            case 'let':\n            case 'const':\n            case 'var':\n            case 'class':\n            case 'function':\n                return delegate.createExportDeclaration(parseSourceElement(), null, null);\n            }\n        }\n        if (isIdentifierName(lookahead)) {\n            previousAllowKeyword = state.allowKeyword;\n            state.allowKeyword = true;\n            decl = parseVariableDeclarationList('let');\n            state.allowKeyword = previousAllowKeyword;\n            return delegate.createExportDeclaration(decl, null, null);\n        }\n        specifiers = [];\n        src = null;\n        if (match('*')) {\n            specifiers.push(parseExportBatchSpecifier());\n        } else {\n            expect('{');\n            do {\n                specifiers.push(parseExportSpecifier());\n            } while (match(',') && lex());\n            expect('}');\n        }\n        if (matchContextualKeyword('from')) {\n            lex();\n            src = parsePrimaryExpression();\n            if (src.type !== Syntax.Literal) {\n                throwError({}, Messages.InvalidModuleSpecifier);\n            }\n        }\n        consumeSemicolon();\n        return delegate.createExportDeclaration(null, specifiers, src);\n    }\n    function parseImportDeclaration() {\n        var specifiers, kind, src;\n        expectKeyword('import');\n        specifiers = [];\n        if (isIdentifierName(lookahead)) {\n            kind = 'default';\n            specifiers.push(parseImportSpecifier());\n            if (!matchContextualKeyword('from')) {\n                throwError({}, Messages.NoFromAfterImport);\n            }\n            lex();\n        } else if (match('{')) {\n            kind = 'named';\n            lex();\n            do {\n                specifiers.push(parseImportSpecifier());\n            } while (match(',') && lex());\n            expect('}');\n            if (!matchContextualKeyword('from')) {\n                throwError({}, Messages.NoFromAfterImport);\n            }\n            lex();\n        }\n        src = parsePrimaryExpression();\n        if (src.type !== Syntax.Literal) {\n            throwError({}, Messages.InvalidModuleSpecifier);\n        }\n        consumeSemicolon();\n        return delegate.createImportDeclaration(specifiers, kind, src);\n    }\n    function parseImportSpecifier() {\n        var id, name = null;\n        id = parseNonComputedProperty();\n        if (matchContextualKeyword('as')) {\n            lex();\n            name = parseVariableIdentifier();\n        }\n        return delegate.createImportSpecifier(id, name);\n    }\n    // 12.3 Empty Statement\n    function parseEmptyStatement() {\n        expect(';');\n        return delegate.createEmptyStatement();\n    }\n    // 12.4 Expression Statement\n    function parseExpressionStatement() {\n        var expr = parseExpression();\n        consumeSemicolon();\n        return delegate.createExpressionStatement(expr);\n    }\n    // 12.5 If statement\n    function parseIfStatement() {\n        var test, consequent, alternate;\n        expectKeyword('if');\n        expect('(');\n        test = parseExpression();\n        expect(')');\n        consequent = parseStatement();\n        if (matchKeyword('else')) {\n            lex();\n            alternate = parseStatement();\n        } else {\n            alternate = null;\n        }\n        return delegate.createIfStatement(test, consequent, alternate);\n    }\n    // 12.6 Iteration Statements\n    function parseDoWhileStatement() {\n        var body, test, oldInIteration;\n        expectKeyword('do');\n        oldInIteration = state.inIteration;\n        state.inIteration = true;\n        body = parseStatement();\n        state.inIteration = oldInIteration;\n        expectKeyword('while');\n        expect('(');\n        test = parseExpression();\n        expect(')');\n        if (match(';')) {\n            lex();\n        }\n        return delegate.createDoWhileStatement(body, test);\n    }\n    function parseWhileStatement() {\n        var test, body, oldInIteration;\n        expectKeyword('while');\n        expect('(');\n        test = parseExpression();\n        expect(')');\n        oldInIteration = state.inIteration;\n        state.inIteration = true;\n        body = parseStatement();\n        state.inIteration = oldInIteration;\n        return delegate.createWhileStatement(test, body);\n    }\n    function parseForVariableDeclaration() {\n        var token = lex(), declarations = parseVariableDeclarationList();\n        return delegate.createVariableDeclaration(declarations, token.value);\n    }\n    function parseForStatement(opts) {\n        var init, test, update, left, right, body, operator, oldInIteration;\n        init = test = update = null;\n        expectKeyword('for');\n        // http://wiki.ecmascript.org/doku.php?id=proposals:iterators_and_generators&s=each\n        if (matchContextualKeyword('each')) {\n            throwError({}, Messages.EachNotAllowed);\n        }\n        expect('(');\n        if (match(';')) {\n            lex();\n        } else {\n            if (matchKeyword('var') || matchKeyword('let') || matchKeyword('const')) {\n                state.allowIn = false;\n                init = parseForVariableDeclaration();\n                state.allowIn = true;\n                if (init.declarations.length === 1) {\n                    if (matchKeyword('in') || matchContextualKeyword('of')) {\n                        operator = lookahead;\n                        if (!((operator.value === 'in' || init.kind !== 'var') && init.declarations[0].init)) {\n                            lex();\n                            left = init;\n                            right = parseExpression();\n                            init = null;\n                        }\n                    }\n                }\n            } else {\n                state.allowIn = false;\n                init = parseExpression();\n                state.allowIn = true;\n                if (matchContextualKeyword('of')) {\n                    operator = lex();\n                    left = init;\n                    right = parseExpression();\n                    init = null;\n                } else if (matchKeyword('in')) {\n                    // LeftHandSideExpression\n                    if (!isAssignableLeftHandSide(init)) {\n                        throwError({}, Messages.InvalidLHSInForIn);\n                    }\n                    operator = lex();\n                    left = init;\n                    right = parseExpression();\n                    init = null;\n                }\n            }\n            if (typeof left === 'undefined') {\n                expect(';');\n            }\n        }\n        if (typeof left === 'undefined') {\n            if (!match(';')) {\n                test = parseExpression();\n            }\n            expect(';');\n            if (!match(')')) {\n                update = parseExpression();\n            }\n        }\n        expect(')');\n        oldInIteration = state.inIteration;\n        state.inIteration = true;\n        if (!(opts !== undefined && opts.ignoreBody)) {\n            body = parseStatement();\n        }\n        state.inIteration = oldInIteration;\n        if (typeof left === 'undefined') {\n            return delegate.createForStatement(init, test, update, body);\n        }\n        if (operator.value === 'in') {\n            return delegate.createForInStatement(left, right, body);\n        }\n        return delegate.createForOfStatement(left, right, body);\n    }\n    // 12.7 The continue statement\n    function parseContinueStatement() {\n        var label = null, key;\n        expectKeyword('continue');\n        // Optimize the most common form: 'continue;'.\n        if (lookahead.value.charCodeAt(0) === 59) {\n            lex();\n            if (!state.inIteration) {\n                throwError({}, Messages.IllegalContinue);\n            }\n            return delegate.createContinueStatement(null);\n        }\n        if (peekLineTerminator()) {\n            if (!state.inIteration) {\n                throwError({}, Messages.IllegalContinue);\n            }\n            return delegate.createContinueStatement(null);\n        }\n        if (lookahead.type === Token.Identifier) {\n            label = parseVariableIdentifier();\n            key = '$' + label.name;\n            if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n                throwError({}, Messages.UnknownLabel, label.name);\n            }\n        }\n        consumeSemicolon();\n        if (label === null && !state.inIteration) {\n            throwError({}, Messages.IllegalContinue);\n        }\n        return delegate.createContinueStatement(label);\n    }\n    // 12.8 The break statement\n    function parseBreakStatement() {\n        var label = null, key;\n        expectKeyword('break');\n        // Catch the very common case first: immediately a semicolon (char #59).\n        if (lookahead.value.charCodeAt(0) === 59) {\n            lex();\n            if (!(state.inIteration || state.inSwitch)) {\n                throwError({}, Messages.IllegalBreak);\n            }\n            return delegate.createBreakStatement(null);\n        }\n        if (peekLineTerminator()) {\n            if (!(state.inIteration || state.inSwitch)) {\n                throwError({}, Messages.IllegalBreak);\n            }\n            return delegate.createBreakStatement(null);\n        }\n        if (lookahead.type === Token.Identifier) {\n            label = parseVariableIdentifier();\n            key = '$' + label.name;\n            if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n                throwError({}, Messages.UnknownLabel, label.name);\n            }\n        }\n        consumeSemicolon();\n        if (label === null && !(state.inIteration || state.inSwitch)) {\n            throwError({}, Messages.IllegalBreak);\n        }\n        return delegate.createBreakStatement(label);\n    }\n    // 12.9 The return statement\n    function parseReturnStatement() {\n        var argument = null;\n        expectKeyword('return');\n        if (!state.inFunctionBody) {\n            throwErrorTolerant({}, Messages.IllegalReturn);\n        }\n        // 'return' followed by a space and an identifier is very common.\n        if (isIdentifierStart(String(lookahead.value).charCodeAt(0))) {\n            argument = parseExpression();\n            consumeSemicolon();\n            return delegate.createReturnStatement(argument);\n        }\n        if (peekLineTerminator()) {\n            return delegate.createReturnStatement(null);\n        }\n        if (!match(';')) {\n            if (!match('}') && lookahead.type !== Token.EOF) {\n                argument = parseExpression();\n            }\n        }\n        consumeSemicolon();\n        return delegate.createReturnStatement(argument);\n    }\n    // 12.10 The with statement\n    function parseWithStatement() {\n        var object, body;\n        if (strict) {\n            throwErrorTolerant({}, Messages.StrictModeWith);\n        }\n        expectKeyword('with');\n        expect('(');\n        object = parseExpression();\n        expect(')');\n        body = parseStatement();\n        return delegate.createWithStatement(object, body);\n    }\n    // 12.10 The swith statement\n    function parseSwitchCase() {\n        var test, consequent = [], sourceElement;\n        if (matchKeyword('default')) {\n            lex();\n            test = null;\n        } else {\n            expectKeyword('case');\n            test = parseExpression();\n        }\n        expect(':');\n        while (streamIndex < length) {\n            if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n                break;\n            }\n            sourceElement = parseSourceElement();\n            if (typeof sourceElement === 'undefined') {\n                break;\n            }\n            consequent.push(sourceElement);\n        }\n        return delegate.createSwitchCase(test, consequent);\n    }\n    function parseSwitchStatement() {\n        var discriminant, cases, clause, oldInSwitch, defaultFound;\n        expectKeyword('switch');\n        expect('(');\n        discriminant = parseExpression();\n        expect(')');\n        expect('{');\n        cases = [];\n        if (match('}')) {\n            lex();\n            return delegate.createSwitchStatement(discriminant, cases);\n        }\n        oldInSwitch = state.inSwitch;\n        state.inSwitch = true;\n        defaultFound = false;\n        while (streamIndex < length) {\n            if (match('}')) {\n                break;\n            }\n            clause = parseSwitchCase();\n            if (clause.test === null) {\n                if (defaultFound) {\n                    throwError({}, Messages.MultipleDefaultsInSwitch);\n                }\n                defaultFound = true;\n            }\n            cases.push(clause);\n        }\n        state.inSwitch = oldInSwitch;\n        expect('}');\n        return delegate.createSwitchStatement(discriminant, cases);\n    }\n    // 12.13 The throw statement\n    function parseThrowStatement() {\n        var argument;\n        expectKeyword('throw');\n        if (peekLineTerminator()) {\n            throwError({}, Messages.NewlineAfterThrow);\n        }\n        argument = parseExpression();\n        consumeSemicolon();\n        return delegate.createThrowStatement(argument);\n    }\n    // 12.14 The try statement\n    function parseCatchClause() {\n        var param, body;\n        expectKeyword('catch');\n        expect('(');\n        if (match(')')) {\n            throwUnexpected(lookahead);\n        }\n        param = parseExpression();\n        // 12.14.1\n        if (strict && param.type === Syntax.Identifier && isRestrictedWord(param.name)) {\n            throwErrorTolerant({}, Messages.StrictCatchVariable);\n        }\n        expect(')');\n        body = parseBlock();\n        return delegate.createCatchClause(param, body);\n    }\n    function parseTryStatement() {\n        var block, handlers = [], finalizer = null;\n        expectKeyword('try');\n        block = parseBlock();\n        if (matchKeyword('catch')) {\n            handlers.push(parseCatchClause());\n        }\n        if (matchKeyword('finally')) {\n            lex();\n            finalizer = parseBlock();\n        }\n        if (handlers.length === 0 && !finalizer) {\n            throwError({}, Messages.NoCatchOrFinally);\n        }\n        return delegate.createTryStatement(block, [], handlers, finalizer);\n    }\n    // 12.15 The debugger statement\n    function parseDebuggerStatement() {\n        expectKeyword('debugger');\n        consumeSemicolon();\n        return delegate.createDebuggerStatement();\n    }\n    // 12 Statements\n    function parseStatement() {\n        var type = lookahead.type, expr, labeledBody, key;\n        if (type === Token.EOF) {\n            throwUnexpected(lookahead);\n        }\n        if (type === Token.Punctuator) {\n            switch (lookahead.value) {\n            case ';':\n                return parseEmptyStatement();\n            case '{':\n                return parseBlock();\n            case '(':\n                return parseExpressionStatement();\n            default:\n                break;\n            }\n        }\n        if (type === Token.Keyword) {\n            switch (lookahead.value) {\n            case 'break':\n                return parseBreakStatement();\n            case 'continue':\n                return parseContinueStatement();\n            case 'debugger':\n                return parseDebuggerStatement();\n            case 'do':\n                return parseDoWhileStatement();\n            case 'for':\n                return parseForStatement();\n            case 'function':\n                return parseFunctionDeclaration();\n            case 'class':\n                return parseClassDeclaration();\n            case 'if':\n                return parseIfStatement();\n            case 'return':\n                return parseReturnStatement();\n            case 'switch':\n                return parseSwitchStatement();\n            case 'throw':\n                return parseThrowStatement();\n            case 'try':\n                return parseTryStatement();\n            case 'var':\n                return parseVariableStatement();\n            case 'while':\n                return parseWhileStatement();\n            case 'with':\n                return parseWithStatement();\n            default:\n                break;\n            }\n        }\n        expr = parseExpression();\n        // 12.12 Labelled Statements\n        if (expr.type === Syntax.Identifier && match(':')) {\n            lex();\n            key = '$' + expr.name;\n            if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n                throwError({}, Messages.Redeclaration, 'Label', expr.name);\n            }\n            state.labelSet[key] = true;\n            labeledBody = parseStatement();\n            delete state.labelSet[key];\n            return delegate.createLabeledStatement(expr, labeledBody);\n        }\n        consumeSemicolon();\n        return delegate.createExpressionStatement(expr);\n    }\n    // 13 Function Definition\n    function parseConciseBody() {\n        if (match('{')) {\n            return parseFunctionSourceElements();\n        }\n        return parseAssignmentExpression();\n    }\n    function parseFunctionSourceElements() {\n        var sourceElement, sourceElements = [], token, directive, firstRestricted, oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesizedCount;\n        expect('{');\n        while (streamIndex < length) {\n            if (lookahead.type !== Token.StringLiteral) {\n                break;\n            }\n            token = lookahead;\n            sourceElement = parseSourceElement();\n            sourceElements.push(sourceElement);\n            if (sourceElement.expression.type !== Syntax.Literal) {\n                // this is not directive\n                break;\n            }\n            directive = token.value;\n            if (directive === 'use strict') {\n                strict = true;\n                if (firstRestricted) {\n                    throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n                }\n            } else {\n                if (!firstRestricted && token.octal) {\n                    firstRestricted = token;\n                }\n            }\n        }\n        oldLabelSet = state.labelSet;\n        oldInIteration = state.inIteration;\n        oldInSwitch = state.inSwitch;\n        oldInFunctionBody = state.inFunctionBody;\n        oldParenthesizedCount = state.parenthesizedCount;\n        state.labelSet = {};\n        state.inIteration = false;\n        state.inSwitch = false;\n        state.inFunctionBody = true;\n        state.parenthesizedCount = 0;\n        while (streamIndex < length) {\n            if (match('}')) {\n                break;\n            }\n            sourceElement = parseSourceElement();\n            if (typeof sourceElement === 'undefined') {\n                break;\n            }\n            sourceElements.push(sourceElement);\n        }\n        expect('}');\n        state.labelSet = oldLabelSet;\n        state.inIteration = oldInIteration;\n        state.inSwitch = oldInSwitch;\n        state.inFunctionBody = oldInFunctionBody;\n        state.parenthesizedCount = oldParenthesizedCount;\n        return delegate.createBlockStatement(sourceElements);\n    }\n    function validateParam(options, param, name) {\n        var key = '$' + name;\n        if (strict) {\n            if (isRestrictedWord(name)) {\n                options.stricted = param;\n                options.message = Messages.StrictParamName;\n            }\n            if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {\n                options.stricted = param;\n                options.message = Messages.StrictParamDupe;\n            }\n        } else if (!options.firstRestricted) {\n            if (isRestrictedWord(name)) {\n                options.firstRestricted = param;\n                options.message = Messages.StrictParamName;\n            } else if (isStrictModeReservedWord(name)) {\n                options.firstRestricted = param;\n                options.message = Messages.StrictReservedWord;\n            } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {\n                options.firstRestricted = param;\n                options.message = Messages.StrictParamDupe;\n            }\n        }\n        options.paramSet[key] = true;\n    }\n    function parseParam(options) {\n        var token, rest, param, def;\n        token = lookahead;\n        if (token.value === '...') {\n            token = lex();\n            rest = true;\n        }\n        if (match('[')) {\n            param = parseArrayInitialiser();\n            reinterpretAsDestructuredParameter(options, param);\n        } else if (match('{')) {\n            if (rest) {\n                throwError({}, Messages.ObjectPatternAsRestParameter);\n            }\n            param = parseObjectInitialiser();\n            reinterpretAsDestructuredParameter(options, param);\n        } else {\n            param = parseVariableIdentifier();\n            validateParam(options, token, token.value);\n            if (match('=')) {\n                if (rest) {\n                    throwErrorTolerant(lookahead, Messages.DefaultRestParameter);\n                }\n                lex();\n                def = parseAssignmentExpression();\n                ++options.defaultCount;\n            }\n        }\n        if (rest) {\n            if (!match(')')) {\n                throwError({}, Messages.ParameterAfterRestParameter);\n            }\n            options.rest = param;\n            return false;\n        }\n        options.params.push(param);\n        options.defaults.push(def);\n        return !match(')');\n    }\n    function parseParams(firstRestricted) {\n        var options;\n        options = {\n            params: [],\n            defaultCount: 0,\n            defaults: [],\n            rest: null,\n            firstRestricted: firstRestricted\n        };\n        expect('(');\n        if (!match(')')) {\n            options.paramSet = {};\n            while (streamIndex < length) {\n                if (!parseParam(options)) {\n                    break;\n                }\n                expect(',');\n            }\n        }\n        expect(')');\n        if (options.defaultCount === 0) {\n            options.defaults = [];\n        }\n        return options;\n    }\n    function parseFunctionDeclaration() {\n        var id, body, token, tmp, firstRestricted, message, previousStrict, previousYieldAllowed, generator, expression;\n        expectKeyword('function');\n        generator = false;\n        if (match('*')) {\n            lex();\n            generator = true;\n        }\n        token = lookahead;\n        id = parseVariableIdentifier();\n        if (strict) {\n            if (isRestrictedWord(token.value)) {\n                throwErrorTolerant(token, Messages.StrictFunctionName);\n            }\n        } else {\n            if (isRestrictedWord(token.value)) {\n                firstRestricted = token;\n                message = Messages.StrictFunctionName;\n            } else if (isStrictModeReservedWord(token.value)) {\n                firstRestricted = token;\n                message = Messages.StrictReservedWord;\n            }\n        }\n        tmp = parseParams(firstRestricted);\n        firstRestricted = tmp.firstRestricted;\n        if (tmp.message) {\n            message = tmp.message;\n        }\n        previousStrict = strict;\n        previousYieldAllowed = state.yieldAllowed;\n        state.yieldAllowed = generator;\n        // here we redo some work in order to set 'expression'\n        expression = !match('{');\n        body = parseConciseBody();\n        if (strict && firstRestricted) {\n            throwError(firstRestricted, message);\n        }\n        if (strict && tmp.stricted) {\n            throwErrorTolerant(tmp.stricted, message);\n        }\n        if (state.yieldAllowed && !state.yieldFound) {\n            throwErrorTolerant({}, Messages.NoYieldInGenerator);\n        }\n        strict = previousStrict;\n        state.yieldAllowed = previousYieldAllowed;\n        return delegate.createFunctionDeclaration(id, tmp.params, tmp.defaults, body, tmp.rest, generator, expression);\n    }\n    function parseFunctionExpression() {\n        var token, id = null, firstRestricted, message, tmp, body, previousStrict, previousYieldAllowed, generator, expression;\n        expectKeyword('function');\n        generator = false;\n        if (match('*')) {\n            lex();\n            generator = true;\n        }\n        if (!match('(')) {\n            token = lookahead;\n            id = parseVariableIdentifier();\n            if (strict) {\n                if (isRestrictedWord(token.value)) {\n                    throwErrorTolerant(token, Messages.StrictFunctionName);\n                }\n            } else {\n                if (isRestrictedWord(token.value)) {\n                    firstRestricted = token;\n                    message = Messages.StrictFunctionName;\n                } else if (isStrictModeReservedWord(token.value)) {\n                    firstRestricted = token;\n                    message = Messages.StrictReservedWord;\n                }\n            }\n        }\n        tmp = parseParams(firstRestricted);\n        firstRestricted = tmp.firstRestricted;\n        if (tmp.message) {\n            message = tmp.message;\n        }\n        previousStrict = strict;\n        previousYieldAllowed = state.yieldAllowed;\n        state.yieldAllowed = generator;\n        // here we redo some work in order to set 'expression'\n        expression = !match('{');\n        body = parseConciseBody();\n        if (strict && firstRestricted) {\n            throwError(firstRestricted, message);\n        }\n        if (strict && tmp.stricted) {\n            throwErrorTolerant(tmp.stricted, message);\n        }\n        if (state.yieldAllowed && !state.yieldFound) {\n            throwErrorTolerant({}, Messages.NoYieldInGenerator);\n        }\n        strict = previousStrict;\n        state.yieldAllowed = previousYieldAllowed;\n        return delegate.createFunctionExpression(id, tmp.params, tmp.defaults, body, tmp.rest, generator, expression);\n    }\n    function parseYieldExpression() {\n        var delegateFlag, expr, previousYieldAllowed;\n        expectKeyword('yield');\n        if (!state.yieldAllowed) {\n            throwErrorTolerant({}, Messages.IllegalYield);\n        }\n        delegateFlag = false;\n        if (match('*')) {\n            lex();\n            delegateFlag = true;\n        }\n        // It is a Syntax Error if any AssignmentExpression Contains YieldExpression.\n        previousYieldAllowed = state.yieldAllowed;\n        state.yieldAllowed = false;\n        expr = parseAssignmentExpression();\n        state.yieldAllowed = previousYieldAllowed;\n        state.yieldFound = true;\n        return delegate.createYieldExpression(expr, delegateFlag);\n    }\n    // 14 Classes\n    function parseMethodDefinition(existingPropNames) {\n        var token, key, param, propType, isValidDuplicateProp = false;\n        if (lookahead.value === 'static') {\n            propType = ClassPropertyType.static;\n            lex();\n        } else {\n            propType = ClassPropertyType.prototype;\n        }\n        if (match('*')) {\n            lex();\n            return delegate.createMethodDefinition(propType, '', parseObjectPropertyKey(), parsePropertyMethodFunction({ generator: true }));\n        }\n        token = lookahead;\n        key = parseObjectPropertyKey();\n        if (token.value === 'get' && !match('(')) {\n            key = parseObjectPropertyKey();\n            // It is a syntax error if any other properties have a name\n            // duplicating this one unless they are a setter\n            if (existingPropNames[propType].hasOwnProperty(key.name)) {\n                isValidDuplicateProp = existingPropNames[propType][key.name].get === undefined && existingPropNames[propType][key.name].data === undefined && existingPropNames[propType][key.name].set !== undefined;\n                if (!isValidDuplicateProp) {\n                    throwError(key, Messages.IllegalDuplicateClassProperty);\n                }\n            } else {\n                existingPropNames[propType][key.name] = {};\n            }\n            existingPropNames[propType][key.name].get = true;\n            expect('(');\n            expect(')');\n            return delegate.createMethodDefinition(propType, 'get', key, parsePropertyFunction({ generator: false }));\n        }\n        if (token.value === 'set' && !match('(')) {\n            key = parseObjectPropertyKey();\n            // It is a syntax error if any other properties have a name\n            // duplicating this one unless they are a getter\n            if (existingPropNames[propType].hasOwnProperty(key.name)) {\n                isValidDuplicateProp = existingPropNames[propType][key.name].set === undefined && existingPropNames[propType][key.name].data === undefined && existingPropNames[propType][key.name].get !== undefined;\n                if (!isValidDuplicateProp) {\n                    throwError(key, Messages.IllegalDuplicateClassProperty);\n                }\n            } else {\n                existingPropNames[propType][key.name] = {};\n            }\n            existingPropNames[propType][key.name].set = true;\n            expect('(');\n            token = lookahead;\n            param = [parseVariableIdentifier()];\n            expect(')');\n            return delegate.createMethodDefinition(propType, 'set', key, parsePropertyFunction({\n                params: param,\n                generator: false,\n                name: token\n            }));\n        }\n        // It is a syntax error if any other properties have the same name as a\n        // non-getter, non-setter method\n        if (existingPropNames[propType].hasOwnProperty(key.name)) {\n            throwError(key, Messages.IllegalDuplicateClassProperty);\n        } else {\n            existingPropNames[propType][key.name] = {};\n        }\n        existingPropNames[propType][key.name].data = true;\n        return delegate.createMethodDefinition(propType, '', key, parsePropertyMethodFunction({ generator: false }));\n    }\n    function parseClassElement(existingProps) {\n        if (match(';')) {\n            lex();\n            return;\n        }\n        return parseMethodDefinition(existingProps);\n    }\n    function parseClassBody() {\n        var classElement, classElements = [], existingProps = {};\n        existingProps[ClassPropertyType.static] = {};\n        existingProps[ClassPropertyType.prototype] = {};\n        expect('{');\n        while (streamIndex < length) {\n            if (match('}')) {\n                break;\n            }\n            classElement = parseClassElement(existingProps);\n            if (typeof classElement !== 'undefined') {\n                classElements.push(classElement);\n            }\n        }\n        expect('}');\n        return delegate.createClassBody(classElements);\n    }\n    function parseClassExpression() {\n        var id, previousYieldAllowed, superClass = null;\n        expectKeyword('class');\n        if (!matchKeyword('extends') && !match('{')) {\n            id = parseVariableIdentifier();\n        }\n        if (matchKeyword('extends')) {\n            expectKeyword('extends');\n            previousYieldAllowed = state.yieldAllowed;\n            state.yieldAllowed = false;\n            superClass = parseAssignmentExpression();\n            state.yieldAllowed = previousYieldAllowed;\n        }\n        return delegate.createClassExpression(id, superClass, parseClassBody());\n    }\n    function parseClassDeclaration() {\n        var id, previousYieldAllowed, superClass = null;\n        expectKeyword('class');\n        id = parseVariableIdentifier();\n        if (matchKeyword('extends')) {\n            expectKeyword('extends');\n            previousYieldAllowed = state.yieldAllowed;\n            state.yieldAllowed = false;\n            superClass = parseAssignmentExpression();\n            state.yieldAllowed = previousYieldAllowed;\n        }\n        return delegate.createClassDeclaration(id, superClass, parseClassBody());\n    }\n    // 15 Program\n    function matchModuleDeclaration() {\n        var id;\n        if (matchContextualKeyword('module')) {\n            id = lookahead2();\n            return id.type === Token.StringLiteral || id.type === Token.Identifier;\n        }\n        return false;\n    }\n    function parseSourceElement() {\n        if (lookahead.type === Token.Keyword) {\n            switch (lookahead.value) {\n            case 'const':\n            case 'let':\n                return parseConstLetDeclaration(lookahead.value);\n            case 'function':\n                return parseFunctionDeclaration();\n            case 'export':\n                return parseExportDeclaration();\n            case 'import':\n                return parseImportDeclaration();\n            default:\n                return parseStatement();\n            }\n        }\n        if (matchModuleDeclaration()) {\n            throwError({}, Messages.NestedModule);\n        }\n        if (lookahead.type !== Token.EOF) {\n            return parseStatement();\n        }\n    }\n    function parseProgramElement() {\n        if (lookahead.type === Token.Keyword) {\n            switch (lookahead.value) {\n            case 'export':\n                return parseExportDeclaration();\n            case 'import':\n                return parseImportDeclaration();\n            }\n        }\n        if (matchModuleDeclaration()) {\n            return parseModuleDeclaration();\n        }\n        return parseSourceElement();\n    }\n    function parseProgramElements() {\n        var sourceElement, sourceElements = [], token, directive, firstRestricted;\n        while (streamIndex < length) {\n            token = lookahead;\n            if (token.type !== Token.StringLiteral) {\n                break;\n            }\n            sourceElement = parseProgramElement();\n            sourceElements.push(sourceElement);\n            if (sourceElement.expression.type !== Syntax.Literal) {\n                // this is not directive\n                break;\n            }\n            directive = token.value;\n            if (directive === 'use strict') {\n                strict = true;\n                if (firstRestricted) {\n                    throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n                }\n            } else {\n                if (!firstRestricted && token.octal) {\n                    firstRestricted = token;\n                }\n            }\n        }\n        while (streamIndex < length) {\n            sourceElement = parseProgramElement();\n            if (typeof sourceElement === 'undefined') {\n                break;\n            }\n            sourceElements.push(sourceElement);\n        }\n        return sourceElements;\n    }\n    function parseModuleElement() {\n        return parseSourceElement();\n    }\n    function parseModuleElements() {\n        var list = [], statement;\n        while (streamIndex < length) {\n            if (match('}')) {\n                break;\n            }\n            statement = parseModuleElement();\n            if (typeof statement === 'undefined') {\n                break;\n            }\n            list.push(statement);\n        }\n        return list;\n    }\n    function parseModuleBlock() {\n        var block;\n        expect('{');\n        block = parseModuleElements();\n        expect('}');\n        return delegate.createBlockStatement(block);\n    }\n    function parseProgram() {\n        var body;\n        strict = false;\n        peek();\n        body = parseProgramElements();\n        return delegate.createProgram(body);\n    }\n    // The following functions are needed only when the option to preserve\n    // the comments is active.\n    function addComment(type, value, start, end, loc) {\n        assert(typeof start === 'number', 'Comment must have valid position');\n        // Because the way the actual token is scanned, often the comments\n        // (if any) are skipped twice during the lexical analysis.\n        // Thus, we need to skip adding a comment if the comment array already\n        // handled it.\n        if (extra.comments.length > 0) {\n            if (extra.comments[extra.comments.length - 1].range[1] > start) {\n                return;\n            }\n        }\n        extra.comments.push({\n            type: type,\n            value: value,\n            range: [\n                start,\n                end\n            ],\n            loc: loc\n        });\n    }\n    function scanComment() {\n        var comment, ch, loc, start, blockComment, lineComment;\n        comment = '';\n        blockComment = false;\n        lineComment = false;\n        while (index < length) {\n            ch = source[index];\n            if (lineComment) {\n                ch = source[index++];\n                if (isLineTerminator(ch.charCodeAt(0))) {\n                    loc.end = {\n                        line: lineNumber,\n                        column: index - lineStart - 1\n                    };\n                    lineComment = false;\n                    addComment('Line', comment, start, index - 1, loc);\n                    if (ch === '\\r' && source[index] === '\\n') {\n                        ++index;\n                    }\n                    ++lineNumber;\n                    lineStart = index;\n                    comment = '';\n                } else if (index >= length) {\n                    lineComment = false;\n                    comment += ch;\n                    loc.end = {\n                        line: lineNumber,\n                        column: length - lineStart\n                    };\n                    addComment('Line', comment, start, length, loc);\n                } else {\n                    comment += ch;\n                }\n            } else if (blockComment) {\n                if (isLineTerminator(ch.charCodeAt(0))) {\n                    if (ch === '\\r' && source[index + 1] === '\\n') {\n                        ++index;\n                        comment += '\\r\\n';\n                    } else {\n                        comment += ch;\n                    }\n                    ++lineNumber;\n                    ++index;\n                    lineStart = index;\n                    if (index >= length) {\n                        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                    }\n                } else {\n                    ch = source[index++];\n                    if (index >= length) {\n                        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                    }\n                    comment += ch;\n                    if (ch === '*') {\n                        ch = source[index];\n                        if (ch === '/') {\n                            comment = comment.substr(0, comment.length - 1);\n                            blockComment = false;\n                            ++index;\n                            loc.end = {\n                                line: lineNumber,\n                                column: index - lineStart\n                            };\n                            addComment('Block', comment, start, index, loc);\n                            comment = '';\n                        }\n                    }\n                }\n            } else if (ch === '/') {\n                ch = source[index + 1];\n                if (ch === '/') {\n                    loc = {\n                        start: {\n                            line: lineNumber,\n                            column: index - lineStart\n                        }\n                    };\n                    start = index;\n                    index += 2;\n                    lineComment = true;\n                    if (index >= length) {\n                        loc.end = {\n                            line: lineNumber,\n                            column: index - lineStart\n                        };\n                        lineComment = false;\n                        addComment('Line', comment, start, index, loc);\n                    }\n                } else if (ch === '*') {\n                    start = index;\n                    index += 2;\n                    blockComment = true;\n                    loc = {\n                        start: {\n                            line: lineNumber,\n                            column: index - lineStart - 2\n                        }\n                    };\n                    if (index >= length) {\n                        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n                    }\n                } else {\n                    break;\n                }\n            } else if (isWhiteSpace(ch.charCodeAt(0))) {\n                ++index;\n            } else if (isLineTerminator(ch.charCodeAt(0))) {\n                ++index;\n                if (ch === '\\r' && source[index] === '\\n') {\n                    ++index;\n                }\n                ++lineNumber;\n                lineStart = index;\n            } else {\n                break;\n            }\n        }\n    }\n    function filterCommentLocation() {\n        var i, entry, comment, comments = [];\n        for (i = 0; i < extra.comments.length; ++i) {\n            entry = extra.comments[i];\n            comment = {\n                type: entry.type,\n                value: entry.value\n            };\n            if (extra.range) {\n                comment.range = entry.range;\n            }\n            if (extra.loc) {\n                comment.loc = entry.loc;\n            }\n            comments.push(comment);\n        }\n        extra.comments = comments;\n    }\n    function collectToken() {\n        var start, loc, token, range, value;\n        skipComment();\n        start = index;\n        loc = {\n            start: {\n                line: lineNumber,\n                column: index - lineStart\n            }\n        };\n        token = extra.advance();\n        loc.end = {\n            line: lineNumber,\n            column: index - lineStart\n        };\n        if (token.type !== Token.EOF) {\n            range = [\n                token.range[0],\n                token.range[1]\n            ];\n            value = source.slice(token.range[0], token.range[1]);\n            extra.tokens.push({\n                type: TokenName[token.type],\n                value: value,\n                range: range,\n                loc: loc\n            });\n        }\n        return token;\n    }\n    function collectRegex() {\n        var pos, loc, regex, token;\n        skipComment();\n        pos = index;\n        loc = {\n            start: {\n                line: lineNumber,\n                column: index - lineStart\n            }\n        };\n        regex = extra.scanRegExp();\n        loc.end = {\n            line: lineNumber,\n            column: index - lineStart\n        };\n        if (!extra.tokenize) {\n            // Pop the previous token, which is likely '/' or '/='\n            if (extra.tokens.length > 0) {\n                token = extra.tokens[extra.tokens.length - 1];\n                if (token.range[0] === pos && token.type === 'Punctuator') {\n                    if (token.value === '/' || token.value === '/=') {\n                        extra.tokens.pop();\n                    }\n                }\n            }\n            extra.tokens.push({\n                type: 'RegularExpression',\n                value: regex.literal,\n                range: [\n                    pos,\n                    index\n                ],\n                loc: loc\n            });\n        }\n        return regex;\n    }\n    function filterTokenLocation() {\n        var i, entry, token, tokens = [];\n        for (i = 0; i < extra.tokens.length; ++i) {\n            entry = extra.tokens[i];\n            token = {\n                type: entry.type,\n                value: entry.value\n            };\n            if (extra.range) {\n                token.range = entry.range;\n            }\n            if (extra.loc) {\n                token.loc = entry.loc;\n            }\n            tokens.push(token);\n        }\n        extra.tokens = tokens;\n    }\n    function LocationMarker() {\n        var sm_index$2 = lookahead ? lookahead.sm_range[0] : 0;\n        var sm_lineStart$2 = lookahead ? lookahead.sm_lineStart : 0;\n        var sm_lineNumber$2 = lookahead ? lookahead.sm_lineNumber : 1;\n        this.range = [\n            sm_index$2,\n            sm_index$2\n        ];\n        this.loc = {\n            start: {\n                line: sm_lineNumber$2,\n                column: sm_index$2 - sm_lineStart$2\n            },\n            end: {\n                line: sm_lineNumber$2,\n                column: sm_index$2 - sm_lineStart$2\n            }\n        };\n    }\n    LocationMarker.prototype = {\n        constructor: LocationMarker,\n        end: function () {\n            this.range[1] = sm_index;\n            this.loc.end.line = sm_lineNumber;\n            this.loc.end.column = sm_index - sm_lineStart;\n        },\n        applyGroup: function (node) {\n            if (extra.range) {\n                node.groupRange = [\n                    this.range[0],\n                    this.range[1]\n                ];\n            }\n            if (extra.loc) {\n                node.groupLoc = {\n                    start: {\n                        line: this.loc.start.line,\n                        column: this.loc.start.column\n                    },\n                    end: {\n                        line: this.loc.end.line,\n                        column: this.loc.end.column\n                    }\n                };\n                node = delegate.postProcess(node);\n            }\n        },\n        apply: function (node) {\n            var nodeType = typeof node;\n            assert(nodeType === 'object', 'Applying location marker to an unexpected node type: ' + nodeType);\n            if (extra.range) {\n                node.range = [\n                    this.range[0],\n                    this.range[1]\n                ];\n            }\n            if (extra.loc) {\n                node.loc = {\n                    start: {\n                        line: this.loc.start.line,\n                        column: this.loc.start.column\n                    },\n                    end: {\n                        line: this.loc.end.line,\n                        column: this.loc.end.column\n                    }\n                };\n                node = delegate.postProcess(node);\n            }\n        }\n    };\n    function createLocationMarker() {\n        return new LocationMarker();\n    }\n    function trackGroupExpression() {\n        var marker, expr;\n        marker = createLocationMarker();\n        expect('(');\n        ++state.parenthesizedCount;\n        expr = parseExpression();\n        expect(')');\n        marker.end();\n        marker.applyGroup(expr);\n        return expr;\n    }\n    function trackLeftHandSideExpression() {\n        var marker, expr;\n        // skipComment();\n        marker = createLocationMarker();\n        expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n        while (match('.') || match('[') || lookahead.type === Token.Template) {\n            if (match('[')) {\n                expr = delegate.createMemberExpression('[', expr, parseComputedMember());\n                marker.end();\n                marker.apply(expr);\n            } else if (match('.')) {\n                expr = delegate.createMemberExpression('.', expr, parseNonComputedMember());\n                marker.end();\n                marker.apply(expr);\n            } else {\n                expr = delegate.createTaggedTemplateExpression(expr, parseTemplateLiteral());\n                marker.end();\n                marker.apply(expr);\n            }\n        }\n        return expr;\n    }\n    function trackLeftHandSideExpressionAllowCall() {\n        var marker, expr, args;\n        // skipComment();\n        marker = createLocationMarker();\n        expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n        while (match('.') || match('[') || match('(') || lookahead.type === Token.Template) {\n            if (match('(')) {\n                args = parseArguments();\n                expr = delegate.createCallExpression(expr, args);\n                marker.end();\n                marker.apply(expr);\n            } else if (match('[')) {\n                expr = delegate.createMemberExpression('[', expr, parseComputedMember());\n                marker.end();\n                marker.apply(expr);\n            } else if (match('.')) {\n                expr = delegate.createMemberExpression('.', expr, parseNonComputedMember());\n                marker.end();\n                marker.apply(expr);\n            } else {\n                expr = delegate.createTaggedTemplateExpression(expr, parseTemplateLiteral());\n                marker.end();\n                marker.apply(expr);\n            }\n        }\n        return expr;\n    }\n    function filterGroup(node) {\n        var n, i, entry;\n        n = Object.prototype.toString.apply(node) === '[object Array]' ? [] : {};\n        for (i in node) {\n            if (node.hasOwnProperty(i) && i !== 'groupRange' && i !== 'groupLoc') {\n                entry = node[i];\n                if (entry === null || typeof entry !== 'object' || entry instanceof RegExp) {\n                    n[i] = entry;\n                } else {\n                    n[i] = filterGroup(entry);\n                }\n            }\n        }\n        return n;\n    }\n    function wrapTrackingFunction(range, loc) {\n        return function (parseFunction) {\n            function isBinary(node) {\n                return node.type === Syntax.LogicalExpression || node.type === Syntax.BinaryExpression;\n            }\n            function visit(node) {\n                var start, end;\n                if (isBinary(node.left)) {\n                    visit(node.left);\n                }\n                if (isBinary(node.right)) {\n                    visit(node.right);\n                }\n                if (range) {\n                    if (node.left.groupRange || node.right.groupRange) {\n                        start = node.left.groupRange ? node.left.groupRange[0] : node.left.range[0];\n                        end = node.right.groupRange ? node.right.groupRange[1] : node.right.range[1];\n                        node.range = [\n                            start,\n                            end\n                        ];\n                    } else if (typeof node.range === 'undefined') {\n                        start = node.left.range[0];\n                        end = node.right.range[1];\n                        node.range = [\n                            start,\n                            end\n                        ];\n                    }\n                }\n                if (loc) {\n                    if (node.left.groupLoc || node.right.groupLoc) {\n                        start = node.left.groupLoc ? node.left.groupLoc.start : node.left.loc.start;\n                        end = node.right.groupLoc ? node.right.groupLoc.end : node.right.loc.end;\n                        node.loc = {\n                            start: start,\n                            end: end\n                        };\n                        node = delegate.postProcess(node);\n                    } else if (typeof node.loc === 'undefined') {\n                        node.loc = {\n                            start: node.left.loc.start,\n                            end: node.right.loc.end\n                        };\n                        node = delegate.postProcess(node);\n                    }\n                }\n            }\n            return function () {\n                var marker, node, curr = lookahead;\n                marker = createLocationMarker();\n                node = parseFunction.apply(null, arguments);\n                marker.end();\n                if (node.type !== Syntax.Program) {\n                    if (curr.leadingComments) {\n                        node.leadingComments = curr.leadingComments;\n                    }\n                    if (curr.trailingComments) {\n                        node.trailingComments = curr.trailingComments;\n                    }\n                }\n                if (range && typeof node.range === 'undefined') {\n                    marker.apply(node);\n                }\n                if (loc && typeof node.loc === 'undefined') {\n                    marker.apply(node);\n                }\n                if (isBinary(node)) {\n                    visit(node);\n                }\n                return node;\n            };\n        };\n    }\n    function patch() {\n        var wrapTracking;\n        if (extra.comments) {\n            extra.skipComment = skipComment;\n            skipComment = scanComment;\n        }\n        if (extra.range || extra.loc) {\n            extra.parseGroupExpression = parseGroupExpression;\n            extra.parseLeftHandSideExpression = parseLeftHandSideExpression;\n            extra.parseLeftHandSideExpressionAllowCall = parseLeftHandSideExpressionAllowCall;\n            parseGroupExpression = trackGroupExpression;\n            parseLeftHandSideExpression = trackLeftHandSideExpression;\n            parseLeftHandSideExpressionAllowCall = trackLeftHandSideExpressionAllowCall;\n            wrapTracking = wrapTrackingFunction(extra.range, extra.loc);\n            extra.parseArrayInitialiser = parseArrayInitialiser;\n            extra.parseAssignmentExpression = parseAssignmentExpression;\n            extra.parseBinaryExpression = parseBinaryExpression;\n            extra.parseBlock = parseBlock;\n            extra.parseFunctionSourceElements = parseFunctionSourceElements;\n            extra.parseCatchClause = parseCatchClause;\n            extra.parseComputedMember = parseComputedMember;\n            extra.parseConditionalExpression = parseConditionalExpression;\n            extra.parseConstLetDeclaration = parseConstLetDeclaration;\n            extra.parseExportBatchSpecifier = parseExportBatchSpecifier;\n            extra.parseExportDeclaration = parseExportDeclaration;\n            extra.parseExportSpecifier = parseExportSpecifier;\n            extra.parseExpression = parseExpression;\n            extra.parseForVariableDeclaration = parseForVariableDeclaration;\n            extra.parseFunctionDeclaration = parseFunctionDeclaration;\n            extra.parseFunctionExpression = parseFunctionExpression;\n            extra.parseParams = parseParams;\n            extra.parseImportDeclaration = parseImportDeclaration;\n            extra.parseImportSpecifier = parseImportSpecifier;\n            extra.parseModuleDeclaration = parseModuleDeclaration;\n            extra.parseModuleBlock = parseModuleBlock;\n            extra.parseNewExpression = parseNewExpression;\n            extra.parseNonComputedProperty = parseNonComputedProperty;\n            extra.parseObjectInitialiser = parseObjectInitialiser;\n            extra.parseObjectProperty = parseObjectProperty;\n            extra.parseObjectPropertyKey = parseObjectPropertyKey;\n            extra.parsePostfixExpression = parsePostfixExpression;\n            extra.parsePrimaryExpression = parsePrimaryExpression;\n            extra.parseProgram = parseProgram;\n            extra.parsePropertyFunction = parsePropertyFunction;\n            extra.parseSpreadOrAssignmentExpression = parseSpreadOrAssignmentExpression;\n            extra.parseTemplateElement = parseTemplateElement;\n            extra.parseTemplateLiteral = parseTemplateLiteral;\n            extra.parseStatement = parseStatement;\n            extra.parseSwitchCase = parseSwitchCase;\n            extra.parseUnaryExpression = parseUnaryExpression;\n            extra.parseVariableDeclaration = parseVariableDeclaration;\n            extra.parseVariableIdentifier = parseVariableIdentifier;\n            extra.parseMethodDefinition = parseMethodDefinition;\n            extra.parseClassDeclaration = parseClassDeclaration;\n            extra.parseClassExpression = parseClassExpression;\n            extra.parseClassBody = parseClassBody;\n            parseArrayInitialiser = wrapTracking(extra.parseArrayInitialiser);\n            parseAssignmentExpression = wrapTracking(extra.parseAssignmentExpression);\n            parseBinaryExpression = wrapTracking(extra.parseBinaryExpression);\n            parseBlock = wrapTracking(extra.parseBlock);\n            parseFunctionSourceElements = wrapTracking(extra.parseFunctionSourceElements);\n            parseCatchClause = wrapTracking(extra.parseCatchClause);\n            parseComputedMember = wrapTracking(extra.parseComputedMember);\n            parseConditionalExpression = wrapTracking(extra.parseConditionalExpression);\n            parseConstLetDeclaration = wrapTracking(extra.parseConstLetDeclaration);\n            parseExportBatchSpecifier = wrapTracking(parseExportBatchSpecifier);\n            parseExportDeclaration = wrapTracking(parseExportDeclaration);\n            parseExportSpecifier = wrapTracking(parseExportSpecifier);\n            parseExpression = wrapTracking(extra.parseExpression);\n            parseForVariableDeclaration = wrapTracking(extra.parseForVariableDeclaration);\n            parseFunctionDeclaration = wrapTracking(extra.parseFunctionDeclaration);\n            parseFunctionExpression = wrapTracking(extra.parseFunctionExpression);\n            parseParams = wrapTracking(extra.parseParams);\n            parseImportDeclaration = wrapTracking(extra.parseImportDeclaration);\n            parseImportSpecifier = wrapTracking(extra.parseImportSpecifier);\n            parseModuleDeclaration = wrapTracking(extra.parseModuleDeclaration);\n            parseModuleBlock = wrapTracking(extra.parseModuleBlock);\n            parseLeftHandSideExpression = wrapTracking(parseLeftHandSideExpression);\n            parseNewExpression = wrapTracking(extra.parseNewExpression);\n            parseNonComputedProperty = wrapTracking(extra.parseNonComputedProperty);\n            parseObjectInitialiser = wrapTracking(extra.parseObjectInitialiser);\n            parseObjectProperty = wrapTracking(extra.parseObjectProperty);\n            parseObjectPropertyKey = wrapTracking(extra.parseObjectPropertyKey);\n            parsePostfixExpression = wrapTracking(extra.parsePostfixExpression);\n            parsePrimaryExpression = wrapTracking(extra.parsePrimaryExpression);\n            parseProgram = wrapTracking(extra.parseProgram);\n            parsePropertyFunction = wrapTracking(extra.parsePropertyFunction);\n            parseTemplateElement = wrapTracking(extra.parseTemplateElement);\n            parseTemplateLiteral = wrapTracking(extra.parseTemplateLiteral);\n            parseSpreadOrAssignmentExpression = wrapTracking(extra.parseSpreadOrAssignmentExpression);\n            parseStatement = wrapTracking(extra.parseStatement);\n            parseSwitchCase = wrapTracking(extra.parseSwitchCase);\n            parseUnaryExpression = wrapTracking(extra.parseUnaryExpression);\n            parseVariableDeclaration = wrapTracking(extra.parseVariableDeclaration);\n            parseVariableIdentifier = wrapTracking(extra.parseVariableIdentifier);\n            parseMethodDefinition = wrapTracking(extra.parseMethodDefinition);\n            parseClassDeclaration = wrapTracking(extra.parseClassDeclaration);\n            parseClassExpression = wrapTracking(extra.parseClassExpression);\n            parseClassBody = wrapTracking(extra.parseClassBody);\n        }\n        if (typeof extra.tokens !== 'undefined') {\n            extra.advance = advance;\n            extra.scanRegExp = scanRegExp;\n            advance = collectToken;\n            scanRegExp = collectRegex;\n        }\n    }\n    function unpatch() {\n        if (typeof extra.skipComment === 'function') {\n            skipComment = extra.skipComment;\n        }\n        if (extra.range || extra.loc) {\n            parseArrayInitialiser = extra.parseArrayInitialiser;\n            parseAssignmentExpression = extra.parseAssignmentExpression;\n            parseBinaryExpression = extra.parseBinaryExpression;\n            parseBlock = extra.parseBlock;\n            parseFunctionSourceElements = extra.parseFunctionSourceElements;\n            parseCatchClause = extra.parseCatchClause;\n            parseComputedMember = extra.parseComputedMember;\n            parseConditionalExpression = extra.parseConditionalExpression;\n            parseConstLetDeclaration = extra.parseConstLetDeclaration;\n            parseExportBatchSpecifier = extra.parseExportBatchSpecifier;\n            parseExportDeclaration = extra.parseExportDeclaration;\n            parseExportSpecifier = extra.parseExportSpecifier;\n            parseExpression = extra.parseExpression;\n            parseForVariableDeclaration = extra.parseForVariableDeclaration;\n            parseFunctionDeclaration = extra.parseFunctionDeclaration;\n            parseFunctionExpression = extra.parseFunctionExpression;\n            parseImportDeclaration = extra.parseImportDeclaration;\n            parseImportSpecifier = extra.parseImportSpecifier;\n            parseGroupExpression = extra.parseGroupExpression;\n            parseLeftHandSideExpression = extra.parseLeftHandSideExpression;\n            parseLeftHandSideExpressionAllowCall = extra.parseLeftHandSideExpressionAllowCall;\n            parseModuleDeclaration = extra.parseModuleDeclaration;\n            parseModuleBlock = extra.parseModuleBlock;\n            parseNewExpression = extra.parseNewExpression;\n            parseNonComputedProperty = extra.parseNonComputedProperty;\n            parseObjectInitialiser = extra.parseObjectInitialiser;\n            parseObjectProperty = extra.parseObjectProperty;\n            parseObjectPropertyKey = extra.parseObjectPropertyKey;\n            parsePostfixExpression = extra.parsePostfixExpression;\n            parsePrimaryExpression = extra.parsePrimaryExpression;\n            parseProgram = extra.parseProgram;\n            parsePropertyFunction = extra.parsePropertyFunction;\n            parseTemplateElement = extra.parseTemplateElement;\n            parseTemplateLiteral = extra.parseTemplateLiteral;\n            parseSpreadOrAssignmentExpression = extra.parseSpreadOrAssignmentExpression;\n            parseStatement = extra.parseStatement;\n            parseSwitchCase = extra.parseSwitchCase;\n            parseUnaryExpression = extra.parseUnaryExpression;\n            parseVariableDeclaration = extra.parseVariableDeclaration;\n            parseVariableIdentifier = extra.parseVariableIdentifier;\n            parseMethodDefinition = extra.parseMethodDefinition;\n            parseClassDeclaration = extra.parseClassDeclaration;\n            parseClassExpression = extra.parseClassExpression;\n            parseClassBody = extra.parseClassBody;\n        }\n        if (typeof extra.scanRegExp === 'function') {\n            advance = extra.advance;\n            scanRegExp = extra.scanRegExp;\n        }\n    }\n    // This is used to modify the delegate.\n    function extend(object, properties) {\n        var entry, result = {};\n        for (entry in object) {\n            if (object.hasOwnProperty(entry)) {\n                result[entry] = object[entry];\n            }\n        }\n        for (entry in properties) {\n            if (properties.hasOwnProperty(entry)) {\n                result[entry] = properties[entry];\n            }\n        }\n        return result;\n    }\n    function tokenize(code, options) {\n        var toString, token, tokens;\n        toString = String;\n        if (typeof code !== 'string' && !(code instanceof String)) {\n            code = toString(code);\n        }\n        delegate = SyntaxTreeDelegate;\n        source = code;\n        index = 0;\n        lineNumber = source.length > 0 ? 1 : 0;\n        lineStart = 0;\n        length = source.length;\n        lookahead = null;\n        state = {\n            allowKeyword: true,\n            allowIn: true,\n            labelSet: {},\n            inFunctionBody: false,\n            inIteration: false,\n            inSwitch: false\n        };\n        extra = {};\n        // Options matching.\n        options = options || {};\n        // Of course we collect tokens here.\n        options.tokens = true;\n        extra.tokens = [];\n        extra.tokenize = true;\n        // The following two fields are necessary to compute the Regex tokens.\n        extra.openParenToken = -1;\n        extra.openCurlyToken = -1;\n        extra.range = typeof options.range === 'boolean' && options.range;\n        extra.loc = typeof options.loc === 'boolean' && options.loc;\n        if (typeof options.comment === 'boolean' && options.comment) {\n            extra.comments = [];\n        }\n        if (typeof options.tolerant === 'boolean' && options.tolerant) {\n            extra.errors = [];\n        }\n        if (length > 0) {\n            if (typeof source[0] === 'undefined') {\n                // Try first to convert to a string. This is good as fast path\n                // for old IE which understands string indexing for string\n                // literals only and not for string object.\n                if (code instanceof String) {\n                    source = code.valueOf();\n                }\n            }\n        }\n        patch();\n        try {\n            peek();\n            if (lookahead.type === Token.EOF) {\n                return extra.tokens;\n            }\n            token = lex();\n            while (lookahead.type !== Token.EOF) {\n                try {\n                    token = lex();\n                } catch (lexError) {\n                    token = lookahead;\n                    if (extra.errors) {\n                        extra.errors.push(lexError);\n                        // We have to break on the first error\n                        // to avoid infinite loops.\n                        break;\n                    } else {\n                        throw lexError;\n                    }\n                }\n            }\n            filterTokenLocation();\n            tokens = extra.tokens;\n            if (typeof extra.comments !== 'undefined') {\n                filterCommentLocation();\n                tokens.comments = extra.comments;\n            }\n            if (typeof extra.errors !== 'undefined') {\n                tokens.errors = extra.errors;\n            }\n        } catch (e) {\n            throw e;\n        } finally {\n            unpatch();\n            extra = {};\n        }\n        return tokens;\n    }\n    // Determines if the {} delimiter is a block or an expression.\n    function blockAllowed(toks, start, inExprDelim, parentIsBlock) {\n        var assignOps = [\n                '=',\n                '+=',\n                '-=',\n                '*=',\n                '/=',\n                '%=',\n                '<<=',\n                '>>=',\n                '>>>=',\n                '&=',\n                '|=',\n                '^=',\n                ','\n            ];\n        var binaryOps = [\n                '+',\n                '-',\n                '*',\n                '/',\n                '%',\n                '<<',\n                '>>',\n                '>>>',\n                '&',\n                '|',\n                '^',\n                '&&',\n                '||',\n                '?',\n                ':',\n                '===',\n                '==',\n                '>=',\n                '<=',\n                '<',\n                '>',\n                '!=',\n                '!==',\n                'instanceof'\n            ];\n        var unaryOps = [\n                '++',\n                '--',\n                '~',\n                '!',\n                'delete',\n                'void',\n                'typeof',\n                'yield',\n                'throw',\n                'new'\n            ];\n        function back(n) {\n            var idx = toks.length - n > 0 ? toks.length - n : 0;\n            return toks[idx];\n        }\n        if (inExprDelim && toks.length - (start + 2) <= 0) {\n            // ... ({...} ...)\n            return false;\n        } else if (back(start + 2).value === ':' && parentIsBlock) {\n            // ...{a:{b:{...}}}\n            return true;\n        } else if (isIn(back(start + 2).value, unaryOps.concat(binaryOps).concat(assignOps))) {\n            // ... + {...}\n            return false;\n        } else if (back(start + 2).value === 'return') {\n            // ASI makes `{}` a block in:\n            //\n            //    return\n            //    { ... }\n            //\n            // otherwise an object literal, so it's an\n            // expression and thus / is divide\n            var currLineNumber = typeof back(start + 1).startLineNumber !== 'undefined' ? back(start + 1).startLineNumber : back(start + 1).lineNumber;\n            if (back(start + 2).lineNumber !== currLineNumber) {\n                return true;\n            } else {\n                return false;\n            }\n        } else if (isIn(back(start + 2).value, [\n                'void',\n                'typeof',\n                'in',\n                'case',\n                'delete'\n            ])) {\n            // ... in {}\n            return false;\n        } else {\n            return true;\n        }\n    }\n    // Readtables\n    var readtables = {\n            currentReadtable: {},\n            queued: [],\n            punctuators: ';,.:!?~=%&*+-/<>^|#@',\n            has: function (ch) {\n                return readtables.currentReadtable[ch] && readtables.punctuators.indexOf(ch) !== -1;\n            },\n            getQueued: function () {\n                return readtables.queued.length ? readtables.queued.shift() : null;\n            },\n            peekQueued: function (lookahead$2) {\n                lookahead$2 = lookahead$2 ? lookahead$2 : 1;\n                return readtables.queued.length ? readtables.queued[lookahead$2 - 1] : null;\n            },\n            invoke: function (ch, toks) {\n                var prevState = snapshotParserState();\n                var newStream = readtables.currentReadtable[ch](ch, readtables.readerAPI, toks, source, index);\n                if (!newStream) {\n                    // Reset the state\n                    restoreParserState(prevState);\n                    return null;\n                } else if (!Array.isArray(newStream)) {\n                    newStream = [newStream];\n                }\n                this.queued = this.queued.concat(newStream);\n                return this.getQueued();\n            }\n        };\n    function snapshotParserState() {\n        return {\n            index: index,\n            lineNumber: lineNumber,\n            lineStart: lineStart\n        };\n    }\n    function restoreParserState(prevState) {\n        index = prevState.index;\n        lineNumber = prevState.lineNumber;\n        lineStart = prevState.lineStart;\n    }\n    function suppressReadError(func) {\n        var prevState = snapshotParserState();\n        try {\n            return func();\n        } catch (e) {\n            if (!(e instanceof SyntaxError) && !(e instanceof TypeError)) {\n                restoreParserState(prevState);\n                return null;\n            }\n            throw e;\n        }\n    }\n    function makeIdentifier(value, opts) {\n        opts = opts || {};\n        var type = Token.Identifier;\n        if (isKeyword(value)) {\n            type = Token.Keyword;\n        } else if (value === 'null') {\n            type = Token.NullLiteral;\n        } else if (value === 'true' || value === 'false') {\n            type = Token.BooleanLiteral;\n        }\n        return {\n            type: type,\n            value: value,\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                opts.start || index,\n                index\n            ]\n        };\n    }\n    function makePunctuator(value, opts) {\n        opts = opts || {};\n        return {\n            type: Token.Punctuator,\n            value: value,\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                opts.start || index,\n                index\n            ]\n        };\n    }\n    function makeStringLiteral(value, opts) {\n        opts = opts || {};\n        return {\n            type: Token.StringLiteral,\n            value: value,\n            octal: !!opts.octal,\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                opts.start || index,\n                index\n            ]\n        };\n    }\n    function makeNumericLiteral(value, opts) {\n        opts = opts || {};\n        return {\n            type: Token.NumericLiteral,\n            value: value,\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                opts.start || index,\n                index\n            ]\n        };\n    }\n    function makeRegExp(value, opts) {\n        opts = opts || {};\n        return {\n            type: Token.RegularExpression,\n            value: value,\n            literal: value.toString(),\n            lineNumber: lineNumber,\n            lineStart: lineStart,\n            range: [\n                opts.start || index,\n                index\n            ]\n        };\n    }\n    function makeDelimiter(value, inner) {\n        var current = {\n                lineNumber: lineNumber,\n                lineStart: lineStart,\n                range: [\n                    index,\n                    index\n                ]\n            };\n        var firstTok = inner.length ? inner[0] : current;\n        var lastTok = inner.length ? inner[inner.length - 1] : current;\n        return {\n            type: Token.Delimiter,\n            value: value,\n            inner: inner,\n            startLineNumber: firstTok.lineNumber,\n            startLineStart: firstTok.lineStart,\n            startRange: firstTok.range,\n            endLineNumber: lastTok.lineNumber,\n            endLineStart: lastTok.lineStart,\n            endRange: lastTok.range\n        };\n    }\n    // Since an actual parser object doesn't exist and we want to\n    // introduce our own API anyway, we create a special reader object\n    // for reader extensions\n    var readerAPI = {\n            Token: Token,\n            get source() {\n                return source;\n            },\n            get index() {\n                return index;\n            },\n            set index(x) {\n                index = x;\n            },\n            get length() {\n                return length;\n            },\n            set length(x) {\n                length = x;\n            },\n            get lineNumber() {\n                return lineNumber;\n            },\n            set lineNumber(x) {\n                lineNumber = x;\n            },\n            get lineStart() {\n                return lineStart;\n            },\n            set lineStart(x) {\n                lineStart = x;\n            },\n            get extra() {\n                return extra;\n            },\n            isIdentifierStart: isIdentifierStart,\n            isIdentifierPart: isIdentifierPart,\n            isLineTerminator: isLineTerminator,\n            readIdentifier: scanIdentifier,\n            readPunctuator: scanPunctuator,\n            readStringLiteral: scanStringLiteral,\n            readNumericLiteral: scanNumericLiteral,\n            readRegExp: scanRegExp,\n            readToken: function () {\n                return readToken([], false, false);\n            },\n            readDelimiter: function () {\n                return readDelim([], false, false);\n            },\n            skipComment: scanComment,\n            makeIdentifier: makeIdentifier,\n            makePunctuator: makePunctuator,\n            makeStringLiteral: makeStringLiteral,\n            makeNumericLiteral: makeNumericLiteral,\n            makeRegExp: makeRegExp,\n            makeDelimiter: makeDelimiter,\n            suppressReadError: suppressReadError,\n            peekQueued: readtables.peekQueued,\n            getQueued: readtables.getQueued\n        };\n    readtables.readerAPI = readerAPI;\n    // Read the next token. Takes the previously read tokens, a\n    // boolean indicating if the parent delimiter is () or [], and a\n    // boolean indicating if the parent delimiter is {} a block\n    function readToken(toks, inExprDelim, parentIsBlock) {\n        var delimiters = [\n                '(',\n                '{',\n                '['\n            ];\n        var parenIdents = [\n                'if',\n                'while',\n                'for',\n                'with'\n            ];\n        var last = toks.length - 1;\n        var comments, commentsLen = extra.comments.length;\n        function back(n) {\n            var idx = toks.length - n > 0 ? toks.length - n : 0;\n            return toks[idx];\n        }\n        function attachComments(token) {\n            if (comments) {\n                token.leadingComments = comments;\n            }\n            return token;\n        }\n        function _advance() {\n            return attachComments(advance());\n        }\n        function _scanRegExp() {\n            return attachComments(scanRegExp());\n        }\n        skipComment();\n        var ch = source[index];\n        if (extra.comments.length > commentsLen) {\n            comments = extra.comments.slice(commentsLen);\n        }\n        if (isIn(source[index], delimiters)) {\n            return attachComments(readDelim(toks, inExprDelim, parentIsBlock));\n        }\n        // Check if we should get the token from the readtable\n        var readtableToken;\n        if ((readtableToken = readtables.getQueued()) || readtables.has(ch) && (readtableToken = readtables.invoke(ch, toks))) {\n            return readtableToken;\n        }\n        if (ch === '/') {\n            var prev = back(1);\n            if (prev) {\n                if (prev.value === '()') {\n                    if (isIn(back(2).value, parenIdents)) {\n                        // ... if (...) / ...\n                        return _scanRegExp();\n                    }\n                    // ... (...) / ...\n                    return _advance();\n                }\n                if (prev.value === '{}') {\n                    if (blockAllowed(toks, 0, inExprDelim, parentIsBlock)) {\n                        if (back(2).value === '()') {\n                            // named function\n                            if (back(4).value === 'function') {\n                                if (!blockAllowed(toks, 3, inExprDelim, parentIsBlock)) {\n                                    // new function foo (...) {...} / ...\n                                    return _advance();\n                                }\n                                if (toks.length - 5 <= 0 && inExprDelim) {\n                                    // (function foo (...) {...} /...)\n                                    // [function foo (...) {...} /...]\n                                    return _advance();\n                                }\n                            }\n                            // unnamed function\n                            if (back(3).value === 'function') {\n                                if (!blockAllowed(toks, 2, inExprDelim, parentIsBlock)) {\n                                    // new function (...) {...} / ...\n                                    return _advance();\n                                }\n                                if (toks.length - 4 <= 0 && inExprDelim) {\n                                    // (function (...) {...} /...)\n                                    // [function (...) {...} /...]\n                                    return _advance();\n                                }\n                            }\n                        }\n                        // ...; {...} /...\n                        return _scanRegExp();\n                    } else {\n                        // ... + {...} / ...\n                        return _advance();\n                    }\n                }\n                if (prev.type === Token.Punctuator) {\n                    // ... + /...\n                    return _scanRegExp();\n                }\n                if (isKeyword(prev.value) && prev.value !== 'this' && prev.value !== 'let' && prev.value !== 'export') {\n                    // typeof /...\n                    return _scanRegExp();\n                }\n                return _advance();\n            }\n            return _scanRegExp();\n        }\n        return _advance();\n    }\n    function readDelim(toks, inExprDelim, parentIsBlock) {\n        var startDelim = advance(), matchDelim = {\n                '(': ')',\n                '{': '}',\n                '[': ']'\n            }, inner = [];\n        var delimiters = [\n                '(',\n                '{',\n                '['\n            ];\n        assert(delimiters.indexOf(startDelim.value) !== -1, 'Need to begin at the delimiter');\n        var token = startDelim;\n        var startLineNumber = token.lineNumber;\n        var startLineStart = token.lineStart;\n        var startRange = token.range;\n        var delimToken = {};\n        delimToken.type = Token.Delimiter;\n        delimToken.value = startDelim.value + matchDelim[startDelim.value];\n        delimToken.startLineNumber = startLineNumber;\n        delimToken.startLineStart = startLineStart;\n        delimToken.startRange = startRange;\n        var delimIsBlock = false;\n        if (startDelim.value === '{') {\n            delimIsBlock = blockAllowed(toks.concat(delimToken), 0, inExprDelim, parentIsBlock);\n        }\n        while (index <= length) {\n            token = readToken(inner, startDelim.value === '(' || startDelim.value === '[', delimIsBlock);\n            if (token.type === Token.Punctuator && token.value === matchDelim[startDelim.value]) {\n                if (token.leadingComments) {\n                    delimToken.trailingComments = token.leadingComments;\n                }\n                break;\n            } else if (token.type === Token.EOF) {\n                throwError({}, Messages.UnexpectedEOS);\n            } else {\n                inner.push(token);\n            }\n        }\n        // at the end of the stream but the very last char wasn't the closing delimiter\n        if (index >= length && matchDelim[startDelim.value] !== source[length - 1]) {\n            throwError({}, Messages.UnexpectedEOS);\n        }\n        var endLineNumber = token.lineNumber;\n        var endLineStart = token.lineStart;\n        var endRange = token.range;\n        delimToken.inner = inner;\n        delimToken.endLineNumber = endLineNumber;\n        delimToken.endLineStart = endLineStart;\n        delimToken.endRange = endRange;\n        return delimToken;\n    }\n    function setReadtable(readtable, syn) {\n        readtables.currentReadtable = readtable;\n        if (syn) {\n            readtables.readerAPI.throwSyntaxError = function (name, message, tok) {\n                var sx = syn.syntaxFromToken(tok);\n                var err = new syn.MacroSyntaxError(name, message, sx);\n                throw new SyntaxError(syn.printSyntaxError(source, err));\n            };\n        }\n    }\n    function currentReadtable() {\n        return readtables.currentReadtable;\n    }\n    // (Str) -> [...CSyntax]\n    function read(code) {\n        var token, tokenTree = [];\n        extra = {};\n        extra.comments = [];\n        patch();\n        source = code;\n        index = 0;\n        lineNumber = source.length > 0 ? 1 : 0;\n        lineStart = 0;\n        length = source.length;\n        state = {\n            allowIn: true,\n            labelSet: {},\n            lastParenthesized: null,\n            inFunctionBody: false,\n            inIteration: false,\n            inSwitch: false\n        };\n        while (index < length || readtables.peekQueued()) {\n            tokenTree.push(readToken(tokenTree, false, false));\n        }\n        var last = tokenTree[tokenTree.length - 1];\n        if (last && last.type !== Token.EOF) {\n            tokenTree.push({\n                type: Token.EOF,\n                value: '',\n                lineNumber: last.lineNumber,\n                lineStart: last.lineStart,\n                range: [\n                    index,\n                    index\n                ]\n            });\n        }\n        return expander.tokensToSyntax(tokenTree);\n    }\n    function parse(code, options) {\n        var program, toString;\n        extra = {};\n        // given an array of tokens instead of a string\n        if (Array.isArray(code)) {\n            tokenStream = code;\n            length = tokenStream.length;\n            lineNumber = tokenStream.length > 0 ? 1 : 0;\n            source = undefined;\n        } else {\n            toString = String;\n            if (typeof code !== 'string' && !(code instanceof String)) {\n                code = toString(code);\n            }\n            source = code;\n            length = source.length;\n            lineNumber = source.length > 0 ? 1 : 0;\n        }\n        delegate = SyntaxTreeDelegate;\n        streamIndex = -1;\n        index = 0;\n        lineStart = 0;\n        sm_lineStart = 0;\n        sm_lineNumber = lineNumber;\n        sm_index = 0;\n        sm_range = [\n            0,\n            0\n        ];\n        lookahead = null;\n        state = {\n            allowKeyword: false,\n            allowIn: true,\n            labelSet: {},\n            parenthesizedCount: 0,\n            inFunctionBody: false,\n            inIteration: false,\n            inSwitch: false,\n            yieldAllowed: false,\n            yieldFound: false\n        };\n        if (typeof options !== 'undefined') {\n            extra.range = typeof options.range === 'boolean' && options.range;\n            extra.loc = typeof options.loc === 'boolean' && options.loc;\n            if (extra.loc && options.source !== null && options.source !== undefined) {\n                delegate = extend(delegate, {\n                    'postProcess': function (node) {\n                        node.loc.source = toString(options.source);\n                        return node;\n                    }\n                });\n            }\n            if (typeof options.tokens === 'boolean' && options.tokens) {\n                extra.tokens = [];\n            }\n            if (typeof options.comment === 'boolean' && options.comment) {\n                extra.comments = [];\n            }\n            if (typeof options.tolerant === 'boolean' && options.tolerant) {\n                extra.errors = [];\n            }\n        }\n        if (length > 0) {\n            if (source && typeof source[0] === 'undefined') {\n                // Try first to convert to a string. This is good as fast path\n                // for old IE which understands string indexing for string\n                // literals only and not for string object.\n                if (code instanceof String) {\n                    source = code.valueOf();\n                }\n            }\n        }\n        extra = {\n            loc: true,\n            errors: []\n        };\n        patch();\n        try {\n            program = parseProgram();\n            if (typeof extra.comments !== 'undefined') {\n                filterCommentLocation();\n                program.comments = extra.comments;\n            }\n            if (typeof extra.tokens !== 'undefined') {\n                filterTokenLocation();\n                program.tokens = extra.tokens;\n            }\n            if (typeof extra.errors !== 'undefined') {\n                program.errors = extra.errors;\n            }\n            if (extra.range || extra.loc) {\n                program.body = filterGroup(program.body);\n            }\n        } catch (e) {\n            throw e;\n        } finally {\n            unpatch();\n            extra = {};\n        }\n        return program;\n    }\n    exports$2.tokenize = tokenize;\n    exports$2.read = read;\n    exports$2.Token = Token;\n    exports$2.setReadtable = setReadtable;\n    exports$2.currentReadtable = currentReadtable;\n    exports$2.parse = parse;\n    // Deep copy.\n    exports$2.Syntax = function () {\n        var name, types = {};\n        if (typeof Object.create === 'function') {\n            types = Object.create(null);\n        }\n        for (name in Syntax) {\n            if (Syntax.hasOwnProperty(name)) {\n                types[name] = Syntax[name];\n            }\n        }\n        if (typeof Object.freeze === 'function') {\n            Object.freeze(types);\n        }\n        return types;\n    }();\n}));\n//# sourceMappingURL=parser.js.map"
  },
  {
    "path": "editor/scripts/patterns.js",
    "content": "(function (root, factory) {\n    if (typeof exports === 'object') {\n        // CommonJS\n        factory(exports, require('underscore'), require('./parser'), require('./expander'), require('./syntax'));\n    } else if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define([\n            'exports',\n            'underscore',\n            'parser',\n            'expander',\n            'syntax'\n        ], factory);\n    }\n}(this, function (exports$2, _, parser, expander, syntax) {\n    var get_expression = expander.get_expression;\n    var syntaxFromToken = syntax.syntaxFromToken;\n    var makePunc = syntax.makePunc;\n    var makeIdent = syntax.makeIdent;\n    var makeDelim = syntax.makeDelim;\n    var joinSyntax = syntax.joinSyntax;\n    var joinSyntaxArray = syntax.joinSyntaxArray;\n    var cloneSyntax = syntax.cloneSyntax;\n    var cloneSyntaxArray = syntax.cloneSyntaxArray;\n    var assert = syntax.assert;\n    var throwSyntaxError = syntax.throwSyntaxError;\n    var push = Array.prototype.push;\n    // ([...CSyntax]) -> [...Str]\n    function freeVarsInPattern(pattern) {\n        var fv = [];\n        _.each(pattern, function (pat) {\n            if (isPatternVar(pat)) {\n                fv.push(pat.token.value);\n            } else if (pat.token.type === parser.Token.Delimiter) {\n                push.apply(fv, freeVarsInPattern(pat.token.inner));\n            }\n        });\n        return fv;\n    }\n    function typeIsLiteral(type) {\n        return type === parser.Token.NullLiteral || type === parser.Token.NumericLiteral || type === parser.Token.StringLiteral || type === parser.Token.RegexLiteral || type === parser.Token.BooleanLiteral;\n    }\n    function containsPatternVar(patterns) {\n        return _.any(patterns, function (pat) {\n            if (pat.token.type === parser.Token.Delimiter) {\n                return containsPatternVar(pat.token.inner);\n            }\n            return isPatternVar(pat);\n        });\n    }\n    function delimIsSeparator(delim) {\n        return delim && delim.token && delim.token.type === parser.Token.Delimiter && delim.token.value === '()' && delim.token.inner.length === 1 && delim.token.inner[0].token.type !== parser.Token.Delimiter && !containsPatternVar(delim.token.inner);\n    }\n    function isPatternVar(stx) {\n        return stx.token.value[0] === '$' && stx.token.value !== '$';\n    }\n    // ([...{level: Num, match: [...CSyntax]}], Syntax) -> [...CSyntax]\n    function joinRepeatedMatch(tojoin, punc) {\n        return _.reduce(_.rest(tojoin, 1), function (acc, join) {\n            if (punc === ' ') {\n                return acc.concat(cloneSyntaxArray(join.match));\n            }\n            return acc.concat(cloneSyntax(punc), cloneSyntaxArray(join.match));\n        }, cloneSyntaxArray(_.first(tojoin).match));\n    }\n    // take the line context (range, lineNumber)\n    // (CSyntax, [...CSyntax]) -> [...CSyntax]\n    function takeLineContext(from, to) {\n        return _.map(to, function (stx) {\n            return takeLine(from, stx);\n        });\n    }\n    // (CSyntax, CSyntax) -> CSyntax\n    function takeLine(from, to) {\n        var next;\n        if (to.token.type === parser.Token.Delimiter) {\n            var sm_startLineNumber = typeof to.token.sm_startLineNumber !== 'undefined' ? to.token.sm_startLineNumber : to.token.startLineNumber;\n            var sm_endLineNumber = typeof to.token.sm_endLineNumber !== 'undefined' ? to.token.sm_endLineNumber : to.token.endLineNumber;\n            var sm_startLineStart = typeof to.token.sm_startLineStart !== 'undefined' ? to.token.sm_startLineStart : to.token.startLineStart;\n            var sm_endLineStart = typeof to.token.sm_endLineStart !== 'undefined' ? to.token.sm_endLineStart : to.token.endLineStart;\n            var sm_startRange = typeof to.token.sm_startRange !== 'undefined' ? to.token.sm_startRange : to.token.startRange;\n            var sm_endRange = typeof to.token.sm_endRange !== 'undefined' ? to.token.sm_endRange : to.token.endRange;\n            if (from.token.type === parser.Token.Delimiter) {\n                next = syntaxFromToken({\n                    type: parser.Token.Delimiter,\n                    value: to.token.value,\n                    inner: takeLineContext(from, to.token.inner),\n                    startRange: from.token.startRange,\n                    endRange: from.token.endRange,\n                    startLineNumber: from.token.startLineNumber,\n                    startLineStart: from.token.startLineStart,\n                    endLineNumber: from.token.endLineNumber,\n                    endLineStart: from.token.endLineStart,\n                    sm_startLineNumber: sm_startLineNumber,\n                    sm_endLineNumber: sm_endLineNumber,\n                    sm_startLineStart: sm_startLineStart,\n                    sm_endLineStart: sm_endLineStart,\n                    sm_startRange: sm_startRange,\n                    sm_endRange: sm_endRange\n                }, to);\n            } else {\n                next = syntaxFromToken({\n                    type: parser.Token.Delimiter,\n                    value: to.token.value,\n                    inner: takeLineContext(from, to.token.inner),\n                    startRange: from.token.range,\n                    endRange: from.token.range,\n                    startLineNumber: from.token.lineNumber,\n                    startLineStart: from.token.lineStart,\n                    endLineNumber: from.token.lineNumber,\n                    endLineStart: from.token.lineStart,\n                    sm_startLineNumber: sm_startLineNumber,\n                    sm_endLineNumber: sm_endLineNumber,\n                    sm_startLineStart: sm_startLineStart,\n                    sm_endLineStart: sm_endLineStart,\n                    sm_startRange: sm_startRange,\n                    sm_endRange: sm_endRange\n                }, to);\n            }\n        } else {\n            var sm_lineNumber = typeof to.token.sm_lineNumber !== 'undefined' ? to.token.sm_lineNumber : to.token.lineNumber;\n            var sm_lineStart = typeof to.token.sm_lineStart !== 'undefined' ? to.token.sm_lineStart : to.token.lineStart;\n            var sm_range = typeof to.token.sm_range !== 'undefined' ? to.token.sm_range : to.token.range;\n            if (from.token.type === parser.Token.Delimiter) {\n                next = syntaxFromToken({\n                    value: to.token.value,\n                    type: to.token.type,\n                    lineNumber: from.token.startLineNumber,\n                    lineStart: from.token.startLineStart,\n                    range: from.token.startRange,\n                    sm_lineNumber: sm_lineNumber,\n                    sm_lineStart: sm_lineStart,\n                    sm_range: sm_range\n                }, to);\n            } else {\n                next = syntaxFromToken({\n                    value: to.token.value,\n                    type: to.token.type,\n                    lineNumber: from.token.lineNumber,\n                    lineStart: from.token.lineStart,\n                    range: from.token.range,\n                    sm_lineNumber: sm_lineNumber,\n                    sm_lineStart: sm_lineStart,\n                    sm_range: sm_range\n                }, to);\n            }\n        }\n        if (to.token.leadingComments) {\n            next.token.leadingComments = to.token.leadingComments;\n        }\n        if (to.token.trailingComments) {\n            next.token.trailingComments = to.token.trailingComments;\n        }\n        return next;\n    }\n    function reversePattern(patterns) {\n        var len = patterns.length;\n        var pat;\n        return _.reduceRight(patterns, function (acc, pat$2) {\n            if (pat$2.class === 'pattern_group' || pat$2.class === 'named_group') {\n                pat$2.inner = reversePattern(pat$2.inner);\n            }\n            if (pat$2.repeat) {\n                pat$2.leading = !pat$2.leading;\n            }\n            acc.push(pat$2);\n            return acc;\n        }, []);\n    }\n    function loadLiteralGroup(patterns) {\n        return patterns.map(function (patStx) {\n            var pat = patternToObject(patStx);\n            if (pat.inner) {\n                pat.inner = loadLiteralGroup(pat.inner);\n            } else {\n                pat.class = 'pattern_literal';\n            }\n            return pat;\n        });\n    }\n    function patternToObject(pat) {\n        var obj = {\n                type: pat.token.type,\n                value: pat.token.value\n            };\n        if (pat.token.inner) {\n            obj.inner = pat.token.inner;\n        }\n        return obj;\n    }\n    function isPrimaryClass(name) {\n        return [\n            'expr',\n            'lit',\n            'ident',\n            'token',\n            'invoke',\n            'invokeRec'\n        ].indexOf(name) > -1;\n    }\n    function loadPattern(patterns, reverse) {\n        var patts = [];\n        for (var i = 0; i < patterns.length; i++) {\n            var tok1 = patterns[i];\n            var tok2 = patterns[i + 1];\n            var tok3 = patterns[i + 2];\n            var tok4 = patterns[i + 3];\n            var last = patts[patts.length - 1];\n            var patt;\n            assert(tok1, 'Expecting syntax object');\n            // Repeaters\n            if (tok1.token.type === parser.Token.Delimiter && tok1.token.value === '()' && tok2 && tok2.token.type === parser.Token.Punctuator && tok2.token.value === '...' && last) {\n                assert(tok1.token.inner.length === 1, 'currently assuming all separators are a single token');\n                i += 1;\n                last.repeat = true;\n                last.separator = tok1.token.inner[0];\n                continue;\n            } else if (tok1.token.type === parser.Token.Punctuator && tok1.token.value === '...' && last) {\n                last.repeat = true;\n                last.separator = ' ';\n                continue;\n            } else if (isPatternVar(tok1)) {\n                patt = patternToObject(tok1);\n                if (tok2 && tok2.token.type === parser.Token.Punctuator && tok2.token.value === ':' && tok3 && (tok3.token.type === parser.Token.Identifier || tok3.token.type === parser.Token.Delimiter && (tok3.token.value === '[]' || tok3.token.value === '()'))) {\n                    i += 2;\n                    if (tok3.token.value === '[]') {\n                        patt.class = 'named_group';\n                        patt.inner = loadLiteralGroup(tok3.expose().token.inner);\n                    } else if (tok3.token.value === '()') {\n                        patt.class = 'named_group';\n                        patt.inner = loadPattern(tok3.expose().token.inner);\n                    } else if (isPrimaryClass(tok3.token.value)) {\n                        patt.class = tok3.token.value;\n                        if (patt.class === 'invokeRec' || patt.class === 'invoke') {\n                            i += 1;\n                            if (tok4.token.value === '()' && tok4.token.inner.length) {\n                                patt.macroName = tok4.expose().token.inner;\n                            } else {\n                                throwSyntaxError(patt.class, 'Expected macro parameter', tok3);\n                            }\n                        }\n                    } else {\n                        patt.class = 'invoke';\n                        patt.macroName = [tok3];\n                    }\n                } else {\n                    patt.class = 'token';\n                }\n            } else if (tok1.token.type === parser.Token.Identifier && tok1.token.value === '$' && tok2.token.type === parser.Token.Delimiter) {\n                i += 1;\n                patt = patternToObject(tok2);\n                patt.class = 'pattern_group';\n                if (patt.value === '[]') {\n                    patt.inner = loadLiteralGroup(patt.inner);\n                } else {\n                    patt.inner = loadPattern(tok2.expose().token.inner);\n                }\n            } else if (tok1.token.type === parser.Token.Identifier && tok1.token.value === '_') {\n                patt = patternToObject(tok1);\n                patt.class = 'wildcard';\n            } else {\n                patt = patternToObject(tok1);\n                patt.class = 'pattern_literal';\n                if (patt.inner) {\n                    patt.inner = loadPattern(tok1.expose().token.inner);\n                }\n            }\n            // Macro classes aren't allowed in lookbehind because we wouldn't\n            // know where to insert the macro, and you can't use a L->R macro\n            // to match R->L.\n            if (reverse && patt.macroName) {\n                throwSyntaxError(patt.class, 'Not allowed in top-level lookbehind', patt.macroName[0]);\n            }\n            patts.push(patt);\n        }\n        return reverse ? reversePattern(patts) : patts;\n    }\n    function cachedTermMatch(stx, term) {\n        var res = [];\n        var i = 0;\n        while (stx[i] && stx[i].term === term) {\n            res.unshift(stx[i]);\n            i++;\n        }\n        return {\n            result: term,\n            destructed: res,\n            rest: stx.slice(res.length)\n        };\n    }\n    function expandWithMacro(macroName, stx, context, rec) {\n        var name = macroName.map(syntax.unwrapSyntax).join('');\n        var ident = syntax.makeIdent(name, macroName[0]);\n        var macroObj = context.env.get(expander.resolve(ident));\n        var newContext = expander.makeExpanderContext(context);\n        if (!macroObj) {\n            throwSyntaxError('invoke', 'Macro not in scope', macroName[0]);\n        }\n        var next = macroName.slice(-1).concat(stx);\n        var rest, result, rt, patternEnv;\n        while (macroObj && next) {\n            try {\n                rt = macroObj.fn(next, newContext, [], []);\n                result = rt.result;\n                rest = rt.rest;\n                patternEnv = rt.patterns;\n            } catch (e) {\n                if (e instanceof syntax.SyntaxCaseError) {\n                    result = null;\n                    rest = stx;\n                    break;\n                } else {\n                    throw e;\n                }\n            }\n            if (rec && result.length >= 1) {\n                var resultHead = result[0];\n                var resultRest = result.slice(1);\n                var nextName = expander.getName(resultHead, resultRest);\n                var nextMacro = expander.getMacroInEnv(resultHead, resultRest, context.env);\n                if (nextName && nextMacro) {\n                    macroObj = nextMacro;\n                    next = result.concat(rest);\n                } else {\n                    break;\n                }\n            } else {\n                break;\n            }\n        }\n        return {\n            result: result,\n            rest: rest,\n            patternEnv: patternEnv\n        };\n    }\n    // (Pattern, [...CSyntax], MacroEnv) -> {result: null or [...CSyntax], rest: [...CSyntax]}\n    function matchPatternClass(patternObj, stx, context) {\n        var result, rest, match, patternEnv;\n        // pattern has no parse class\n        if (patternObj.class === 'token' && stx[0] && stx[0].token.type !== parser.Token.EOF) {\n            result = [stx[0]];\n            rest = stx.slice(1);\n        } else if (patternObj.class === 'lit' && stx[0] && typeIsLiteral(stx[0].token.type)) {\n            result = [stx[0]];\n            rest = stx.slice(1);\n        } else if (patternObj.class === 'ident' && stx[0] && stx[0].token.type === parser.Token.Identifier) {\n            result = [stx[0]];\n            rest = stx.slice(1);\n        } else if (stx.length > 0 && patternObj.class === 'VariableStatement') {\n            match = stx[0].term ? cachedTermMatch(stx, stx[0].term) : expander.enforest(stx, expander.makeExpanderContext(context));\n            if (match.result && match.result.isVariableStatement) {\n                result = match.destructed || match.result.destruct(false);\n                rest = match.rest;\n            } else {\n                result = null;\n                rest = stx;\n            }\n        } else if (stx.length > 0 && patternObj.class === 'expr') {\n            match = expander.get_expression(stx, expander.makeExpanderContext(context));\n            if (match.result === null || !match.result.isExpr) {\n                result = null;\n                rest = stx;\n            } else {\n                result = match.destructed || match.result.destruct(false);\n                result = [syntax.makeDelim('()', result, result[0])];\n                rest = match.rest;\n            }\n        } else if (stx.length > 0 && (patternObj.class === 'invoke' || patternObj.class === 'invokeRec')) {\n            match = expandWithMacro(patternObj.macroName, stx, context, patternObj.class === 'invokeRec');\n            result = match.result;\n            rest = match.result ? match.rest : stx;\n            patternEnv = match.patternEnv;\n        } else {\n            result = null;\n            rest = stx;\n        }\n        return {\n            result: result,\n            rest: rest,\n            patternEnv: patternEnv\n        };\n    }\n    // attempt to match patterns against stx\n    // ([...Pattern], [...Syntax], Env) -> { result: [...Syntax], rest: [...Syntax], patternEnv: PatternEnv }\n    function matchPatterns(patterns, stx, context, topLevel) {\n        // topLevel lets us know if the patterns are on the top level or nested inside\n        // a delimiter:\n        //     case $topLevel (,) ... => { }\n        //     case ($nested (,) ...) => { }\n        // This matters for how we deal with trailing unmatched syntax when the pattern\n        // has an ellipses:\n        //     m 1,2,3 foo\n        // should match 1,2,3 and leave foo alone but:\n        //     m (1,2,3 foo)\n        // should fail to match entirely.\n        topLevel = topLevel || false;\n        // note that there are two environments floating around,\n        // one is the mapping of identifiers to macro definitions (env)\n        // and the other is the pattern environment (patternEnv) that maps\n        // patterns in a macro case to syntax.\n        var result = [];\n        var patternEnv = {};\n        var match;\n        var pattern;\n        var rest = stx;\n        var success = true;\n        var inLeading;\n        patternLoop:\n            for (var i = 0; i < patterns.length; i++) {\n                if (success === false) {\n                    break;\n                }\n                pattern = patterns[i];\n                inLeading = false;\n                do {\n                    // handles cases where patterns trail a repeated pattern like `$x ... ;`\n                    if (pattern.repeat && i + 1 < patterns.length) {\n                        var restMatch = matchPatterns(patterns.slice(i + 1), rest, context, topLevel);\n                        if (restMatch.success) {\n                            // match the repeat pattern on the empty array to fill in its\n                            // pattern variable in the environment\n                            match = matchPattern(pattern, [], context, patternEnv, topLevel);\n                            patternEnv = _.extend(restMatch.patternEnv, match.patternEnv);\n                            rest = restMatch.rest;\n                            break patternLoop;\n                        }\n                    }\n                    if (pattern.repeat && pattern.leading && pattern.separator !== ' ') {\n                        if (rest[0].token.value === pattern.separator.token.value) {\n                            if (!inLeading) {\n                                inLeading = true;\n                            }\n                            rest = rest.slice(1);\n                        } else {\n                            // If we are in a leading repeat, the separator is required.\n                            if (inLeading) {\n                                success = false;\n                                break;\n                            }\n                        }\n                    }\n                    match = matchPattern(pattern, rest, context, patternEnv, topLevel);\n                    if (!match.success && pattern.repeat) {\n                        // a repeat can match zero tokens and still be a\n                        // \"success\" so break out of the inner loop and\n                        // try the next pattern\n                        break;\n                    }\n                    if (!match.success) {\n                        success = false;\n                        break;\n                    }\n                    rest = match.rest;\n                    patternEnv = match.patternEnv;\n                    if (success && !(topLevel || pattern.repeat)) {\n                        // the very last pattern matched, inside a\n                        // delimiter, not a repeat, *and* there are more\n                        // unmatched bits of syntax\n                        if (i == patterns.length - 1 && rest.length !== 0) {\n                            success = false;\n                            break;\n                        }\n                    }\n                    if (pattern.repeat && !pattern.leading && success) {\n                        // if (i < patterns.length - 1 && rest.length > 0) {\n                        //     var restMatch = matchPatterns(patterns.slice(i+1), rest, env, topLevel);\n                        //     if (restMatch.success) {\n                        //         patternEnv = _.extend(patternEnv, restMatch.patternEnv);\n                        //         rest = restMatch.rest;\n                        //         break patternLoop;\n                        //     }\n                        // }\n                        if (pattern.separator === ' ') {\n                            // no separator specified (using the empty string for this)\n                            // so keep going\n                            continue;\n                        } else if (rest[0] && rest[0].token.value === pattern.separator.token.value) {\n                            // more tokens and the next token matches the separator\n                            rest = rest.slice(1);\n                        } else if (pattern.separator !== ' ' && rest.length > 0 && i === patterns.length - 1 && topLevel === false) {\n                            // separator is specified, there is a next token, the\n                            // next token doesn't match the separator, there are\n                            // no more patterns, and this is a top level pattern\n                            // so the match has failed\n                            success = false;\n                            break;\n                        } else {\n                            break;\n                        }\n                    }\n                } while (pattern.repeat && success && rest.length > 0);\n            }\n        // If we are in a delimiter and we haven't matched all the syntax, it\n        // was a failed match.\n        if (!topLevel && rest.length) {\n            success = false;\n        }\n        var result;\n        if (success) {\n            result = rest.length ? stx.slice(0, -rest.length) : stx;\n        } else {\n            result = [];\n        }\n        return {\n            success: success,\n            result: result,\n            rest: rest,\n            patternEnv: patternEnv\n        };\n    }\n    /* the pattern environment will look something like:\n    {\n        \"$x\": {\n            level: 2,\n            match: [{\n                level: 1,\n                match: [{\n                    level: 0,\n                    match: [tok1, tok2, ...]\n                }, {\n                    level: 0,\n                    match: [tok1, tok2, ...]\n                }]\n            }, {\n                level: 1,\n                match: [{\n                    level: 0,\n                    match: [tok1, tok2, ...]\n                }]\n            }]\n        },\n        \"$y\" : ...\n    }\n    */\n    function matchPattern(pattern, stx, context, patternEnv, topLevel) {\n        var subMatch;\n        var match, matchEnv;\n        var rest;\n        var success;\n        if (typeof pattern.inner !== 'undefined') {\n            if (pattern.class === 'pattern_group') {\n                // pattern groups don't match the delimiters\n                subMatch = matchPatterns(pattern.inner, stx, context, true);\n                rest = subMatch.rest;\n                success = subMatch.success;\n            } else if (pattern.class === 'named_group') {\n                subMatch = matchPatterns(pattern.inner, stx, context, true);\n                rest = subMatch.rest;\n                success = subMatch.success;\n                if (success) {\n                    var namedMatch = {};\n                    namedMatch[pattern.value] = {\n                        level: 0,\n                        match: subMatch.result,\n                        topLevel: topLevel\n                    };\n                    subMatch.patternEnv = loadPatternEnv(namedMatch, subMatch.patternEnv, topLevel, false, pattern.value);\n                }\n            } else if (stx[0] && stx[0].token.type === parser.Token.Delimiter && stx[0].token.value === pattern.value) {\n                stx[0].expose();\n                if (pattern.inner.length === 0 && stx[0].token.inner.length !== 0) {\n                    return {\n                        success: false,\n                        rest: stx,\n                        patternEnv: patternEnv\n                    };\n                }\n                subMatch = matchPatterns(pattern.inner, stx[0].token.inner, context, false);\n                rest = stx.slice(1);\n                success = subMatch.success;\n            } else {\n                subMatch = matchPatterns(pattern.inner, [], context, false);\n                success = false;\n            }\n            if (success) {\n                patternEnv = loadPatternEnv(patternEnv, subMatch.patternEnv, topLevel, pattern.repeat);\n            } else if (pattern.repeat) {\n                patternEnv = initPatternEnv(patternEnv, subMatch.patternEnv, topLevel);\n            }\n        } else {\n            if (pattern.class === 'wildcard') {\n                success = true;\n                rest = stx.slice(1);\n            } else if (pattern.class === 'pattern_literal') {\n                // match the literal but don't update the pattern environment\n                if (stx[0] && pattern.value === stx[0].token.value) {\n                    success = true;\n                    rest = stx.slice(1);\n                } else {\n                    success = false;\n                    rest = stx;\n                }\n            } else {\n                match = matchPatternClass(pattern, stx, context);\n                success = match.result !== null;\n                rest = match.rest;\n                matchEnv = {\n                    level: 0,\n                    match: match.result,\n                    topLevel: topLevel\n                };\n                // push the match onto this value's slot in the environment\n                if (pattern.repeat) {\n                    if (patternEnv[pattern.value] && success) {\n                        patternEnv[pattern.value].match.push(matchEnv);\n                    } else if (patternEnv[pattern.value] === undefined) {\n                        // initialize if necessary\n                        patternEnv[pattern.value] = {\n                            level: 1,\n                            match: [matchEnv],\n                            topLevel: topLevel\n                        };\n                    }\n                } else {\n                    patternEnv[pattern.value] = matchEnv;\n                }\n                patternEnv = loadPatternEnv(patternEnv, match.patternEnv, topLevel, pattern.repeat, pattern.value);\n            }\n        }\n        return {\n            success: success,\n            rest: rest,\n            patternEnv: patternEnv\n        };\n    }\n    function initPatternEnv(toEnv, fromEnv, topLevel) {\n        _.forEach(fromEnv, function (patternVal, patternKey) {\n            if (!toEnv[patternKey]) {\n                toEnv[patternKey] = {\n                    level: patternVal.level + 1,\n                    match: [patternVal],\n                    topLevel: topLevel\n                };\n            }\n        });\n        return toEnv;\n    }\n    function loadPatternEnv(toEnv, fromEnv, topLevel, repeat, prefix) {\n        prefix = prefix || '';\n        _.forEach(fromEnv, function (patternVal, patternKey) {\n            var patternName = prefix + patternKey;\n            if (repeat) {\n                var nextLevel = patternVal.level + 1;\n                if (toEnv[patternName]) {\n                    toEnv[patternName].level = nextLevel;\n                    toEnv[patternName].match.push(patternVal);\n                } else {\n                    toEnv[patternName] = {\n                        level: nextLevel,\n                        match: [patternVal],\n                        topLevel: topLevel\n                    };\n                }\n            } else {\n                toEnv[patternName] = patternVal;\n            }\n        });\n        return toEnv;\n    }\n    function matchLookbehind(patterns, stx, terms, context) {\n        var success, patternEnv, prevStx, prevTerms;\n        // No lookbehind, noop.\n        if (!patterns.length) {\n            success = true;\n            patternEnv = {};\n            prevStx = stx;\n            prevTerms = terms;\n        } else {\n            var match = matchPatterns(patterns, stx, context, true);\n            var last = match.result[match.result.length - 1];\n            success = match.success;\n            patternEnv = match.patternEnv;\n            if (success) {\n                if (match.rest.length) {\n                    if (last && last.term && last.term === match.rest[0].term) {\n                        // The term tree was split, so its a failed match;\n                        success = false;\n                    } else {\n                        prevStx = match.rest;\n                        // Find where to slice the prevTerms to match up with\n                        // the state of prevStx.\n                        for (var i = 0, len = terms.length; i < len; i++) {\n                            if (terms[i] === prevStx[0].term) {\n                                prevTerms = terms.slice(i);\n                                break;\n                            }\n                        }\n                        assert(prevTerms, 'No matching previous term found');\n                    }\n                } else {\n                    prevTerms = [];\n                    prevStx = [];\n                }\n            }\n        }\n        // We need to reverse the matches for any top level repeaters because\n        // they match in reverse, and thus put their results in backwards.\n        _.forEach(patternEnv, function (val, key) {\n            if (val.level && val.match && val.topLevel) {\n                val.match.reverse();\n            }\n        });\n        return {\n            success: success,\n            patternEnv: patternEnv,\n            prevStx: prevStx,\n            prevTerms: prevTerms\n        };\n    }\n    function hasMatch(m) {\n        if (m.level === 0) {\n            return m.match.length > 0;\n        }\n        return !!m.match;\n    }\n    // given the given the macroBody (list of Pattern syntax objects) and the\n    // environment (a mapping of patterns to syntax) return the body with the\n    // appropriate patterns replaces with their value in the environment\n    function transcribe(macroBody, macroNameStx, env) {\n        return _.chain(macroBody).reduce(function (acc, bodyStx, idx, original) {\n            // first find the ellipses and mark the syntax objects\n            // (note that this step does not eagerly go into delimiter bodies)\n            var last = original[idx - 1];\n            var next = original[idx + 1];\n            var nextNext = original[idx + 2];\n            // drop `...`\n            if (bodyStx.token.value === '...') {\n                return acc;\n            }\n            // drop `(<separator)` when followed by an ellipse\n            if (delimIsSeparator(bodyStx) && next && next.token.value === '...') {\n                return acc;\n            }\n            // skip the $ in $(...)\n            if (bodyStx.token.value === '$' && next && next.token.type === parser.Token.Delimiter && next.token.value === '()') {\n                return acc;\n            }\n            // mark $[...] as a literal\n            if (bodyStx.token.value === '$' && next && next.token.type === parser.Token.Delimiter && next.token.value === '[]') {\n                next.literal = true;\n                return acc;\n            }\n            if (bodyStx.token.type === parser.Token.Delimiter && bodyStx.token.value === '()' && last && last.token.value === '$') {\n                bodyStx.group = true;\n            }\n            // literal [] delimiters have their bodies just\n            // directly passed along\n            if (bodyStx.literal === true) {\n                assert(bodyStx.token.type === parser.Token.Delimiter, 'expecting a literal to be surrounded by []');\n                return acc.concat(bodyStx.token.inner);\n            }\n            if (next && next.token.value === '...') {\n                bodyStx.repeat = true;\n                bodyStx.separator = ' ';\n            }    // default to space separated\n            else if (delimIsSeparator(next) && nextNext && nextNext.token.value === '...') {\n                bodyStx.repeat = true;\n                bodyStx.separator = next.token.inner[0];\n            }\n            acc.push(bodyStx);\n            return acc;\n        }, []).reduce(function (acc, bodyStx, idx) {\n            // then do the actual transcription\n            if (bodyStx.repeat) {\n                if (bodyStx.token.type === parser.Token.Delimiter) {\n                    bodyStx.expose();\n                    var fv = _.filter(freeVarsInPattern(bodyStx.token.inner), function (pat) {\n                            // ignore \"patterns\"\n                            // that aren't in the\n                            // environment (treat\n                            // them like literals)\n                            return env.hasOwnProperty(pat);\n                        });\n                    var restrictedEnv = [];\n                    var nonScalar = _.find(fv, function (pat) {\n                            return env[pat].level > 0;\n                        });\n                    assert(typeof nonScalar !== 'undefined', 'must have a least one non-scalar in repeat');\n                    var repeatLength = env[nonScalar].match.length;\n                    var sameLength = _.all(fv, function (pat) {\n                            return env[pat].level === 0 || env[pat].match.length === repeatLength;\n                        });\n                    assert(sameLength, 'all non-scalars must have the same length');\n                    // create a list of envs restricted to the free vars\n                    _.each(_.range(repeatLength), function (idx$2) {\n                        var renv = {};\n                        _.each(fv, function (pat) {\n                            if (env[pat].level === 0) {\n                                // copy scalars over\n                                renv[pat] = env[pat];\n                            } else {\n                                // grab the match at this index\n                                renv[pat] = env[pat].match[idx$2];\n                            }\n                        });\n                        var allHaveMatch = Object.keys(renv).every(function (pat) {\n                                return hasMatch(renv[pat]);\n                            });\n                        if (allHaveMatch) {\n                            restrictedEnv.push(renv);\n                        }\n                    });\n                    var transcribed = _.map(restrictedEnv, function (renv) {\n                            if (bodyStx.group) {\n                                return transcribe(bodyStx.token.inner, macroNameStx, renv);\n                            } else {\n                                var newBody$2 = syntaxFromToken(_.clone(bodyStx.token), bodyStx);\n                                newBody$2.token.inner = transcribe(bodyStx.token.inner, macroNameStx, renv);\n                                return newBody$2;\n                            }\n                        });\n                    var joined;\n                    if (bodyStx.group) {\n                        joined = joinSyntaxArray(transcribed, bodyStx.separator);\n                    } else {\n                        joined = joinSyntax(transcribed, bodyStx.separator);\n                    }\n                    push.apply(acc, joined);\n                    return acc;\n                }\n                if (!env[bodyStx.token.value]) {\n                    throwSyntaxError('patterns', 'The pattern variable is not bound for the template', bodyStx);\n                } else if (env[bodyStx.token.value].level !== 1) {\n                    throwSyntaxError('patterns', 'Ellipses level does not match in the template', bodyStx);\n                }\n                push.apply(acc, joinRepeatedMatch(env[bodyStx.token.value].match, bodyStx.separator));\n                return acc;\n            } else {\n                if (bodyStx.token.type === parser.Token.Delimiter) {\n                    bodyStx.expose();\n                    var newBody = syntaxFromToken(_.clone(bodyStx.token), macroBody);\n                    newBody.token.inner = transcribe(bodyStx.token.inner, macroNameStx, env);\n                    acc.push(newBody);\n                    return acc;\n                }\n                if (isPatternVar(bodyStx) && Object.prototype.hasOwnProperty.bind(env)(bodyStx.token.value)) {\n                    if (!env[bodyStx.token.value]) {\n                        throwSyntaxError('patterns', 'The pattern variable is not bound for the template', bodyStx);\n                    } else if (env[bodyStx.token.value].level !== 0) {\n                        throwSyntaxError('patterns', 'Ellipses level does not match in the template', bodyStx);\n                    }\n                    push.apply(acc, takeLineContext(bodyStx, env[bodyStx.token.value].match));\n                    return acc;\n                }\n                acc.push(syntaxFromToken(_.clone(bodyStx.token), bodyStx));\n                return acc;\n            }\n        }, []).value();\n    }\n    function cloneMatch(oldMatch) {\n        var newMatch = {\n                success: oldMatch.success,\n                rest: oldMatch.rest,\n                patternEnv: {}\n            };\n        for (var pat in oldMatch.patternEnv) {\n            if (oldMatch.patternEnv.hasOwnProperty(pat)) {\n                newMatch.patternEnv[pat] = oldMatch.patternEnv[pat];\n            }\n        }\n        return newMatch;\n    }\n    function makeIdentityRule(pattern, isInfix, context) {\n        var inf = [];\n        var pat = [];\n        var stx = [];\n        if (isInfix) {\n            for (var i = 0; i < pattern.length; i++) {\n                if (pattern[i].token.type === parser.Token.Punctuator && pattern[i].token.value === '|') {\n                    pat.push(makeIdent('$inf', context), makePunc(':', context), makeDelim('()', inf, context), pattern[0], makeIdent('$id', context), makePunc(':', context), makeDelim('()', pat.slice(i + 1), context));\n                    stx.push(makeIdent('$inf', context), makeIdent('$id', context));\n                    break;\n                }\n                inf.push(pattern[i]);\n            }\n        } else {\n            pat.push(makeIdent('$id', context), makePunc(':', context), makeDelim('()', pattern, context));\n            stx.push(makeIdent('$id', context));\n        }\n        return {\n            pattern: pat,\n            body: stx\n        };\n    }\n    exports$2.loadPattern = loadPattern;\n    exports$2.matchPatterns = matchPatterns;\n    exports$2.matchLookbehind = matchLookbehind;\n    exports$2.transcribe = transcribe;\n    exports$2.matchPatternClass = matchPatternClass;\n    exports$2.takeLineContext = takeLineContext;\n    exports$2.takeLine = takeLine;\n    exports$2.typeIsLiteral = typeIsLiteral;\n    exports$2.cloneMatch = cloneMatch;\n    exports$2.makeIdentityRule = makeIdentityRule;\n}));\n//# sourceMappingURL=patterns.js.map"
  },
  {
    "path": "editor/scripts/require.js",
    "content": "/*\n RequireJS 2.1.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.\n Available via the MIT or new BSD license.\n see: http://github.com/jrburke/requirejs for details\n*/\nvar requirejs,require,define;\n(function(W){function D(b){return M.call(b)===\"[object Function]\"}function E(b){return M.call(b)===\"[object Array]\"}function t(b,c){if(b){var d;for(d=0;d<b.length;d+=1)if(b[d]&&c(b[d],d,b))break}}function N(b,c){if(b){var d;for(d=b.length-1;d>-1;d-=1)if(b[d]&&c(b[d],d,b))break}}function A(b,c){for(var d in b)if(b.hasOwnProperty(d)&&c(b[d],d))break}function O(b,c,d,g){c&&A(c,function(c,j){if(d||!F.call(b,j))g&&typeof c!==\"string\"?(b[j]||(b[j]={}),O(b[j],c,d,g)):b[j]=c});return b}function r(b,c){return function(){return c.apply(b,\narguments)}}function X(b){if(!b)return b;var c=W;t(b.split(\".\"),function(b){c=c[b]});return c}function G(b,c,d,g){c=Error(c+\"\\nhttp://requirejs.org/docs/errors.html#\"+b);c.requireType=b;c.requireModules=g;if(d)c.originalError=d;return c}function ba(){if(H&&H.readyState===\"interactive\")return H;N(document.getElementsByTagName(\"script\"),function(b){if(b.readyState===\"interactive\")return H=b});return H}var g,s,u,y,q,B,H,I,Y,Z,ca=/(\\/\\*([\\s\\S]*?)\\*\\/|([^:]|^)\\/\\/(.*)$)/mg,da=/[^.]\\s*require\\s*\\(\\s*[\"']([^'\"\\s]+)[\"']\\s*\\)/g,\n$=/\\.js$/,ea=/^\\.\\//;s=Object.prototype;var M=s.toString,F=s.hasOwnProperty,fa=Array.prototype.splice,v=!!(typeof window!==\"undefined\"&&navigator&&document),aa=!v&&typeof importScripts!==\"undefined\",ga=v&&navigator.platform===\"PLAYSTATION 3\"?/^complete$/:/^(complete|loaded)$/,R=typeof opera!==\"undefined\"&&opera.toString()===\"[object Opera]\",w={},n={},P=[],J=!1;if(typeof define===\"undefined\"){if(typeof requirejs!==\"undefined\"){if(D(requirejs))return;n=requirejs;requirejs=void 0}typeof require!==\"undefined\"&&\n!D(require)&&(n=require,require=void 0);g=requirejs=function(b,c,d,p){var i,j=\"_\";!E(b)&&typeof b!==\"string\"&&(i=b,E(c)?(b=c,c=d,d=p):b=[]);if(i&&i.context)j=i.context;(p=w[j])||(p=w[j]=g.s.newContext(j));i&&p.configure(i);return p.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick=typeof setTimeout!==\"undefined\"?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version=\"2.1.1\";g.jsExtRegExp=/^\\/|:|\\?|\\.js$/;g.isBrowser=v;s=g.s={contexts:w,newContext:function(b){function c(a,\nf,x){var e,m,b,c,d,h,i,g=f&&f.split(\"/\");e=g;var j=k.map,l=j&&j[\"*\"];if(a&&a.charAt(0)===\".\")if(f){e=k.pkgs[f]?g=[f]:g.slice(0,g.length-1);f=a=e.concat(a.split(\"/\"));for(e=0;f[e];e+=1)if(m=f[e],m===\".\")f.splice(e,1),e-=1;else if(m===\"..\")if(e===1&&(f[2]===\"..\"||f[0]===\"..\"))break;else e>0&&(f.splice(e-1,2),e-=2);e=k.pkgs[f=a[0]];a=a.join(\"/\");e&&a===f+\"/\"+e.main&&(a=f)}else a.indexOf(\"./\")===0&&(a=a.substring(2));if(x&&(g||l)&&j){f=a.split(\"/\");for(e=f.length;e>0;e-=1){b=f.slice(0,e).join(\"/\");if(g)for(m=\ng.length;m>0;m-=1)if(x=j[g.slice(0,m).join(\"/\")])if(x=x[b]){c=x;d=e;break}if(c)break;!h&&l&&l[b]&&(h=l[b],i=e)}!c&&h&&(c=h,d=i);c&&(f.splice(0,d,c),a=f.join(\"/\"))}return a}function d(a){v&&t(document.getElementsByTagName(\"script\"),function(f){if(f.getAttribute(\"data-requiremodule\")===a&&f.getAttribute(\"data-requirecontext\")===h.contextName)return f.parentNode.removeChild(f),!0})}function p(a){var f=k.paths[a];if(f&&E(f)&&f.length>1)return d(a),f.shift(),h.require.undef(a),h.require([a]),!0}function i(a){var f,\nb=a?a.indexOf(\"!\"):-1;b>-1&&(f=a.substring(0,b),a=a.substring(b+1,a.length));return[f,a]}function j(a,f,b,e){var m,K,d=null,g=f?f.name:null,j=a,l=!0,k=\"\";a||(l=!1,a=\"_@r\"+(M+=1));a=i(a);d=a[0];a=a[1];d&&(d=c(d,g,e),K=o[d]);a&&(d?k=K&&K.normalize?K.normalize(a,function(a){return c(a,g,e)}):c(a,g,e):(k=c(a,g,e),a=i(k),d=a[0],k=a[1],b=!0,m=h.nameToUrl(k)));b=d&&!K&&!b?\"_unnormalized\"+(N+=1):\"\";return{prefix:d,name:k,parentMap:f,unnormalized:!!b,url:m,originalName:j,isDefine:l,id:(d?d+\"!\"+k:k)+b}}function n(a){var f=\na.id,b=l[f];b||(b=l[f]=new h.Module(a));return b}function q(a,f,b){var e=a.id,m=l[e];if(F.call(o,e)&&(!m||m.defineEmitComplete))f===\"defined\"&&b(o[e]);else n(a).on(f,b)}function z(a,f){var b=a.requireModules,e=!1;if(f)f(a);else if(t(b,function(f){if(f=l[f])f.error=a,f.events.error&&(e=!0,f.emit(\"error\",a))}),!e)g.onError(a)}function s(){P.length&&(fa.apply(C,[C.length-1,0].concat(P)),P=[])}function u(a,f,b){var e=a.map.id;a.error?a.emit(\"error\",a.error):(f[e]=!0,t(a.depMaps,function(e,c){var d=e.id,\ng=l[d];g&&!a.depMatched[c]&&!b[d]&&(f[d]?(a.defineDep(c,o[d]),a.check()):u(g,f,b))}),b[e]=!0)}function w(){var a,f,b,e,m=(b=k.waitSeconds*1E3)&&h.startTime+b<(new Date).getTime(),c=[],g=[],i=!1,j=!0;if(!S){S=!0;A(l,function(b){a=b.map;f=a.id;if(b.enabled&&(a.isDefine||g.push(b),!b.error))if(!b.inited&&m)p(f)?i=e=!0:(c.push(f),d(f));else if(!b.inited&&b.fetched&&a.isDefine&&(i=!0,!a.prefix))return j=!1});if(m&&c.length)return b=G(\"timeout\",\"Load timeout for modules: \"+c,null,c),b.contextName=h.contextName,\nz(b);j&&t(g,function(a){u(a,{},{})});if((!m||e)&&i)if((v||aa)&&!T)T=setTimeout(function(){T=0;w()},50);S=!1}}function y(a){n(j(a[0],null,!0)).init(a[1],a[2])}function B(a){var a=a.currentTarget||a.srcElement,b=h.onScriptLoad;a.detachEvent&&!R?a.detachEvent(\"onreadystatechange\",b):a.removeEventListener(\"load\",b,!1);b=h.onScriptError;a.detachEvent&&!R||a.removeEventListener(\"error\",b,!1);return{node:a,id:a&&a.getAttribute(\"data-requiremodule\")}}function I(){var a;for(s();C.length;)if(a=C.shift(),a[0]===\nnull)return z(G(\"mismatch\",\"Mismatched anonymous define() module: \"+a[a.length-1]));else y(a)}var S,U,h,L,T,k={waitSeconds:7,baseUrl:\"./\",paths:{},pkgs:{},shim:{},map:{},config:{}},l={},V={},C=[],o={},Q={},M=1,N=1;L={require:function(a){return a.require?a.require:a.require=h.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?a.exports:a.exports=o[a.map.id]={}},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return k.config&&\nk.config[a.map.id]||{}},exports:o[a.map.id]}}};U=function(a){this.events=V[a.id]||{};this.map=a;this.shim=k.shim[a.id];this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};U.prototype={init:function(a,b,c,e){e=e||{};if(!this.inited){this.factory=b;if(c)this.on(\"error\",c);else this.events.error&&(c=r(this,function(a){this.emit(\"error\",a)}));this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;this.ignore=e.ignore;e.enabled||this.enabled?this.enable():this.check()}},\ndefineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;h.startTime=(new Date).getTime();var a=this.map;if(this.shim)h.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],r(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;Q[a]||(Q[a]=!0,h.load(this.map.id,a))},check:function(){if(this.enabled&&\n!this.enabling){var a,b,c=this.map.id;b=this.depExports;var e=this.exports,m=this.factory;if(this.inited)if(this.error)this.emit(\"error\",this.error);else{if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(D(m)){if(this.events.error)try{e=h.execCb(c,m,b,e)}catch(d){a=d}else e=h.execCb(c,m,b,e);if(this.map.isDefine)if((b=this.module)&&b.exports!==void 0&&b.exports!==this.exports)e=b.exports;else if(e===void 0&&this.usingExports)e=this.exports;if(a)return a.requireMap=this.map,\na.requireModules=[this.map.id],a.requireType=\"define\",z(this.error=a)}else e=m;this.exports=e;if(this.map.isDefine&&!this.ignore&&(o[c]=e,g.onResourceLoad))g.onResourceLoad(h,this.map,this.depMaps);delete l[c];this.defined=!0}this.defining=!1;if(this.defined&&!this.defineEmitted)this.defineEmitted=!0,this.emit(\"defined\",this.exports),this.defineEmitComplete=!0}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=j(a.prefix);this.depMaps.push(d);q(d,\"defined\",r(this,function(e){var m,\nd;d=this.map.name;var x=this.map.parentMap?this.map.parentMap.name:null,i=h.makeRequire(a.parentMap,{enableBuildCallback:!0,skipMap:!0});if(this.map.unnormalized){if(e.normalize&&(d=e.normalize(d,function(a){return c(a,x,!0)})||\"\"),e=j(a.prefix+\"!\"+d,this.map.parentMap),q(e,\"defined\",r(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=l[e.id]){this.depMaps.push(e);if(this.events.error)d.on(\"error\",r(this,function(a){this.emit(\"error\",a)}));d.enable()}}else m=r(this,\nfunction(a){this.init([],function(){return a},null,{enabled:!0})}),m.error=r(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];A(l,function(a){a.map.id.indexOf(b+\"_unnormalized\")===0&&delete l[a.map.id]});z(a)}),m.fromText=r(this,function(b,e){var f=a.name,c=j(f),d=J;e&&(b=e);d&&(J=!1);n(c);try{g.exec(b)}catch(x){throw Error(\"fromText eval for \"+f+\" failed: \"+x);}d&&(J=!0);this.depMaps.push(c);h.completeLoad(f);i([f],m)}),e.load(a.name,i,m,k)}));h.enable(d,this);this.pluginMaps[d.id]=\nd},enable:function(){this.enabling=this.enabled=!0;t(this.depMaps,r(this,function(a,b){var c,e;if(typeof a===\"string\"){a=j(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=L[a.id]){this.depExports[b]=c(this);return}this.depCount+=1;q(a,\"defined\",r(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&q(a,\"error\",this.errback)}c=a.id;e=l[c];!L[c]&&e&&!e.enabled&&h.enable(a,this)}));A(this.pluginMaps,r(this,function(a){var b=l[a.id];b&&!b.enabled&&\nh.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){t(this.events[a],function(a){a(b)});a===\"error\"&&delete this.events[a]}};h={config:k,contextName:b,registry:l,defined:o,urlFetched:Q,defQueue:C,Module:U,makeModuleMap:j,nextTick:g.nextTick,configure:function(a){a.baseUrl&&a.baseUrl.charAt(a.baseUrl.length-1)!==\"/\"&&(a.baseUrl+=\"/\");var b=k.pkgs,c=k.shim,e={paths:!0,config:!0,map:!0};A(a,function(a,b){e[b]?\nb===\"map\"?O(k[b],a,!0,!0):O(k[b],a,!0):k[b]=a});if(a.shim)A(a.shim,function(a,b){E(a)&&(a={deps:a});if(a.exports&&!a.exportsFn)a.exportsFn=h.makeShimExports(a);c[b]=a}),k.shim=c;if(a.packages)t(a.packages,function(a){a=typeof a===\"string\"?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||\"main\").replace(ea,\"\").replace($,\"\")}}),k.pkgs=b;A(l,function(a,b){if(!a.inited&&!a.map.unnormalized)a.map=j(b)});if(a.deps||a.callback)h.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;\na.init&&(b=a.init.apply(W,arguments));return b||X(a.exports)}},makeRequire:function(a,f){function d(e,c,i){var k,p;if(f.enableBuildCallback&&c&&D(c))c.__requireJsBuild=!0;if(typeof e===\"string\"){if(D(c))return z(G(\"requireargs\",\"Invalid require call\"),i);if(a&&L[e])return L[e](l[a.id]);if(g.get)return g.get(h,e,a);k=j(e,a,!1,!0);k=k.id;return!F.call(o,k)?z(G(\"notloaded\",'Module name \"'+k+'\" has not been loaded yet for context: '+b+(a?\"\":\". Use require([])\"))):o[k]}I();h.nextTick(function(){I();p=\nn(j(null,a));p.skipMap=f.skipMap;p.init(e,c,i,{enabled:!0});w()});return d}f=f||{};O(d,{isBrowser:v,toUrl:function(b){var d=b.lastIndexOf(\".\"),f=null;d!==-1&&(f=b.substring(d,b.length),b=b.substring(0,d));return h.nameToUrl(c(b,a&&a.id,!0),f)},defined:function(b){b=j(b,a,!1,!0).id;return F.call(o,b)},specified:function(b){b=j(b,a,!1,!0).id;return F.call(o,b)||F.call(l,b)}});if(!a)d.undef=function(b){s();var c=j(b,a,!0),d=l[b];delete o[b];delete Q[c.url];delete V[b];if(d){if(d.events.defined)V[b]=\nd.events;delete l[b]}};return d},enable:function(a){l[a.id]&&n(a).enable()},completeLoad:function(a){var b,c,d=k.shim[a]||{},g=d.exports;for(s();C.length;){c=C.shift();if(c[0]===null){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);y(c)}c=l[a];if(!b&&!o[a]&&c&&!c.inited)if(k.enforceDefine&&(!g||!X(g)))if(p(a))return;else return z(G(\"nodefine\",\"No define call for \"+a,null,[a]));else y([a,d.deps||[],d.exportsFn]);w()},nameToUrl:function(a,b){var c,d,i,h,j,l;if(g.jsExtRegExp.test(a))h=a+(b||\"\");else{c=\nk.paths;d=k.pkgs;h=a.split(\"/\");for(j=h.length;j>0;j-=1)if(l=h.slice(0,j).join(\"/\"),i=d[l],l=c[l]){E(l)&&(l=l[0]);h.splice(0,j,l);break}else if(i){c=a===i.name?i.location+\"/\"+i.main:i.location;h.splice(0,j,c);break}h=h.join(\"/\");h+=b||(/\\?/.test(h)?\"\":\".js\");h=(h.charAt(0)===\"/\"||h.match(/^[\\w\\+\\.\\-]+:/)?\"\":k.baseUrl)+h}return k.urlArgs?h+((h.indexOf(\"?\")===-1?\"?\":\"&\")+k.urlArgs):h},load:function(a,b){g.load(h,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if(a.type===\n\"load\"||ga.test((a.currentTarget||a.srcElement).readyState))H=null,a=B(a),h.completeLoad(a.id)},onScriptError:function(a){var b=B(a);if(!p(b.id))return z(G(\"scripterror\",\"Script error\",a,[b.id]))}};h.require=h.makeRequire();return h}};g({});t([\"toUrl\",\"undef\",\"defined\",\"specified\"],function(b){g[b]=function(){var c=w._;return c.require[b].apply(c,arguments)}});if(v&&(u=s.head=document.getElementsByTagName(\"head\")[0],y=document.getElementsByTagName(\"base\")[0]))u=s.head=y.parentNode;g.onError=function(b){throw b;\n};g.load=function(b,c,d){var g=b&&b.config||{},i;if(v)return i=g.xhtml?document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"html:script\"):document.createElement(\"script\"),i.type=g.scriptType||\"text/javascript\",i.charset=\"utf-8\",i.async=!0,i.setAttribute(\"data-requirecontext\",b.contextName),i.setAttribute(\"data-requiremodule\",c),i.attachEvent&&!(i.attachEvent.toString&&i.attachEvent.toString().indexOf(\"[native code\")<0)&&!R?(J=!0,i.attachEvent(\"onreadystatechange\",b.onScriptLoad)):(i.addEventListener(\"load\",\nb.onScriptLoad,!1),i.addEventListener(\"error\",b.onScriptError,!1)),i.src=d,I=i,y?u.insertBefore(i,y):u.appendChild(i),I=null,i;else aa&&(importScripts(d),b.completeLoad(c))};v&&N(document.getElementsByTagName(\"script\"),function(b){if(!u)u=b.parentNode;if(q=b.getAttribute(\"data-main\")){if(!n.baseUrl)B=q.split(\"/\"),Y=B.pop(),Z=B.length?B.join(\"/\")+\"/\":\"./\",n.baseUrl=Z,q=Y;q=q.replace($,\"\");n.deps=n.deps?n.deps.concat(q):[q];return!0}});define=function(b,c,d){var g,i;typeof b!==\"string\"&&(d=c,c=b,b=\nnull);E(c)||(d=c,c=[]);!c.length&&D(d)&&d.length&&(d.toString().replace(ca,\"\").replace(da,function(b,d){c.push(d)}),c=(d.length===1?[\"require\"]:[\"require\",\"exports\",\"module\"]).concat(c));if(J&&(g=I||ba()))b||(b=g.getAttribute(\"data-requiremodule\")),i=w[g.getAttribute(\"data-requirecontext\")];(i?i.defQueue:P).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(n)}})(this);\n"
  },
  {
    "path": "editor/scripts/scopedEval.js",
    "content": "// thou shalt not macro expand me...all kinds of hygiene hackary\n// with strings and `with`.\n\n\n(function (root, factory) {\n    if (typeof exports === 'object') {\n        // CommonJS\n        factory(exports);\n    } else if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['exports'], factory);\n    }\n}(this, function(exports) {\n\n    exports.scopedEval = function(source, global) {\n        return eval('(function() { with(global) { return ' + source + ' } }).call(global, global);');\n    };\n\n}));\n\n"
  },
  {
    "path": "editor/scripts/stxcase.js",
    "content": "let quoteSyntax = macro {\n    function(stx) {\n        var name_stx = stx[0];\n\n        if (!(stx[1] && stx[1].token && stx[1].token.inner)) {\n            throwSyntaxError(\"macro\", \"Macro `quoteSyntax` could not be matched\" , stx[1]);\n        }\n\n        var res = [\n            makeIdent(\"#quoteSyntax\", null),\n            stx[1].expose()\n        ];\n\n        return {\n            result: res,\n            rest: stx.slice(2)\n        };\n    }\n}\nexport quoteSyntax\n\nlet syntax = macro {\n    function(stx) {\n        var name_stx = stx[0];\n        var here = quoteSyntax{here};\n        var takeLineContext = patternModule.takeLineContext;\n        var takeLine = patternModule.takeLine;\n        var mod = makeIdent(\"patternModule\", here);\n\n        if (!(stx[1] && stx[1].token && stx[1].token.inner)) {\n            throwSyntaxError(\"macro\", \"Macro `syntax` could not be matched\", stx[1]);\n        }\n\n        var res = [mod,\n                   makePunc(\".\", here),\n                   makeIdent(\"transcribe\", here),\n                   makeDelim(\"()\", [\n                       makeIdent(\"#quoteSyntax\", here),\n                       stx[1].expose(),\n                       makePunc(\",\", here),\n                       // breaking hygiene to capture `name_stx`, `match`, and\n                       // `patternEnv` inside the syntaxCase macro\n                       makeIdent(\"name_stx\", name_stx),\n                       makePunc(\",\", here),\n                       makeIdent(\"match\", name_stx),\n                       makePunc(\".\", here),\n                       makeIdent(\"patternEnv\", name_stx)\n                   ], here)];\n\n\n        return {\n            result: res,\n            rest: stx.slice(2)\n        };\n    }\n}\nexport syntax\n\nmacro # {\n    function (stx) {\n        return {\n            // breaking hygiene to capture inside syntaxCase\n            result: [makeIdent(\"syntax\", stx[0]),\n                     stx[1]],\n            rest: stx.slice(2)\n        }\n    }\n}\nexport #\n\n\nlet syntaxCase = macro {\n    function(stx, context) {\n        var name_stx = stx[0];\n        var here = quoteSyntax{here};\n\n        if (!(stx[1] && stx[1].token && stx[1].token.inner) ||\n            !(stx[2] && stx[2].token && stx[2].token.inner)) {\n            throwSyntaxError(\"macro\", \"Macro `syntaxCase` could not be matched\" , stx[1]);\n        }\n\n        var arg_stx = stx[1].expose().token.inner;\n        var cases_stx = stx[2].expose().token.inner;\n\n        var Token = parser.Token;\n        var assert = parser.assert;\n        var loadPattern = patternModule.loadPattern;\n        var takeLine = patternModule.takeLine;\n        var matchPatterns = matchPatterns;\n\n        function makeFunc(params, body) {\n            return [\n                makeKeyword(\"function\", here),\n                makeDelim(\"()\", params, here),\n                makeDelim(\"{}\", body, here)\n            ];\n        }\n\n        function makeVarDef(id, expr) {\n            return [\n                makeKeyword(\"var\", here),\n                makeIdent(id, name_stx),\n                makePunc(\"=\", here)\n            ].concat(expr, makePunc(\";\", here));\n        }\n\n        function makeAssign(id, expr) {\n          return [\n            makeIdent(id, name_stx),\n            makePunc(\"=\", here)\n          ].concat(expr, makePunc(\";\", here));\n        }\n\n        function cloneSyntax(stx) {\n            var clone = _.extend({}, stx, { token: _.clone(stx.token) });\n            if (clone.token.inner) {\n                clone.token.inner = clone.token.inner.map(cloneSyntax);\n            }\n            return clone;\n        }\n\n        if (cases_stx.length == 0) {\n            throw new Error(\"Must have at least one case\")\n        }\n\n        var cases = [];\n\n        for (var i = 0; i < cases_stx.length; i += 4) {\n            var caseKwd = cases_stx[i];\n            var isInfix = cases_stx[i + 1].token.value === \"infix\";\n            if (isInfix) {\n                i += 1;\n            }\n            var casePattern = cases_stx[i + 1];\n            var caseArrow = cases_stx[i + 2];\n            var caseBody = cases_stx[i + 3];\n\n            if (!(caseKwd && caseKwd.token && caseKwd.token.value === \"case\")) {\n                throw new Error(\"expecting case keyword in syntax case\");\n            }\n            if (!(casePattern && casePattern.token && casePattern.token.value === \"{}\")) {\n                throw new Error(\"expecting a pattern surrounded by {} in syntax case\");\n            }\n            if (!(caseArrow && caseArrow.token && caseArrow.token.value === \"=>\")) {\n                throw new Error(\"expecting an arrow separating pattern from body in syntax case\");\n            }\n            if (!(caseBody && caseBody.token && caseBody.token.value === \"{}\")) {\n                throw new Error(\"expecting a body surrounded by {} in syntax case\");\n            }\n\n            // If infix, loop through the pattern separating the lhs and rhs.\n            if (isInfix) {\n                var pattern = cloneSyntax(casePattern).expose().token.inner;\n                var lhs = [];\n                var rhs = [];\n                var separator = null;\n                for (var j = 0; j < pattern.length; j++) {\n                    if (separator) {\n                        rhs.push(pattern[j]);\n                    } else {\n                        if (pattern[j].token.type === parser.Token.Punctuator &&\n                            pattern[j].token.value === '|') {\n                            separator = pattern[j];\n                        } else {\n                            lhs.push(pattern[j]);\n                        }\n                    }\n                }\n                if (!separator) {\n                    throwSyntaxError(\"syntaxCase\", \"Infix macros require a `|` separator\", casePattern);\n                }\n                cases.push({\n                    lookbehind: loadPattern(lhs, true),\n                    pattern: loadPattern(rhs),\n                    body: caseBody.expose().token.inner\n                });\n            } else {\n                cases.push({\n                    lookbehind: [],\n                    pattern: loadPattern(cloneSyntax(casePattern).expose().token.inner),\n                    body: caseBody.expose().token.inner\n                });\n            }\n        }\n\n        function patternsToObject(pats) {\n            if (!pats.length) {\n                return makeDelim(\"[]\", [], here);\n            }\n\n            var freshId = __fresh();\n            context.patternMap.set(freshId, pats);\n\n            return [\n                makeIdent(\"getPattern\", here),\n                makeDelim(\"()\", [\n                    makeValue(freshId, here)\n                ], here)\n            ];\n        }\n\n        function makeMatch(caseObj) {\n            var lhs = makeAssign(\"lhs\", patternsToObject(caseObj.lookbehind));\n            var rhs = makeAssign(\"rhs\", patternsToObject(caseObj.pattern));\n\n            var lhsMatch = makeAssign(\"lhsMatch\", [\n                makeIdent(\"patternModule\", here),\n                makePunc(\".\", here),\n                makeIdent(\"matchLookbehind\", here),\n                makeDelim(\"()\", [\n                    makeIdent(\"lhs\", name_stx),\n                    makePunc(\",\", here),\n                    makeIdent(\"prevStx\", name_stx),\n                    makePunc(\",\", here),\n                    makeIdent(\"prevTerms\", name_stx),\n                    makePunc(\",\", here),\n                    makeIdent(\"context\", name_stx)\n                ], here)\n            ]);\n\n            var rhsMatch = makeAssign(\"rhsMatch\", [\n                makeIdent(\"patternModule\", here),\n                makePunc(\".\", here),\n                makeIdent(\"matchPatterns\", here),\n                makeDelim(\"()\", [\n                    makeIdent(\"rhs\", name_stx),\n                    makePunc(\",\", here),\n                    makeIdent(\"arg\", name_stx),\n                    makePunc(\",\", here),\n                    makeIdent(\"context\", name_stx),\n                    makePunc(\",\", here),\n                    makeValue(true, here)\n                ], here)\n            ]);\n\n            var mergeMatch = makeAssign(\"match\", [\n                makeIdent(\"mergeMatches\", here),\n                makeDelim(\"()\", [\n                    makeIdent(\"rhsMatch\", name_stx),\n                    makePunc(\",\", here),\n                ].concat(\n                    makeIdent(\"mergeMatches\", here),\n                    makeDelim(\"()\", [\n                        makeIdent(\"lhsMatch\", name_stx),\n                        makePunc(\",\", here),\n                        makeIdent(\"parentMatch\", name_stx)\n                    ], here)\n                ), here)\n            ]);\n\n            return lhs.concat(lhsMatch, [\n                makeKeyword(\"if\", here),\n                makeDelim(\"()\", [\n                    makeIdent(\"lhsMatch\", name_stx),\n                    makePunc(\".\", here),\n                    makeIdent(\"success\", here)\n                ], here),\n                makeDelim(\"{}\", rhs.concat(rhsMatch, [\n                    makeKeyword(\"if\", here),\n                    makeDelim(\"()\", [\n                        makeIdent(\"rhsMatch\", name_stx),\n                        makePunc(\".\", here),\n                        makeIdent(\"success\", here)\n                    ], here),\n                    makeDelim(\"{}\", mergeMatch.concat(makeTranscribe(caseObj)), here)\n                ]), here)\n            ]);\n        }\n\n        function makeTranscribe(caseObj) {\n            // applyMarkToPatternEnv (context.mark, match.patternEnv);\n            var applyPreMark = [\n                makeIdent(\"applyMarkToPatternEnv\", here),\n                makeDelim(\"()\", [\n                    makeIdent(\"context\", name_stx),\n                    makePunc(\".\", here),\n                    makeIdent(\"mark\", name_stx),\n                    makePunc(\",\", here),\n                    makeIdent(\"match\", name_stx),\n                    makePunc(\".\", here),\n                    makeIdent(\"patternEnv\", name_stx)\n                ], here),\n                makePunc(\";\", here)\n            ];\n            // var res = (function() { <caseObj.body> })();\n            var runBody = makeVarDef(\"res\", [\n                makeDelim(\"()\", makeFunc([], caseObj.body), here),\n                makeDelim(\"()\", [], here)\n            ]);\n            // if (!Array.isArray(res)) { throwSyntaxError(\"macro\", \"Macro must return a syntax array\", stx); }\n            var errHandling = [\n                makeKeyword(\"if\", here),\n                makeDelim(\"()\", [\n                    makePunc(\"!\", here),\n                    makeIdent(\"Array\", here),\n                    makePunc(\".\", here),\n                    makeIdent(\"isArray\", here),\n                    makeDelim(\"()\", [\n                        makeIdent(\"res\", name_stx)\n                    ], here)\n                ], here),\n                makeDelim(\"{}\", [\n                    makeIdent(\"throwSyntaxError\", here),\n                    makeDelim(\"()\", [\n                        makeValue(\"macro\", here),\n                        makePunc(\",\", here),\n                        makeValue(\"Macro must return a syntax array\", here),\n                        makePunc(\",\", here),\n                        makeIdent(\"stx\", name_stx)\n                    ], here)\n                ], here)\n            ];\n            // res = res.map(function(stx) { return stx.mark(context.mark); })\n            var applyPostMark = [\n                makeIdent(\"res\", name_stx),\n                makePunc(\"=\", here),\n                makeIdent(\"res\", name_stx),\n                makePunc(\".\", here),\n                makeIdent(\"map\", here),\n                makeDelim(\"()\", makeFunc([makeIdent(\"stx\", here)], [\n                        makeKeyword(\"return\", here),\n                        makeIdent(\"stx\", here),\n                        makePunc(\".\", here),\n                        makeIdent(\"mark\", here),\n                        makeDelim(\"()\", [\n                            makeIdent(\"context\", name_stx),\n                            makePunc(\".\", here),\n                            makeIdent(\"mark\", here)\n                        ], here)\n                ]), here),\n                makePunc(\";\", here)\n            ];\n            // return { result: res, rest: match.rest };\n            var retResult = [\n                makeKeyword(\"return\", here),\n                makeDelim(\"{}\", [\n                    makeIdent(\"result\", here), makePunc(\":\", here),\n                    makeIdent(\"res\", name_stx),\n                    makePunc(\",\", here),\n                    makeIdent(\"rest\", here), makePunc(\":\", here),\n                    makeIdent(\"match\", name_stx), makePunc(\".\", here), makeIdent(\"rest\", here),\n                    makePunc(\",\", here),\n                    makeIdent(\"prevStx\", here), makePunc(\":\", here),\n                    makeIdent(\"lhsMatch\", name_stx), makePunc(\".\", here), makeIdent(\"prevStx\", here),\n                    makePunc(\",\", here),\n                    makeIdent(\"prevTerms\", here), makePunc(\":\", here),\n                    makeIdent(\"lhsMatch\", name_stx), makePunc(\".\", here), makeIdent(\"prevTerms\", here)\n                ], here)\n            ];\n            return applyPreMark.concat(runBody, errHandling, applyPostMark, retResult);\n        }\n\n        var arg_def = makeVarDef(\"arg\", [makeIdent(\"stx\", name_stx)]);\n        var name_def = makeVarDef(\"name_stx\", [\n            makeIdent(\"arg\", name_stx),\n            makeDelim(\"[]\", [makeValue(0, here)], here)\n        ]);\n        var match_defs = [\n            makeKeyword('var', here),\n            makeIdent('lhs', name_stx), makePunc(',', here),\n            makeIdent('lhsMatch', name_stx), makePunc(',', here),\n            makeIdent('rhs', name_stx), makePunc(',', here),\n            makeIdent('rhsMatch', name_stx), makePunc(',', here),\n            makeIdent('match', name_stx), makePunc(',', here),\n            makeIdent('res', name_stx), makePunc(';', here),\n        ];\n\n        var body = arg_def.concat(name_def, match_defs);\n\n        for (var i = 0; i < cases.length; i++) {\n            body = body.concat(makeMatch(cases[i]));\n        }\n\n        body = body.concat(quoteSyntax {\n            throwSyntaxCaseError(\"Could not match any cases\");\n        });\n\n        var res = makeFunc([\n            makeIdent(\"stx\", name_stx),\n            makePunc(\",\", here),\n            makeIdent(\"context\", name_stx),\n            makePunc(\",\", here),\n            makeIdent(\"prevStx\", name_stx),\n            makePunc(\",\", here),\n            makeIdent(\"prevTerms\", name_stx),\n            makePunc(\",\", here),\n            makeIdent(\"parentMatch\", name_stx)\n        ], body).concat([\n            makeDelim(\"()\", arg_stx.concat([\n                makePunc(\",\", here),\n                makeKeyword(\"typeof\", here),\n                makeIdent(\"match\", name_stx),\n                makePunc(\"!==\", here),\n                makeValue(\"undefined\", here),\n                makePunc(\"?\", here),\n                makeIdent(\"match\", name_stx),\n                makePunc(\":\", here),\n                makeDelim(\"{}\", [], here)\n            ]), here)\n        ]);\n\n        return {\n            result: res,\n            rest: stx.slice(3)\n        }\n    }\n}\nexport syntaxCase\n\n\nlet macro = macro {\n    function(stx) {\n        var name_stx = stx[0];\n        var here = quoteSyntax{here};\n        var mac_name_stx;\n        var body_inner_stx;\n        var body_stx;\n        var takeLine = patternModule.takeLine;\n        var makeIdentityRule = patternModule.makeIdentityRule;\n        var rest;\n\n        if (stx[1] && stx[1].token.type === parser.Token.Delimiter &&\n            stx[1].token.value === \"{}\") {\n            mac_name_stx = null;\n            body_stx = stx[1];\n            body_inner_stx = stx[1].expose().token.inner;\n            rest = stx.slice(2);\n        } else {\n            mac_name_stx = [];\n            mac_name_stx.push(stx[1]);\n            body_stx = stx[2];\n            body_inner_stx = stx[2].expose().token.inner;\n            rest = stx.slice(3);\n        }\n\n        function makeFunc(params, body) {\n            return [\n                makeKeyword(\"function\", here),\n                makeDelim(\"()\", params, here),\n                makeDelim(\"{}\", body, here)\n            ];\n        }\n\n        function translateRule(pattern, def, isInfix) {\n            var translatedPatt;\n            // When infix, we need to loop through the body and make sure there\n            // is a separator to distinguish the lhs and rhs.\n            if (isInfix) {\n                translatedPatt = [];\n                for (var i = 0, len = pattern.length; i < len; i++) {\n                    translatedPatt.push(pattern[i]);\n                    if (pattern[i].token.type === parser.Token.Punctuator &&\n                        pattern[i].token.value === '|') {\n                        translatedPatt.push(makeIdent(\"_\", here));\n                        translatedPatt = translatedPatt.concat([makeIdent(\"$\", here),\n                                                                makeDelim(\"()\", pattern.slice(i + 1), here)]);\n                        break;\n                    }\n                }\n            } else {\n                translatedPatt = [makeIdent(\"_\", here),\n                                  // wrapping the patterns in a group to disambiguate\n                                  // `_ (foo) ...`\n                                  // since the `(foo)` would be interpreted as a separator\n                                  makeIdent(\"$\", here),\n                                  makeDelim(\"()\", pattern, here)];\n            }\n\n            var translatedDef = [\n                makeKeyword(\"return\", here),\n                takeLine(here[0], makeIdent(\"syntax\", name_stx)),\n                makeDelim(\"{}\", def, here)\n            ];\n\n            return [makeIdent(\"case\", here)].concat(\n                isInfix ? makeIdent(\"infix\", here) : [],\n                makeDelim(\"{}\", translatedPatt, here),\n                makePunc(\"=>\", here),\n                makeDelim(\"{}\", translatedDef, here)\n            );\n        }\n\n        if (body_inner_stx[0] && body_inner_stx[0].token.value === \"function\") {\n\n            if (mac_name_stx) {\n                var res = [makeIdent(\"macro\", here)].concat(mac_name_stx).concat(body_stx)\n                return {\n                    result: res,\n                    rest: rest\n                };\n            } else {\n                var res = [\n                    makeIdent(\"macro\", here),\n                    body_stx\n                ];\n                return {\n                    result: res,\n                    rest: rest\n                };\n            }\n\n        }\n\n        var rules = [];\n        if (body_inner_stx[0] && body_inner_stx[0].token.value === \"rule\") {\n            for (var i = 0; i < body_inner_stx.length; i += 4) {\n                var isInfix = body_inner_stx[i + 1].token.value === 'infix';\n                if (isInfix) {\n                    i += 1;\n                }\n\n                var rule_pattern = body_inner_stx[i + 1];\n                var rule_arrow = body_inner_stx[i + 2];\n                var rule_def = body_inner_stx[i + 3];\n\n                if (rule_pattern && rule_arrow && rule_arrow.token.value === \"=>\" && rule_def) {\n                    rules = rules.concat(translateRule(rule_pattern.expose().token.inner,\n                                                       rule_def.expose().token.inner,\n                                                       isInfix));\n                } else if (rule_pattern) {\n                    var idRule = makeIdentityRule(rule_pattern.token.inner, isInfix, rule_pattern);\n                    rules = rules.concat(translateRule(idRule.pattern, idRule.body, isInfix));\n                    i -= 2;\n                } else {\n                  throwSyntaxError(\"macro\", \"Macro `macro` could not be matched\" , rule_arrow);\n                }\n            }\n            rules = makeDelim(\"{}\", rules, here);\n\n        } else {\n            rules = body_stx;\n        }\n\n        var stxSyntaxCase = takeLine(here[0], makeIdent(\"syntaxCase\", name_stx));\n        var res = mac_name_stx\n            ? [makeIdent(\"macro\", here)].concat(mac_name_stx)\n            : [makeIdent(\"macro\", here)];\n        res = res.concat(makeDelim(\"{}\", makeFunc([makeIdent(\"stx\", name_stx),\n                                                   makePunc(\",\", here),\n                                                   makeIdent(\"context\", name_stx),\n                                                   makePunc(\",\", here),\n                                                   makeIdent(\"prevStx\", name_stx),\n                                                   makePunc(\",\", here),\n                                                   makeIdent(\"prevTerms\", name_stx)],\n                                                   [makeKeyword(\"return\", here),\n                                                    stxSyntaxCase,\n                                                    makeDelim(\"()\", [makeIdent(\"stx\", name_stx),\n                                                                     makePunc(\",\", here),\n                                                                     makeIdent(\"context\", name_stx),\n                                                                     makePunc(\",\", here),\n                                                                     makeIdent(\"prevStx\", name_stx),\n                                                                     makePunc(\",\", here),\n                                                                     makeIdent(\"prevTerms\", name_stx)], here),\n                                                    rules]),\n                                    here));\n\n\n        return {\n            result: res,\n            rest: rest\n        }\n    }\n}\nexport macro;\n\nmacro withSyntax_done {\n    case { _ $ctx ($vars ...) {$rest ...} } => {\n        var ctx = #{ $ctx };\n        var here = #{ here };\n        var vars = #{ $vars ... };\n        var rest = #{ $rest ... };\n\n        var res = [];\n\n        for (var i = 0; i < vars.length; i += 3) {\n            var name = vars[i];\n            var repeat = !!vars[i + 1].token.inner.length;\n            var rhs = vars[i + 2];\n\n            if (repeat) {\n                res.push(\n                    makeIdent('match', ctx),\n                    makePunc('.', here),\n                    makeIdent('patternEnv', here),\n                    makeDelim('[]', [makeValue(name.token.value, here)], here),\n                    makePunc('=', here),\n                    makeDelim('{}', [\n                        makeIdent('level', here), makePunc(':', here), makeValue(1, here), makePunc(',', here),\n                        makeIdent('match', here), makePunc(':', here), makeDelim('()', #{\n                            (function(exp) {\n                                return exp.length\n                                    ? exp.map(function(t) { return { level: 0, match: [t] } })\n                                    : [{ level: 0, match: [] }];\n                            })\n                        }, here), makeDelim('()', [rhs], here)\n                    ], here),\n                    makePunc(';', here)\n                );\n            } else {\n                res.push(\n                    makeIdent('match', ctx),\n                    makePunc('.', here),\n                    makeIdent('patternEnv', here),\n                    makeDelim('[]', [makeValue(name.token.value, here)], here),\n                    makePunc('=', here),\n                    makeDelim('{}', [\n                        makeIdent('level', here), makePunc(':', here), makeValue(0, here), makePunc(',', here),\n                        makeIdent('match', here), makePunc(':', here), rhs\n                    ], here),\n                    makePunc(';', here)\n                );\n            }\n        }\n\n        res = res.concat(rest);\n        res = [\n            makeDelim(\"()\", [\n                makeKeyword(\"function\", here),\n                makeDelim(\"()\", [makeIdent(\"match\", ctx)], here),\n                makeDelim(\"{}\", res, here)\n            ], here),\n            makeDelim(\"()\", [\n                makeIdent(\"patternModule\", here),\n                makePunc(\".\", here),\n                makeIdent(\"cloneMatch\", here),\n                makeDelim(\"()\", [makeIdent(\"match\", ctx)], here)\n            ], here)\n        ];\n\n        return res;\n    }\n}\n\nmacro withSyntax_bind {\n    rule { $name:ident $[...] = $rhs:expr } => {\n        $name (true) $rhs\n    }\n    rule { $name:ident = $rhs:expr } => {\n        $name () $rhs\n    }\n}\n\nlet withSyntax = macro {\n    case { $name ($binders:withSyntax_bind (,) ...) { $body ... } } => {\n        return #{\n            withSyntax_done $name ($binders ...) { $body ... }\n        }\n    }\n    case { $name ($binders:withSyntax_bind (,) ...) $quote:[#] { $body ... } } => {\n        return #{\n            withSyntax_done $name ($binders ...) {\n                return $quote { $body ... }\n            }\n        }\n    }\n}\nexport withSyntax;\n\nmacro letstx_bind {\n    rule { $name:ident = $rhs:expr , $more:letstx_bind } => {\n        $name () $rhs $more\n    }\n    rule { $name:ident = $rhs:expr ;... letstx $more:letstx_bind } => {\n        $name () $rhs $more\n    }\n    rule { $name:ident = $rhs:expr ;... } => {\n        $name () $rhs\n    }\n    rule { $name:ident $[...] = $rhs:expr , $more:letstx_bind } => {\n        $name (true) $rhs $more\n    }\n    rule { $name:ident $[...] = $rhs:expr ;... letstx $more:letstx_bind } => {\n        $name (true) $rhs $more\n    }\n    rule { $name:ident $[...] = $rhs:expr ;... } => {\n        $name (true) $rhs\n    }\n}\n\nlet letstx = macro {\n    case { $name $binders:letstx_bind $rest ... } => {\n        return #{\n            return withSyntax_done $name ($binders) { $rest ... }\n        }\n    }\n}\nexport letstx;\n\n\nmacro macroclass {\n    rule { $name:ident { $decls:macroclass_decl ... } } => {\n        macro $name {\n            function (stx, context, prevStx, prevTerms) {\n                var name_stx = stx[0];\n                var match;\n                macroclass_create $name stx context match ($decls ...)\n            }\n        }\n    }\n}\n\nmacro macroclass_decl {\n    rule { $kw:[name] = $name:lit ;... } => {\n        ($kw $name)\n    }\n    rule { $kw:[pattern] { $mods:macroclass_modifier ... } ;... } => {\n        ($kw $mods ...)\n    }\n    rule { rule { $rule ... } ;... } => {\n        (pattern (rule ($rule ...)))\n    }\n}\n\nmacro macroclass_modifier {\n    rule { $kw:[name] = $name:lit ;... } => {\n        ($kw $name)\n    }\n    rule { $kw:[rule] { $rule ... } ;... } => {\n        ($kw ($rule ...))\n    }\n    rule { $kw:[with] $($lhs:macroclass_with_lhs = $rhs:macroclass_with_rhs) (,) ... } => {\n        $(($kw ($lhs) ($rhs))) ...\n    }\n    rule { ; ;... } => { }\n}\n\nmacro macroclass_with_lhs {\n    rule { $name:ident $[...] }\n    rule { $name:ident }\n}\n\nmacro macroclass_with_rhs {\n    rule { #{ $stx ... } }\n    rule { $code:expr }\n}\n\nmacro macroclass_create {\n    function(stx, context, prevStx, prevTerms) {\n        var here = quoteSyntax { here };\n        var macName = stx[0];\n        var nameStx = stx[1];\n        var stxName = stx[2];\n        var ctxName = stx[3];\n        var matchName = stx[4];\n        var decls = stx[5].expose().token.inner;\n        var mclass = decls.reduce(function(m, decl) {\n            var tag = unwrapSyntax(decl.token.inner[0]);\n            if (tag === 'name') {\n                if (m.name) {\n                    throwSyntaxError('macroclass',\n                                     'Duplicate name declaration',\n                                     decl.token.inner[0])\n                }\n                m.name = unwrapSyntax(decl.token.inner[1]);\n            } else if (tag === 'pattern') {\n                var patternStx = decl.expose().token.inner.slice(1);\n                var pattern = patternStx.reduce(function(p, mod) {\n                    var tag = unwrapSyntax(mod.token.inner[0]);\n                    if (tag === 'name') {\n                        if (p.name) {\n                            throwSyntaxError('macroclass',\n                                             'Duplicate name declaration',\n                                             mod.token.inner[0])\n                        }\n                        p.name = unwrapSyntax(mod.token.inner[1]);\n                    } else if (tag === 'rule') {\n                        if (p.rule) {\n                            throwSyntaxError('macroclass',\n                                             'Duplicate rule declaration',\n                                             mod.token.inner[0])\n                        }\n                        p.rule = mod.expose().token.inner[1].expose().token.inner;\n                    } else if (tag === 'with') {\n                        mod.expose();\n                        p.withs.push({\n                            lhs: mod.token.inner[1].expose().token.inner,\n                            rhs: mod.token.inner[2].expose().token.inner.map(function mapper(s) {\n                                // We need to transplant syntax quotes so that it looks\n                                // like they are within the macro body code and not\n                                // the original code, otherwise it won't expand.\n                                if (unwrapSyntax(s) === '#') {\n                                    s.context = macName.context;\n                                } else if (s.token.type === parser.Token.Delimiter) {\n                                    s.expose();\n                                    s.token.inner = s.token.inner.map(mapper);\n                                }\n                                return s;\n                            })\n                        });\n                    }\n                    return p;\n                }, { withs: [] });\n                m.patterns.push(pattern);\n            }\n            return m;\n        }, { patterns: [] });\n\n        var body = mclass.patterns.reduce(function(stx, pattern) {\n            var ruleStx = [makeIdent('_', here)].concat(pattern.rule);\n            var ruleId = __fresh();\n            var rule = patternModule.loadPattern(ruleStx);\n\n            context.patternMap.set(ruleId, rule);\n\n            var withBindings = pattern.withs.reduce(function(acc, w) {\n                return acc.concat(w.lhs.concat(makePunc('=', here), w.rhs, makePunc(',', here)));\n            }, []);\n\n            var ret = [\n                makeKeyword('return', here), makeDelim('{}', [\n                    makeIdent('result', here), makePunc(':', here), makeDelim('[]', [], here),\n                    makePunc(',', here),\n                    makeIdent('rest', here), makePunc(':', here),\n                    matchName, makePunc('.', here), makeIdent('rest', here),\n                    makePunc(',', here),\n                    makeIdent('patterns', here), makePunc(':', here),\n                    matchName, makePunc('.', here), makeIdent('patternEnv', here),\n                ], here)\n            ];\n\n            var inner = ret;\n            if (withBindings.length) {\n                inner = [\n                    makeKeyword('return', macName), makeIdent('withSyntax', macName),\n                    makeDelim('()', withBindings, here),\n                    makeDelim('{}', ret, here)\n                ];\n            }\n\n            var res = [\n                matchName, makePunc('=', here),\n                makeIdent('patternModule', here), makePunc('.', here),\n                makeIdent('matchPatterns', here), makeDelim('()', [\n                    makeIdent('getPattern', here), makeDelim('()', [\n                        makeValue(ruleId, here)\n                    ], here),\n                    makePunc(',', here), stxName,\n                    makePunc(',', here), ctxName,\n                    makePunc(',', here), makeValue(true, here)\n                ], here),\n                makePunc(';', here),\n                makeKeyword('if', here), makeDelim('()', [\n                    matchName, makePunc('.', here), makeIdent('success', here)\n                ], here), makeDelim('{}', inner, here)\n            ];\n          \n            return stx.concat(res);\n\n        }, []);\n\n        var res = body.concat(\n            makeIdent('throwSyntaxCaseError', here),\n            makeDelim('()', [\n                makeValue(mclass.name || unwrapSyntax(nameStx), here), makePunc(',', here),\n                makeValue('No match', here)\n            ], here)\n        );\n\n        return {\n            result: res,\n            rest: stx.slice(6)\n        };\n    }\n}\n\nexport macroclass;\n\nmacro safemacro {\n    rule { $name:ident { rule $body ... } } => {\n        let $name = macro {\n            rule { : } => { $name : }\n            rule infix { . | } => { . $name }\n            rule $body ...\n        }\n    }\n    rule { $name:ident { case $body ... } } => {\n        let $name = macro {\n            case { _ : } => { return #{ $name : } }\n            case infix { . | _ } => { return #{ . $name } }\n            case $body ...\n        }\n    }\n}\n\nmacro op_assoc {\n    rule { left }\n    rule { right }\n}\n\nmacro op_name {\n    rule { ($name ...) }\n    rule { $name } => { ($name) }\n}\n\nsafemacro operator {\n    rule {\n        $name:op_name $prec:lit $assoc:op_assoc\n        { $left:ident, $right:ident } => #{ $body ... }\n    } => {\n        binaryop $name $prec $assoc {\n            macro {\n                rule { ($left:expr) ($right:expr) } => { $body ... }\n            }\n        }\n    }\n    rule {\n        $name:op_name $prec:lit { $op:ident } => #{ $body ... }\n    } => {\n        unaryop $name $prec {\n            macro {\n                rule { $op:expr } => { $body ... }\n            }\n        }\n    }\n}\nexport operator;\n\n// macro __log {\n//     case { _ defctx $stx } => {\n//         var context = #{ $stx }[0].context;\n//         console.log(\"defctx context for \" + unwrapSyntax(#{$stx}) + \"]\");\n//         while (context) {\n//             if (context.defctx) {\n//                 console.log(context.defctx.map(function(d) {\n//                     return d.id.token.value\n//                 }));\n//             }\n//             context = context.context;\n//         }\n//         return [];\n//     }\n//     case {_ rename $stx } => {\n//         var context = #{ $stx }[0].context;\n//         console.log(\"rename context for \" + unwrapSyntax(#{$stx}) + \":\");\n//         while (context) {\n//             if (context.name) {\n//                 console.log(\"[name: \" + context.name + \", id: \" + context.id.token.value + \"]\");\n//             }\n//             context = context.context;\n//         }\n//         return [];\n//     }\n//     case {_ all $stx } => {\n//         var context = #{ $stx }[0].context;\n//         console.log(\"context for \" + unwrapSyntax(#{$stx}) + \":\");\n//         while (context) {\n//             if (context.name) {\n//                 console.log(\"rename@[name: \" + context.name + \", id: \" + context.id.token.value + \"]\");\n//             }\n//             if (context.mark) {\n//                 console.log(\"mark@[mark: \" + context.mark + \"]\");\n//             }\n//             if (context.defctx) {\n//                 console.log(\"defctx@[\" + context.defctx.map(function(d) {\n//                     return d.id.token.value\n//                 }) + \"]\");\n//             }\n//             context = context.context;\n//         }\n//         return [];\n//     }\n// }\n// export __log;\n"
  },
  {
    "path": "editor/scripts/sweet.js",
    "content": "/*\n  Copyright (C) 2012 Tim Disney <tim@disnet.me>\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n(function (root, factory) {\n    if (typeof exports === 'object') {\n        var path = require('path');\n        var fs = require('fs');\n        var resolveSync = require('resolve/lib/sync');\n        var codegen = require('escodegen');\n        var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../macros');\n        var stxcaseModule = fs.readFileSync(lib + '/stxcase.js', 'utf8');\n        var moduleCache = {};\n        var cwd = process.cwd();\n        var requireModule = function (id, filename) {\n            var basedir = filename ? path.dirname(filename) : cwd;\n            var key = basedir + id;\n            if (!moduleCache[key]) {\n                moduleCache[key] = require(resolveSync(id, { basedir: basedir }));\n            }\n            return moduleCache[key];\n        };\n        factory(exports, require('underscore'), require('./parser'), require('./expander'), require('./syntax'), stxcaseModule, require('escodegen'), require('escope'), fs, path, resolveSync, requireModule);\n        // Alow require('./example') for an example.sjs file.\n        require.extensions['.sjs'] = function (module, filename) {\n            var content = require('fs').readFileSync(filename, 'utf8');\n            module._compile(codegen.generate(exports.parse(content, exports.loadedMacros)), filename);\n        };\n    } else if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define([\n            'exports',\n            'underscore',\n            './parser',\n            './expander',\n            './syntax',\n            'text!./stxcase.js',\n            'escodegen',\n            'escope'\n        ], factory);\n    }\n}(this, function (exports$2, _, parser, expander, syn, stxcaseModule, gen, escope, fs, path, resolveSync, requireModule) {\n    // escodegen still doesn't quite support AMD: https://github.com/Constellation/escodegen/issues/115\n    var codegen = typeof escodegen !== 'undefined' ? escodegen : gen;\n    var expand = makeExpand(expander.expand);\n    var expandModule = makeExpand(expander.expandModule);\n    var stxcaseCtx;\n    function makeExpand(expandFn) {\n        // fun (Str) -> [...CSyntax]\n        return function expand$2(code, modules, options) {\n            var program, toString;\n            modules = modules || [];\n            if (!stxcaseCtx) {\n                stxcaseCtx = expander.expandModule(parser.read(stxcaseModule));\n            }\n            toString = String;\n            if (typeof code !== 'string' && !(code instanceof String)) {\n                code = toString(code);\n            }\n            var source$2 = code;\n            if (source$2.length > 0) {\n                if (typeof source$2[0] === 'undefined') {\n                    // Try first to convert to a string. This is good as fast path\n                    // for old IE which understands string indexing for string\n                    // literals only and not for string object.\n                    if (code instanceof String) {\n                        source$2 = code.valueOf();\n                    }\n                    // Force accessing the characters via an array.\n                    if (typeof source$2[0] === 'undefined') {\n                        source$2 = stringToArray(code);\n                    }\n                }\n            }\n            var readTree = parser.read(source$2);\n            try {\n                return expandFn(readTree, [stxcaseCtx].concat(modules), options);\n            } catch (err) {\n                if (err instanceof syn.MacroSyntaxError) {\n                    throw new SyntaxError(syn.printSyntaxError(source$2, err));\n                } else {\n                    throw err;\n                }\n            }\n        };\n    }\n    function expandSyntax(stx, modules, options) {\n        if (!stxcaseCtx) {\n            stxcaseCtx = expander.expandModule(parser.read(stxcaseModule));\n        }\n        var isSyntax = syn.isSyntax(stx);\n        options = options || {};\n        options.flatten = false;\n        if (!isSyntax) {\n            stx = syn.tokensToSyntax(stx);\n        }\n        try {\n            var result = expander.expand(stx, [stxcaseCtx].concat(modules), options);\n            return isSyntax ? result : syn.syntaxToTokens(result);\n        } catch (err) {\n            if (err instanceof syn.MacroSyntaxError) {\n                throw new SyntaxError(syn.printSyntaxError(source, err));\n            } else {\n                throw err;\n            }\n        }\n    }\n    // fun (Str, {}) -> AST\n    function parse(code, modules, options) {\n        if (code === '') {\n            // old version of esprima doesn't play nice with the empty string\n            // and loc/range info so until we can upgrade hack in a single space\n            code = ' ';\n        }\n        modules = modules ? loadedMacros.concat(modules) : modules;\n        return parser.parse(expand(code, modules, options));\n    }\n    // (Str, {sourceMap: ?Bool, filename: ?Str})\n    //    -> { code: Str, sourceMap: ?Str }\n    function compile(code, options) {\n        var output;\n        options = options || {};\n        options.requireModule = options.requireModule || requireModule;\n        var ast = parse(code, options.modules || [], options);\n        if (options.readableNames) {\n            ast = optimizeHygiene(ast);\n        }\n        if (options.ast) {\n            return ast;\n        }\n        if (options.sourceMap) {\n            output = codegen.generate(ast, _.extend({\n                comment: true,\n                sourceMap: options.filename,\n                sourceMapWithCode: true\n            }, options.escodegen));\n            return {\n                code: output.code,\n                sourceMap: output.map.toString()\n            };\n        }\n        return { code: codegen.generate(ast, _.extend({ comment: true }, options.escodegen)) };\n    }\n    var baseReadtable = Object.create({\n            extend: function (obj) {\n                var extended = Object.create(this);\n                Object.keys(obj).forEach(function (ch) {\n                    extended[ch] = obj[ch];\n                });\n                return extended;\n            }\n        });\n    parser.setReadtable(baseReadtable, syn);\n    function setReadtable(readtableModule) {\n        var filename = resolveSync(readtableModule, { basedir: process.cwd() });\n        var readtable = require(filename);\n        parser.setReadtable(require(filename));\n    }\n    function currentReadtable() {\n        return parser.currentReadtable();\n    }\n    function loadNodeModule(root, moduleName, options) {\n        options = options || {};\n        if (moduleName[0] === '.') {\n            moduleName = path.resolve(root, moduleName);\n        }\n        var filename = resolveSync(moduleName, {\n                basedir: root,\n                extensions: [\n                    '.js',\n                    '.sjs'\n                ]\n            });\n        return expandModule(fs.readFileSync(filename, 'utf8'), undefined, {\n            filename: moduleName,\n            requireModule: options.requireModule || requireModule\n        });\n    }\n    function optimizeHygiene(ast) {\n        // escope hack: sweet doesn't rename global vars. We wrap in a closure\n        // to create a 'static` scope for all of the vars sweet renamed.\n        var wrapper = parse('(function(){})()');\n        wrapper.body[0].expression.callee.body.body = ast.body;\n        function sansUnique(name) {\n            var match = name.match(/^(.+)\\$[\\d]+$/);\n            return match ? match[1] : null;\n        }\n        function wouldShadow(name, scope) {\n            while (scope) {\n                if (scope.scrubbed && scope.scrubbed.has(name)) {\n                    return scope.scrubbed.get(name);\n                }\n                scope = scope.upper;\n            }\n            return 0;\n        }\n        var scopes = escope.analyze(wrapper).scopes;\n        var globalScope;\n        // The first pass over the scope collects any non-static references,\n        // which means references from the global scope. We need to make these\n        // verboten so we don't accidently mangle a name to match. This could\n        // cause seriously hard to find bugs if you were just testing with\n        // --readable-names on.\n        scopes.forEach(function (scope) {\n            scope.scrubbed = new expander.StringMap();\n            // There aren't any references declared in the global scope since\n            // we wrapped our input in a static closure.\n            if (!scope.isStatic()) {\n                globalScope = scope;\n                return;\n            }\n            scope.references.forEach(function (ref) {\n                if (!ref.isStatic()) {\n                    globalScope.scrubbed.set(ref.identifier.name, 1);\n                }\n            });\n        });\n        // The second pass mangles the names to get rid of the hygiene tag\n        // wherever possible.\n        scopes.forEach(function (scope) {\n            // No need to rename things in the global scope.\n            if (!scope.isStatic()) {\n                return;\n            }\n            scope.variables.forEach(function (variable) {\n                var name = sansUnique(variable.name);\n                if (!name) {\n                    return;\n                }\n                var level = wouldShadow(name, scope);\n                if (level) {\n                    scope.scrubbed.set(name, level + 1);\n                    name = name + '$' + (level + 1);\n                } else {\n                    scope.scrubbed.set(name, 1);\n                }\n                variable.identifiers.forEach(function (i) {\n                    i.name = name;\n                });\n                variable.references.forEach(function (r) {\n                    r.identifier.name = name;\n                });\n            });\n        });\n        return ast;\n    }\n    var loadedMacros = [];\n    // syntax sugar for\n    // sweet.loadedMacros.push(sweet.loadNodeModule(process.cwd(), './macros/str'));\n    function loadMacro(relative_file) {\n        loadedMacros.push(loadNodeModule(process.cwd(), relative_file));\n    }\n    exports$2.expand = expand;\n    exports$2.expandSyntax = expandSyntax;\n    exports$2.parse = parse;\n    exports$2.compile = compile;\n    exports$2.setReadtable = setReadtable;\n    exports$2.currentReadtable = currentReadtable;\n    exports$2.loadModule = expandModule;\n    exports$2.loadNodeModule = loadNodeModule;\n    exports$2.loadedMacros = loadedMacros;\n    exports$2.loadMacro = loadMacro;\n}));\n//# sourceMappingURL=sweet.js.map"
  },
  {
    "path": "editor/scripts/syntax.js",
    "content": "(function (root, factory) {\n    if (typeof exports === 'object') {\n        // CommonJS\n        factory(exports, require('underscore'), require('./parser'), require('./expander'));\n    } else if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define([\n            'exports',\n            'underscore',\n            'parser',\n            'expander'\n        ], factory);\n    }\n}(this, function (exports$2, _, parser, expander) {\n    function assert(condition, message) {\n        if (!condition) {\n            throw new Error('ASSERT: ' + message);\n        }\n    }\n    // Keep an incrementing global counter so that a particular\n    // each new context object is assigned a unique \"instance number\"\n    // that it can be identified by. This helps with the memoization\n    // of the recursive resolveCtx implementation in expander.js.\n    // The memoization addresses issue #232.\n    var globalContextInstanceNumber = 1;\n    // (CSyntax, Str) -> CContext\n    function Rename(id, name, ctx, defctx) {\n        defctx = defctx || null;\n        this.id = id;\n        this.name = name;\n        this.context = ctx;\n        this.def = defctx;\n        this.instNum = globalContextInstanceNumber++;\n    }\n    // (Num) -> CContext\n    function Mark(mark, ctx) {\n        this.mark = mark;\n        this.context = ctx;\n        this.instNum = globalContextInstanceNumber++;\n    }\n    function Def(defctx, ctx) {\n        this.defctx = defctx;\n        this.context = ctx;\n        this.instNum = globalContextInstanceNumber++;\n    }\n    function Syntax(token, oldstx) {\n        this.token = token;\n        this.context = oldstx && oldstx.context ? oldstx.context : null;\n        this.deferredContext = oldstx && oldstx.deferredContext ? oldstx.deferredContext : null;\n    }\n    Syntax.prototype = {\n        mark: function (newMark) {\n            if (this.token.inner) {\n                return syntaxFromToken(this.token, {\n                    deferredContext: new Mark(newMark, this.deferredContext),\n                    context: new Mark(newMark, this.context)\n                });\n            }\n            return syntaxFromToken(this.token, { context: new Mark(newMark, this.context) });\n        },\n        rename: function (id, name, defctx) {\n            // defer renaming of delimiters\n            if (this.token.inner) {\n                return syntaxFromToken(this.token, {\n                    deferredContext: new Rename(id, name, this.deferredContext, defctx),\n                    context: new Rename(id, name, this.context, defctx)\n                });\n            }\n            return syntaxFromToken(this.token, { context: new Rename(id, name, this.context, defctx) });\n        },\n        addDefCtx: function (defctx) {\n            if (this.token.inner) {\n                return syntaxFromToken(this.token, {\n                    deferredContext: new Def(defctx, this.deferredContext),\n                    context: new Def(defctx, this.context)\n                });\n            }\n            return syntaxFromToken(this.token, { context: new Def(defctx, this.context) });\n        },\n        getDefCtx: function () {\n            var ctx = this.context;\n            while (ctx !== null) {\n                if (ctx instanceof Def) {\n                    return ctx.defctx;\n                }\n                ctx = ctx.context;\n            }\n            return null;\n        },\n        expose: function () {\n            assert(this.token.type === parser.Token.Delimiter, 'Only delimiters can be exposed');\n            function applyContext(stxCtx, ctx) {\n                if (ctx == null) {\n                    return stxCtx;\n                } else if (ctx instanceof Rename) {\n                    return new Rename(ctx.id, ctx.name, applyContext(stxCtx, ctx.context), ctx.def);\n                } else if (ctx instanceof Mark) {\n                    return new Mark(ctx.mark, applyContext(stxCtx, ctx.context));\n                } else if (ctx instanceof Def) {\n                    return new Def(ctx.defctx, applyContext(stxCtx, ctx.context));\n                } else {\n                    assert(false, 'unknown context type');\n                }\n            }\n            var self = this;\n            this.token.inner = _.map(this.token.inner, function (stx) {\n                // when not a syntax object (aka a TermTree) then no need to push down the expose\n                if (!stx.token) {\n                    return stx;\n                }\n                if (stx.token.inner) {\n                    return syntaxFromToken(stx.token, {\n                        deferredContext: applyContext(stx.deferredContext, self.deferredContext),\n                        context: applyContext(stx.context, self.deferredContext)\n                    });\n                } else {\n                    return syntaxFromToken(stx.token, { context: applyContext(stx.context, self.deferredContext) });\n                }\n            });\n            this.deferredContext = null;\n            return this;\n        },\n        toString: function () {\n            var val = this.token.type === parser.Token.EOF ? 'EOF' : this.token.value;\n            return '[Syntax: ' + val + ']';\n        }\n    };\n    // (CToken, CSyntax?) -> CSyntax\n    function syntaxFromToken(token, oldstx) {\n        return new Syntax(token, oldstx);\n    }\n    function mkSyntax(stx, value, type, inner) {\n        if (stx && Array.isArray(stx) && stx.length === 1) {\n            stx = stx[0];\n        } else if (stx && Array.isArray(stx)) {\n            throwSyntaxError('mkSyntax', 'Expecting a syntax object or an array with a single syntax object');\n        } else if (stx === undefined) {\n            throwSyntaxError('mkSyntax', 'You must provide an old syntax object context (or null) when creating a new syntax object.');\n        }\n        if (type === parser.Token.Delimiter) {\n            var startLineNumber, startLineStart, endLineNumber, endLineStart, startRange, endRange;\n            if (!Array.isArray(inner)) {\n                throwSyntaxError('mkSyntax', 'Must provide inner array of syntax objects when creating a delimiter');\n            }\n            if (stx && stx.token.type === parser.Token.Delimiter) {\n                startLineNumber = stx.token.startLineNumber;\n                startLineStart = stx.token.startLineStart;\n                endLineNumber = stx.token.endLineNumber;\n                endLineStart = stx.token.endLineStart;\n                startRange = stx.token.startRange;\n                endRange = stx.token.endRange;\n            } else if (stx && stx.token) {\n                startLineNumber = stx.token.lineNumber;\n                startLineStart = stx.token.lineStart;\n                endLineNumber = stx.token.lineNumber;\n                endLineStart = stx.token.lineStart;\n                startRange = stx.token.range;\n                endRange = stx.token.range;\n            }\n            return syntaxFromToken({\n                type: parser.Token.Delimiter,\n                value: value,\n                inner: inner,\n                startLineStart: startLineStart,\n                startLineNumber: startLineNumber,\n                endLineStart: endLineStart,\n                endLineNumber: endLineNumber,\n                startRange: startRange,\n                endRange: endRange\n            }, stx);\n        } else {\n            var lineStart, lineNumber, range;\n            if (stx && stx.token.type === parser.Token.Delimiter) {\n                lineStart = stx.token.startLineStart;\n                lineNumber = stx.token.startLineNumber;\n                range = stx.token.startRange;\n            } else if (stx && stx.token) {\n                lineStart = stx.token.lineStart;\n                lineNumber = stx.token.lineNumber;\n                range = stx.token.range;\n            }\n            return syntaxFromToken({\n                type: type,\n                value: value,\n                lineStart: lineStart,\n                lineNumber: lineNumber,\n                range: range\n            }, stx);\n        }\n    }\n    function makeValue(val, stx) {\n        if (typeof val === 'boolean') {\n            return mkSyntax(stx, val ? 'true' : 'false', parser.Token.BooleanLiteral);\n        } else if (typeof val === 'number') {\n            if (val !== val) {\n                return makeDelim('()', [\n                    makeValue(0, stx),\n                    makePunc('/', stx),\n                    makeValue(0, stx)\n                ], stx);\n            }\n            if (val < 0) {\n                return makeDelim('()', [\n                    makePunc('-', stx),\n                    makeValue(Math.abs(val), stx)\n                ], stx);\n            } else {\n                return mkSyntax(stx, val, parser.Token.NumericLiteral);\n            }\n        } else if (typeof val === 'string') {\n            return mkSyntax(stx, val, parser.Token.StringLiteral);\n        } else if (val === null) {\n            return mkSyntax(stx, 'null', parser.Token.NullLiteral);\n        } else {\n            throwSyntaxError('makeValue', 'Cannot make value syntax object from: ' + val);\n        }\n    }\n    function makeRegex(val, flags, stx) {\n        var newstx = mkSyntax(stx, new RegExp(val, flags), parser.Token.RegexLiteral);\n        // regex tokens need the extra field literal on token\n        newstx.token.literal = val;\n        return newstx;\n    }\n    function makeIdent(val, stx) {\n        return mkSyntax(stx, val, parser.Token.Identifier);\n    }\n    function makeKeyword(val, stx) {\n        return mkSyntax(stx, val, parser.Token.Keyword);\n    }\n    function makePunc(val, stx) {\n        return mkSyntax(stx, val, parser.Token.Punctuator);\n    }\n    function makeDelim(val, inner, stx) {\n        return mkSyntax(stx, val, parser.Token.Delimiter, inner);\n    }\n    function unwrapSyntax(stx) {\n        if (Array.isArray(stx) && stx.length === 1) {\n            // pull stx out of single element arrays for convenience\n            stx = stx[0];\n        }\n        if (stx.token) {\n            if (stx.token.type === parser.Token.Delimiter) {\n                return stx.token;\n            } else {\n                return stx.token.value;\n            }\n        } else {\n            throw new Error('Not a syntax object: ' + stx);\n        }\n    }\n    // ([...CSyntax]) -> [...CToken]\n    function syntaxToTokens(stx) {\n        return _.map(stx, function (stx$2) {\n            if (stx$2.token.inner) {\n                stx$2.token.inner = syntaxToTokens(stx$2.token.inner);\n            }\n            return stx$2.token;\n        });\n    }\n    // (CToken or [...CToken]) -> [...CSyntax]\n    function tokensToSyntax(tokens) {\n        if (!_.isArray(tokens)) {\n            tokens = [tokens];\n        }\n        return _.map(tokens, function (token) {\n            if (token.inner) {\n                token.inner = tokensToSyntax(token.inner);\n            }\n            return syntaxFromToken(token);\n        });\n    }\n    // ([...CSyntax], Syntax) -> [...CSyntax])\n    function joinSyntax(tojoin, punc) {\n        if (tojoin.length === 0) {\n            return [];\n        }\n        if (punc === ' ') {\n            return tojoin;\n        }\n        return _.reduce(_.rest(tojoin, 1), function (acc, join) {\n            acc.push(cloneSyntax(punc), join);\n            return acc;\n        }, [_.first(tojoin)]);\n    }\n    // ([...[...CSyntax]], Syntax) -> [...CSyntax]\n    function joinSyntaxArray(tojoin, punc) {\n        if (tojoin.length === 0) {\n            return [];\n        }\n        if (punc === ' ') {\n            return _.flatten(tojoin, true);\n        }\n        return _.reduce(_.rest(tojoin, 1), function (acc, join) {\n            acc.push(cloneSyntax(punc));\n            Array.prototype.push.apply(acc, join);\n            return acc;\n        }, _.first(tojoin));\n    }\n    function cloneSyntax(stx) {\n        return syntaxFromToken(_.clone(stx.token), stx);\n    }\n    function cloneSyntaxArray(arr) {\n        return arr.map(function (stx) {\n            var o = cloneSyntax(stx);\n            if (o.token.type === parser.Token.Delimiter) {\n                o.token.inner = cloneSyntaxArray(o.token.inner);\n            }\n            return o;\n        });\n    }\n    function MacroSyntaxError(name, message, stx) {\n        this.name = name;\n        this.message = message;\n        this.stx = stx;\n    }\n    function throwSyntaxError(name, message, stx) {\n        if (stx && Array.isArray(stx)) {\n            stx = stx[0];\n        }\n        throw new MacroSyntaxError(name, message, stx);\n    }\n    function SyntaxCaseError(message) {\n        this.message = message;\n    }\n    function throwSyntaxCaseError(message) {\n        throw new SyntaxCaseError(message);\n    }\n    function printSyntaxError(code, err) {\n        if (!err.stx) {\n            return '[' + err.name + '] ' + err.message;\n        }\n        var token = err.stx.token;\n        var lineNumber = _.find([\n                token.sm_startLineNumber,\n                token.sm_lineNumber,\n                token.startLineNumber,\n                token.lineNumber\n            ], _.isNumber);\n        var lineStart = _.find([\n                token.sm_startLineStart,\n                token.sm_lineStart,\n                token.startLineStart,\n                token.lineStart\n            ], _.isNumber);\n        var start = (token.sm_startRange || token.sm_range || token.startRange || token.range)[0];\n        var offset = start - lineStart;\n        var line = '';\n        var pre = lineNumber + ': ';\n        var ch;\n        while (ch = code.charAt(lineStart++)) {\n            if (ch == '\\r' || ch == '\\n') {\n                break;\n            }\n            line += ch;\n        }\n        return '[' + err.name + '] ' + err.message + '\\n' + pre + line + '\\n' + Array(offset + pre.length).join(' ') + ' ^';\n    }\n    // fun ([...CSyntax]) -> String\n    function prettyPrint(stxarr, shouldResolve) {\n        var indent = 0;\n        var unparsedLines = stxarr.reduce(function (acc, stx) {\n                var s = shouldResolve ? expander.resolve(stx) : stx.token.value;\n                // skip the end of file token\n                if (stx.token.type === parser.Token.EOF) {\n                    return acc;\n                }\n                if (stx.token.type === parser.Token.StringLiteral) {\n                    s = '\"' + s + '\"';\n                }\n                if (s == '{') {\n                    acc[0].str += ' ' + s;\n                    indent++;\n                    acc.unshift({\n                        indent: indent,\n                        str: ''\n                    });\n                } else if (s == '}') {\n                    indent--;\n                    acc.unshift({\n                        indent: indent,\n                        str: s\n                    });\n                    acc.unshift({\n                        indent: indent,\n                        str: ''\n                    });\n                } else if (s == ';') {\n                    acc[0].str += s;\n                    acc.unshift({\n                        indent: indent,\n                        str: ''\n                    });\n                } else {\n                    acc[0].str += (acc[0].str ? ' ' : '') + s;\n                }\n                return acc;\n            }, [{\n                    indent: 0,\n                    str: ''\n                }]);\n        return unparsedLines.reduce(function (acc, line) {\n            var ind = '';\n            while (ind.length < line.indent * 2) {\n                ind += ' ';\n            }\n            return ind + line.str + '\\n' + acc;\n        }, '');\n    }\n    exports$2.assert = assert;\n    exports$2.unwrapSyntax = unwrapSyntax;\n    exports$2.makeDelim = makeDelim;\n    exports$2.makePunc = makePunc;\n    exports$2.makeKeyword = makeKeyword;\n    exports$2.makeIdent = makeIdent;\n    exports$2.makeRegex = makeRegex;\n    exports$2.makeValue = makeValue;\n    exports$2.Rename = Rename;\n    exports$2.Mark = Mark;\n    exports$2.Def = Def;\n    exports$2.syntaxFromToken = syntaxFromToken;\n    exports$2.tokensToSyntax = tokensToSyntax;\n    exports$2.syntaxToTokens = syntaxToTokens;\n    exports$2.isSyntax = function (obj) {\n        obj = Array.isArray(obj) ? obj[0] : obj;\n        return obj instanceof Syntax;\n    };\n    exports$2.joinSyntax = joinSyntax;\n    exports$2.joinSyntaxArray = joinSyntaxArray;\n    exports$2.cloneSyntax = cloneSyntax;\n    exports$2.cloneSyntaxArray = cloneSyntaxArray;\n    exports$2.prettyPrint = prettyPrint;\n    exports$2.MacroSyntaxError = MacroSyntaxError;\n    exports$2.throwSyntaxError = throwSyntaxError;\n    exports$2.SyntaxCaseError = SyntaxCaseError;\n    exports$2.throwSyntaxCaseError = throwSyntaxCaseError;\n    exports$2.printSyntaxError = printSyntaxError;\n}));\n//# sourceMappingURL=syntax.js.map"
  },
  {
    "path": "editor/scripts/text.js",
    "content": "/**\n * @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/requirejs/text for details\n */\n/*jslint regexp: true */\n/*global require, XMLHttpRequest, ActiveXObject,\n  define, window, process, Packages,\n  java, location, Components, FileUtils */\n\ndefine(['module'], function (module) {\n    'use strict';\n\n    var text, fs, Cc, Ci, xpcIsWindows,\n        progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],\n        xmlRegExp = /^\\s*<\\?xml(\\s)+version=[\\'\\\"](\\d)*.(\\d)*[\\'\\\"](\\s)*\\?>/im,\n        bodyRegExp = /<body[^>]*>\\s*([\\s\\S]+)\\s*<\\/body>/im,\n        hasLocation = typeof location !== 'undefined' && location.href,\n        defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\\:/, ''),\n        defaultHostName = hasLocation && location.hostname,\n        defaultPort = hasLocation && (location.port || undefined),\n        buildMap = {},\n        masterConfig = (module.config && module.config()) || {};\n\n    text = {\n        version: '2.0.10',\n\n        strip: function (content) {\n            //Strips <?xml ...?> declarations so that external SVG and XML\n            //documents can be added to a document without worry. Also, if the string\n            //is an HTML document, only the part inside the body tag is returned.\n            if (content) {\n                content = content.replace(xmlRegExp, \"\");\n                var matches = content.match(bodyRegExp);\n                if (matches) {\n                    content = matches[1];\n                }\n            } else {\n                content = \"\";\n            }\n            return content;\n        },\n\n        jsEscape: function (content) {\n            return content.replace(/(['\\\\])/g, '\\\\$1')\n                .replace(/[\\f]/g, \"\\\\f\")\n                .replace(/[\\b]/g, \"\\\\b\")\n                .replace(/[\\n]/g, \"\\\\n\")\n                .replace(/[\\t]/g, \"\\\\t\")\n                .replace(/[\\r]/g, \"\\\\r\")\n                .replace(/[\\u2028]/g, \"\\\\u2028\")\n                .replace(/[\\u2029]/g, \"\\\\u2029\");\n        },\n\n        createXhr: masterConfig.createXhr || function () {\n            //Would love to dump the ActiveX crap in here. Need IE 6 to die first.\n            var xhr, i, progId;\n            if (typeof XMLHttpRequest !== \"undefined\") {\n                return new XMLHttpRequest();\n            } else if (typeof ActiveXObject !== \"undefined\") {\n                for (i = 0; i < 3; i += 1) {\n                    progId = progIds[i];\n                    try {\n                        xhr = new ActiveXObject(progId);\n                    } catch (e) {}\n\n                    if (xhr) {\n                        progIds = [progId];  // so faster next time\n                        break;\n                    }\n                }\n            }\n\n            return xhr;\n        },\n\n        /**\n         * Parses a resource name into its component parts. Resource names\n         * look like: module/name.ext!strip, where the !strip part is\n         * optional.\n         * @param {String} name the resource name\n         * @returns {Object} with properties \"moduleName\", \"ext\" and \"strip\"\n         * where strip is a boolean.\n         */\n        parseName: function (name) {\n            var modName, ext, temp,\n                strip = false,\n                index = name.indexOf(\".\"),\n                isRelative = name.indexOf('./') === 0 ||\n                             name.indexOf('../') === 0;\n\n            if (index !== -1 && (!isRelative || index > 1)) {\n                modName = name.substring(0, index);\n                ext = name.substring(index + 1, name.length);\n            } else {\n                modName = name;\n            }\n\n            temp = ext || modName;\n            index = temp.indexOf(\"!\");\n            if (index !== -1) {\n                //Pull off the strip arg.\n                strip = temp.substring(index + 1) === \"strip\";\n                temp = temp.substring(0, index);\n                if (ext) {\n                    ext = temp;\n                } else {\n                    modName = temp;\n                }\n            }\n\n            return {\n                moduleName: modName,\n                ext: ext,\n                strip: strip\n            };\n        },\n\n        xdRegExp: /^((\\w+)\\:)?\\/\\/([^\\/\\\\]+)/,\n\n        /**\n         * Is an URL on another domain. Only works for browser use, returns\n         * false in non-browser environments. Only used to know if an\n         * optimized .js version of a text resource should be loaded\n         * instead.\n         * @param {String} url\n         * @returns Boolean\n         */\n        useXhr: function (url, protocol, hostname, port) {\n            var uProtocol, uHostName, uPort,\n                match = text.xdRegExp.exec(url);\n            if (!match) {\n                return true;\n            }\n            uProtocol = match[2];\n            uHostName = match[3];\n\n            uHostName = uHostName.split(':');\n            uPort = uHostName[1];\n            uHostName = uHostName[0];\n\n            return (!uProtocol || uProtocol === protocol) &&\n                   (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&\n                   ((!uPort && !uHostName) || uPort === port);\n        },\n\n        finishLoad: function (name, strip, content, onLoad) {\n            content = strip ? text.strip(content) : content;\n            if (masterConfig.isBuild) {\n                buildMap[name] = content;\n            }\n            onLoad(content);\n        },\n\n        load: function (name, req, onLoad, config) {\n            //Name has format: some.module.filext!strip\n            //The strip part is optional.\n            //if strip is present, then that means only get the string contents\n            //inside a body tag in an HTML string. For XML/SVG content it means\n            //removing the <?xml ...?> declarations so the content can be inserted\n            //into the current doc without problems.\n\n            // Do not bother with the work if a build and text will\n            // not be inlined.\n            if (config.isBuild && !config.inlineText) {\n                onLoad();\n                return;\n            }\n\n            masterConfig.isBuild = config.isBuild;\n\n            var parsed = text.parseName(name),\n                nonStripName = parsed.moduleName +\n                    (parsed.ext ? '.' + parsed.ext : ''),\n                url = req.toUrl(nonStripName),\n                useXhr = (masterConfig.useXhr) ||\n                         text.useXhr;\n\n            // Do not load if it is an empty: url\n            if (url.indexOf('empty:') === 0) {\n                onLoad();\n                return;\n            }\n\n            //Load the text. Use XHR if possible and in a browser.\n            if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {\n                text.get(url, function (content) {\n                    text.finishLoad(name, parsed.strip, content, onLoad);\n                }, function (err) {\n                    if (onLoad.error) {\n                        onLoad.error(err);\n                    }\n                });\n            } else {\n                //Need to fetch the resource across domains. Assume\n                //the resource has been optimized into a JS module. Fetch\n                //by the module name + extension, but do not include the\n                //!strip part to avoid file system issues.\n                req([nonStripName], function (content) {\n                    text.finishLoad(parsed.moduleName + '.' + parsed.ext,\n                                    parsed.strip, content, onLoad);\n                });\n            }\n        },\n\n        write: function (pluginName, moduleName, write, config) {\n            if (buildMap.hasOwnProperty(moduleName)) {\n                var content = text.jsEscape(buildMap[moduleName]);\n                write.asModule(pluginName + \"!\" + moduleName,\n                               \"define(function () { return '\" +\n                                   content +\n                               \"';});\\n\");\n            }\n        },\n\n        writeFile: function (pluginName, moduleName, req, write, config) {\n            var parsed = text.parseName(moduleName),\n                extPart = parsed.ext ? '.' + parsed.ext : '',\n                nonStripName = parsed.moduleName + extPart,\n                //Use a '.js' file name so that it indicates it is a\n                //script that can be loaded across domains.\n                fileName = req.toUrl(parsed.moduleName + extPart) + '.js';\n\n            //Leverage own load() method to load plugin value, but only\n            //write out values that do not have the strip argument,\n            //to avoid any potential issues with ! in file names.\n            text.load(nonStripName, req, function (value) {\n                //Use own write() method to construct full module value.\n                //But need to create shell that translates writeFile's\n                //write() to the right interface.\n                var textWrite = function (contents) {\n                    return write(fileName, contents);\n                };\n                textWrite.asModule = function (moduleName, contents) {\n                    return write.asModule(moduleName, fileName, contents);\n                };\n\n                text.write(pluginName, nonStripName, textWrite, config);\n            }, config);\n        }\n    };\n\n    if (masterConfig.env === 'node' || (!masterConfig.env &&\n            typeof process !== \"undefined\" &&\n            process.versions &&\n            !!process.versions.node &&\n            !process.versions['node-webkit'])) {\n        //Using special require.nodeRequire, something added by r.js.\n        fs = require.nodeRequire('fs');\n\n        text.get = function (url, callback, errback) {\n            try {\n                var file = fs.readFileSync(url, 'utf8');\n                //Remove BOM (Byte Mark Order) from utf8 files if it is there.\n                if (file.indexOf('\\uFEFF') === 0) {\n                    file = file.substring(1);\n                }\n                callback(file);\n            } catch (e) {\n                errback(e);\n            }\n        };\n    } else if (masterConfig.env === 'xhr' || (!masterConfig.env &&\n            text.createXhr())) {\n        text.get = function (url, callback, errback, headers) {\n            var xhr = text.createXhr(), header;\n            xhr.open('GET', url, true);\n\n            //Allow plugins direct access to xhr headers\n            if (headers) {\n                for (header in headers) {\n                    if (headers.hasOwnProperty(header)) {\n                        xhr.setRequestHeader(header.toLowerCase(), headers[header]);\n                    }\n                }\n            }\n\n            //Allow overrides specified in config\n            if (masterConfig.onXhr) {\n                masterConfig.onXhr(xhr, url);\n            }\n\n            xhr.onreadystatechange = function (evt) {\n                var status, err;\n                //Do not explicitly handle errors, those should be\n                //visible via console output in the browser.\n                if (xhr.readyState === 4) {\n                    status = xhr.status;\n                    if (status > 399 && status < 600) {\n                        //An http 4xx or 5xx error. Signal an error.\n                        err = new Error(url + ' HTTP status: ' + status);\n                        err.xhr = xhr;\n                        errback(err);\n                    } else {\n                        callback(xhr.responseText);\n                    }\n\n                    if (masterConfig.onXhrComplete) {\n                        masterConfig.onXhrComplete(xhr, url);\n                    }\n                }\n            };\n            xhr.send(null);\n        };\n    } else if (masterConfig.env === 'rhino' || (!masterConfig.env &&\n            typeof Packages !== 'undefined' && typeof java !== 'undefined')) {\n        //Why Java, why is this so awkward?\n        text.get = function (url, callback) {\n            var stringBuffer, line,\n                encoding = \"utf-8\",\n                file = new java.io.File(url),\n                lineSeparator = java.lang.System.getProperty(\"line.separator\"),\n                input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),\n                content = '';\n            try {\n                stringBuffer = new java.lang.StringBuffer();\n                line = input.readLine();\n\n                // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324\n                // http://www.unicode.org/faq/utf_bom.html\n\n                // Note that when we use utf-8, the BOM should appear as \"EF BB BF\", but it doesn't due to this bug in the JDK:\n                // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058\n                if (line && line.length() && line.charAt(0) === 0xfeff) {\n                    // Eat the BOM, since we've already found the encoding on this file,\n                    // and we plan to concatenating this buffer with others; the BOM should\n                    // only appear at the top of a file.\n                    line = line.substring(1);\n                }\n\n                if (line !== null) {\n                    stringBuffer.append(line);\n                }\n\n                while ((line = input.readLine()) !== null) {\n                    stringBuffer.append(lineSeparator);\n                    stringBuffer.append(line);\n                }\n                //Make sure we return a JavaScript string and not a Java string.\n                content = String(stringBuffer.toString()); //String\n            } finally {\n                input.close();\n            }\n            callback(content);\n        };\n    } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&\n            typeof Components !== 'undefined' && Components.classes &&\n            Components.interfaces)) {\n        //Avert your gaze!\n        Cc = Components.classes,\n        Ci = Components.interfaces;\n        Components.utils['import']('resource://gre/modules/FileUtils.jsm');\n        xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);\n\n        text.get = function (url, callback) {\n            var inStream, convertStream, fileObj,\n                readData = {};\n\n            if (xpcIsWindows) {\n                url = url.replace(/\\//g, '\\\\');\n            }\n\n            fileObj = new FileUtils.File(url);\n\n            //XPCOM, you so crazy\n            try {\n                inStream = Cc['@mozilla.org/network/file-input-stream;1']\n                           .createInstance(Ci.nsIFileInputStream);\n                inStream.init(fileObj, 1, 0, false);\n\n                convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']\n                                .createInstance(Ci.nsIConverterInputStream);\n                convertStream.init(inStream, \"utf-8\", inStream.available(),\n                Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);\n\n                convertStream.readString(inStream.available(), readData);\n                convertStream.close();\n                inStream.close();\n                callback(readData.value);\n            } catch (e) {\n                throw new Error((fileObj && fileObj.path || '') + ': ' + e);\n            }\n        };\n    }\n    return text;\n});\n"
  },
  {
    "path": "editor/scripts/underscore.js",
    "content": "//     Underscore.js 1.7.0\n//     http://underscorejs.org\n//     (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\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 `exports` on the server.\n  var root = this;\n\n  // Save the previous value of the `_` variable.\n  var previousUnderscore = root._;\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\n    push             = ArrayProto.push,\n    slice            = ArrayProto.slice,\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    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.\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.7.0';\n\n  // Internal function that returns an efficient (for current engines) version\n  // of the passed-in callback, to be repeatedly applied in other Underscore\n  // functions.\n  var optimizeCb = function(func, context, argCount) {\n    if (context === void 0) return func;\n    switch (argCount == null ? 3 : argCount) {\n      case 1: return function(value) {\n        return func.call(context, value);\n      };\n      case 2: return function(value, other) {\n        return func.call(context, value, other);\n      };\n      case 3: return function(value, index, collection) {\n        return func.call(context, value, index, collection);\n      };\n      case 4: return function(accumulator, value, index, collection) {\n        return func.call(context, accumulator, value, index, collection);\n      };\n    }\n    return function() {\n      return func.apply(context, arguments);\n    };\n  };\n\n  // A mostly-internal function to generate callbacks that can be applied\n  // to each element in a collection, returning the desired result — either\n  // identity, an arbitrary callback, a property matcher, or a property accessor.\n  var cb = function(value, context, argCount) {\n    if (value == null) return _.identity;\n    if (_.isFunction(value)) return optimizeCb(value, context, argCount);\n    if (_.isObject(value)) return _.matches(value);\n    return _.property(value);\n  };\n  _.iteratee = function(value, context) {\n    return cb(value, context);\n  };\n\n  // Collection Functions\n  // --------------------\n\n  // The cornerstone, an `each` implementation, aka `forEach`.\n  // Handles raw objects in addition to array-likes. Treats all\n  // sparse array-likes as if they were dense.\n  _.each = _.forEach = function(obj, iteratee, context) {\n    if (obj == null) return obj;\n    iteratee = optimizeCb(iteratee, context);\n    var i, length = obj.length;\n    if (length === +length) {\n      for (i = 0; i < length; i++) {\n        iteratee(obj[i], i, obj);\n      }\n    } else {\n      var keys = _.keys(obj);\n      for (i = 0, length = keys.length; i < length; i++) {\n        iteratee(obj[keys[i]], keys[i], obj);\n      }\n    }\n    return obj;\n  };\n\n  // Return the results of applying the iteratee to each element.\n  _.map = _.collect = function(obj, iteratee, context) {\n    if (obj == null) return [];\n    iteratee = cb(iteratee, context);\n    var keys = obj.length !== +obj.length && _.keys(obj),\n        length = (keys || obj).length,\n        results = Array(length),\n        currentKey;\n    for (var index = 0; index < length; index++) {\n      currentKey = keys ? keys[index] : index;\n      results[index] = iteratee(obj[currentKey], currentKey, obj);\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`.\n  _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) {\n    if (obj == null) obj = [];\n    iteratee = optimizeCb(iteratee, context, 4);\n    var keys = obj.length !== +obj.length && _.keys(obj),\n        length = (keys || obj).length,\n        index = 0, currentKey;\n    if (arguments.length < 3) {\n      if (!length) throw new TypeError(reduceError);\n      memo = obj[keys ? keys[index++] : index++];\n    }\n    for (; index < length; index++) {\n      currentKey = keys ? keys[index] : index;\n      memo = iteratee(memo, obj[currentKey], currentKey, obj);\n    }\n    return memo;\n  };\n\n  // The right-associative version of reduce, also known as `foldr`.\n  _.reduceRight = _.foldr = function(obj, iteratee, memo, context) {\n    if (obj == null) obj = [];\n    iteratee = optimizeCb(iteratee, context, 4);\n    var keys = obj.length !== + obj.length && _.keys(obj),\n        index = (keys || obj).length,\n        currentKey;\n    if (arguments.length < 3) {\n      if (!index) throw new TypeError(reduceError);\n      memo = obj[keys ? keys[--index] : --index];\n    }\n    while (index--) {\n      currentKey = keys ? keys[index] : index;\n      memo = iteratee(memo, obj[currentKey], currentKey, obj);\n    }\n    return memo;\n  };\n\n  // Return the first value which passes a truth test. Aliased as `detect`.\n  _.find = _.detect = function(obj, predicate, context) {\n    var key;\n    if (obj.length === +obj.length) {\n      key = _.findIndex(obj, predicate, context);\n    } else {\n      key = _.findKey(obj, predicate, context);\n    }\n    if (key !== void 0 && key !== -1) return obj[key];\n  };\n\n  // Return all the elements that pass a truth test.\n  // Aliased as `select`.\n  _.filter = _.select = function(obj, predicate, context) {\n    var results = [];\n    if (obj == null) return results;\n    predicate = cb(predicate, context);\n    _.each(obj, function(value, index, list) {\n      if (predicate(value, index, list)) results.push(value);\n    });\n    return results;\n  };\n\n  // Return all the elements for which a truth test fails.\n  _.reject = function(obj, predicate, context) {\n    return _.filter(obj, _.negate(cb(predicate)), context);\n  };\n\n  // Determine whether all of the elements match a truth test.\n  // Aliased as `all`.\n  _.every = _.all = function(obj, predicate, context) {\n    if (obj == null) return true;\n    predicate = cb(predicate, context);\n    var keys = obj.length !== +obj.length && _.keys(obj),\n        length = (keys || obj).length,\n        index, currentKey;\n    for (index = 0; index < length; index++) {\n      currentKey = keys ? keys[index] : index;\n      if (!predicate(obj[currentKey], currentKey, obj)) return false;\n    }\n    return true;\n  };\n\n  // Determine if at least one element in the object matches a truth test.\n  // Aliased as `any`.\n  _.some = _.any = function(obj, predicate, context) {\n    if (obj == null) return false;\n    predicate = cb(predicate, context);\n    var keys = obj.length !== +obj.length && _.keys(obj),\n        length = (keys || obj).length,\n        index, currentKey;\n    for (index = 0; index < length; index++) {\n      currentKey = keys ? keys[index] : index;\n      if (predicate(obj[currentKey], currentKey, obj)) return true;\n    }\n    return false;\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 (obj.length !== +obj.length) obj = _.values(obj);\n    return _.indexOf(obj, target) >= 0;\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, _.property(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) {\n    return _.filter(obj, _.matches(attrs));\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 _.find(obj, _.matches(attrs));\n  };\n\n  // Return the maximum element (or element-based computation).\n  _.max = function(obj, iteratee, context) {\n    var result = -Infinity, lastComputed = -Infinity,\n        value, computed;\n    if (iteratee == null && obj != null) {\n      obj = obj.length === +obj.length ? obj : _.values(obj);\n      for (var i = 0, length = obj.length; i < length; i++) {\n        value = obj[i];\n        if (value > result) {\n          result = value;\n        }\n      }\n    } else {\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index, list) {\n        computed = iteratee(value, index, list);\n        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n          result = value;\n          lastComputed = computed;\n        }\n      });\n    }\n    return result;\n  };\n\n  // Return the minimum element (or element-based computation).\n  _.min = function(obj, iteratee, context) {\n    var result = Infinity, lastComputed = Infinity,\n        value, computed;\n    if (iteratee == null && obj != null) {\n      obj = obj.length === +obj.length ? obj : _.values(obj);\n      for (var i = 0, length = obj.length; i < length; i++) {\n        value = obj[i];\n        if (value < result) {\n          result = value;\n        }\n      }\n    } else {\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index, list) {\n        computed = iteratee(value, index, list);\n        if (computed < lastComputed || computed === Infinity && result === Infinity) {\n          result = value;\n          lastComputed = computed;\n        }\n      });\n    }\n    return result;\n  };\n\n  // Shuffle a collection, using the modern version of the\n  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n  _.shuffle = function(obj) {\n    var set = obj && obj.length === +obj.length ? obj : _.values(obj);\n    var length = set.length;\n    var shuffled = Array(length);\n    for (var index = 0, rand; index < length; index++) {\n      rand = _.random(0, index);\n      if (rand !== index) shuffled[index] = shuffled[rand];\n      shuffled[rand] = set[index];\n    }\n    return shuffled;\n  };\n\n  // Sample **n** random values from a collection.\n  // If **n** is not specified, returns a single random element.\n  // The internal `guard` argument allows it to work with `map`.\n  _.sample = function(obj, n, guard) {\n    if (n == null || guard) {\n      if (obj.length !== +obj.length) obj = _.values(obj);\n      return obj[_.random(obj.length - 1)];\n    }\n    return _.shuffle(obj).slice(0, Math.max(0, n));\n  };\n\n  // Sort the object's values by a criterion produced by an iteratee.\n  _.sortBy = function(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    return _.pluck(_.map(obj, function(value, index, list) {\n      return {\n        value: value,\n        index: index,\n        criteria: iteratee(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;\n    }), 'value');\n  };\n\n  // An internal function used for aggregate \"group by\" operations.\n  var group = function(behavior) {\n    return function(obj, iteratee, context) {\n      var result = {};\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index) {\n        var key = iteratee(value, index, obj);\n        behavior(result, value, key);\n      });\n      return result;\n    };\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 = group(function(result, value, key) {\n    if (_.has(result, key)) result[key].push(value); else result[key] = [value];\n  });\n\n  // Indexes the object's values by a criterion, similar to `groupBy`, but for\n  // when you know that your index values will be unique.\n  _.indexBy = group(function(result, value, key) {\n    result[key] = value;\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 = group(function(result, value, key) {\n    if (_.has(result, key)) result[key]++; else result[key] = 1;\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, iteratee, context) {\n    iteratee = cb(iteratee, context, 1);\n    var value = iteratee(obj);\n    var low = 0, high = array.length;\n    while (low < high) {\n      var mid = low + high >>> 1;\n      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n    }\n    return low;\n  };\n\n  // Safely create a real, live array from anything iterable.\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  // Split a collection into two arrays: one whose elements all satisfy the given\n  // predicate, and one whose elements all do not satisfy the predicate.\n  _.partition = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var pass = [], fail = [];\n    _.each(obj, function(value, key, obj) {\n      (predicate(value, key, obj) ? pass : fail).push(value);\n    });\n    return [pass, fail];\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    if (n == null || guard) return array[0];\n    return _.initial(array, array.length - n);\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, Math.max(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) return array[array.length - 1];\n    return _.rest(array, Math.max(0, array.length - 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, strict, startIndex) {\n    var output = [], idx = 0, value;\n    for (var i = startIndex || 0, length = input && input.length; i < length; i++) {\n      value = input[i];\n      if (value && value.length >= 0 && (_.isArray(value) || _.isArguments(value))) {\n        //flatten current level of array or arguments object\n        if (!shallow) value = flatten(value, shallow, strict);\n        var j = 0, len = value.length;\n        output.length += len;\n        while (j < len) {\n          output[idx++] = value[j++];\n        }\n      } else if (!strict) {\n        output[idx++] = value;\n      }\n    }\n    return output;\n  };\n\n  // Flatten out an array, either recursively (by default), or just one level.\n  _.flatten = function(array, shallow) {\n    return flatten(array, shallow, false);\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, iteratee, context) {\n    if (array == null) return [];\n    if (!_.isBoolean(isSorted)) {\n      context = iteratee;\n      iteratee = isSorted;\n      isSorted = false;\n    }\n    if (iteratee != null) iteratee = cb(iteratee, context);\n    var result = [];\n    var seen = [];\n    for (var i = 0, length = array.length; i < length; i++) {\n      var value = array[i],\n          computed = iteratee ? iteratee(value, i, array) : value;\n      if (isSorted) {\n        if (!i || seen !== computed) result.push(value);\n        seen = computed;\n      } else if (iteratee) {\n        if (!_.contains(seen, computed)) {\n          seen.push(computed);\n          result.push(value);\n        }\n      } else if (!_.contains(result, value)) {\n        result.push(value);\n      }\n    }\n    return result;\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(flatten(arguments, true, true));\n  };\n\n  // Produce an array that contains every item shared between all the\n  // passed-in arrays.\n  _.intersection = function(array) {\n    if (array == null) return [];\n    var result = [];\n    var argsLength = arguments.length;\n    for (var i = 0, length = array.length; i < length; i++) {\n      var item = array[i];\n      if (_.contains(result, item)) continue;\n      for (var j = 1; j < argsLength; j++) {\n        if (!_.contains(arguments[j], item)) break;\n      }\n      if (j === argsLength) result.push(item);\n    }\n    return result;\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 = flatten(arguments, true, true, 1);\n    return _.filter(array, function(value){\n      return !_.contains(rest, value);\n    });\n  };\n\n  // Zip together multiple lists into a single array -- elements that share\n  // an index go together.\n  _.zip = function(array) {\n    if (array == null) return [];\n    var length = _.max(arguments, 'length').length;\n    var results = Array(length);\n    while (length-- > 0) {\n      results[length] = _.pluck(arguments, length);\n    }\n    return results;\n  };\n\n  // Complement of _.zip. Unzip accepts an array of arrays and groups\n  // each array's elements on shared indices\n  _.unzip = function(array) {\n    return _.zip.apply(null, array);\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, length = list.length; i < length; 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  // Return the position of the first occurrence of an item in an array,\n  // or -1 if the item is not included in the array.\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, length = array && array.length;\n    if (typeof isSorted == 'number') {\n      i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;\n    } else if (isSorted) {\n      i = _.sortedIndex(array, item);\n      return array[i] === item ? i : -1;\n    }\n    for (; i < length; i++) if (array[i] === item) return i;\n    return -1;\n  };\n\n  _.lastIndexOf = function(array, item, from) {\n    var idx = array ? array.length : 0;\n    if (typeof from == 'number') {\n      idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);\n    }\n    while (--idx >= 0) if (array[idx] === item) return idx;\n    return -1;\n  };\n\n  // Returns the first index on an array-like that passes a predicate test\n  _.findIndex = function(array, predicate, context) {\n    predicate = cb(predicate, context);\n    var length = array != null ? array.length : 0;\n    for (var i = 0; i < length; i++) {\n      if (predicate(array[i], i, array)) return i;\n    }\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 = step || 1;\n\n    var length = Math.max(Math.ceil((stop - start) / step), 0);\n    var range = Array(length);\n\n    for (var idx = 0; idx < length; idx++, start += step) {\n      range[idx] = start;\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  // Determines whether to execute a function as a constructor\n  // or a normal function with the provided arguments\n  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {\n    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n    Ctor.prototype = sourceFunc.prototype;\n    var self = new Ctor;\n    Ctor.prototype = null;\n    var result = sourceFunc.apply(self, args);\n    if (_.isObject(result)) return result;\n    return self;\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 (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n    if (!_.isFunction(func)) throw TypeError('Bind must be called on a function');\n    var args = slice.call(arguments, 2);\n    return function bound() {\n      return executeBound(func, bound, context, this, 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. _ acts\n  // as a placeholder, allowing any combination of arguments to be pre-filled.\n  _.partial = function(func) {\n    var boundArgs = slice.call(arguments, 1);\n    return function bound() {\n      var position = 0;\n      var args = boundArgs.slice();\n      for (var i = 0, length = args.length; i < length; i++) {\n        if (args[i] === _) args[i] = arguments[position++];\n      }\n      while (position < arguments.length) args.push(arguments[position++]);\n      return executeBound(func, bound, this, this, args);\n    };\n  };\n\n  // Bind a number of an object's methods to that object. Remaining arguments\n  // are the method names to be bound. Useful for ensuring that all callbacks\n  // defined on an object belong to it.\n  _.bindAll = function(obj) {\n    var i, length = arguments.length, key;\n    if (length <= 1) throw new Error('bindAll must be passed function names');\n    for (i = 1; i < length; i++) {\n      key = arguments[i];\n      obj[key] = _.bind(obj[key], obj);\n    }\n    return obj;\n  };\n\n  // Memoize an expensive function by storing its results.\n  _.memoize = function(func, hasher) {\n    var memoize = function(key) {\n      var cache = memoize.cache;\n      var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);\n      return cache[address];\n    };\n    memoize.cache = {};\n    return memoize;\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(){\n      return func.apply(null, args);\n    }, 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. Normally, the throttled function will run\n  // as much as it can, without ever going more than once per `wait` duration;\n  // but if you'd like to disable the execution on the leading edge, pass\n  // `{leading: false}`. To disable execution on the trailing edge, ditto.\n  _.throttle = function(func, wait, options) {\n    var context, args, result;\n    var timeout = null;\n    var previous = 0;\n    if (!options) options = {};\n    var later = function() {\n      previous = options.leading === false ? 0 : _.now();\n      timeout = null;\n      result = func.apply(context, args);\n      if (!timeout) context = args = null;\n    };\n    return function() {\n      var now = _.now();\n      if (!previous && options.leading === false) previous = now;\n      var remaining = wait - (now - previous);\n      context = this;\n      args = arguments;\n      if (remaining <= 0 || remaining > wait) {\n        if (timeout) {\n          clearTimeout(timeout);\n          timeout = null;\n        }\n        previous = now;\n        result = func.apply(context, args);\n        if (!timeout) context = args = null;\n      } else if (!timeout && options.trailing !== false) {\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, args, context, timestamp, result;\n\n    var later = function() {\n      var last = _.now() - timestamp;\n\n      if (last < wait && last >= 0) {\n        timeout = setTimeout(later, wait - last);\n      } else {\n        timeout = null;\n        if (!immediate) {\n          result = func.apply(context, args);\n          if (!timeout) context = args = null;\n        }\n      }\n    };\n\n    return function() {\n      context = this;\n      args = arguments;\n      timestamp = _.now();\n      var callNow = immediate && !timeout;\n      if (!timeout) timeout = setTimeout(later, wait);\n      if (callNow) {\n        result = func.apply(context, args);\n        context = args = null;\n      }\n\n      return result;\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 _.partial(wrapper, func);\n  };\n\n  // Returns a negated version of the passed-in predicate.\n  _.negate = function(predicate) {\n    return function() {\n      return !predicate.apply(this, arguments);\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 args = arguments;\n    var start = args.length - 1;\n    return function() {\n      var i = start;\n      var result = args[start].apply(this, arguments);\n      while (i--) result = args[i].call(this, result);\n      return result;\n    };\n  };\n\n  // Returns a function that will only be executed after being called N times.\n  _.after = function(times, func) {\n    return function() {\n      if (--times < 1) {\n        return func.apply(this, arguments);\n      }\n    };\n  };\n\n  // Returns a function that will only be executed before being called N times.\n  _.before = function(times, func) {\n    var memo;\n    return function() {\n      if (--times > 0) {\n        memo = func.apply(this, arguments);\n      }\n      if (times <= 1) func = null;\n      return memo;\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 = _.partial(_.before, 2);\n\n  // Object Functions\n  // ----------------\n\n  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n  var hasEnumBug = !({toString: null}).propertyIsEnumerable('toString');\n  var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString',\n                      'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n  // Retrieve the names of an object's properties.\n  // Delegates to **ECMAScript 5**'s native `Object.keys`\n  _.keys = function(obj) {\n    if (!_.isObject(obj)) return [];\n    if (nativeKeys) return nativeKeys(obj);\n    var keys = [];\n    for (var key in obj) if (_.has(obj, key)) keys.push(key);\n\n    // Ahem, IE < 9.\n    if (hasEnumBug) {\n      var nonEnumIdx = nonEnumerableProps.length;\n      while (nonEnumIdx--) {\n        var prop = nonEnumerableProps[nonEnumIdx];\n        if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\n      }\n    }\n    return keys;\n  };\n\n  // Retrieve the values of an object's properties.\n  _.values = function(obj) {\n    var keys = _.keys(obj);\n    var length = keys.length;\n    var values = Array(length);\n    for (var i = 0; i < length; i++) {\n      values[i] = obj[keys[i]];\n    }\n    return values;\n  };\n\n  // Convert an object into a list of `[key, value]` pairs.\n  _.pairs = function(obj) {\n    var keys = _.keys(obj);\n    var length = keys.length;\n    var pairs = Array(length);\n    for (var i = 0; i < length; i++) {\n      pairs[i] = [keys[i], obj[keys[i]]];\n    }\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    var keys = _.keys(obj);\n    for (var i = 0, length = keys.length; i < length; i++) {\n      result[obj[keys[i]]] = keys[i];\n    }\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    if (!_.isObject(obj)) return obj;\n    var source, prop;\n    for (var i = 1, length = arguments.length; i < length; i++) {\n      source = arguments[i];\n      for (prop in source) {\n        obj[prop] = source[prop];\n      }\n    }\n    return obj;\n  };\n\n  // Returns the first key on an object that passes a predicate test\n  _.findKey = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var keys = _.keys(obj), key;\n    for (var i = 0, length = keys.length; i < length; i++) {\n      key = keys[i];\n      if (predicate(obj[key], key, obj)) return key;\n    }\n  };\n\n  // Return a copy of the object only containing the whitelisted properties.\n  _.pick = function(obj, iteratee, context) {\n    var result = {}, key;\n    if (obj == null) return result;\n    if (_.isFunction(iteratee)) {\n      iteratee = optimizeCb(iteratee, context);\n      for (key in obj) {\n        var value = obj[key];\n        if (iteratee(value, key, obj)) result[key] = value;\n      }\n    } else {\n      var keys = flatten(arguments, false, false, 1);\n      obj = new Object(obj);\n      for (var i = 0, length = keys.length; i < length; i++) {\n        key = keys[i];\n        if (key in obj) result[key] = obj[key];\n      }\n    }\n    return result;\n  };\n\n   // Return a copy of the object without the blacklisted properties.\n  _.omit = function(obj, iteratee, context) {\n    if (_.isFunction(iteratee)) {\n      iteratee = _.negate(iteratee);\n    } else {\n      var keys = _.map(flatten(arguments, false, false, 1), String);\n      iteratee = function(value, key) {\n        return !_.contains(keys, key);\n      };\n    }\n    return _.pick(obj, iteratee, context);\n  };\n\n  // Fill in a given object with default properties.\n  _.defaults = function(obj) {\n    if (!_.isObject(obj)) return obj;\n    for (var i = 1, length = arguments.length; i < length; i++) {\n      var source = arguments[i];\n      for (var prop in source) {\n        if (obj[prop] === void 0) 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, regular expressions, dates, and booleans are compared by value.\n      case '[object RegExp]':\n      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\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 === '' + b;\n      case '[object Number]':\n        // `NaN`s are equivalent, but non-reflexive.\n        // Object(NaN) is equivalent to NaN\n        if (+a !== +a) return +b !== +b;\n        // An `egal` comparison is performed for other numeric values.\n        return +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    }\n\n    var areArrays = className === '[object Array]';\n    if (!areArrays) {\n      if (typeof a != 'object' || typeof b != 'object') return false;\n\n      // Objects with different constructors are not equivalent, but `Object`s or `Array`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                          && ('constructor' in a && 'constructor' in b)) {\n        return false;\n      }\n    }\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\n    // Add the first object to the stack of traversed objects.\n    aStack.push(a);\n    bStack.push(b);\n    var size, result;\n    // Recursively compare objects and arrays.\n    if (areArrays) {\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      // Deep compare objects.\n      var keys = _.keys(a), key;\n      size = keys.length;\n      // Ensure that both objects contain the same number of properties before comparing deep equality.\n      result = _.keys(b).length === size;\n      if (result) {\n        while (size--) {\n          // Deep compare each member\n          key = keys[size];\n          if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;\n        }\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) || _.isArguments(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    var type = typeof obj;\n    return type === 'function' || type === 'object' && !!obj;\n  };\n\n  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.\n  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], 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 < 9), where\n  // there isn't any inspectable \"Arguments\" type.\n  if (!_.isArguments(arguments)) {\n    _.isArguments = function(obj) {\n      return _.has(obj, 'callee');\n    };\n  }\n\n  // Optimize `isFunction` if appropriate. Work around an IE 11 bug.\n  if (typeof /./ !== 'function') {\n    _.isFunction = function(obj) {\n      return typeof obj == 'function' || false;\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 obj != null && 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 iteratees.\n  _.identity = function(value) {\n    return value;\n  };\n\n  // Predicate-generating functions. Often useful outside of Underscore.\n  _.constant = function(value) {\n    return function() {\n      return value;\n    };\n  };\n\n  _.noop = function(){};\n\n  _.property = function(key) {\n    return function(obj) {\n      return obj == null ? void 0 : obj[key];\n    };\n  };\n\n  // Returns a predicate for checking whether an object has a given set of `key:value` pairs.\n  _.matches = function(attrs) {\n    var pairs = _.pairs(attrs), length = pairs.length;\n    return function(obj) {\n      if (obj == null) return !length;\n      obj = new Object(obj);\n      for (var i = 0; i < length; i++) {\n        var pair = pairs[i], key = pair[0];\n        if (pair[1] !== obj[key] || !(key in obj)) return false;\n      }\n      return true;\n    };\n  };\n\n  // Run a function **n** times.\n  _.times = function(n, iteratee, context) {\n    var accum = Array(Math.max(0, n));\n    iteratee = optimizeCb(iteratee, context, 1);\n    for (var i = 0; i < n; i++) accum[i] = iteratee(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  // A (possibly faster) way to get the current timestamp as an integer.\n  _.now = Date.now || function() {\n    return new Date().getTime();\n  };\n\n   // List of HTML entities for escaping.\n  var escapeMap = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    \"'\": '&#x27;',\n    '`': '&#x60;'\n  };\n  var unescapeMap = _.invert(escapeMap);\n\n  // Functions for escaping and unescaping strings to/from HTML interpolation.\n  var createEscaper = function(map) {\n    var escaper = function(match) {\n      return map[match];\n    };\n    // Regexes for identifying a key that needs to be escaped\n    var source = '(?:' + _.keys(map).join('|') + ')';\n    var testRegexp = RegExp(source);\n    var replaceRegexp = RegExp(source, 'g');\n    return function(string) {\n      string = string == null ? '' : '' + string;\n      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n    };\n  };\n  _.escape = createEscaper(escapeMap);\n  _.unescape = createEscaper(unescapeMap);\n\n  // If the value of the named `property` is a function then invoke it with the\n  // `object` as context; otherwise, return it.\n  _.result = function(object, property, fallback) {\n    var value = object == null ? void 0 : object[property];\n    if (value === void 0) {\n      value = fallback;\n    }\n    return _.isFunction(value) ? value.call(object) : value;\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    '\\u2028': 'u2028',\n    '\\u2029': 'u2029'\n  };\n\n  var escaper = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n  var escapeChar = function(match) {\n    return '\\\\' + escapes[match];\n  };\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  // NB: `oldSettings` only exists for backwards compatibility.\n  _.template = function(text, settings, oldSettings) {\n    if (!settings && oldSettings) settings = oldSettings;\n    settings = _.defaults({}, settings, _.templateSettings);\n\n    // Combine delimiters into one regular expression via alternation.\n    var matcher = 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).replace(escaper, escapeChar);\n      index = offset + match.length;\n\n      if (escape) {\n        source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n      } else if (interpolate) {\n        source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n      } else if (evaluate) {\n        source += \"';\\n\" + evaluate + \"\\n__p+='\";\n      }\n\n      // Adobe VMs need the match returned to produce the correct offest.\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      var render = new Function(settings.variable || 'obj', '_', source);\n    } catch (e) {\n      e.source = source;\n      throw e;\n    }\n\n    var template = function(data) {\n      return render.call(this, data, _);\n    };\n\n    // Provide the compiled source as a convenience for precompilation.\n    var argument = settings.variable || 'obj';\n    template.source = 'function(' + argument + '){\\n' + source + '}';\n\n    return template;\n  };\n\n  // Add a \"chain\" function. Start chaining a wrapped Underscore object.\n  _.chain = function(obj) {\n    var instance = _(obj);\n    instance._chain = true;\n    return instance;\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(instance, obj) {\n    return instance._chain ? _(obj).chain() : obj;\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(this, func.apply(_, args));\n      };\n    });\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(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(this, method.apply(this._wrapped, arguments));\n    };\n  });\n\n  // Extracts the result from a wrapped and chained object.\n  _.prototype.value = function() {\n    return this._wrapped;\n  };\n\n  // AMD registration happens at the end for compatibility with AMD loaders\n  // that may not enforce next-turn semantics on modules. Even though general\n  // practice for AMD registration is to be anonymous, underscore registers\n  // as a named module because, like jQuery, it is a base library that is\n  // popular enough to be bundled in a third party lib, but not be part of\n  // an AMD load request. Those cases could generate an error when an\n  // anonymous define() is called outside of a loader request.\n  if (typeof define === 'function' && define.amd) {\n    define('underscore', [], function() {\n      return _;\n    });\n  }\n}.call(this));\n"
  },
  {
    "path": "editor/theme/sweetprism.css",
    "content": "/* sweetprism theme for codemirror */\n/** \n * Loosely based on:\n * sweetprism.js default theme for JavaScript, CSS and HTML\n * Based on dabblet (http://dabblet.com)\n * @author Lea Verou\n */\n/* Color scheme */\n\n.cm-s-sweetprism .cm-keyword { color: #07a; }\n.cm-s-sweetprism .cm-atom { color: #07a; }\n.cm-s-sweetprism .cm-number { color: #905; }\n.cm-s-sweetprism .cm-def { color: #000; }\n.cm-s-sweetprism .cm-variable { color: #000; }\n.cm-s-sweetprism .cm-variable-2 { color: #000; }\n.cm-s-sweetprism .cm-variable-3 { color: #000; }\n.cm-s-sweetprism .cm-property { color: #000; }\n.cm-s-sweetprism .cm-operator {color: #a67f59; background: hsla(0,0%,100%,.5);}\n.cm-s-sweetprism .cm-comment { color: slategray; font-style:italic; }\n.cm-s-sweetprism .cm-string { color: #690; }\n.cm-s-sweetprism .cm-string-2 { color: #690; }\n.cm-s-sweetprism .cm-meta { color: #000; }\n.cm-s-sweetprism .cm-error { color: #e90; }\n.cm-s-sweetprism .cm-qualifier { color: 000; }\n.cm-s-sweetprism .cm-builtin { color: #000; }\n.cm-s-sweetprism .cm-bracket { color: #999; }\n.cm-s-sweetprism .cm-tag { color: #000 }\n.cm-s-sweetprism .cm-attribute {  color: #000; }\n.cm-s-sweetprism .cm-header {color: 000;}\n.cm-s-sweetprism .cm-quote { color: #999; }\n.cm-s-sweetprism .cm-hr { color: 000; }\n.cm-s-sweetprism .cm-link { color: #000; }\n.cm-s-sweetprism .cm-special { color: #000; }\n\n.cm-s-sweetprism .CodeMirror-matchingbracket { color: #690; }\n.cm-s-sweetprism .CodeMirror-nonmatchingbracket { color: #e90; }\n\n\n\n\n.cm-s-sweetprism .CodeMirror-selected { background: #999; opacity:.2;}\n.cm-s-sweetprism .CodeMirror-focused .CodeMirror-selected { background: #999; opacity:.2; }\n\n\n/* Editor styling */\n\n.cm-s-sweetprism.CodeMirror {\n  margin: .5em 0;\n  height:auto;\n  color: black;\n  text-shadow: 0 1px white;\n  font-family: Consolas, Monaco, 'Andale Mono', monospace;\n  direction: ltr;\n  text-align: left;\n  white-space: pre;\n  word-spacing: normal;\n  \n  -moz-tab-size: 4;\n  -o-tab-size: 4;\n  tab-size: 4;\n  \n  -webkit-hyphens: none;\n  -moz-hyphens: none;\n  -ms-hyphens: none;\n  hyphens: none;\n  border: 1px solid #aaa;\n  background-color: #f7f7f7 /*#f5f2f0*/ ;\n\n}\n\n.cm-s-sweetprism .CodeMirror-gutters {\n  background: transparent;\n  border-right: 1px solid rgba(0,0,0, 0.1);\n}\n\n.cm-s-sweetprism .CodeMirror-linenumber {\n  text-shadow: 0px 1px white;\n  color: rgba(0,0,0, 0.3);\n}\n\n.cm-s-sweetprism .CodeMirror-lines .CodeMirror-cursor {\n  border-left: 1px solid black;\n}\n\n.cm-s-sweetprism .activeline {\n  background: none repeat scroll 0% 0% /*rgba(255, 255, 255, 0.031)*/ pink;\n}\n\n.cm-s-sweetprism.CodeMirror,\n.cm-s-sweetprism .CodeMirror-gutters {\n}\n"
  },
  {
    "path": "lib/ki.js",
    "content": "\n(function (root, factory) {\n  if (typeof exports === 'object') {\n    factory(exports, require('sweet.js'));\n  }\n  else if (typeof define === 'function' && define.amd) {\n    define([\n      'exports',\n      'sweet'\n      ], factory);\n  }\n\n}(this, function(exports, sweet) {\n\n  var getNSExprs = function(s,n) {\n    var nesting = 0;\n    var sexpr = \"\";\n    var res = {matches: [], end: -1};\n    for (var i = 0; i < s.length; ++i)\n    {\n      c = s[i];\n      switch (c) {\n        case '(':\n          nesting++;\n          break;\n        case ')':\n          nesting--;\n          if (nesting < 0) {\n            return null;\n          }\n          if (nesting == 0) {\n            res.matches.push(sexpr + c);\n            sexpr = \"\";\n          }\n          if (res.matches.length == n) {\n            res.end = i+1;\n            return res;\n          }\n          break;\n      }\n      if (nesting > 0) {\n        sexpr += c;\n      }\n    }\n    return null;\n  }\n  \n  var parseMacros = function(code) {\n    var re = /ki *macro/\n    \n    var current = code;\n    var start = current.search(re);\n    var ret;\n    var macros = [];\n    while (start != -1) {\n      current = current.substr(start);\n      ret = getNSExprs(current,2);\n      macros.push(ret.matches);\n      current = current.substr(ret.end);\n      start = current.search(re);\n    }\n    \n    var rules = macros.map(function(macro) { \n      return 'rule { ' + macro[0] + ' } => { _sexpr ' + macro[1] + ' }' \n    });\n  \n    return rules.join('\\n');\n  }\n\n  var joinModule = function(src, ki_core, additionalRules) {\n    rules = additionalRules || [];\n    rules.push(parseMacros(src));\n    return ki_core.replace('/*__macros__*/',rules.join('\\n'));\n  }\n\n  var compile = function(src, options, uglify, fs) {\n    if (!options.modules && options.ki_core) {\n      var module = joinModule(src,options.ki_core,options.rules);\n      options.modules = sweet.loadModule(module);\n    }\n    var result = sweet.compile(src, options);\n    if (options.autonomous) {\n      result.code += '\\nvar mori = ' + options.moriSrc;\n    }\n    if (options.sourceMap) {\n      var code = result.code + '\\n//# sourceMappingURL=' + options.mapfile;\n      var sourceMap = result.sourceMap;\n      var tmpfile = options.mapfile + \".tmp\";\n      if (options.minify && fs) {\n        fs.writeFileSync(tmpfile, sourceMap, 'utf8');\n        result = uglify.minify(code, {\n          fromString: true,\n          inSourceMap: tmpfile,\n          outSourceMap: options.mapfile,\n          compress: options.compress\n        });\n        fs.unlinkSync(tmpfile);\n        return { code: result.code, sourceMap: result.map };\n      }\n\n      return { code: code, sourceMap: sourceMap };\n    }\n    else if (options.minify) {\n      var result = uglify.minify(result.code, {fromString: true, compress: options.compress});\n      return { code: result.code };\n    }\n    return { code: result.code };\n  }\n\n  exports.compile = compile;\n  exports.joinModule = joinModule;\n  exports.parseMacros = parseMacros;\n}))\n\n"
  },
  {
    "path": "lib/ki_run.js",
    "content": "\nvar fs = require('fs');\nvar path = require('path');\nvar sweet = require('sweet.js');\nvar uglify = require('uglify-js');\nvar ki = require('./ki.js');\n\n// TODO: add option to build a version of ki macros that includes modules\n\nvar argv = require(\"optimist\")\n  .usage(\"Usage: ki [options] path/to/file.js\")\n  .alias('o', 'output')\n  .describe('o', 'output file path')\n  .alias('i', 'include')\n  .describe('i', 'include code from file (relative path or npm package)')\n  .alias('w', 'watch')\n  .describe('w', 'watch a file')\n  .boolean('watch')\n  .alias('s', 'sourceMap')\n  .describe('s', 'generate a sourceMap')\n  .boolean('sourceMap')\n  .alias('u', 'minify')\n  .describe('u', 'minify output code using UglifyJS2')\n  .boolean('minify')\n  .alias('c', 'compress')\n  .describe('c', 'compress and optimize during minify (default true if minify)')\n  .boolean('compress')\n  .alias('a', 'autonomous')\n  .describe('a', 'embed mori in the output')\n  .boolean('autonomous')\n  .argv;\n\nexports.run = function() {\n  var infile = argv._[0];\n  var outfile = argv.output;\n  var watch = argv.watch;\n  var sourceMap = argv.sourceMap;\n  var minify = argv.minify;\n  var compress = argv.compress;\n  var autonomous = argv.autonomous;\n  compress = compress ? {} : false;\n\n  var file;\n  if (infile) {\n    file = fs.readFileSync(infile, 'utf8');\n  }\n  else if (argv._.length === 0) {\n    console.log(require(\"optimist\").help());\n    return 0;\n  }\n\n  var ki_core = fs.readFileSync(path.join(path.dirname(fs.realpathSync(__filename)),'../macros/index.js'), 'utf8');\n\n  var moriSrc;\n  if (autonomous) {\n    moriSrc = fs.readFileSync(path.join(path.dirname(fs.realpathSync(__filename)),'../node_modules/mori/mori.js'), 'utf8');\n  }\n\n  var parseIncludedRules = function(includes) {\n    var includeFiles = includes.map(function(path) {\n      return {\"path\": path, \"file\": fs.readFileSync(path, 'utf8')};\n    });\n\n    var rules = includeFiles.map(function(include) {\n      try {\n        return ki.parseMacros(include.file);\n      }\n      catch (e) {\n        // console.error(e); // not useful error, so far\n        throw new Error(\"Failed to parse \" + include.path);\n      }\n    });\n\n    return rules;\n  }\n\n  var includes = (typeof argv.include === 'string' ? [argv.include] : argv.include) || [];\n\n  var rules = parseIncludedRules(includes);\n\n  var module = ki.joinModule(file,ki_core,rules);\n\n  var mapfile = path.basename(outfile) + '.map';\n\n  var options = {\n    filename: infile,\n    modules: sweet.loadModule(module),\n    sourceMap: sourceMap,\n    mapfile: mapfile,\n    minify: minify,\n    compress: compress,\n    outfile: outfile,\n    autonomous: autonomous,\n    moriSrc: moriSrc,\n    rules: rules\n  };\n\n  var compile = function(src, options, uglify, fs) {\n    try {\n      var result = ki.compile(src,options,uglify,fs);\n      if (options.outfile) {\n        fs.writeFileSync(options.outfile,result.code,'utf8');\n        if (options.sourceMap) {\n          fs.writeFileSync(options.mapfile,result.sourceMap,'utf8');\n        }\n      }\n      else {\n        console.log(result.code);\n      }\n      return 0;\n    }\n    catch (e) {\n      console.error(e);\n      return 1;\n    }\n  }\n\n  var ret = compile(file,options,uglify,fs);\n\n  var onFileChanged = function() {\n    var src = fs.readFileSync(infile, 'utf8');\n    var newModule = ki.joinModule(src,ki_core,rules);\n    if (module != newModule) {\n      module = newModule;\n      options.modules = sweet.loadModule(module);\n    }\n    try {\n      if(compile(src,options,uglify,fs) === 0) {\n        console.log('Compiled', infile);\n      }\n      else {\n        console.error('Failed to compile', infile);\n      }\n    }\n    catch (e) {\n      console.error(e);\n    }\n  }\n\n  var onIncludedFileChanged = function() {\n    try {\n      rules = parseIncludedRules(includes);\n    }\n    catch (e) {\n      console.error(e);\n      return; // don't compile if parseIncludedRules throws\n    }\n    var module = ki.joinModule(file,ki_core,rules);\n    options.modules = sweet.loadModule(module);\n    onFileChanged();\n  }\n\n  if (watch) {\n    var watchOptions = {\n      persistent: true,\n      interval: 1000\n    };\n    fs.watchFile(infile, watchOptions, onFileChanged);\n    var includeFiles = includes.forEach(function(path) {\n      fs.watchFile(path, watchOptions, onIncludedFileChanged);\n    });\n    return -1;\n  }\n\n  return ret;\n}\n"
  },
  {
    "path": "macros/index.js",
    "content": "/**\n * ki: the lisp that macroexpands to JavaScript\n * MIT license http://www.opensource.org/licenses/mit-license.php/\n * Copyright (C) 2014 Luca Antiga http://lantiga.github.io\n */\n\nmacro _arr {\n  rule { () } => {\n  }\n\n  rule { ($arg) } => {\n    _sexpr $arg\n  }\n\n  rule { ($arg $args ...) } => {\n    _sexpr $arg, _arr ($args ...)\n  }\n}\n\nmacro _obj {\n  rule { () } => {\n  }\n  \n  rule { ((keyword $k) $v) } => {\n    _sexpr $k: _sexpr $v\n  }\n\n  rule { ((keyword $k) $v $args ...) } => {\n    _sexpr $k: _sexpr $v, _obj ($args ...)\n  }\n\n  rule { ($k $v) } => {\n    _sexpr $k: _sexpr $v\n  }\n\n  rule { ($k $v $args ...) } => {\n    _sexpr $k: _sexpr $v, _obj ($args ...)\n  }\n}\n\nmacro _args {\n  rule { () } => {\n  }\n\n  rule { ($arg) } => {\n    _sexpr $arg\n  }\n\n  rule { ($arg $args ...) } => {\n    _sexpr $arg, _args ($args ...)\n  }\n}\n\nmacro _x {\n  case { $ctx null } => {\n    throwSyntaxError('ki','<null> is not a valid literal, use nil',#{$ctx})\n  }\n  case { $ctx undefined } => {\n    throwSyntaxError('ki','<undefined> is not a valid literal, use nil',#{$ctx})\n  }\n  case { _ nil } => {\n    return #{null}\n  }\n  case { _ $x} => {\n    return #{$x}\n  }\n}\n\nmacro _throw {\n  case { $ctx + } => {\n    throwSyntaxError('Unexpected token +','(+ ...) unsupported, use (add ...) instead',#{$ctx})\n  }\n  case { $ctx - } => {\n    throwSyntaxError('Unexpected token -','(- ...) unsupported, use (sub ...) instead',#{$ctx})\n  }\n  case { $ctx * } => {\n    throwSyntaxError('Unexpected token *','(* ...) unsupported, use (mul ...) instead',#{$ctx})\n  }\n  //case { $ctx / } => {\n  //  throwSyntaxError('Unexpected token /','(/ ...) unsupported, use (div ...) instead',#{$ctx})\n  //}\n}\n\nmacro _ns {\n  case { _ $ns $sexprs ... } => {\n    var nsname = unwrapSyntax(#{$ns});\n    letstx $nsname = [makeValue(nsname,#{$ns})];\n    return #{\n      (function () {\n        _ki.init(this,$nsname);\n        _return_sexprs ($sexprs ...);\n      }())\n    }\n  }\n}\n\nmacro _def {\n  case { _ $n $sexpr } => {\n    var varname = unwrapSyntax(#{$n});\n    letstx $varname = [makeValue(varname,#{$n})];\n    return #{\n      (function () {\n        _ki_ns_ctx[$varname] = _sexpr $sexpr;\n        _ki.namespaces[_ki_ns_name].vars.$n = _ki_ns_ctx[$varname]\n        return _ki_ns_ctx[$varname];\n      }())\n    };\n  }\n}\n\nmacro _count {\n  case { $m ($x(,) ...) } => {\n    var n = #{$x ...}.length;\n    letstx $n = [makeValue(n,#{$m})];\n    return #{$n};\n  }\n}\n\nmacro _fnmap {\n  rule { ([$args ...] $sexprs ...), $rest(,)... } => {\n    _count ($args(,)...): _sexpr (fn [$args ...] $sexprs ...), _fnmap $rest(,)...\n  }\n  rule { ([$args ...] $sexprs ...) } => {\n    _count ($args(,)...): _sexpr (fn [$args ...] $sexprs ...)\n  }\n}\n\nmacro _destr { \n  rule { ([$ $a], $v) } => {\n    var f = $v[0];\n    _destr($a, f)\n  }\n  rule { ([$ $a $b ...], $v) } => {\n    var f = $v[0];\n    _destr($a, f)\n    var r = $v.slice(1);\n    _destr([$ $b ...], r)\n  }\n\n  rule { ({$ $a $b}, $v) } => {\n    var f = $v[$b];\n    _destr($a, f)\n  }\n  rule { ({$ $a $b $c $d ...}, $v) } => {\n    var f = $v[$b];\n    _destr($a, f)\n    _destr({$ $c $d ...}, $v)\n  }\n\n  rule { ([$a], $v) } => {\n    var f = _sexpr(first $v);\n    _destr($a, f)\n  }\n  rule { ([$a $b ...], $v) } => {\n    var f = _sexpr(first $v);\n    _destr($a, f)\n    var r = _sexpr(rest $v)\n    _destr([$b ...], r)\n  }\n\n  rule { ({$a $b}, $v) } => {\n    var f = _sexpr(get $v $b);\n    _destr($a, f)\n  }\n  rule { ({$a $b $c $d ...}, $v) } => {\n    var f = _sexpr(get $v $b);\n    _destr($a, f)\n    _destr({$c $d ...}, $v)\n  }\n\n  rule { ($a, $v) } => {\n    var $a = $v;\n  }\n}\n\nmacro _let {\n  rule { ([$k $v $rest ...] $sexprs ...) } => {\n    return (function (v) {\n      _destr($k, v)\n      _let ([$rest ...] $sexprs ...)\n    }.call(this,_sexpr $v));\n  }\n  rule { ([] $sexprs ...) } => {\n    _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _letc {\n  rule { ([[$ks ...] ($fn ...)] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$ks ...] $sexprs ... nil))\n  }\n  rule { ([$k ($fn ...)] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$k] $sexprs ... nil))\n  }\n  rule { ([[$ks ...] ($fn ...) $rest ...] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$ks ...] \n                     (letc [$rest ...] $sexprs ...) nil))\n  }\n  rule { ([$k ($fn ...) $rest ...] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$k] \n                     (letc [$rest ...] $sexprs ...) nil))\n  }\n}\n\nmacro _loop_let {\n  rule { ([$k $v $rest ...] $i $vals $sexprs ...) } => {\n    return (function (v) {\n      _destr($k, v)\n      _loop_let ([$rest ...] ($i+1) $vals $sexprs ...)\n    }($vals === undefined ? _sexpr $v : $vals[$i]));\n  }\n  rule { ([] $i $vals $sexprs ...) } => {\n    _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _chain {\n  rule { (($method $args ...)) } => {\n    . _sexpr $method (_args ($args ...))\n  }\n  rule { ($property) } => {\n    . _sexpr $property\n  }\n  rule { (($method $args ...) $rest ...) } => {\n    . _sexpr $method (_args ($args ...)) _chain ($rest ...)\n  }\n  rule { ($property $rest ...) } => {\n    . _sexpr $property _chain ($rest ...)\n  }\n}\n\nmacro _doto {\n  rule { ($obj ($method $args ...)) } => {\n    $obj.$method(_args ($args ...));\n  }\n  rule { ($obj ($method $args ...) $rest ...) } => {\n    $obj.$method(_args ($args ...));\n    _doto ($obj $rest ...)\n  }\n}\n\nmacro _sexpr {\n\n  rule { () } => { \n  }\n  \n  /*__macros__*/\n\n  rule { (ns $ns:ident $sexprs ...) } => {\n    _ns $ns $sexprs ...\n  }\n\n  rule { (use ) } => {\n  }\n  rule { (use $module $modules ...) } => {\n    (function () {\n      _ki.intern.bind(_ki_ns_ctx)(_ki.modules.$module);\n      _sexpr (use $modules ...);\n    }())\n  }\n\n  rule { (ns_get $ns:ident $x) } => {\n    _sexpr _ki.namespaces.$ns.vars.$x\n  }\n\n  rule { (js $body ...) } => {\n    $body ...\n  }\n\n  rule { (fn $name:ident [$args ...] $sexprs ...) } => {\n    function $name($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }\n  }\n\n  rule { (fn [$args ...] $sexprs ...) } => {\n    function ($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }\n  }\n\n  rule { (fnth $name:ident [$args ...] $sexprs ...) } => {\n    function $name($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }.bind(this)\n  }\n\n  rule { (fnth [$args ...] $sexprs ...) } => {\n    function ($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }.bind(this)\n  }\n\n  rule { (fn $name:ident $sexprs ...) } => {\n    function $name() {\n      var fnmap = {_fnmap $sexprs(,) ...};\n      var max_arity = 0;\n      for (var a in fnmap) {\n        max_arity = a > max_arity ? a : max_arity;\n      }\n      fnmap[null] = fnmap[max_arity];\n      var f = fnmap[arguments.length] || fnmap[null];\n      return f.apply(this,arguments);\n    }\n  }\n\n  rule { (fn $sexprs ...) } => {\n    (function () {\n      var fnmap = {_fnmap $sexprs(,) ...};\n      var max_arity = 0;\n      for (var a in fnmap) {\n        max_arity = a > max_arity ? a : max_arity;\n      }\n      fnmap[null] = fnmap[max_arity];\n      return function () {\n        var f = fnmap[arguments.length] || fnmap[null];\n        return f.apply(this,arguments);\n      }\n    }.call(this))\n  }\n\n  rule { (if $cond $sthen $selse) } => {\n    (function () {\n      if (_sexpr (truthy $cond)) {\n        return _sexpr $sthen;\n      }\n      return _sexpr $selse;\n    }.call(this))\n  }\n\n  rule { (ifNot $cond $sthen $selse) } => {\n    _sexpr (if (not $cond) $sthen $selse)\n  }\n\n  rule { (when $cond $sthen) } => {\n    (function () {\n      if (_sexpr (truthy $cond)) {\n        return _sexpr $sthen;\n      }\n      return;\n    }.call(this))\n  }\n\n  rule { (whenNot $cond $sthen) } => {\n    _sexpr (when (not $cond) $sthen)\n  }\n\n  rule { (cond $cond1 $body1 $rest ...) } => {\n    (function () {\n      if (_sexpr (truthy $cond1)) {\n        return _sexpr $body1;\n      }\n      return _sexpr (cond $rest ...);\n    }.call(this))\n  }\n  rule { (cond) } => {\n    undefined\n  }\n\n  rule { (and $sexpr) } => {\n    _sexpr (truthy $sexpr)\n  }\n  rule { (and $sexpr $sexprs ...) } => {\n    _sexpr (truthy $sexpr) && _sexpr (and $sexprs ...)\n  }\n\n  rule { (or $sexpr) } => {\n    _sexpr (truthy $sexpr)\n  }\n  rule { (or $sexpr $sexprs ...) } => {\n    _sexpr (truthy $sexpr) || _sexpr (or $sexprs ...)\n  }\n\n  rule { ($[let] [$bindings ...] $sexprs ...) } => {\n    (function () {\n      _let ([$bindings ...] $sexprs ...)\n    }.call(this))\n  }\n\n  rule { (letc [$bindings ...] $sexprs ...) } => {\n    _letc ([$bindings ...] $sexprs ...)\n  }\n\n  rule { (do $sexprs ...) } => {\n    (function () {\n      _return_sexprs ($sexprs ...)\n    }.call(this))\n  }\n\n  rule { (while $cond $sexpr) } => {\n    (function () {\n      while (_sexpr (truthy $cond)) {\n        _sexpr $sexpr;\n      }\n    }.call(this))\n  }\n\n  rule { (loop [$bindings ...] $sexprs ...) } => {\n    (function () {\n      var res = {};\n      do {\n        res = (function () {\n          _loop_let ([$bindings ...] 0 (res._ki_vals) $sexprs ...);\n        }());\n      }\n      while ((res || 0)._ki_recur);\n      return res;\n    }.call(this))\n  }\n\n  rule { (recur $args ...) } => {\n    {_ki_recur: true, _ki_vals: [_args ($args ...)]}\n  }\n\n  rule { (def $n:ident $sexpr) } => {\n    _def $n $sexpr\n  }\n\n  // TODO: docstring\n  rule { (defn $n:ident [$args ...] $sexprs ...) } => {\n    _sexpr (def $n (fn [$args ...] $sexprs ...))\n  }\n \n  rule { (defn $n:ident ([$args ...] $sexprs ...) $rest ...) } => {\n    _sexpr (def $n (fn ([$args ...] $sexprs ...) $rest ...))\n  }\n\n  rule { (bind $obj $fn) } => {\n    _sexpr $fn.bind($obj)\n  }\n\n  rule { (defmulti $n:ident $dispatch_fn) } => {\n    _sexpr \n       (defn $n [] \n        (js\n         if ($n._ki_methods === undefined || $n._ki_methods.length == 0) {\n           return undefined;\n         }\n         var dispatch_fn = _sexpr $dispatch_fn;\n         for (var i=0; i<$n._ki_methods.length; i++) {\n           var dispatch_value = $n._ki_methods[i][0];\n           var fn = $n._ki_methods[i][1];\n           if (equals(dispatch_fn.apply(this,arguments),dispatch_value)) {\n             return fn.apply(this,arguments);\n           }\n         }) nil)\n  }\n \n  rule { (defmethod $n:ident $dispatch_val [$args ...] $sexprs ...) } => {\n    (function () {\n      if ($n._ki_methods === undefined) {\n        $n._ki_methods = [];\n      }\n      $n._ki_methods.push([_sexpr $dispatch_val,_sexpr (fn [$args ...] $sexprs ...)])\n    }())\n  }\n\n  rule { (threadf $v ($[.]$fn $args ...)) } => {\n    _sexpr (.$fn $v $args ...)\n  }\n  rule { (threadf $v ($[.]$fn $args ...) $x ...) } => {\n    _sexpr (threadf (.$fn $v $args ...) $x ...)\n  }\n \n  rule { (threadf $v ($fn $args ...)) } => {\n    _sexpr ($fn $v $args ...)\n  }\n  rule { (threadf $v ($fn $args ...) $x ...) } => {\n    _sexpr (threadf ($fn $v $args ...) $x ...)\n  }\n  rule { (threadf $v $el) } => {\n    _sexpr ($el $v)\n  }\n  rule { (threadf $v $el $x ...) } => {\n    _sexpr (threadf ($el $v) $x ...)\n  }\n\n  //rule { (threadl $v ($[.]$fn $args ...)) } => {\n  //  _sexpr (.$fn $args ... $v)\n  //}\n  //rule { (threadl $v ($[.]$fn $args ...) $x ...) } => {\n  //  _sexpr (threadl (.$fn $args ... $v) $x ...)\n  //}\n\n  rule { (threadl $v ($fn $args ...)) } => {\n    _sexpr ($fn $args ... $v)\n  }\n  rule { (threadl $v ($fn $args ...) $x ...) } => {\n    _sexpr (threadl ($fn $args ... $v) $x ...)\n  }\n  rule { (threadl $v $el) } => {\n    _sexpr ($el $v)\n  }\n  rule { (threadl $v $el $x ...) } => {\n    _sexpr (threadl ($el $v) $x ...)\n  }\n\n  rule { (chain $obj $rest ...) } => {\n    _sexpr $obj _chain ($rest ...)\n  }\n\n  rule { (doto $obj $rest ...) } => {\n    (function () {\n      _doto ($obj $rest ...)\n      return $obj;\n    }.call(this))\n  }\n\n  rule { (atom $val) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: null, \n      _ki_rcb: null }\n  }\n\n  rule { (atom $val $write_cb) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: _sexpr $write_cb, \n      _ki_rcb: null }\n  }\n\n  rule { (atom $val $write_cb $read_cb) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: _sexpr $write_cb, \n      _ki_rcb: _sexpr $read_cb }\n  }\n\n  rule { (reset $ref $val) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      var val = _sexpr $val;\n      var prev_val = ref._ki_val;\n      ref._ki_val = val;\n      if (ref._ki_wcb) {\n        ref._ki_wcb(val, prev_val);\n      }\n      return val;\n    }.call(this))\n  }\n\n  rule { (swap $ref $fn $args ...) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      var val = ref._ki_val;\n      return _sexpr (reset ref ($fn val $args ...))\n    }.call(this))\n  }\n\n  rule { (deref $ref) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      if (ref._ki_rcb) {\n        ref._ki_rcb(ref._ki_val);\n      }\n      return ref._ki_val;\n    }.call(this))\n  }\n\n  rule { (try $body (catch $e $catch_expr)) } => {\n    (function () {\n      try {\n        _sexpr $body\n      }\n      catch ($e) {\n        _sexpr $catch_expr\n      }\n    }.call(this))\n  }\n\n  rule { (try $body (catch $e $catch_expr) (finally $finally_expr)) } => {\n    (function () {\n      var ret;\n      try {\n        ret = _sexpr $body;\n      }\n      catch ($e) {\n        ret = _sexpr $catch_expr;\n      }\n      finally {\n        _sexpr $finally_expr;\n      }\n      return ret;\n    }.call(this))\n  }\n\n  rule { (throw $x) } => {\n    (function () {\n      throw(_sexpr $x);\n    }.call(this))\n  }\n  \n  rule { (+ $args ...) } => {\n    _throw +\n  }\n\n  rule { (- $args ...) } => {\n    _throw -\n  }\n\n  rule { (* $args ...) } => {\n    _throw *\n  }\n\n  //rule { (/ $args ...) } => {\n  //  _throw /\n  //}\n\n  rule { ($[.] $fn $obj $args ...) } => {\n    _sexpr $obj . $fn (_args ($args ...))\n  }\n\n  rule { ($fn $args ...) } => {\n    _sexpr $fn (_args ($args ...))\n  }\n\n  rule { [$ $x ...] } => {\n    [_arr ($x ...)]\n  }\n\n  rule { {$ $x ...} } => {\n    {_obj ($x ...)}\n  }\n\n  rule { [$x ...] } => {\n    _sexpr (vector $x ...)\n  }\n\n  rule { {$x ...} } => {\n    _sexpr (hashMap $x ...)\n  }\n\n  rule { $x } => { \n    _x $x\n  }\n\n}\n\nmacro _return_sexprs {\n  rule { ($sexpr) } => {\n    return _sexpr $sexpr\n  }\n  rule { ($sexpr $sexprs ...) } => {\n    _sexpr $sexpr; _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _sexprs {\n  rule { ($sexpr) } => {\n    _sexpr $sexpr\n  }\n  rule { ($sexpr $sexprs ...) } => {\n    _sexpr $sexpr _sexprs ($sexprs ...)\n  }\n}\n\nmacro ki {\n  case { _ require core} => {\n    return #{\n      _ki = {\n        init: function (self, ns_name) {\n          if (_ki.namespaces[ns_name] === undefined) {\n            _ki.namespaces[ns_name] = { vars: {} };\n          }\n          self._ki_ns_name = ns_name;\n          self._ki_ns_ctx = self;\n          _ki.intern.bind(self)(_ki.modules.core);\n          _ki.intern.bind(self)(_ki.modules.mori);\n          _ki.intern.bind(self)(_ki.modules);\n          _ki.intern.bind(self)(_ki.namespaces[_ki_ns_name].vars);\n        },\n        intern: function (obj) {\n          for (var e in obj) {\n            this[e] = obj[e];\n          }\n        },\n        namespaces: {},\n        modules: {\n          core: {\n            truthy: function(x) {\n              return x === false || x == null ? false : true;\n            },\n            falsey: function(x) {\n              return !truthy(x);\n            },\n            not: function(x) {\n              return !truthy(x);\n            },\n            eq: function() { \n              return equals.apply(null,arguments); \n            },\n            neq: function() {\n              return !equals.apply(null,arguments); \n            },\n            add: function() {\n              var res = 0.0;\n              for (var i=0; i<arguments.length; i++) {\n                res += arguments[i];\n              }\n              return res;\n            },\n            sub: function() {\n              var res = arguments[0];\n              for (var i=1; i<arguments.length; i++) {\n                res -= arguments[i];\n              }\n              return res;\n            },\n            mul: function() {\n              var res = 1.0;\n              for (var i=0; i<arguments.length; i++) {\n                res *= arguments[i];\n              }\n              return res;\n            },\n            div: function() {\n              var res = arguments[0];\n              for (var i=1; i<arguments.length; i++) {\n                res /= arguments[i];\n              }\n              return res;\n            },\n            mod: function(a,b) {\n              return a % b;\n            },\n            lt: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] < arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            gt: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] > arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            leq: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] <= arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            geq: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] >= arguments[i+1];\n              }\n              return res;\n            },\n            prn: function() {\n              console.log.apply(console,arguments);\n            },\n            str: function() {\n              return String.prototype.concat.apply('',arguments);\n            }\n          },\n          mori: (function () { \n            try {\n              return require('ki/node_modules/mori') \n            }\n            catch (e) {\n              try {\n                return require('mori') \n              }\n              catch (e) {\n                return mori;\n              }\n            }\n          }())\n        }\n      }; \n    }\n  }\n  case { _ require $module as $name} => {\n    var module_name = unwrapSyntax(#{$module});\n    letstx $module_name = [makeValue(module_name,#{$module})];\n    return #{_ki.modules.$name = (function () { \n      try { return require($module_name) } \n      catch (e) { return $name }\n    }());}\n  }\n  case { _ require $module} => {\n    var module_name = unwrapSyntax(#{$module});\n    letstx $module_name = [makeValue(module_name,#{$module})];\n    return #{_ki.modules.$module = (function () { \n      try { return require($module_name) } \n      catch (e) { return $module }\n    }());}\n  }\n\n  case {_ macro ($x ...) ($y ...)} => {\n    return #{};\n  }\n\n  case { $ki ($x ...) } => {\n    \n    var Token = {\n      BooleanLiteral: 1,\n      EOF: 2,\n      Identifier: 3,\n      Keyword: 4,\n      NullLiteral: 5,\n      NumericLiteral: 6,\n      Punctuator: 7,\n      StringLiteral: 8,\n      RegularExpression: 9,\n      Template: 10,\n      Delimiter: 11\n    }\n    \n    function transform(ki_ast, inner) {\n      var content = inner.map(function (el) { return el; });\n      if (content[0].token.type == Token.Punctuator && \n          content[0].token.value == ':') {\n        content.shift();\n        var name = content.shift();\n        content.forEach(function (el,i) {\n          name.token.value += el.token.value;\n        });\n        name.token.type = Token.StringLiteral;\n        content = [{\n          token: {\n            type: Token.Identifier,\n            value: 'keyword',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext},\n          name];\n        }\n      else if (content.length == 3 && \n          content[1].token.type == Token.Punctuator && \n          content[1].token.value == '/') {\n        content = [{\n          token: {\n            type: Token.Identifier,\n            value: 'ns_get',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext},\n          content[0], content[2]];\n        }\n      else {\n        content.unshift({\n          token: {\n            type: Token.Identifier,\n            value: 'js',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext});\n      }\n      ki_ast.push({\n        token: {\n          type: Token.Delimiter,\n          value: '()',\n          startLineNumber: inner[0].token.lineNumber,\n          startLineStart: inner[0].token.lineStart,\n          startRange: inner[0].token.range,\n          inner: content,\n          endLineNumber: inner[0].token.lineNumber,\n          endLineStart: inner[0].token.lineStart,\n          endRange: inner[0].token.range\n        }\n      });\n    }\n    \n    function ast_js_to_ki(ast) {\n    \n      var ki_ast = [];\n      var acc = [];\n      var next = null;\n    \n      ast.forEach(function (el,i) {\n    \n        switch (el.token.type) {\n          case Token.Punctuator:\n            if (i == 0 && el.token.value != ':') {\n              ki_ast.push(el);\n            }\n            else {\n              acc.push(el);\n            }\n            break;\n          case Token.Identifier:\n          case Token.Keyword:\n            next = ast[i+1];\n            if (next === undefined || next.token.type != Token.Punctuator ||\n                (next.token.type == Token.Punctuator && next.token.value == ':')) {\n              if (acc.length == 0) {\n                ki_ast.push(el);\n              }\n              else {\n                acc.push(el);\n                transform(ki_ast, acc);\n                acc = [];\n              }\n            }\n            else {\n              acc.push(el);\n            }\n            break;\n          case Token.Delimiter:\n            // FIXME: here we're modifying el in place.\n            // We should probably avoid it.\n            if (!(el.token.inner.length > 0 && \n                  (el.token.inner[0].token.type == Token.Identifier &&\n                   el.token.inner[0].token.value == 'js'))) {\n                     el.token.inner = ast_js_to_ki(el.token.inner);\n                   }\n            ki_ast.push(el);\n            break;\n          default:\n            ki_ast.push(el);\n            break;\n        }\n      });\n    \n      return ki_ast;\n    }\n\n    var x = #{$x ...};\n    var ki_x = ast_js_to_ki(x);\n    letstx $ki_x ... = ki_x;\n\n    return #{\n      (function () { \n        _ki.init(this,'_ki');\n        return (_sexpr ($ki_x ...)); \n      }())\n    }\n  }\n}\n\nexport ki;\n\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"ki\",\n  \"version\": \"0.2.5\",\n  \"description\": \"lisp + mori, sweet.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/lantiga/ki.git\"\n  },\n  \"scripts\": {\n    \"test\": \"grunt test\"\n  },\n  \"keywords\": [\n    \"lisp\",\n    \"data\",\n    \"persistent\",\n    \"functional\",\n    \"clojure\",\n    \"clojurescript\",\n    \"macros\",\n    \"macro\",\n    \"sweet-macros\"\n  ],\n  \"bin\": {\n    \"ki\": \"bin/ki\"\n  },\n  \"author\": \"Luca Antiga http://lantiga.github.io\",\n  \"license\": \"MIT\",\n  \"readmeFilename\": \"README.md\",\n  \"dependencies\": {\n    \"grunt\": \"^0.4.5\",\n    \"mori\": \"~0.3.2\",\n    \"optimist\": \"~0.6.1\",\n    \"sweet.js\": \"~0.7.2\",\n    \"uglify-js\": \"~2.4.15\"\n  },\n  \"devDependencies\": {\n    \"mocha\": \"~2.0.1\",\n    \"expect.js\": \"~0.3.1\",\n    \"grunt-cli\": \"0.1.x\",\n    \"grunt-mocha-test\": \"~0.12.2\"\n  }\n}\n"
  },
  {
    "path": "src/ki.sjs",
    "content": "/**\n * ki: the lisp that macroexpands to JavaScript\n * MIT license http://www.opensource.org/licenses/mit-license.php/\n * Copyright (C) 2014 Luca Antiga http://lantiga.github.io\n */\n\nmacro _arr {\n  rule { () } => {\n  }\n\n  rule { ($arg) } => {\n    _sexpr $arg\n  }\n\n  rule { ($arg $args ...) } => {\n    _sexpr $arg, _arr ($args ...)\n  }\n}\n\nmacro _obj {\n  rule { () } => {\n  }\n  \n  rule { ((keyword $k) $v) } => {\n    _sexpr $k: _sexpr $v\n  }\n\n  rule { ((keyword $k) $v $args ...) } => {\n    _sexpr $k: _sexpr $v, _obj ($args ...)\n  }\n\n  rule { ($k $v) } => {\n    _sexpr $k: _sexpr $v\n  }\n\n  rule { ($k $v $args ...) } => {\n    _sexpr $k: _sexpr $v, _obj ($args ...)\n  }\n}\n\nmacro _args {\n  rule { () } => {\n  }\n\n  rule { ($arg) } => {\n    _sexpr $arg\n  }\n\n  rule { ($arg $args ...) } => {\n    _sexpr $arg, _args ($args ...)\n  }\n}\n\nmacro _x {\n  case { $ctx null } => {\n    throwSyntaxError('ki','<null> is not a valid literal, use nil',#{$ctx})\n  }\n  case { $ctx undefined } => {\n    throwSyntaxError('ki','<undefined> is not a valid literal, use nil',#{$ctx})\n  }\n  case { _ nil } => {\n    return #{null}\n  }\n  case { _ $x} => {\n    return #{$x}\n  }\n}\n\nmacro _throw {\n  case { $ctx + } => {\n    throwSyntaxError('Unexpected token +','(+ ...) unsupported, use (add ...) instead',#{$ctx})\n  }\n  case { $ctx - } => {\n    throwSyntaxError('Unexpected token -','(- ...) unsupported, use (sub ...) instead',#{$ctx})\n  }\n  case { $ctx * } => {\n    throwSyntaxError('Unexpected token *','(* ...) unsupported, use (mul ...) instead',#{$ctx})\n  }\n  //case { $ctx / } => {\n  //  throwSyntaxError('Unexpected token /','(/ ...) unsupported, use (div ...) instead',#{$ctx})\n  //}\n}\n\nmacro _ns {\n  case { _ $ns $sexprs ... } => {\n    var nsname = unwrapSyntax(#{$ns});\n    letstx $nsname = [makeValue(nsname,#{$ns})];\n    return #{\n      (function () {\n        _ki.init(this,$nsname);\n        _return_sexprs ($sexprs ...);\n      }())\n    }\n  }\n}\n\nmacro _def {\n  case { _ $n $sexpr } => {\n    var varname = unwrapSyntax(#{$n});\n    letstx $varname = [makeValue(varname,#{$n})];\n    return #{\n      (function () {\n        _ki_ns_ctx[$varname] = _sexpr $sexpr;\n        _ki.namespaces[_ki_ns_name].vars.$n = _ki_ns_ctx[$varname]\n        return _ki_ns_ctx[$varname];\n      }())\n    };\n  }\n}\n\nmacro _count {\n  case { $m ($x(,) ...) } => {\n    var n = #{$x ...}.length;\n    letstx $n = [makeValue(n,#{$m})];\n    return #{$n};\n  }\n}\n\nmacro _fnmap {\n  rule { ([$args ...] $sexprs ...), $rest(,)... } => {\n    _count ($args(,)...): _sexpr (fn [$args ...] $sexprs ...), _fnmap $rest(,)...\n  }\n  rule { ([$args ...] $sexprs ...) } => {\n    _count ($args(,)...): _sexpr (fn [$args ...] $sexprs ...)\n  }\n}\n\nmacro _destr { \n  rule { ([$ $a], $v) } => {\n    var f = $v[0];\n    _destr($a, f)\n  }\n  rule { ([$ $a $b ...], $v) } => {\n    var f = $v[0];\n    _destr($a, f)\n    var r = $v.slice(1);\n    _destr([$ $b ...], r)\n  }\n\n  rule { ({$ $a $b}, $v) } => {\n    var f = $v[$b];\n    _destr($a, f)\n  }\n  rule { ({$ $a $b $c $d ...}, $v) } => {\n    var f = $v[$b];\n    _destr($a, f)\n    _destr({$ $c $d ...}, $v)\n  }\n\n  rule { ([$a], $v) } => {\n    var f = _sexpr(first $v);\n    _destr($a, f)\n  }\n  rule { ([$a $b ...], $v) } => {\n    var f = _sexpr(first $v);\n    _destr($a, f)\n    var r = _sexpr(rest $v)\n    _destr([$b ...], r)\n  }\n\n  rule { ({$a $b}, $v) } => {\n    var f = _sexpr(get $v $b);\n    _destr($a, f)\n  }\n  rule { ({$a $b $c $d ...}, $v) } => {\n    var f = _sexpr(get $v $b);\n    _destr($a, f)\n    _destr({$c $d ...}, $v)\n  }\n\n  rule { ($a, $v) } => {\n    var $a = $v;\n  }\n}\n\nmacro _let {\n  rule { ([$k $v $rest ...] $sexprs ...) } => {\n    return (function (v) {\n      _destr($k, v)\n      _let ([$rest ...] $sexprs ...)\n    }.call(this,_sexpr $v));\n  }\n  rule { ([] $sexprs ...) } => {\n    _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _letc {\n  rule { ([[$ks ...] ($fn ...)] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$ks ...] $sexprs ... nil))\n  }\n  rule { ([$k ($fn ...)] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$k] $sexprs ... nil))\n  }\n  rule { ([[$ks ...] ($fn ...) $rest ...] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$ks ...] \n                     (letc [$rest ...] $sexprs ...) nil))\n  }\n  rule { ([$k ($fn ...) $rest ...] $sexprs ...) } => {\n    _sexpr ($fn ... (fn [$k] \n                     (letc [$rest ...] $sexprs ...) nil))\n  }\n}\n\nmacro _loop_let {\n  rule { ([$k $v $rest ...] $i $vals $sexprs ...) } => {\n    return (function (v) {\n      _destr($k, v)\n      _loop_let ([$rest ...] ($i+1) $vals $sexprs ...)\n    }($vals === undefined ? _sexpr $v : $vals[$i]));\n  }\n  rule { ([] $i $vals $sexprs ...) } => {\n    _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _chain {\n  rule { (($method $args ...)) } => {\n    . _sexpr $method (_args ($args ...))\n  }\n  rule { ($property) } => {\n    . _sexpr $property\n  }\n  rule { (($method $args ...) $rest ...) } => {\n    . _sexpr $method (_args ($args ...)) _chain ($rest ...)\n  }\n  rule { ($property $rest ...) } => {\n    . _sexpr $property _chain ($rest ...)\n  }\n}\n\nmacro _doto {\n  rule { ($obj ($method $args ...)) } => {\n    $obj.$method(_args ($args ...));\n  }\n  rule { ($obj ($method $args ...) $rest ...) } => {\n    $obj.$method(_args ($args ...));\n    _doto ($obj $rest ...)\n  }\n}\n\nmacro _sexpr {\n\n  rule { () } => { \n  }\n  \n  /*__macros__*/\n\n  rule { (ns $ns:ident $sexprs ...) } => {\n    _ns $ns $sexprs ...\n  }\n\n  rule { (use ) } => {\n  }\n  rule { (use $module $modules ...) } => {\n    (function () {\n      _ki.intern.bind(_ki_ns_ctx)(_ki.modules.$module);\n      _sexpr (use $modules ...);\n    }())\n  }\n\n  rule { (ns_get $ns:ident $x) } => {\n    _sexpr _ki.namespaces.$ns.vars.$x\n  }\n\n  rule { (js $body ...) } => {\n    $body ...\n  }\n\n  rule { (fn $name:ident [$args ...] $sexprs ...) } => {\n    function $name($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }\n  }\n\n  rule { (fn [$args ...] $sexprs ...) } => {\n    function ($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }\n  }\n\n  rule { (fnth $name:ident [$args ...] $sexprs ...) } => {\n    function $name($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }.bind(this)\n  }\n\n  rule { (fnth [$args ...] $sexprs ...) } => {\n    function ($args(,)...) {\n      _return_sexprs ($sexprs ...)\n    }.bind(this)\n  }\n\n  rule { (fn $name:ident $sexprs ...) } => {\n    function $name() {\n      var fnmap = {_fnmap $sexprs(,) ...};\n      var max_arity = 0;\n      for (var a in fnmap) {\n        max_arity = a > max_arity ? a : max_arity;\n      }\n      fnmap[null] = fnmap[max_arity];\n      var f = fnmap[arguments.length] || fnmap[null];\n      return f.apply(this,arguments);\n    }\n  }\n\n  rule { (fn $sexprs ...) } => {\n    (function () {\n      var fnmap = {_fnmap $sexprs(,) ...};\n      var max_arity = 0;\n      for (var a in fnmap) {\n        max_arity = a > max_arity ? a : max_arity;\n      }\n      fnmap[null] = fnmap[max_arity];\n      return function () {\n        var f = fnmap[arguments.length] || fnmap[null];\n        return f.apply(this,arguments);\n      }\n    }.call(this))\n  }\n\n  rule { (if $cond $sthen $selse) } => {\n    (function () {\n      if (_sexpr (truthy $cond)) {\n        return _sexpr $sthen;\n      }\n      return _sexpr $selse;\n    }.call(this))\n  }\n\n  rule { (ifNot $cond $sthen $selse) } => {\n    _sexpr (if (not $cond) $sthen $selse)\n  }\n\n  rule { (when $cond $sthen) } => {\n    (function () {\n      if (_sexpr (truthy $cond)) {\n        return _sexpr $sthen;\n      }\n      return;\n    }.call(this))\n  }\n\n  rule { (whenNot $cond $sthen) } => {\n    _sexpr (when (not $cond) $sthen)\n  }\n\n  rule { (cond $cond1 $body1 $rest ...) } => {\n    (function () {\n      if (_sexpr (truthy $cond1)) {\n        return _sexpr $body1;\n      }\n      return _sexpr (cond $rest ...);\n    }.call(this))\n  }\n  rule { (cond) } => {\n    undefined\n  }\n\n  rule { (and $sexpr) } => {\n    _sexpr (truthy $sexpr)\n  }\n  rule { (and $sexpr $sexprs ...) } => {\n    _sexpr (truthy $sexpr) && _sexpr (and $sexprs ...)\n  }\n\n  rule { (or $sexpr) } => {\n    _sexpr (truthy $sexpr)\n  }\n  rule { (or $sexpr $sexprs ...) } => {\n    _sexpr (truthy $sexpr) || _sexpr (or $sexprs ...)\n  }\n\n  rule { ($[let] [$bindings ...] $sexprs ...) } => {\n    (function () {\n      _let ([$bindings ...] $sexprs ...)\n    }.call(this))\n  }\n\n  rule { (letc [$bindings ...] $sexprs ...) } => {\n    _letc ([$bindings ...] $sexprs ...)\n  }\n\n  rule { (do $sexprs ...) } => {\n    (function () {\n      _return_sexprs ($sexprs ...)\n    }.call(this))\n  }\n\n  rule { (while $cond $sexpr) } => {\n    (function () {\n      while (_sexpr (truthy $cond)) {\n        _sexpr $sexpr;\n      }\n    }.call(this))\n  }\n\n  rule { (loop [$bindings ...] $sexprs ...) } => {\n    (function () {\n      var res = {};\n      do {\n        res = (function () {\n          _loop_let ([$bindings ...] 0 (res._ki_vals) $sexprs ...);\n        }());\n      }\n      while ((res || 0)._ki_recur);\n      return res;\n    }.call(this))\n  }\n\n  rule { (recur $args ...) } => {\n    {_ki_recur: true, _ki_vals: [_args ($args ...)]}\n  }\n\n  rule { (def $n:ident $sexpr) } => {\n    _def $n $sexpr\n  }\n\n  // TODO: docstring\n  rule { (defn $n:ident [$args ...] $sexprs ...) } => {\n    _sexpr (def $n (fn [$args ...] $sexprs ...))\n  }\n \n  rule { (defn $n:ident ([$args ...] $sexprs ...) $rest ...) } => {\n    _sexpr (def $n (fn ([$args ...] $sexprs ...) $rest ...))\n  }\n\n  rule { (bind $obj $fn) } => {\n    _sexpr $fn.bind($obj)\n  }\n\n  rule { (defmulti $n:ident $dispatch_fn) } => {\n    _sexpr \n       (defn $n [] \n        (js\n         if ($n._ki_methods === undefined || $n._ki_methods.length == 0) {\n           return undefined;\n         }\n         var dispatch_fn = _sexpr $dispatch_fn;\n         for (var i=0; i<$n._ki_methods.length; i++) {\n           var dispatch_value = $n._ki_methods[i][0];\n           var fn = $n._ki_methods[i][1];\n           if (equals(dispatch_fn.apply(this,arguments),dispatch_value)) {\n             return fn.apply(this,arguments);\n           }\n         }) nil)\n  }\n \n  rule { (defmethod $n:ident $dispatch_val [$args ...] $sexprs ...) } => {\n    (function () {\n      if ($n._ki_methods === undefined) {\n        $n._ki_methods = [];\n      }\n      $n._ki_methods.push([_sexpr $dispatch_val,_sexpr (fn [$args ...] $sexprs ...)])\n    }())\n  }\n\n  rule { (threadf $v ($[.]$fn $args ...)) } => {\n    _sexpr (.$fn $v $args ...)\n  }\n  rule { (threadf $v ($[.]$fn $args ...) $x ...) } => {\n    _sexpr (threadf (.$fn $v $args ...) $x ...)\n  }\n \n  rule { (threadf $v ($fn $args ...)) } => {\n    _sexpr ($fn $v $args ...)\n  }\n  rule { (threadf $v ($fn $args ...) $x ...) } => {\n    _sexpr (threadf ($fn $v $args ...) $x ...)\n  }\n  rule { (threadf $v $el) } => {\n    _sexpr ($el $v)\n  }\n  rule { (threadf $v $el $x ...) } => {\n    _sexpr (threadf ($el $v) $x ...)\n  }\n\n  //rule { (threadl $v ($[.]$fn $args ...)) } => {\n  //  _sexpr (.$fn $args ... $v)\n  //}\n  //rule { (threadl $v ($[.]$fn $args ...) $x ...) } => {\n  //  _sexpr (threadl (.$fn $args ... $v) $x ...)\n  //}\n\n  rule { (threadl $v ($fn $args ...)) } => {\n    _sexpr ($fn $args ... $v)\n  }\n  rule { (threadl $v ($fn $args ...) $x ...) } => {\n    _sexpr (threadl ($fn $args ... $v) $x ...)\n  }\n  rule { (threadl $v $el) } => {\n    _sexpr ($el $v)\n  }\n  rule { (threadl $v $el $x ...) } => {\n    _sexpr (threadl ($el $v) $x ...)\n  }\n\n  rule { (chain $obj $rest ...) } => {\n    _sexpr $obj _chain ($rest ...)\n  }\n\n  rule { (doto $obj $rest ...) } => {\n    (function () {\n      _doto ($obj $rest ...)\n      return $obj;\n    }.call(this))\n  }\n\n  rule { (atom $val) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: null, \n      _ki_rcb: null }\n  }\n\n  rule { (atom $val $write_cb) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: _sexpr $write_cb, \n      _ki_rcb: null }\n  }\n\n  rule { (atom $val $write_cb $read_cb) } => {\n    { _ki_val: _sexpr $val, \n      _ki_wcb: _sexpr $write_cb, \n      _ki_rcb: _sexpr $read_cb }\n  }\n\n  rule { (reset $ref $val) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      var val = _sexpr $val;\n      var prev_val = ref._ki_val;\n      ref._ki_val = val;\n      if (ref._ki_wcb) {\n        ref._ki_wcb(val, prev_val);\n      }\n      return val;\n    }.call(this))\n  }\n\n  rule { (swap $ref $fn $args ...) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      var val = ref._ki_val;\n      return _sexpr (reset ref ($fn val $args ...))\n    }.call(this))\n  }\n\n  rule { (deref $ref) } => {\n    (function () {\n      var ref = _sexpr $ref;\n      if (ref._ki_rcb) {\n        ref._ki_rcb(ref._ki_val);\n      }\n      return ref._ki_val;\n    }.call(this))\n  }\n\n  rule { (try $body (catch $e $catch_expr)) } => {\n    (function () {\n      try {\n        _sexpr $body\n      }\n      catch ($e) {\n        _sexpr $catch_expr\n      }\n    }.call(this))\n  }\n\n  rule { (try $body (catch $e $catch_expr) (finally $finally_expr)) } => {\n    (function () {\n      var ret;\n      try {\n        ret = _sexpr $body;\n      }\n      catch ($e) {\n        ret = _sexpr $catch_expr;\n      }\n      finally {\n        _sexpr $finally_expr;\n      }\n      return ret;\n    }.call(this))\n  }\n\n  rule { (throw $x) } => {\n    (function () {\n      throw(_sexpr $x);\n    }.call(this))\n  }\n  \n  rule { (+ $args ...) } => {\n    _throw +\n  }\n\n  rule { (- $args ...) } => {\n    _throw -\n  }\n\n  rule { (* $args ...) } => {\n    _throw *\n  }\n\n  //rule { (/ $args ...) } => {\n  //  _throw /\n  //}\n\n  rule { ($[.] $fn $obj $args ...) } => {\n    _sexpr $obj . $fn (_args ($args ...))\n  }\n\n  rule { ($fn $args ...) } => {\n    _sexpr $fn (_args ($args ...))\n  }\n\n  rule { [$ $x ...] } => {\n    [_arr ($x ...)]\n  }\n\n  rule { {$ $x ...} } => {\n    {_obj ($x ...)}\n  }\n\n  rule { [$x ...] } => {\n    _sexpr (vector $x ...)\n  }\n\n  rule { {$x ...} } => {\n    _sexpr (hashMap $x ...)\n  }\n\n  rule { $x } => { \n    _x $x\n  }\n\n}\n\nmacro _return_sexprs {\n  rule { ($sexpr) } => {\n    return _sexpr $sexpr\n  }\n  rule { ($sexpr $sexprs ...) } => {\n    _sexpr $sexpr; _return_sexprs ($sexprs ...)\n  }\n}\n\nmacro _sexprs {\n  rule { ($sexpr) } => {\n    _sexpr $sexpr\n  }\n  rule { ($sexpr $sexprs ...) } => {\n    _sexpr $sexpr _sexprs ($sexprs ...)\n  }\n}\n\nmacro ki {\n  case { _ require core} => {\n    return #{\n      _ki = {\n        init: function (self, ns_name) {\n          if (_ki.namespaces[ns_name] === undefined) {\n            _ki.namespaces[ns_name] = { vars: {} };\n          }\n          self._ki_ns_name = ns_name;\n          self._ki_ns_ctx = self;\n          _ki.intern.bind(self)(_ki.modules.core);\n          _ki.intern.bind(self)(_ki.modules.mori);\n          _ki.intern.bind(self)(_ki.modules);\n          _ki.intern.bind(self)(_ki.namespaces[_ki_ns_name].vars);\n        },\n        intern: function (obj) {\n          for (var e in obj) {\n            this[e] = obj[e];\n          }\n        },\n        namespaces: {},\n        modules: {\n          core: {\n            truthy: function(x) {\n              return x === false || x == null ? false : true;\n            },\n            falsey: function(x) {\n              return !truthy(x);\n            },\n            not: function(x) {\n              return !truthy(x);\n            },\n            eq: function() { \n              return equals.apply(null,arguments); \n            },\n            neq: function() {\n              return !equals.apply(null,arguments); \n            },\n            add: function() {\n              var res = 0.0;\n              for (var i=0; i<arguments.length; i++) {\n                res += arguments[i];\n              }\n              return res;\n            },\n            sub: function() {\n              var res = arguments[0];\n              for (var i=1; i<arguments.length; i++) {\n                res -= arguments[i];\n              }\n              return res;\n            },\n            mul: function() {\n              var res = 1.0;\n              for (var i=0; i<arguments.length; i++) {\n                res *= arguments[i];\n              }\n              return res;\n            },\n            div: function() {\n              var res = arguments[0];\n              for (var i=1; i<arguments.length; i++) {\n                res /= arguments[i];\n              }\n              return res;\n            },\n            mod: function(a,b) {\n              return a % b;\n            },\n            lt: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] < arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            gt: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] > arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            leq: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] <= arguments[i+1];\n                if (!res) break;\n              }\n              return res;\n            },\n            geq: function() {\n              var res = true;\n              for (var i=0; i<arguments.length-1; i++) {\n                res = res && arguments[i] >= arguments[i+1];\n              }\n              return res;\n            },\n            prn: function() {\n              console.log.apply(console,arguments);\n            },\n            str: function() {\n              return String.prototype.concat.apply('',arguments);\n            }\n          },\n          mori: (function () { \n            try {\n              return require('ki/node_modules/mori') \n            }\n            catch (e) {\n              try {\n                return require('mori') \n              }\n              catch (e) {\n                return mori;\n              }\n            }\n          }())\n        }\n      }; \n    }\n  }\n  case { _ require $module as $name} => {\n    var module_name = unwrapSyntax(#{$module});\n    letstx $module_name = [makeValue(module_name,#{$module})];\n    return #{_ki.modules.$name = (function () { \n      try { return require($module_name) } \n      catch (e) { return $name }\n    }());}\n  }\n  case { _ require $module} => {\n    var module_name = unwrapSyntax(#{$module});\n    letstx $module_name = [makeValue(module_name,#{$module})];\n    return #{_ki.modules.$module = (function () { \n      try { return require($module_name) } \n      catch (e) { return $module }\n    }());}\n  }\n\n  case {_ macro ($x ...) ($y ...)} => {\n    return #{};\n  }\n\n  case { $ki ($x ...) } => {\n    \n    var Token = {\n      BooleanLiteral: 1,\n      EOF: 2,\n      Identifier: 3,\n      Keyword: 4,\n      NullLiteral: 5,\n      NumericLiteral: 6,\n      Punctuator: 7,\n      StringLiteral: 8,\n      RegularExpression: 9,\n      Template: 10,\n      Delimiter: 11\n    }\n    \n    function transform(ki_ast, inner) {\n      var content = inner.map(function (el) { return el; });\n      if (content[0].token.type == Token.Punctuator && \n          content[0].token.value == ':') {\n        content.shift();\n        var name = content.shift();\n        content.forEach(function (el,i) {\n          name.token.value += el.token.value;\n        });\n        name.token.type = Token.StringLiteral;\n        content = [{\n          token: {\n            type: Token.Identifier,\n            value: 'keyword',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext},\n          name];\n        }\n      else if (content.length == 3 && \n          content[1].token.type == Token.Punctuator && \n          content[1].token.value == '/') {\n        content = [{\n          token: {\n            type: Token.Identifier,\n            value: 'ns_get',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext},\n          content[0], content[2]];\n        }\n      else {\n        content.unshift({\n          token: {\n            type: Token.Identifier,\n            value: 'js',\n            lineNumber: inner[0].token.lineNumber,\n            lineStart: inner[0].token.lineStart,\n            range: inner[0].token.range},\n          context: inner[0].context,\n          deferredContext: inner[0].deferredContext});\n      }\n      ki_ast.push({\n        token: {\n          type: Token.Delimiter,\n          value: '()',\n          startLineNumber: inner[0].token.lineNumber,\n          startLineStart: inner[0].token.lineStart,\n          startRange: inner[0].token.range,\n          inner: content,\n          endLineNumber: inner[0].token.lineNumber,\n          endLineStart: inner[0].token.lineStart,\n          endRange: inner[0].token.range\n        }\n      });\n    }\n    \n    function ast_js_to_ki(ast) {\n    \n      var ki_ast = [];\n      var acc = [];\n      var next = null;\n    \n      ast.forEach(function (el,i) {\n    \n        switch (el.token.type) {\n          case Token.Punctuator:\n            if (i == 0 && el.token.value != ':') {\n              ki_ast.push(el);\n            }\n            else {\n              acc.push(el);\n            }\n            break;\n          case Token.Identifier:\n          case Token.Keyword:\n            next = ast[i+1];\n            if (next === undefined || next.token.type != Token.Punctuator ||\n                (next.token.type == Token.Punctuator && next.token.value == ':')) {\n              if (acc.length == 0) {\n                ki_ast.push(el);\n              }\n              else {\n                acc.push(el);\n                transform(ki_ast, acc);\n                acc = [];\n              }\n            }\n            else {\n              acc.push(el);\n            }\n            break;\n          case Token.Delimiter:\n            // FIXME: here we're modifying el in place.\n            // We should probably avoid it.\n            if (!(el.token.inner.length > 0 && \n                  (el.token.inner[0].token.type == Token.Identifier &&\n                   el.token.inner[0].token.value == 'js'))) {\n                     el.token.inner = ast_js_to_ki(el.token.inner);\n                   }\n            ki_ast.push(el);\n            break;\n          default:\n            ki_ast.push(el);\n            break;\n        }\n      });\n    \n      return ki_ast;\n    }\n\n    var x = #{$x ...};\n    var ki_x = ast_js_to_ki(x);\n    letstx $ki_x ... = ki_x;\n\n    return #{\n      (function () { \n        _ki.init(this,'_ki');\n        return (_sexpr ($ki_x ...)); \n      }())\n    }\n  }\n}\n\nexport ki;\n\n"
  },
  {
    "path": "test/core.js",
    "content": "\nvar expect = require(\"expect.js\");\n\n\ndescribe(\"require core\", function() {\n\n  it(\"should create a _ki object\", function() {\n    ki require core\n    expect(typeof _ki).to.not.eql('undefined')\n  });\n\n  it(\"should make mori available\", function() {\n    ki require core\n    var mori = _ki.modules.mori;\n    expect(ki (vector 1 2 3)).to.eql(mori.vector(1,2,3))\n  });\n\n});\n\ndescribe(\"sexpressions\", function() {\n\n  it(\"should allow to call js functions\", function() {\n    ki require core\n    var f0 = function() { return 1; }\n    var f1 = function(a) { return a; }\n    var f2 = function(a, b) { return [a, b]; }\n    expect(ki (f0)).to.eql(1);\n    expect(ki (f1 1)).to.eql(1);\n    expect(ki (f2 1 2)).to.eql([1,2]);\n  });\n\n  it(\"should allow to use attribute access notation as function name\", function() {\n    ki require core\n    var foo0 = { bar: function() { return 1; } }\n    var foo1 = { bar: function(a) { return a; } }\n    var foo2 = { bar: function(a,b) { return [a, b]; } }\n    var goo0 = { bar: { baz : function() { return 1; } } }\n    var goo1 = { bar: { baz : function(a) { return a; } } }\n    var goo2 = { bar: { baz : function(a, b) { return [a, b]; } } }\n    expect(ki (foo0.bar)).to.eql(1);\n    expect(ki (foo1.bar 1)).to.eql(1);\n    expect(ki (foo2.bar 1 2)).to.eql([1,2]);\n    expect(ki (goo0.bar.baz)).to.eql(1);\n    expect(ki (goo1.bar.baz 1)).to.eql(1);\n    expect(ki (goo2.bar.baz 1 2)).to.eql([1,2]);\n  });\n\n  it(\"should allow to use attribute access notation as function argument\", function() {\n    ki require core\n    var goo1 = { bar: { baz : function(a) { return a; } } }\n    var goo2 = { bar: { baz : function(a, b) { return [a, b]; } } }\n    var goo3 = { bar: { baz : function(a, b, c) { return [a, b, c]; } } }\n    var data = { a: { b: 0 }}\n    expect(ki (goo1.bar.baz data.a.b)).to.eql(0);\n    expect(ki (goo2.bar.baz data.a.b 1)).to.eql([0,1]);\n    expect(ki (goo3.bar.baz data.a.b 1 data.a.b)).to.eql([0,1,0]);\n  });\n\n  it(\"should allow to call mori functions on mori data structures\", function() {\n    ki require core\n    var foo = ki (vector 1 2 3)\n    expect(ki (conj foo 4)).to.eql(ki (vector 1 2 3 4));\n  });\n\n});\n\ndescribe(\"lambdas\", function() {\n\n  it(\"should allow to define anonymous functions and call them from js\", function() {\n    ki require core\n    var f = ki (fn [x] (sum x 1))\n    expect(f(1)).to.eql(2);\n  });\n\n  it(\"should allow to define anonymous functions and use them in ki\", function() {\n    ki require core\n    expect(\n      ki (toJs (map (fn [x] (sum x 1)) (vector 1 2 3)))\n      ).to.eql([2,3,4]);\n  });\n\n  it(\"should allow to define named anonymous functions and call them recursively\", function() {\n    ki require core\n    expect(\n      ki (toJs (map (fn foobar[x] (if (eq x 1) x (foobar (dec x)))) (vector 1 2 3)))\n      ).to.eql([1,1,1]);\n  });\n\n});\n\ndescribe(\"interoperability\", function() {\n\n  it(\"should allow to call js within ki\", function() {\n    ki require core\n    expect(\n      ki (toJs (map (js function(x) { return x + 1; }) (vector 1 2 3)))\n      ).to.eql([2,3,4]);\n  });\n\n  it(\"should allow to pass a ki fn as a js callback\", function() {\n    ki require core\n    expect(\n      [1,2,3,4].map(ki (fn [x] (isEven x)))).to.eql([false,true,false,true]);\n  });\n\n});\n\ndescribe(\"local bindings and lexical scope\", function() {\n\n  it(\"should allow to define local bindings in a let form and ensure proper lexical scope\", function() {\n    ki require core\n    expect(\n      ki (toJs\n           (let [a 1 \n                  b 2]\n              (vector a b)))\n      ).to.eql([1,2]);\n    expect(\n      ki (toJs\n           (let [a 0]\n            (let [a (inc a) \n                   b (inc a)]\n               (vector a b))))\n      ).to.eql([1,2]);\n    var c = {d: 1};\n    var mori = _ki.modules.mori;\n    expect(\n      ki (let [a c.d\n                b (inc a)\n                e :e]\n            (let [a (inc a) \n                   b (inc b)] \n              a)\n            (vector a b e))\n      ).to.eql(mori.vector(1,2,mori.keyword('e')));\n  });\n\n});\n\ndescribe(\"namespaces\", function() {\n\n  it(\"should allow to define multiple namespaces and an anonymous namespace\", function() {\n    ki require core\n    ki (def a 0);\n    ki (defn b [x] x);\n    ki (ns foo (def a 1));\n    ki (ns bar (def a 2));\n    expect(ki (identity a)).to.eql(0);\n    expect(ki (b 0)).to.eql(0);\n    expect(ki (ns foo a)).to.eql(1);\n    expect(ki (ns bar a)).to.eql(2);\n  });\n\n  it(\"should allow to use fully qualified identifiers\", function() {\n    ki require core\n    ki (def a 0);\n    ki (ns foo (def a 1));\n    ki (ns bar (def a 2));\n    expect(\n      ki (toJs (vector a foo/a bar/a))\n      ).to.eql([0,1,2]);\n  });\n\n  it(\"should allow to intern modules\", function() {\n    ki require core\n    _ki.modules['amodule'] = { bar: function() { return 1; }};\n    _ki.modules['bmodule'] = { baz: function() { return 2; }};\n    ki (ns foo \n        (use amodule bmodule));\n    expect(\n      ki (toJs (ns foo (vector (bar) (baz))))\n      ).to.eql([1,2]);\n  });\n\n});\n\ndescribe(\"truthiness\", function() {\n\n  it(\"should have truthy return false only for boolean false, nil (and js null and undefined)\", function() {\n    ki require core\n    expect(ki (truthy false)).to.eql(false);\n    expect(ki (truthy nil)).to.eql(false);\n    expect(ki (truthy (js null))).to.eql(false);\n    expect(ki (truthy (js undefined))).to.eql(false);\n    expect(ki (truthy \"\")).to.eql(true);\n    expect(ki (truthy 0)).to.eql(true);\n    expect(ki (falsey false)).to.eql(true);\n    expect(ki (falsey 0)).to.eql(false);\n    expect(ki (not (falsey false))).to.eql(false);\n    expect(ki (not (falsey 0))).to.eql(true);\n  });\n\n});\n\ndescribe(\"logical operators\", function() {\n\n  it(\"should be consistent with definition of truthiness\", function() {\n    ki require core\n    expect(ki (and \"\" 0)).to.eql(true);\n    expect(ki (and \"\" 0 nil)).to.eql(false);\n    expect(ki (or \"\" 0)).to.eql(true);\n    expect(ki (or false nil)).to.eql(false);\n    expect(ki (and \"\" (not (or false nil)) 0)).to.eql(true);\n  });\n\n  it(\"should short circuit\", function() {\n    ki require core\n    expect(ki (and true false undefined_symbol)).to.eql(false);\n    expect(ki (or false true undefined_symbol)).to.eql(true);\n  });\n});\n\ndescribe(\"equality\", function() {\n\n  it(\"should operate on deep data structures\", function() {\n    ki require core\n    expect(ki (eq {\"a\" 1 \"b\" [{\"c\" 1} 2]} {\"a\" 1 \"b\" [{\"c\" 1} 2]})).to.eql(true);\n    expect(ki (eq {\"a\" 1 \"b\" [{\"c\" 3} 2]} {\"a\" 1 \"b\" [{\"c\" 1} 2]})).to.eql(false);\n    expect(ki (neq {\"a\" 1 \"b\" [{\"c\" 3} 2]} {\"a\" 1 \"b\" [{\"c\" 1} 2]})).to.eql(true);\n  });\n\n});\n\ndescribe(\"flow control\", function() {\n\n  it(\"should allow branching consistently with definition of truthiness\", function() {\n    ki require core\n    expect(ki (when (eq 1 1) \"foo\")).to.eql(\"foo\");\n    expect(ki (whenNot (eq 1 2) \"foo\")).to.eql(\"foo\");\n    expect(ki (if \"\" \"foo\" \"bar\")).to.eql(\"foo\");\n    expect(ki (if 0 \"foo\" \"bar\")).to.eql(\"foo\");\n    expect(ki (if nil \"foo\" \"bar\")).to.eql(\"bar\");\n    expect(ki (ifNot \"\" \"foo\" \"bar\")).to.eql(\"bar\");\n  });\n\n  it(\"should have cond be consistent with definition of truthiness\", function() {\n    ki require core\n    expect(\n      ki (cond\n           (eq 1 2) \"foo\"\n           nil \"bar\"\n           \"\" \"baz\")).to.eql(\"baz\");\n    expect(\n      ki (cond\n           (eq 1 2) \"foo\"\n           nil \"bar\"\n           :else \"baz\")).to.eql(\"baz\");\n  });\n\n  it(\"should have cond short circuit\", function() {\n    ki require core\n    expect(ki (cond\n                (eq 1 2) \"foo\"\n                true \"bar\"\n                undefined_symbol \"baz\")).to.eql(\"bar\");\n  });\n\n});\n\ndescribe(\"data literals\", function() {\n\n  it(\"should allow to create vectors\", function() {\n    ki require core\n    expect(ki (eq [1 2 3 4] (vector 1 2 3 4))).to.eql(true);\n  });\n\n  it(\"should allow to create hash maps\", function() {\n    ki require core\n    expect(ki (eq {\"a\" 2 \"b\" 4} (hashMap \"a\" 2 \"b\" 4))).to.eql(true);\n  });\n\n  it(\"should allow to create hash maps and evaluate forms\", function() {\n    ki require core\n    expect(ki (eq {\"a\" (inc 1) (str \"b\") 4} (hashMap \"a\" 2 \"b\" 4))).to.eql(true);\n  });\n\n  it(\"should allow to create deeply nested data structures\", function() {\n    ki require core\n    expect(ki (eq {\"a\" [2 [3 4]] \"b\" {\"c\" 5 [6 7] \"d\"}} \n                (hashMap \"a\" (vector 2 (vector 3 4)) \n                          \"b\" (hashMap \"c\" 5 (vector 6 7) \"d\")))).to.eql(true);\n  });\n\n  it(\"should allow to create js arrays\", function() {\n    ki require core\n    expect(ki (do [$ 1 2 3 4])).to.eql([1,2,3,4]);\n  });\n\n  it(\"should allow to create js objects\", function() {\n    ki require core\n    expect(ki (do {$ \"a\" 1 \"b\" 2})).to.eql({a: 1, b: 2});\n  });\n\n  it(\"should allow to create nested js objects\", function() {\n    ki require core\n    expect(ki (do {$ \"a\" {$ \"c\" [$ 3 4]} \"b\" 2})).to.eql({a: {c: [3, 4]}, b: 2});\n  });\n\n\n});\n\ndescribe(\"recursion\", function() {\n\n  it(\"should allow to express simple recursion\", function() {\n    ki require core\n    ki (defn fib [n]\n        (cond \n         (eq n 0) 0\n         (eq n 1) 1\n         \"else\" (sum (fib (js n-1)) (fib (js n-2)))));\n    expect(ki (fib 20)).to.eql(6765);\n  });\n\n  it(\"should allow to recur using loop/recur without blowing the stack\", function() {\n    ki require core\n    ki (defn fib [n]\n        (loop [a 0 b (inc a) iter 0]\n         (if (js iter == n) a\n          (recur b (js a + b) (inc iter)))));\n    expect(ki (fib 20)).to.eql(6765);\n    expect(ki (fib 500)).to.eql(1.394232245616977e+104);\n  });\n\n});\n\ndescribe(\"keywords\", function() {\n\n  it(\"should be usable in collections\", function() {\n    ki require core\n    var mori = _ki.modules.mori;\n    expect(ki (do [:a 1 :b {:c 2}])).to.eql(\n      mori.vector(mori.keyword('a'),1,\n        mori.keyword('b'),mori.hashMap(mori.keyword('c'),2)));\n  });\n\n  //it(\"should evaluate to themselves\", function() {\n  //  ki require core\n  //  var mori = _ki.modules.mori;\n  //  expect(ki (do (:a))).to.eql(mori.keyword('a'));\n  //});\n\n  //it(\"should evaluate as keys to get values from collections\", function() {\n  //  ki require core\n  //  var mori = _ki.modules.mori;\n  //  expect(ki (:a {:a 1 :b 2})).to.eql(1);\n  //});\n\n});\n\ndescribe(\"arity\", function() {\n\n  it(\"should allow calling functions without arity constraints, as in js\", function() {\n    ki require core\n    ki (defn foo [a] (str \"Hello \" a))\n    expect(\n      ki (foo 1 2)\n      ).to.eql(\"Hello 1\");\n    expect(\n      ki (foo)\n      ).to.eql(\"Hello undefined\");\n  });\n\n  it(\"should allow to define functions with multiple arities\", function() {\n    ki require core\n    ki (defn foo \n         ([a] (str \"Hello \" a))\n         ([a b] (str \"There \" a \" \" b)))\n    expect(\n      ki (foo 1)\n      ).to.eql(\"Hello 1\");\n    expect(\n      ki (foo 1 2)\n      ).to.eql(\"There 1 2\");\n  });\n\n  it(\"should allow to define named anonymous functions with multiple arities and refer to the name within the body\", function() {\n    ki require core\n    var f = ki (fn self\n                 ([] (self \"world\"))\n                 ([who] (str \"Hello \" who \"!\")))\n    expect(f()).to.eql(\"Hello world!\");\n    expect(f(\"yellow\")).to.eql(\"Hello yellow!\");\n  });\n\n  it(\"should fallback to max arity in case supplied arguments do not match the specified arities\", function() {\n    ki require core\n    ki (defn foo \n         ([a] (str \"Hello \" a))\n         ([a b] (str \"There \" a \" \" b)))\n    expect(\n      ki (foo)\n      ).to.eql(\"There undefined undefined\");\n    expect(\n      ki (foo 1 2 3)\n      ).to.eql(\"There 1 2\");\n  });\n\n  //it(\"should allow to define functions with optional arguments\", function() {\n  //  throw \"Not implemented\"\n  //});\n\n});\n\ndescribe(\"dot notation\", function() {\n\n  it(\"should allow to use dot notation to invoke methods on JavaScript objects\", function() {\n    ki require core\n    var a = {\n      bar: function(x) {\n        return x*2;\n      }\n    };\n    var b = {\n      foo: function(x) {\n        return a;\n      }\n    };\n    expect(\n      ki (.bar a 2)\n      ).to.eql(4);\n    expect(\n      ki (threadf b (.foo) (.bar 2))\n      ).to.eql(4);\n  });\n\n});\n\ndescribe(\"chaining and doto\", function() {\n\n  it(\"should allow to use JavaScript chained APIs\", function() {\n    ki require core\n    var A = function() {\n      var self = this;\n      this.v = \"init \";\n      this.foo = function(x) {\n        self.v += \"foo called with \" + x + \" \";\n        return self;\n      };\n      this.bar = function(x) {\n        self.v += \"bar called with \" + x + \" \";\n        return self;\n      };\n    }\n    var a = new A();\n    var mori = _ki.modules.mori;\n    expect(\n      ki (chain a (foo 1) (bar 2) v)\n      ).to.eql('init foo called with 1 bar called with 2 ');\n  });\n\n  it(\"should allow to repeatedly call methods on a JavaScript object\", function() {\n    ki require core\n    var A = function() {\n      var self = this;\n      this.foo = null;\n      this.bar = null;\n      this.setFoo = function(x) {\n        self.foo = x;\n      };\n      this.setBar = function(x) {\n        self.bar = x;\n      };\n      this.getFooBar = function() {\n        return self.foo + \" \" + self.bar;\n      }\n    }\n    var a = new A();\n    var mori = _ki.modules.mori;\n    expect(\n      ki (doto a (setFoo 'a') (setBar 'b')).getFooBar()\n      ).to.eql('a b');\n  });\n\n});\n\ndescribe(\"threading\", function() {\n\n  it(\"should allow to thread first a value through a sequence of computations\", function() {\n    ki require core\n    var a = 1;\n    expect(\n      ki (threadf a inc inc dec)\n      ).to.eql(2);\n    expect(\n      ki (threadf a (sum 2) (sum 3))\n      ).to.eql(6);\n    expect(\n      ki (threadf [] (conj 1) first)\n      ).to.eql(1);\n  });\n\n  it(\"should allow to thread last a value through a sequence of computations\", function() {\n    ki require core\n    var a = 1;\n    expect(\n      ki (threadl a (conj []) (map (fn [x] (inc x))) first)\n      ).to.eql(2);\n  });\n\n});\n\ndescribe(\"math operations\", function() {\n\n  it(\"should allow to add, subtract, multiply, divide a sequence of numbers and compute the modulo of two numbers\", function() {\n    ki require core\n    expect(ki (add 1 2 3)).to.eql(6);\n    expect(ki (sub 3 2 1)).to.eql(0);\n    expect(ki (mul 1 2 3)).to.eql(6);\n    expect(ki (div 3 2 1)).to.eql(1.5);\n    expect(ki (mod 3 2)).to.eql(1);\n  });\n\n  it(\"should allow to compare sequences of numbers\", function() {\n    ki require core\n    expect(ki (lt 1 2 3)).to.eql(true);\n    expect(ki (lt 3 2 1)).to.eql(false);\n    expect(ki (lt 1 2 2)).to.eql(false);\n    expect(ki (gt 1 2 3)).to.eql(false);\n    expect(ki (gt 3 2 1)).to.eql(true);\n    expect(ki (gt 3 2 2)).to.eql(false);\n    expect(ki (leq 1 2 3)).to.eql(true);\n    expect(ki (leq 3 2 1)).to.eql(false);\n    expect(ki (leq 1 2 2)).to.eql(true);\n    expect(ki (geq 1 2 3)).to.eql(false);\n    expect(ki (geq 3 2 1)).to.eql(true);\n    expect(ki (geq 3 2 2)).to.eql(true);\n  });\n\n});\n\ndescribe(\"continuations\", function() {\n  \n  it(\"should allow to write asynchronous code in a synchronous fashion\", function() {\n    ki require core\n    var foo = function(x, cb) {\n      var y = x * 2;\n      cb(y);\n    };\n    var bar = function(x, cb) {\n      var y = x + 1;\n      cb(y);\n    };\n    var baz = function(x, cb) {\n      var y = x + 1;\n      var z = x * 2;\n      cb(y,z);\n    };\n\n    ki (letc [a (foo 2)\n              b (bar a)\n              [c d] (baz b)]\n        (js expect(b).to.eql(5))\n        (js expect(c).to.eql(6))\n        (js expect(d).to.eql(10)))\n\n    ki require core\n    var log = \"\";\n    ki (do\n        (defn fake_request [url cb]\n         (setTimeout (fn [] (cb 1234)) 1000))\n        \n        (letc [data (fake_request \"fakeurl\")]\n         (js log += \"Response received: \" + data + \".\")\n         (js expect(log).to.eql(\"Request sent. Response received: 1234.\")))\n\n        (js log += \"Request sent. \"))\n    expect(log).to.eql(\"Request sent. \");\n  });\n\n});\n\ndescribe(\"apply\", function() {\n\n  it(\"should call a function given a list of arguments supplied as a collection\", function() {\n    ki require core\n    var mori = _ki.modules.mori;\n    expect(\n      ki (apply list [1 2 3 4])\n      ).to.eql(mori.list(1,2,3,4));\n  });\n\n});\n\ndescribe(\"bind\", function() {\n\n  it(\"should return a function with this set to the provided object\", function() {\n    ki require core\n    ki (do \n        (def a {:a 1 :b 2})\n        (defn f [] (get this :a)))\n    expect(ki ((bind a f))).to.eql(1);\n    expect(ki ((bind a (fn [] (get this :a))))).to.eql(1);\n  });\n\n});\n\ndescribe(\"multimethods\", function() {\n\n  it(\"should allow to define functions that dispatch according to the result of the evaluation of another function\", function() {\n    ki require core\n    ki (do\n        (defmulti boss (fn [x] (get x :type)))\n        (defmethod boss :employee [x] (get x :employer))\n        (defmethod boss :employer [x] (get x :name)));\n    expect(ki (boss {:type :employee :name \"Barnie\" :employer \"Fred\"})).to.eql(\"Fred\");\n    expect(ki (boss {:type :employer :name \"Fred\"})).to.eql(\"Fred\");\n  });\n\n});\n\ndescribe(\"atoms\", function() {\n\n  it(\"should allow to define reference types with read and write callbacks\", function() {\n    ki require core\n\n    ki (do\n        (let [r (atom 1 (fn [n o] (js expect(n).to.eql(2); expect(o).to.eql(1)))\n                        (fn [x] (js expect(x).to.eql(2))))]\n         (reset r 2)\n         (deref r)));\n\n    ki (do\n        (let [r (atom 1 (fn [n o] (js expect(n).to.eql(2); expect(o).to.eql(1)))\n                        (fn [x] (js expect(x).to.eql(2))))]\n         (swap r inc)\n         (js expect(ki (deref r)).to.eql(2))));\n\n  });\n\n});\n\ndescribe(\"exceptions\", function() {\n\n  it(\"should allow to try expressions and catch exceptions\", function() {\n\n    ki require core\n\n    ki (try foo.bar (catch e (js expect(e).to.be.a(ReferenceError))));\n\n    var side_effect = false;\n    ki (try foo.bar (catch e (js expect(e).to.be.a(ReferenceError))) (finally (js side_effect = true)));\n    expect(side_effect).to.eql(true);\n\n  });\n\n  it(\"should allow to throw exceptions\", function() {\n\n    ki require core\n\n    expect(ki (fn [] (throw (Error \"foo\")))).to.throwError();\n\n  });\n\n});\n\ndescribe(\"this and fnth\", function() {\n\n  it(\"should handle binding this fn-wise correctly from within IIFN\", function() {\n\n    ki require core\n\n    ki (defn somefn [] (let [a 1] this.someprop));\n    var bar = {someprop: 1};\n    var baz = {};\n\n    expect(ki ((bind bar somefn))).to.eql(1);\n    expect(ki ((bind baz somefn))).to.eql(undefined);\n    expect(ki (somefn)).to.eql(undefined);\n\n  });\n\n  it(\"should allow a shorthand notation for defining a fn bound to the enclosing this, both named and unnamed\", function() {\n\n    ki require core\n\n    var fn1, fn2;\n    ki (do\n         (js this.jee = 1)\n         (let [a (fn [] this.jee)\n               b (fnth [] this.jee)\n               c (fnth cfn[] this.jee)]\n           (js fn1 = a)\n           (js fn2 = b)\n           (js fn3 = c)));\n\n    expect(fn1.bind({jee: 2})()).to.eql(2);\n    expect(fn2.bind({jee: 2})()).to.eql(1);\n    expect(fn3.bind({jee: 2})()).to.eql(1);\n\n  });\n\n});\n\ndescribe(\"str\", function() {\n\n  it(\"should allow to concatenate strings and literals\", function() {\n    ki require core\n    expect(ki (str \"a\" 2 \"b\" 3 \"c\")).to.eql(\"a2b3c\");\n  });\n\n});\n\ndescribe(\"destructuring\", function() {\n\n  it(\"should destructure nested immutable data structures in let forms\", function(){\n    ki require core\n\n    var r = ki (let [[a b {c :c [d e] :d}] [1 2 {:c 3 :d [4 5]}]\n                     f 6]\n                 (eq [a b c d e] [1 2 3 4 5]))\n\n    expect(r).to.eql(true);\n  });\n\n  it(\"should destructure nested JS data structures in let forms\", function(){\n    ki require core\n\n    var r = ki (let [[$ a b {$ c 'c' [$ d e] 'd'}] [$ 1 2 {$ c 3 d [$ 4 5]}]]\n                 (eq [a b c d e] [1 2 3 4 5]))\n\n    expect(r).to.eql(true);\n  });\n\n  it(\"should destructure nested immutable data structures in loop forms\", function(){\n    ki require core\n\n    var r = ki (loop [[a b _] [1 2 3]]\n                 (if (gt a 3)\n                  (eq [a b] [4 5])\n                  (recur (map inc [a b 3]))))\n\n    expect(r).to.eql(true);\n  });\n\n  it(\"should destructure nested JS data structures in loop forms\", function(){\n    ki require core\n\n    var r = ki (loop [[$ a b _] [$ 1 2 3]]\n                 (if (gt a 3)\n                  (eq [a b] [4 5])\n                  (recur (toJs (map inc [a b 3])))))\n\n    expect(r).to.eql(true);\n  });\n\n});\n"
  }
]