diff --git a/docs/assets.json b/docs/assets.json new file mode 100644 index 0000000..0dda561 --- /dev/null +++ b/docs/assets.json @@ -0,0 +1,35 @@ +{ + "app.js": "/static/js/app.5475ec42.js", + "app.js.map": "/static/js/app.d61b86e3a14b0f31e0d0.js.map", + "docs-source-0-introduction-00-about.js": "/static/js/docs-source-0-introduction-00-about.205fe912.js", + "docs-source-0-introduction-00-about.js.map": "/static/js/docs-source-0-introduction-00-about.d61b86e3a14b0f31e0d0.js.map", + "docs-source-0-introduction-05-installation.js": "/static/js/docs-source-0-introduction-05-installation.99c9851c.js", + "docs-source-0-introduction-05-installation.js.map": "/static/js/docs-source-0-introduction-05-installation.d61b86e3a14b0f31e0d0.js.map", + "docs-source-0-introduction-10-getting-started.js": "/static/js/docs-source-0-introduction-10-getting-started.2a7df790.js", + "docs-source-0-introduction-10-getting-started.js.map": "/static/js/docs-source-0-introduction-10-getting-started.d61b86e3a14b0f31e0d0.js.map", + "docs-source-0-introduction-20-objects-and-factories.js": "/static/js/docs-source-0-introduction-20-objects-and-factories.65e655c9.js", + "docs-source-0-introduction-20-objects-and-factories.js.map": "/static/js/docs-source-0-introduction-20-objects-and-factories.d61b86e3a14b0f31e0d0.js.map", + "docs-source-0-introduction-30-with-react.js": "/static/js/docs-source-0-introduction-30-with-react.e2437ad7.js", + "docs-source-0-introduction-30-with-react.js.map": "/static/js/docs-source-0-introduction-30-with-react.d61b86e3a14b0f31e0d0.js.map", + "docs-source-0-introduction-40-philosophy.js": "/static/js/docs-source-0-introduction-40-philosophy.1e050d71.js", + "docs-source-0-introduction-40-philosophy.js.map": "/static/js/docs-source-0-introduction-40-philosophy.d61b86e3a14b0f31e0d0.js.map", + "docs-source-1-advanced-examples.js": "/static/js/docs-source-1-advanced-examples.3d617ef8.js", + "docs-source-1-advanced-examples.js.map": "/static/js/docs-source-1-advanced-examples.d61b86e3a14b0f31e0d0.js.map", + "docs-source-1-advanced-models.js": "/static/js/docs-source-1-advanced-models.e6984dce.js", + "docs-source-1-advanced-models.js.map": "/static/js/docs-source-1-advanced-models.d61b86e3a14b0f31e0d0.js.map", + "docs-source-1-advanced-preprocessors.js": "/static/js/docs-source-1-advanced-preprocessors.978d3bc1.js", + "docs-source-1-advanced-preprocessors.js.map": "/static/js/docs-source-1-advanced-preprocessors.d61b86e3a14b0f31e0d0.js.map", + "docs-source-1-advanced-updaters.js": "/static/js/docs-source-1-advanced-updaters.34d005c0.js", + "docs-source-1-advanced-updaters.js.map": "/static/js/docs-source-1-advanced-updaters.d61b86e3a14b0f31e0d0.js.map", + "pkgs-core-readme.js": "/static/js/pkgs-core-readme.2ff9f0a1.js", + "pkgs-core-readme.js.map": "/static/js/pkgs-core-readme.d61b86e3a14b0f31e0d0.js.map", + "pkgs-react-readme.js": "/static/js/pkgs-react-readme.05b56ebd.js", + "pkgs-react-readme.js.map": "/static/js/pkgs-react-readme.d61b86e3a14b0f31e0d0.js.map", + "runtime~app.js": "/static/js/runtime~app.d61b86e3a14b0f31e0d0.js", + "runtime~app.js.map": "/static/js/runtime~app.d61b86e3a14b0f31e0d0.js.map", + "vendors.js": "/static/js/vendors.3d24669e.js", + "vendors.js.map": "/static/js/vendors.d61b86e3a14b0f31e0d0.js.map", + "static/js/15.0b8c79ca.js": "/static/js/15.0b8c79ca.js", + "static/js/15.d61b86e3a14b0f31e0d0.js.map": "/static/js/15.d61b86e3a14b0f31e0d0.js.map", + "index.html": "/index.html" +} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..72808b9 --- /dev/null +++ b/docs/index.html @@ -0,0 +1 @@ +Rval
\ No newline at end of file diff --git a/docs/static/js/15.0b8c79ca.js b/docs/static/js/15.0b8c79ca.js new file mode 100644 index 0000000..c1ba3c7 --- /dev/null +++ b/docs/static/js/15.0b8c79ca.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{"./.docz/app/imports.js":function(n,o,d){"use strict";d.r(o),d.d(o,"imports",function(){return e});var e={"docs_source/0_introduction/00_about.mdx":function(){return d.e(1).then(d.bind(null,"./docs_source/0_introduction/00_about.mdx"))},"docs_source/0_introduction/05_installation.mdx":function(){return d.e(2).then(d.bind(null,"./docs_source/0_introduction/05_installation.mdx"))},"docs_source/0_introduction/10_getting-started.mdx":function(){return d.e(3).then(d.bind(null,"./docs_source/0_introduction/10_getting-started.mdx"))},"docs_source/0_introduction/20_objects-and-factories.mdx":function(){return d.e(4).then(d.bind(null,"./docs_source/0_introduction/20_objects-and-factories.mdx"))},"docs_source/0_introduction/30_with-react.mdx":function(){return d.e(5).then(d.bind(null,"./docs_source/0_introduction/30_with-react.mdx"))},"docs_source/0_introduction/40_philosophy.mdx":function(){return d.e(6).then(d.bind(null,"./docs_source/0_introduction/40_philosophy.mdx"))},"docs_source/1_advanced/examples.mdx":function(){return d.e(7).then(d.bind(null,"./docs_source/1_advanced/examples.mdx"))},"docs_source/1_advanced/models.mdx":function(){return d.e(8).then(d.bind(null,"./docs_source/1_advanced/models.mdx"))},"docs_source/1_advanced/preprocessors.mdx":function(){return d.e(9).then(d.bind(null,"./docs_source/1_advanced/preprocessors.mdx"))},"docs_source/1_advanced/updaters.mdx":function(){return d.e(10).then(d.bind(null,"./docs_source/1_advanced/updaters.mdx"))},"pkgs/core/README.mdx":function(){return d.e(11).then(d.bind(null,"./pkgs/core/README.mdx"))},"pkgs/react/README.mdx":function(){return d.e(12).then(d.bind(null,"./pkgs/react/README.mdx"))}}}},0,[1,2,3,4,5,6,7,8,9,10,11,12]]); +//# sourceMappingURL=15.d61b86e3a14b0f31e0d0.js.map \ No newline at end of file diff --git a/docs/static/js/15.d61b86e3a14b0f31e0d0.js.map b/docs/static/js/15.d61b86e3a14b0f31e0d0.js.map new file mode 100644 index 0000000..ef8e970 --- /dev/null +++ b/docs/static/js/15.d61b86e3a14b0f31e0d0.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./.docz/app/imports.js"],"names":["__webpack_require__","r","__webpack_exports__","d","imports","docs_source/0_introduction/00_about.mdx","e","then","bind","docs_source/0_introduction/05_installation.mdx","docs_source/0_introduction/10_getting-started.mdx","docs_source/0_introduction/20_objects-and-factories.mdx","docs_source/0_introduction/30_with-react.mdx","docs_source/0_introduction/40_philosophy.mdx","docs_source/1_advanced/examples.mdx","docs_source/1_advanced/models.mdx","docs_source/1_advanced/preprocessors.mdx","docs_source/1_advanced/updaters.mdx","pkgs/core/README.mdx","pkgs/react/README.mdx"],"mappings":"gHAAAA,EAAAC,EAAAC,GAAAF,EAAAG,EAAAD,EAAA,4BAAAE,IAAO,IAAMA,EAAU,CACrBC,0CAA2C,kBACzCL,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,oDACFC,iDAAkD,kBAChDT,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,2DACFE,oDAAqD,kBACnDV,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,8DACFG,0DAA2D,kBACzDX,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,oEACFI,+CAAgD,kBAC9CZ,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,yDACFK,+CAAgD,kBAC9Cb,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,yDACFM,sCAAuC,kBACrCd,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,gDACFO,oCAAqC,kBACnCf,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,8CACFQ,2CAA4C,kBAC1ChB,EAAAM,EAAA,GAAAC,KAAAP,EAAAQ,KAAA,qDACFS,sCAAuC,kBACrCjB,EAAAM,EAAA,IAAAC,KAAAP,EAAAQ,KAAA,gDACFU,uBAAwB,kBACtBlB,EAAAM,EAAA,IAAAC,KAAAP,EAAAQ,KAAA,iCACFW,wBAAyB,kBACvBnB,EAAAM,EAAA,IAAAC,KAAAP,EAAAQ,KAAA","file":"static/js/15.0b8c79ca.js","sourcesContent":["export const imports = {\n 'docs_source/0_introduction/00_about.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-0-introduction-00-about\" */ 'docs_source/0_introduction/00_about.mdx'),\n 'docs_source/0_introduction/05_installation.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-0-introduction-05-installation\" */ 'docs_source/0_introduction/05_installation.mdx'),\n 'docs_source/0_introduction/10_getting-started.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-0-introduction-10-getting-started\" */ 'docs_source/0_introduction/10_getting-started.mdx'),\n 'docs_source/0_introduction/20_objects-and-factories.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-0-introduction-20-objects-and-factories\" */ 'docs_source/0_introduction/20_objects-and-factories.mdx'),\n 'docs_source/0_introduction/30_with-react.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-0-introduction-30-with-react\" */ 'docs_source/0_introduction/30_with-react.mdx'),\n 'docs_source/0_introduction/40_philosophy.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-0-introduction-40-philosophy\" */ 'docs_source/0_introduction/40_philosophy.mdx'),\n 'docs_source/1_advanced/examples.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-1-advanced-examples\" */ 'docs_source/1_advanced/examples.mdx'),\n 'docs_source/1_advanced/models.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-1-advanced-models\" */ 'docs_source/1_advanced/models.mdx'),\n 'docs_source/1_advanced/preprocessors.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-1-advanced-preprocessors\" */ 'docs_source/1_advanced/preprocessors.mdx'),\n 'docs_source/1_advanced/updaters.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"docs-source-1-advanced-updaters\" */ 'docs_source/1_advanced/updaters.mdx'),\n 'pkgs/core/README.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"pkgs-core-readme\" */ 'pkgs/core/README.mdx'),\n 'pkgs/react/README.mdx': () =>\n import(/* webpackPrefetch: true, webpackChunkName: \"pkgs-react-readme\" */ 'pkgs/react/README.mdx'),\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/app.5475ec42.js b/docs/static/js/app.5475ec42.js new file mode 100644 index 0000000..0d381cd --- /dev/null +++ b/docs/static/js/app.5475ec42.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{"./.docz/app/db.json":function(e){e.exports={config:{title:"Rval",description:"My awesome app using docz",menu:[],ordering:"descending",version:"0.0.1",repository:"https://github.com/mweststrate/rval",native:!1,codeSandbox:!0,themeConfig:{}},entries:{"docs_source/0_introduction/00_about.mdx":{name:"About RVal",order:0,menu:"Introduction",route:"/introduction/introduction",id:"40e7c723e6cd44e2fb55eed5fa5b8126",filepath:"docs_source/0_introduction/00_about.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/0_introduction/00_about.mdx",slug:"docs-source-0-introduction-00-about",headings:[{depth:1,slug:"about-rval",value:"About RVal"},{depth:2,slug:"quick-example",value:"Quick example"},{depth:2,slug:"packages",value:"Packages"}]},"docs_source/0_introduction/05_installation.mdx":{name:"Installation",order:1,menu:"Introduction",route:"/introduction/installation",id:"8c812cec5cfa47c09046c0ad4028d9e9",filepath:"docs_source/0_introduction/05_installation.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/0_introduction/05_installation.mdx",slug:"docs-source-0-introduction-05-installation",headings:[]},"docs_source/0_introduction/10_getting-started.mdx":{name:"Getting started",order:2,menu:"Introduction",route:"/introduction/getting-started",id:"881f0239ef16525c0578edcfeec12cfe",filepath:"docs_source/0_introduction/10_getting-started.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/0_introduction/10_getting-started.mdx",slug:"docs-source-0-introduction-10-getting-started",headings:[{depth:1,slug:"getting-started-with-rval",value:"Getting started with RVal"},{depth:2,slug:"val-reactive-values",value:"val : reactive values"},{depth:2,slug:"drv-derived-values",value:"drv : derived values"},{depth:2,slug:"sub-listing-to-changes",value:"sub : listing to changes"},{depth:2,slug:"act-batching-updates",value:"act : batching updates"}]},"docs_source/0_introduction/20_objects-and-factories.mdx":{name:"Working with objects",order:3,menu:"Introduction",route:"/introduction/factories",id:"f11a1014b5943e7acc23512d5c0f57f0",filepath:"docs_source/0_introduction/20_objects-and-factories.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/0_introduction/20_objects-and-factories.mdx",slug:"docs-source-0-introduction-20-objects-and-factories",headings:[{depth:1,slug:"working-with-objects-and-arrays",value:"Working with objects and arrays"},{depth:2,slug:"a-first-object-factory",value:"A first object factory"},{depth:2,slug:"creating-collections",value:"Creating collections"},{depth:2,slug:"using-classes",value:"Using classes"},{depth:2,slug:"next-steps",value:"Next steps"}]},"docs_source/0_introduction/30_with-react.mdx":{name:"Using react",order:4,menu:"Introduction",route:"/introduction/react",id:"ec224d754815113334362af6422d0f07",filepath:"docs_source/0_introduction/30_with-react.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/0_introduction/30_with-react.mdx",slug:"docs-source-0-introduction-30-with-react",headings:[]},"docs_source/0_introduction/40_philosophy.mdx":{name:"Philosophy",order:5,menu:"Introduction",route:"/introduction/philosophy",id:"7fb81491976fe813a74bb7d04fe1ee76",filepath:"docs_source/0_introduction/40_philosophy.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/0_introduction/40_philosophy.mdx",slug:"docs-source-0-introduction-40-philosophy",headings:[{depth:1,slug:"the-philosophy-of-rval",value:"The Philosophy of RVal"},{depth:2,slug:"functions-solidify-state",value:"Functions solidify state"}]},"docs_source/1_advanced/examples.mdx":{name:"Examples",order:3,menu:"Advanced",route:"/advanced/examples",id:"852af60ceb032d002177699d60ea205a",filepath:"docs_source/1_advanced/examples.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/1_advanced/examples.mdx",slug:"docs-source-1-advanced-examples",headings:[]},"docs_source/1_advanced/models.mdx":{name:"Working with models",order:1,menu:"Advanced",route:"/advanced/models",id:"8e346cafc38eaef81418b120d0433853",filepath:"docs_source/1_advanced/models.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/1_advanced/models.mdx",slug:"docs-source-1-advanced-models",headings:[]},"docs_source/1_advanced/preprocessors.mdx":{name:"Using preprocessors",order:0,menu:"Advanced",route:"/advanced/preprocessors",id:"2c3f02cbe7776436e609ca868dd69c16",filepath:"docs_source/1_advanced/preprocessors.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/1_advanced/preprocessors.mdx",slug:"docs-source-1-advanced-preprocessors",headings:[]},"docs_source/1_advanced/updaters.mdx":{name:"Simplifying updates",order:2,menu:"Advanced",route:"/advanced/updaters",id:"e4e268b487a9a298c9365eee3556e0e0",filepath:"docs_source/1_advanced/updaters.mdx",link:"https://github.com/mweststrate/rval/edit/master/docs_source/1_advanced/updaters.mdx",slug:"docs-source-1-advanced-updaters",headings:[{depth:1,slug:"updaters-package",value:"Updaters package"},{depth:1,slug:"immer",value:"Immer"}]},"pkgs/core/README.mdx":{name:"Core api",order:1,menu:"API",route:"/api/core",id:"b36d139fb3bf841133c7e5bb2f02087a",filepath:"pkgs/core/README.mdx",link:"https://github.com/mweststrate/rval/edit/master/pkgs/core/README.mdx",slug:"pkgs-core-readme",headings:[{depth:1,slug:"r-valcore-api",value:"@r-val/core api"},{depth:2,slug:"val",value:"val"}]},"pkgs/react/README.mdx":{name:"React bindings",order:1,menu:"API",route:"/api/react",id:"36aa066c925eb504a630abe2dc46d199",filepath:"pkgs/react/README.mdx",link:"https://github.com/mweststrate/rval/edit/master/pkgs/react/README.mdx",slug:"pkgs-react-readme",headings:[]}}}},"./.docz/app/index.jsx":function(e,t,o){"use strict";o.r(t);var d=o("./node_modules/react/index.js"),s=o.n(d),a=o("./node_modules/react-dom/index.js"),c=o.n(a),r=o("./.docz/app/root.jsx"),i=[],n=[],u=function(){return n.forEach(function(e){return e&&e()})},l=document.querySelector("#root");!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.a;i.forEach(function(e){return e&&e()}),c.a.render(s.a.createElement(e,null),l,u)}(r.a)},"./.docz/app/root.jsx":function(e,t,o){"use strict";(function(e){var d=o("./node_modules/react/index.js"),s=o.n(d),a=o("./node_modules/react-hot-loader/index.js"),c=o("./node_modules/docz-theme-default/dist/index.m.js"),r=function(){return s.a.createElement(c.a,null)};t.a=Object(a.hot)(e)(r),r.__docgenInfo={description:"",methods:[],displayName:"Root"}}).call(this,o("./node_modules/webpack/buildin/harmony-module.js")(e))},0:function(e,t,o){o("./node_modules/react-dev-utils/webpackHotDevClient.js"),o("./node_modules/@babel/polyfill/lib/index.js"),e.exports=o("./.docz/app/index.jsx")}},[[0,13,14]]]); +//# sourceMappingURL=app.d61b86e3a14b0f31e0d0.js.map \ No newline at end of file diff --git a/docs/static/js/app.d61b86e3a14b0f31e0d0.js.map b/docs/static/js/app.d61b86e3a14b0f31e0d0.js.map new file mode 100644 index 0000000..01d7837 --- /dev/null +++ b/docs/static/js/app.d61b86e3a14b0f31e0d0.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./.docz/app/index.jsx","webpack:///./.docz/app/root.jsx"],"names":["__webpack_require__","r","__webpack_exports__","react__WEBPACK_IMPORTED_MODULE_0__","react__WEBPACK_IMPORTED_MODULE_0___default","n","react_dom__WEBPACK_IMPORTED_MODULE_1__","react_dom__WEBPACK_IMPORTED_MODULE_1___default","_root__WEBPACK_IMPORTED_MODULE_2__","_onPreRenders","_onPostRenders","onPostRender","forEach","f","root","document","querySelector","Component","arguments","length","undefined","Root","ReactDOM","render","a","createElement","module","react_hot_loader__WEBPACK_IMPORTED_MODULE_1__","docz_theme_default__WEBPACK_IMPORTED_MODULE_2__","hot"],"mappings":"6pLAAAA,EAAAC,EAAAC,GAAA,IAAAC,EAAAH,EAAA,iCAAAI,EAAAJ,EAAAK,EAAAF,GAAAG,EAAAN,EAAA,qCAAAO,EAAAP,EAAAK,EAAAC,GAAAE,EAAAR,EAAA,wBAIMS,EAAgB,GAChBC,EAAiB,GAGjBC,EAAe,kBAAMD,EAAeE,QAAQ,SAAAC,GAAC,OAAIA,GAAKA,OAEtDC,EAAOC,SAASC,cAAc,UACrB,WAAsB,IAArBC,EAAqBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAATG,IAJFZ,EAAcG,QAAQ,SAAAC,GAAC,OAAIA,GAAKA,MAMxDS,IAASC,OAAOnB,EAAAoB,EAAAC,cAACR,EAAD,MAAeH,EAAMH,GAGvCY,CAAOF,2DChBP,SAAAK,GAAA,IAAAvB,EAAAH,EAAA,iCAAAI,EAAAJ,EAAAK,EAAAF,GAAAwB,EAAA3B,EAAA,4CAAA4B,EAAA5B,EAAA,qDAIMqB,EAAO,kBAAMjB,EAAAoB,EAAAC,cAACG,EAAA,EAAD,OAEJC,kBAAIH,EAAJG,CAAYR","file":"static/js/app.5475ec42.js","sourcesContent":["import React from 'react'\nimport ReactDOM from 'react-dom'\nimport Root from './root'\n\nconst _onPreRenders = []\nconst _onPostRenders = []\n\nconst onPreRender = () => _onPreRenders.forEach(f => f && f())\nconst onPostRender = () => _onPostRenders.forEach(f => f && f())\n\nconst root = document.querySelector('#root')\nconst render = (Component = Root) => {\n onPreRender()\n ReactDOM.render(, root, onPostRender)\n}\n\nrender(Root)\n","import React from 'react'\nimport { hot } from 'react-hot-loader'\nimport Theme from 'docz-theme-default'\n\nconst Root = () => \n\nexport default hot(module)(Root)\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-00-about.205fe912.js b/docs/static/js/docs-source-0-introduction-00-about.205fe912.js new file mode 100644 index 0000000..3a94ce7 --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-00-about.205fe912.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"./docs_source/0_introduction/00_about.mdx":function(e,n,t){"use strict";t.r(n),t.d(n,"default",function(){return u});var a=t("./node_modules/react/index.js"),o=t.n(a),r=t("./node_modules/@mdx-js/tag/dist/index.js");function i(e){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,n){if(null==e)return{};var t,a,o=function(e,n){if(null==e)return{};var t,a,o={},r=Object.keys(e);for(a=0;a=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function c(e,n){for(var t=0;t{`About RVal`}\n{`RVal is a minimalistic, transparent reactive programming library, heavily inspired by `}{`MobX`}{`,\nwith the same core principle: `}{`Everything that can be derived from state, should be derived. Automatically`}{`.`}\n{`However, the goals are slightly different. RVal core principles include:`}\n\n{`🍭 `}{`Minimalistic`}{` A very simple, minimalistic core API`}\n{`🛅 `}{`Functions + immutable objects`}{`: Functions and (stateful) immutable objects as the primary means to organize state`}\n{`🎯 `}{`Convention driven`}{`: An idiomatic way of working, that guides devs into the `}{`Pit of Success`}\n{`📦 `}{`Embeddable`}{`: A low level building block, that is small (~2KB minified gzipped) so that it can easily be embedded in existing libraries and frameworks as state management libraries.`}\n{`🐆 `}{`Fast`}{`: Rock solid performance, leveraging the battle tested algorithms of MobX.`}\n{`☔ `}{`Versatile`}{`: no dependencies, no modern syntax or language requirements, non-intrusive, applicable in any ES5 JavaScript stack`}\n{`🎓 `}{`Gradual learning curve`}{`: Opt-in utilities that help with applying best practices`}\n{`💪 `}{`Strongly typed`}{`: Shouldn't need further explanation in 2019`}\n\n{`Ok, that is a pretty vague, generic list of things that sound positive. Hardly saying anything.\nIt boils down to this: RVal, is small, conceptually simple and powerful.\nBut mostly: `}\n{`The proof of the pudding is in the eating.`}{`.`}\n{`Here is a term that you will encounter when reading the introduction:\nIt's all about `}{`reactive values`}{` and `}{`immutable stateful objects`}{`.\nRead the introduction to find out what that abomination of seemingly conflicting concepts means.\nAt least I can promise you this: you won't be needing `}{`this`}{`, `}{`let`}{`, `}{`var`}{` or `}{`class`}{`.`}\n{`Quick example`}\n{`TODO`}\n{`Packages`}\n{`TODO`}\n{`Table, with name, goal, cdn, umdname, bundlesize`}\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-05-installation.99c9851c.js b/docs/static/js/docs-source-0-introduction-05-installation.99c9851c.js new file mode 100644 index 0000000..3cd906a --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-05-installation.99c9851c.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"./docs_source/0_introduction/05_installation.mdx":function(t,e,n){"use strict";n.r(e),n.d(e,"default",function(){return s});var o=n("./node_modules/react/index.js"),r=n.n(o),u=n("./node_modules/@mdx-js/tag/dist/index.js");function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(null==t)return{};var n,o,r=function(t,e){if(null==t)return{};var n,o,r={},u=Object.keys(t);for(o=0;o=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function f(t,e){for(var n=0;n\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-10-getting-started.2a7df790.js b/docs/static/js/docs-source-0-introduction-10-getting-started.2a7df790.js new file mode 100644 index 0000000..95e2a23 --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-10-getting-started.2a7df790.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"./docs_source/0_introduction/10_getting-started.mdx":function(e,n,a){"use strict";a.r(n),a.d(n,"default",function(){return u});var t=a("./node_modules/react/index.js"),o=a.n(t),r=a("./node_modules/@mdx-js/tag/dist/index.js");function m(e){return(m="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,n){if(null==e)return{};var a,t,o=function(e,n){if(null==e)return{};var a,t,o={},r=Object.keys(e);for(t=0;t=0||(o[a]=e[a]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}function c(e,n){for(var a=0;a myLuckyNumber() % 2 === 1)\n\nconsole.log(isGoodLuckyNumber()) // true\nmyLuckyNumber(42)\nconsole.log(isGoodLuckyNumber()) // false\n")),o.a.createElement(r.MDXTag,{name:"p",components:n},o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv")," can be used to ",o.a.createElement(r.MDXTag,{name:"strong",components:n,parentName:"p"},"derive")," arbitrarly simple or complex values based on other reactive values, created by either ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv")," or ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val"),"."),o.a.createElement(r.MDXTag,{name:"p",components:n},"The critical reader might think at this point: ","\u201c","That's nice and dandy, but you couldn't we just have used ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"const isGoodLuckyNumber = () => myLuckyNumber() % 2 === 1"),"?","\u201d",".\nAnd that is true, glad you ask. That would indeed have yielded the same output.\nBut! Using ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv")," brings in a few new possiblities:"),o.a.createElement(r.MDXTag,{name:"p",components:n},"First, ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv")," will memoize",o.a.createElement(r.MDXTag,{name:"sup",components:n,parentName:"p",props:{id:"fnref-(usually)"}},o.a.createElement(r.MDXTag,{name:"a",components:n,parentName:"sup",props:{href:"#fn-(usually)",className:"footnote-ref"}},"(usually)"))," it's results. That is: as long as ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"myLuckyNumber")," doesn't change, invoking ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"isGoodLuckyNumber()")," multiple times won't actually re-evaluate the original expression, but just return a memoized result."),o.a.createElement(r.MDXTag,{name:"p",components:n},"Secondly, and more importantly. So far we having been pulling values through our system by explicitly calling ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"myLuckyNumber()")," or ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"isGoodLuckyNumber()"),".\nBut in a reactive system, the control flow is inversed",o.a.createElement(r.MDXTag,{name:"sup",components:n,parentName:"p",props:{id:"fnref-1"}},o.a.createElement(r.MDXTag,{name:"a",components:n,parentName:"sup",props:{href:"#fn-1",className:"footnote-ref"}},"1")),".\nTo build a reactive system, we have to push our values to consumers and actively ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"notify")," them."),o.a.createElement(r.MDXTag,{name:"h2",components:n,props:{id:"sub-listing-to-changes"}},o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"h2"},"sub"),": listing to changes"),o.a.createElement(r.MDXTag,{name:"p",components:n},"And that is where ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"sub")," comes in!\nWith ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"sub"),", one can create a consumer of a reactive value created using ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val")," or ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv"),".\nIn other words, it sets up a ",o.a.createElement(r.MDXTag,{name:"strong",components:n,parentName:"p"},"subscription"),".\nThis creates a ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"we'll call you")," basis of operation:"),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},"const myLuckyNumber = val(13)\nconst isGoodLuckyNumber = drv(() => myLuckyNumber() % 2 === 1)\n\nconst cancelPrint = sub(isGoodLuckyNumber, isGood => {\n console.log(isGood)\n})\n\nmyLuckyNumber(42) // prints: 'false'\nmyLuckyNumber(33) // prints: 'true'\nmyLuckyNumber(55) // (doesn't print, isGoodLuckyNumber didn't produce a new value)\nmyLuckyNumber(2) // prints: 'false'\n\ncancelPrint() // stop listening to future updates\n")),o.a.createElement(r.MDXTag,{name:"p",components:n},"Finally, we did something that we couldn't have achieved by using just plain functions and omitting ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv")," or ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val"),".\nWhat ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv")," and ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val")," achieve is that they set up a dependency system, so that when we update state, this state is propagated through the derived values, to the subscriptions.\nTransparent reactive programming is used to determine the optimal program flow, and based on the ",o.a.createElement(r.MDXTag,{name:"a",components:n,parentName:"p",props:{href:"https://mobx.js.org"}},"MobX")," package."),o.a.createElement(r.MDXTag,{name:"p",components:n},"Note that we didn't pass ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"isGoodLuckyNumber()"),"! We want to subscribe to the function's future output, not to it's current value (",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"13"),").\nAlso note that ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"sub")," returns a function. This function has only one purpose: cancelling future executions of the subscription."),o.a.createElement(r.MDXTag,{name:"p",components:n},"A remarkable property about ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"sub")," is that you don't need them as often as you would initially think.\nThey are not needed to propagate values through your system. ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv")," can take care of that.\n",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"sub")," is generally only need to achieve side effects; visible output from your system.\nSuch as updating the UI, logging, making network effects etc. "),o.a.createElement(r.MDXTag,{name:"h2",components:n,props:{id:"act-batching-updates"}},o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"h2"},"act"),": batching updates"),o.a.createElement(r.MDXTag,{name:"p",components:n},"TODO: run or act?"),o.a.createElement(r.MDXTag,{name:"p",components:n},"You might have noticed that in the previous listening or side effects where immediately fired when emitting an update to ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"myLuckyNumber"),".\nThis is just the default behavior and there are several ways to influence it.\nFirst of all, we can use techniques like debounce to roun our subscriptions less frequently.\nBut more importantly, we can hold of the reactive system to wait a bit until we've done all our updates,\nso that changes will be broadcased as one atomic update.\nTo express that, there is ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"act")," to group multiple changes into a single ",o.a.createElement(r.MDXTag,{name:"strong",components:n,parentName:"p"},"activity"),": "),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},"const cancelPrint = sub(isGoodLuckyNumber, isGood => {\n console.log(isGood)\n})\n\nact(() => {\n myLuckyNumber(42) \n myLuckyNumber(33)\n myLuckyNumber(55)\n myLuckyNumber(2) \n}) // prints only once, at the end of the activity: 'false'\n")),o.a.createElement(r.MDXTag,{name:"p",components:n},"That's all! Note that ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"act")," only batches ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"synchronosly")," run updates. Passing an ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"async")," function to ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"act")," is in that regard mostly useless."),o.a.createElement(r.MDXTag,{name:"hr",components:n}),o.a.createElement(r.MDXTag,{name:"p",components:n},"Your system will most probably not be expressible in a single ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val"),", ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"drv")," and ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"sub"),'.\nBut, we\'ve now covered the entire basic mechanism of "rval"!\nIn the next sections we will focus on organizing many different values, objects etc.\nAnd see how we can hook up the UI.'),o.a.createElement(r.MDXTag,{name:"div",components:n,props:{className:"footnotes"}},o.a.createElement(r.MDXTag,{name:"hr",components:n,parentName:"div"}),o.a.createElement(r.MDXTag,{name:"ol",components:n,parentName:"div"},o.a.createElement(r.MDXTag,{name:"li",components:n,parentName:"ol",props:{id:"fn-(usually)"}},o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"li"},"drv")," will by default memoize as long as there is at least one active subscription. Without subscriptions, memoization will be disabled to avoid accidentally leaking memory. The behavior can be overriden by using the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"li"},"keepAlive")," option. (TODO).",o.a.createElement(r.MDXTag,{name:"a",components:n,parentName:"li",props:{href:"#fnref-(usually)",className:"footnote-backref"}},"\u21a9")),o.a.createElement(r.MDXTag,{name:"li",components:n,parentName:"ol",props:{id:"fn-(a.k.a. inversion of control)"}},"Wiki: ",o.a.createElement(r.MDXTag,{name:"a",components:n,parentName:"li",props:{href:"https://en.wikipedia.org/wiki/Inversion_of_control"}},"Inversion of control"),o.a.createElement(r.MDXTag,{name:"a",components:n,parentName:"li",props:{href:"#fnref-(a.k.a.%20inversion%20of%20control)",className:"footnote-backref"}},"\u21a9")),o.a.createElement(r.MDXTag,{name:"li",components:n,parentName:"ol",props:{id:"fn-1"}},"(a.k.a. inversion of control)",o.a.createElement(r.MDXTag,{name:"a",components:n,parentName:"li",props:{href:"#fnref-1",className:"footnote-backref"}},"\u21a9")))))}}])&&c(a.prototype,t),m&&c(a,m),n}();u.__docgenInfo={description:"",methods:[],displayName:"MDXContent"}}}]); +//# sourceMappingURL=docs-source-0-introduction-10-getting-started.d61b86e3a14b0f31e0d0.js.map \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-10-getting-started.d61b86e3a14b0f31e0d0.js.map b/docs/static/js/docs-source-0-introduction-10-getting-started.d61b86e3a14b0f31e0d0.js.map new file mode 100644 index 0000000..a9f9c32 --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-10-getting-started.d61b86e3a14b0f31e0d0.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./docs_source/0_introduction/10_getting-started.mdx"],"names":["MDXContent","props","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","layout","React","Component","_this$props","components","_objectWithoutProperties","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","_mdx_js_tag__WEBPACK_IMPORTED_MODULE_1__","name","id","parentName","className","href"],"mappings":"87CAKqBA,cACnB,SAAAA,EAAYC,GAAO,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACjBE,EAAAG,EAAAD,KAAAE,EAAAN,GAAAO,KAAAH,KAAMH,KACDO,OAAS,KAFGN,yPADmBO,IAAMC,kDAKnC,IAAAC,EAC0BP,KAAKH,MAA9BW,EADDD,EACCC,WADDC,EAAAF,EAAA,gBAGP,OAAOG,EAAAC,EAAAC,cAACC,EAAA,OAAD,CACEC,KAAK,UAELN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,8BAAvD,6BACrCL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,eAAyDE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,QAAzD,6DAAyMN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAzM,KAAgSN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAhS,KAAuXN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAvX,QAAidN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAjd,4FAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,wBAAwBL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,OAA/E,qBACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,0KACzCN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,yCAAmFE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,mBAAnF,+DAC2DN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,qBAD3D,KAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,mEAI3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAzC,wCAAmKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,SAASN,WAAYA,EAAYQ,WAAW,KAAzD,SAAnK,4BACKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,iBADL,0EAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,kDAG3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,wNAGWE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,MAHX,gCAIAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,uEAK3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,8MAEAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,gQAIAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,WAAqDE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,IAAInB,MAAO,CAACqB,KAAO,oBAAvE,cAArD,2CACAR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,uBAAuBL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,OAA9E,oBACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,yHACzCN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,4GACAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,yFAG3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,kDAA4FE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,iBAA5F,iDACKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,qBADL,iBAEaN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAFb,gDAE+IN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAF/I,uCAGmCN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAHnC,mGAKAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,8MAO3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAzC,mBAA8IN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,SAASN,WAAYA,EAAYQ,WAAW,KAAzD,UAA9I,0FAAyTN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAzT,OAAkZN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAlZ,KACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,wHAA+JE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,6DAA/J,+GAEaN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAFb,sCAGAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,UAAoDE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAApD,gBAAsJN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,EAAYQ,WAAW,IAAInB,MAAO,CAACkB,GAAK,oBAAoBL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACqB,KAAO,gBAAgBD,UAAY,iBAArG,cAAjP,sCAA6aP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,iBAA7a,6BAAsiBN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,uBAAtiB,0GACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,iHAA2JE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,mBAA3J,OAAgQN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,uBAAhQ,4DACwDN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,EAAYQ,WAAW,IAAInB,MAAO,CAACkB,GAAK,YAAYL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACqB,KAAO,QAAQD,UAAY,iBAA7F,MAD3I,uFAEmFP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,UAFnF,UAGAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,2BAA2BL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,OAAlF,wBACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,qBAA+DE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAA/D,oBACON,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OADP,iEAC0JN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAD1J,OACmPN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OADnP,mCAE+BN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,SAASN,WAAYA,EAAYQ,WAAW,KAAzD,gBAF/B,qBAGiBN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,kBAHjB,wBAIAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,ubAc3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,uGAAiJE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAjJ,OAA0ON,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAA1O,WACON,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OADP,QACiGN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OADjG,gQAEmGN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,IAAInB,MAAO,CAACqB,KAAO,wBAAvE,QAFnG,aAGAR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,4BAAsEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,uBAAtE,sFAA8PN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,MAA9P,sBACiBN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OADjB,8GAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,+BAAyEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAzE,qIAC+DN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAD/D,4BAEEN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAFF,qJAIAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,yBAAyBL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,OAAhF,sBACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,qBACAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,4HAAsKE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,iBAAtK,iXAK4BN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAL5B,4CAK0JN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,SAASN,WAAYA,EAAYQ,WAAW,KAAzD,YAL1J,MAMAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,mQAW3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,yBAAmEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAnE,iBAAsKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,gBAAtK,4BAAqRN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,SAArR,gBAAyXN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAzX,sCACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,IAC9BE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,iEAA2GE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAA3G,KAAkMN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAlM,QAA4RN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAA5R,8LAIAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,EAAYX,MAAO,CAACoB,UAAY,cAC/DP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,QACrDN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,OACrDN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACkB,GAAK,iBAAiBL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,OAAxF,uNAAkYN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,aAAlY,mBAA8eN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACqB,KAAO,mBAAmBD,UAAY,qBAAvG,WAC9eP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACkB,GAAK,qCAAvE,SAAsHL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACqB,KAAO,uDAAxE,wBAAgKR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACqB,KAAO,6CAA6CD,UAAY,qBAAjI,WACtRP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACkB,GAAK,SAAvE,gCAAiHL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACqB,KAAO,WAAWD,UAAY,qBAA/F","file":"static/js/docs-source-0-introduction-10-getting-started.2a7df790.js","sourcesContent":["\n import React from 'react'\n import { MDXTag } from '@mdx-js/tag'\n \n\nexport default class MDXContent extends React.Component {\n constructor(props) {\n super(props)\n this.layout = null\n }\n render() {\n const { components, ...props } = this.props\n\n return {`Getting started with RVal`}\n{`The core of `}{`RVal`}{` is four functions which have all a very simple contract: `}{`val`}{`, `}{`drv`}{`, `}{`sub`}{` and `}{`act`}{`.\nYes, they all have three-letter names. That's kind of cool I think. Not sure yet why.`}\n{`val`}{`: reactive values`}\n{`“`}{`Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.`}{`”`}{` `}{`—`}{` John Carmack`}\n{`In RVal, the universe revolves around `}{`reactive values`}{`.\nCreating your first reactive value is easy by leveraging `}{`val(initialValue)`}{`:`}\n{`import { val } from \"rval\";\n\nconst myLuckyNumber = val(13)\n`}\n{`val`}{` returns a function that returns any `}{`value`}{` you've put into it.\nSo `}{`myLuckyNumber`}{` is now a function, returning the original number, and we can call it:`}\n{`console.log(myLuckyNumber())\n// prints: 13\n`}\n{`Fancy! But what use is it to create a function that just returns the original value?\nWe'll find out in a bit.\nFirst, there is another trick the function can do: We can call it with a new lucky number,\n(in case `}{`13`}{` didn't work out after all):`}\n{`myLuckyNumber(42)\n\nconsole.log(myLuckyNumber())\n// prints: 42\n`}\n{`By passing an argument to the function, we can update it's internal state.\nWhen calling the reactive value function without argumens, it will always return the value we've passed into it the last time.`}\n{`You can put any value you like into a reactive value.\nBut, for all practical purposes, you've should consider this value to be immutable.\nThis will greatly benefit the understanding of the code base once it grows big enough.\nBut, more on that later.`}\n{`See the `}{`Philosophy`}{` for some more background on this idea.`}\n{`drv`}{`: derived values`}\n{`“`}{`\"No, officer 👮‍♀️, I don't drv(thunk)!\" `}{`”`}{` `}{`—`}{` Erik Rasmussen`}\n{`In my humble opinion, good lucky numbers should at least be odd. So we can quickly run a check for that:`}\n{`const myLuckyNumber = val(13)\nconst isGoodLuckyNumber = myLuckyNumber() % 2 === 1\n`}\n{`That works. But is a bit limited, if we update `}{`myLuckyNumber`}{` later on, this change won't be reflected\nin `}{`isGoodLuckyNumber`}{`.\nBut, using `}{`drv`}{` we can repeat a similar trick as we did for `}{`val`}{`:\nInstead of capturing some state, `}{`drv`}{` captures a computation.\nIt returns a function, that, when invoked, runs the computation once.`}\n{`const myLuckyNumber = val(13)\nconst isGoodLuckyNumber = drv(() => myLuckyNumber() % 2 === 1)\n\nconsole.log(isGoodLuckyNumber()) // true\nmyLuckyNumber(42)\nconsole.log(isGoodLuckyNumber()) // false\n`}\n{`drv`}{` can be used to `}{`derive`}{` arbitrarly simple or complex values based on other reactive values, created by either `}{`drv`}{` or `}{`val`}{`.`}\n{`The critical reader might think at this point: `}{`“`}{`That's nice and dandy, but you couldn't we just have used `}{`const isGoodLuckyNumber = () => myLuckyNumber() % 2 === 1`}{`?`}{`”`}{`.\nAnd that is true, glad you ask. That would indeed have yielded the same output.\nBut! Using `}{`drv`}{` brings in a few new possiblities:`}\n{`First, `}{`drv`}{` will memoize`}{`(usually)`}{` it's results. That is: as long as `}{`myLuckyNumber`}{` doesn't change, invoking `}{`isGoodLuckyNumber()`}{` multiple times won't actually re-evaluate the original expression, but just return a memoized result.`}\n{`Secondly, and more importantly. So far we having been pulling values through our system by explicitly calling `}{`myLuckyNumber()`}{` or `}{`isGoodLuckyNumber()`}{`.\nBut in a reactive system, the control flow is inversed`}{`1`}{`.\nTo build a reactive system, we have to push our values to consumers and actively `}{`notify`}{` them.`}\n{`sub`}{`: listing to changes`}\n{`And that is where `}{`sub`}{` comes in!\nWith `}{`sub`}{`, one can create a consumer of a reactive value created using `}{`val`}{` or `}{`drv`}{`.\nIn other words, it sets up a `}{`subscription`}{`.\nThis creates a `}{`we'll call you`}{` basis of operation:`}\n{`const myLuckyNumber = val(13)\nconst isGoodLuckyNumber = drv(() => myLuckyNumber() % 2 === 1)\n\nconst cancelPrint = sub(isGoodLuckyNumber, isGood => {\n console.log(isGood)\n})\n\nmyLuckyNumber(42) // prints: 'false'\nmyLuckyNumber(33) // prints: 'true'\nmyLuckyNumber(55) // (doesn't print, isGoodLuckyNumber didn't produce a new value)\nmyLuckyNumber(2) // prints: 'false'\n\ncancelPrint() // stop listening to future updates\n`}\n{`Finally, we did something that we couldn't have achieved by using just plain functions and omitting `}{`drv`}{` or `}{`val`}{`.\nWhat `}{`drv`}{` and `}{`val`}{` achieve is that they set up a dependency system, so that when we update state, this state is propagated through the derived values, to the subscriptions.\nTransparent reactive programming is used to determine the optimal program flow, and based on the `}{`MobX`}{` package.`}\n{`Note that we didn't pass `}{`isGoodLuckyNumber()`}{`! We want to subscribe to the function's future output, not to it's current value (`}{`13`}{`).\nAlso note that `}{`sub`}{` returns a function. This function has only one purpose: cancelling future executions of the subscription.`}\n{`A remarkable property about `}{`sub`}{` is that you don't need them as often as you would initially think.\nThey are not needed to propagate values through your system. `}{`drv`}{` can take care of that.\n`}{`sub`}{` is generally only need to achieve side effects; visible output from your system.\nSuch as updating the UI, logging, making network effects etc. `}\n{`act`}{`: batching updates`}\n{`TODO: run or act?`}\n{`You might have noticed that in the previous listening or side effects where immediately fired when emitting an update to `}{`myLuckyNumber`}{`.\nThis is just the default behavior and there are several ways to influence it.\nFirst of all, we can use techniques like debounce to roun our subscriptions less frequently.\nBut more importantly, we can hold of the reactive system to wait a bit until we've done all our updates,\nso that changes will be broadcased as one atomic update.\nTo express that, there is `}{`act`}{` to group multiple changes into a single `}{`activity`}{`: `}\n{`const cancelPrint = sub(isGoodLuckyNumber, isGood => {\n console.log(isGood)\n})\n\nact(() => {\n myLuckyNumber(42) \n myLuckyNumber(33)\n myLuckyNumber(55)\n myLuckyNumber(2) \n}) // prints only once, at the end of the activity: 'false'\n`}\n{`That's all! Note that `}{`act`}{` only batches `}{`synchronosly`}{` run updates. Passing an `}{`async`}{` function to `}{`act`}{` is in that regard mostly useless.`}\n\n{`Your system will most probably not be expressible in a single `}{`val`}{`, `}{`drv`}{` and `}{`sub`}{`.\nBut, we've now covered the entire basic mechanism of \"rval\"!\nIn the next sections we will focus on organizing many different values, objects etc.\nAnd see how we can hook up the UI.`}\n\n\n\n{`drv`}{` will by default memoize as long as there is at least one active subscription. Without subscriptions, memoization will be disabled to avoid accidentally leaking memory. The behavior can be overriden by using the `}{`keepAlive`}{` option. (TODO).`}{`↩`}\n{`Wiki: `}{`Inversion of control`}{`↩`}\n{`(a.k.a. inversion of control)`}{`↩`}\n\n\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-20-objects-and-factories.65e655c9.js b/docs/static/js/docs-source-0-introduction-20-objects-and-factories.65e655c9.js new file mode 100644 index 0000000..585edd3 --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-20-objects-and-factories.65e655c9.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"./docs_source/0_introduction/20_objects-and-factories.mdx":function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return d});var a=n("./node_modules/react/index.js"),o=n.n(a),r=n("./node_modules/@mdx-js/tag/dist/index.js");function s(e){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e,t){for(var n=0;n done() ? " * [x] ~" + title() + "~" : " * [ ] " +title())\n const toggle = act(() {\n done(!done())\n })\n\n return {\n title, done, toggle, asMarkdown\n }\n}\n')),o.a.createElement(r.MDXTag,{name:"p",components:t},"So, we now have a factory that creates an immutable object, containing some reactive values, derivations and actions.\nNote that we are only creating ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"const"),"s in these listing, and we neatly avoided using ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"this"),", which might save some headaches down the road!",o.a.createElement(r.MDXTag,{name:"sup",components:t,parentName:"p",props:{id:"fnref-2"}},o.a.createElement(r.MDXTag,{name:"a",components:t,parentName:"sup",props:{href:"#fn-2",className:"footnote-ref"}},"2"))),o.a.createElement(r.MDXTag,{name:"p",components:t},"Let's put our code to the test and create a ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"sub")," to observe the effects of our state updates:"),o.a.createElement(r.MDXTag,{name:"pre",components:t},o.a.createElement(r.MDXTag,{name:"code",components:t,parentName:"pre",props:{className:"language-javascript"}},'const myFirstTodo = createTodo("Get coffee")\nsub(myFirstTodo.asMarkdown, md => {\n console.log(md)\n}\n\nmyFirstTodo.title("Get coffee and cookie")\n// Prints: * [ ] Get coffee and cookie\n\nmyFirstTodo.toggle()\n// Prints: * [x] ~Get coffee and cookie~\n')),o.a.createElement(r.MDXTag,{name:"p",components:t},"Yeah, our first factory is a fact!"),o.a.createElement(r.MDXTag,{name:"p",components:t},o.a.createElement(r.MDXTag,{name:"em",components:t,parentName:"p"},"Tip: When starting with RVal, it will take mere seconds before you will forget parenthesis for the first and write ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"em"},"if (todo.done) ...")," instead of ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"em"},"if (todo.done())"),". So be smart. Or, use TypeScript so that you don't have be (Granted, TypeScript won't catch all of those mistakes, but hopefully enough to learn the right habits).")," "),o.a.createElement(r.MDXTag,{name:"h2",components:t,props:{id:"creating-collections"}},"Creating collections"),o.a.createElement(r.MDXTag,{name:"p",components:t},"At this point you might be wondering, ok, you tricked me with objects. But how do I organize a collection of todo items, with just using ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"val"),".\nThe answer is: we'll repeat the same trick.\nLet's quickly design a factory for a \"todoStore\":"),o.a.createElement(r.MDXTag,{name:"pre",components:t},o.a.createElement(r.MDXTag,{name:"code",components:t,parentName:"pre",props:{className:"language-javascript"}},'function createTodoStore() {\n const todos = val([])\n\n function addTodo(title) {\n todos([\n ...todos(),\n createTodo(title)\n ])\n }\n\n return { todos, addTodo }\n}\n\nconst store = createTodoStore()\nstore.addTodo("Go for a walk")\nconsole.log(tore.todos().map(todo => todo.title())) // prints: ["Go for a walk"]\n')),o.a.createElement(r.MDXTag,{name:"p",components:t},"See what we did there? We introduced a ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"val")," to maintain our collection of todos, but the value we assign to it/ read from it, we still consider it as immutable!\nSo, we always replace the entire collection. But, we recycle all the contents, so it isn't to involved.\nSo, when using RVal, the recommended approach is to always produces those trees that are immutable themselves, but have stateful reactive values inside them, which always store a scalar value, but their contents aren't actively mutated.\nIn fact, by default RVal will help you with that; it will automatically deeply freeze any value you store in ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"val"),"!\nThis makes sure that an error will throw if you accidentally write something that would otherwise mutate the contents, like ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},'store.todos().push(createTodo("Go for a walk))'),".\nThis way of organizing could be expressed as: using ",o.a.createElement(r.MDXTag,{name:"em",components:t,parentName:"p"},"immutable, but stateful objects"),"."),o.a.createElement(r.MDXTag,{name:"p",components:t},o.a.createElement(r.MDXTag,{name:"em",components:t,parentName:"p"},"Note: that this approach doesn't suffer too much from writing complex deep updates, because a deep update is just reads until you arrive at the location for the update. You don't have to produce an entire new state tree. For example this is a valid \"deep update\": ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"em"},"store.todos()[0].done(true)"))),o.a.createElement(r.MDXTag,{name:"p",components:t},o.a.createElement(r.MDXTag,{name:"em",components:t,parentName:"p"},"Tip: The autofreeze behavior can be disabled for performance reasons, by using ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"em"},"configure({ autoFreeze: false })"),".")),o.a.createElement(r.MDXTag,{name:"h2",components:t,props:{id:"using-classes"}},"Using classes"),o.a.createElement(r.MDXTag,{name:"p",components:t},"You might be wondering whether it is possible to use classes instead of factory functions.\nThe answer is, yes that is perfectly possible.\nThe reason for the chose approach in this documentation however, is that it hopefully set's you up for the ",o.a.createElement(r.MDXTag,{name:"a",components:t,parentName:"p",props:{href:"https://medium.com/@ricomariani/the-pit-of-success-cfefc6cb64c8"}},"Pit of Success"),".\nOnce you get used to this approach, there should be less places where you can accidentally error, you can't forget to bind a function,\nand the mental model becomes really trivial: Nothing should or can't be modified. Except ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"val"),"s."),o.a.createElement(r.MDXTag,{name:"p",components:t},"That being said, in an existing codebase it might be easier to start with introducing reactive values at certain places and keep the rest as is.\nIf you are using TypeScript, it is highly recommended to use the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"readonly")," keyword when ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"val")," as classfield: ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"p"},"readonly done = val(false)"),".\nThis will protect you against accidental reassignments of the field."),o.a.createElement(r.MDXTag,{name:"h2",components:t,props:{id:"next-steps"}},"Next steps"),o.a.createElement(r.MDXTag,{name:"p",components:t},"TODO: fix links"),o.a.createElement(r.MDXTag,{name:"p",components:t},"This page covered the basics of working with objects and collections in RVal.\nTo dive a bit deeper, you might want to check these sections out later:"),o.a.createElement(r.MDXTag,{name:"ul",components:t},o.a.createElement(r.MDXTag,{name:"li",components:t,parentName:"ul"},"Using updaters to simplify writing the update functions"),o.a.createElement(r.MDXTag,{name:"li",components:t,parentName:"ul"},"Using models to simplify and reduce the boilerplate of writing factories")),o.a.createElement(r.MDXTag,{name:"div",components:t,props:{className:"footnotes"}},o.a.createElement(r.MDXTag,{name:"hr",components:t,parentName:"div"}),o.a.createElement(r.MDXTag,{name:"ol",components:t,parentName:"div"},o.a.createElement(r.MDXTag,{name:"li",components:t,parentName:"ol",props:{id:"fn-1"}},"In MobX, roughly 75% of the code base is dealing with decorators, making plain data structures observable and dealing with the various different ways that people have to work with objects.",o.a.createElement(r.MDXTag,{name:"a",components:t,parentName:"li",props:{href:"#fnref-1",className:"footnote-backref"}},"\u21a9")),o.a.createElement(r.MDXTag,{name:"li",components:t,parentName:"ol",props:{id:"fn-2"}},"For ",o.a.createElement(r.MDXTag,{name:"em",components:t,parentName:"li"},"super")," performance critical applications (measure before optimizing!), one could use ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"li"},"Object.create")," and store all methods on the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"li"},"prototype"),". Those methods would then rely on using ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:t,parentName:"li"},"this"),", but it would avoid creating a closure for each method on each instance.",o.a.createElement(r.MDXTag,{name:"a",components:t,parentName:"li",props:{href:"#fnref-2",className:"footnote-backref"}},"\u21a9")))))}}])&&c(n.prototype,a),s&&c(n,s),t}();d.__docgenInfo={description:"",methods:[],displayName:"MDXContent"}}}]); +//# sourceMappingURL=docs-source-0-introduction-20-objects-and-factories.d61b86e3a14b0f31e0d0.js.map \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-20-objects-and-factories.d61b86e3a14b0f31e0d0.js.map b/docs/static/js/docs-source-0-introduction-20-objects-and-factories.d61b86e3a14b0f31e0d0.js.map new file mode 100644 index 0000000..eff3176 --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-20-objects-and-factories.d61b86e3a14b0f31e0d0.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./docs_source/0_introduction/20_objects-and-factories.mdx"],"names":["MDXContent","props","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","layout","React","Component","_this$props","components","_objectWithoutProperties","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","_mdx_js_tag__WEBPACK_IMPORTED_MODULE_1__","name","id","parentName","href","className"],"mappings":"o8CAKqBA,cACnB,SAAAA,EAAYC,GAAO,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACjBE,EAAAG,EAAAD,KAAAE,EAAAN,GAAAO,KAAAH,KAAMH,KACDO,OAAS,KAFGN,yPADmBO,IAAMC,kDAKnC,IAAAC,EAC0BP,KAAKH,MAA9BW,EADDD,EACCC,WADDC,EAAAF,EAAA,gBAGP,OAAOG,EAAAC,EAAAC,cAACC,EAAA,OAAD,CACEC,KAAK,UAELN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,oCAAvD,mCACrCL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,wPAIAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,iFACzCN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,6KACgEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,EAAYQ,WAAW,IAAInB,MAAO,CAACkB,GAAK,YAAYL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,KAAO,QAAQC,UAAY,iBAA7F,MADnJ,aAEAR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,0OAEAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,wEAAkHE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,QAAlH,sDACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACqB,UAAY,wBAAjF,6JAW3CR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,sDAAgGE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,SAAhG,qBAAyMN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,eAAzM,oIAC2CN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,8BAD3C,0GAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,2BAAvD,0BACAL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,6HACqCE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,WADrC,aAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACqB,UAAY,wBAAjF,2NAY3CR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,6KACuCE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OADvC,uBACgJN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OADhJ,+CAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACqB,UAAY,wBAAjF,iUAa3CR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,yJACiCE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,SADjC,mDACwKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,QADxK,mDAC8SN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,EAAYQ,WAAW,IAAInB,MAAO,CAACkB,GAAK,YAAYL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,KAAO,QAAQC,UAAY,iBAA7F,OACjYR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,+CAAyFE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAzF,iDACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACqB,UAAY,wBAAjF,wQAW3CR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,sCACAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,sHAAgLN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,sBAAhL,eAAiSN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,oBAAjS,wKAAzC,KACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,yBAAvD,wBACAL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,4IAAsLE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAtL,uGAGAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACqB,UAAY,wBAAjF,oXAiB3CR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,0CAAoFE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAApF,8jBAG+GN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAH/G,kIAI8HN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,kDAJ9H,0DAKsDN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,mCALtD,KAMAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,6QAAqUN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,iCAC9WN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,kFAA4IN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,oCAA5I,MACzCN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,kBAAvD,iBACAL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,0PAE6GE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,IAAInB,MAAO,CAACoB,KAAO,oEAAvE,kBAF7G,uOAI2FP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAJ3F,MAKAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,sNACmEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,YADnE,iBAC2KN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAD3K,mBACgRN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,8BADhR,2EAGAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,eAAvD,cACAL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,mBACAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,0JAEAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,GAC9BE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,MAArD,2DACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,MAArD,6EAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,EAAYX,MAAO,CAACqB,UAAY,cAC/DR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,QACrDN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,OACrDN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACkB,GAAK,SAAvE,+LAAgRL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACoB,KAAO,WAAWC,UAAY,qBAA/F,WAChRR,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACkB,GAAK,SAAvE,OAAwFL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,MAArD,SAAxF,kFAAuPN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,iBAAvP,iCAAqXN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,aAArX,4CAA0fN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,QAA1f,4EAA0pBN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,KAAKnB,MAAO,CAACoB,KAAO,WAAWC,UAAY,qBAA/F","file":"static/js/docs-source-0-introduction-20-objects-and-factories.65e655c9.js","sourcesContent":["\n import React from 'react'\n import { MDXTag } from '@mdx-js/tag'\n \n\nexport default class MDXContent extends React.Component {\n constructor(props) {\n super(props)\n this.layout = null\n }\n render() {\n const { components, ...props } = this.props\n\n return {`Working with objects and arrays`}\n{`So far we only used stand-alone reactive values to capture our state.\nBut in real world applications we will need complex objects or state trees.\nBut suprisingly, RVal however doesn't offer a primitive to work with objects or array.\nInstead:`}\n{`consider every object or array as an immutable collection of reactive values`}\n{`By keeping objects and arrays themself immutable, it turns out that the mental model remains much simpler,\nand the API surface that is needed to apply reactivity is much`}{`1`}{` smaller.`}\n{`But, that doesn't RVal is awkward of inconvenient when working with objects.\nInstead, it turns out that using objects, which are structurally immutable, but contain stateful reactive values, are presently convenient to work with.`}\n{`Let's start a bit simple with an object that captures the state of a `}{`Todo`}{` item (with apologies for the uninspired example):`}\n{`const title = val('Get coffee')\nconst done = val(false)\n\nconst myFirstTodo = {\n title,\n done,\n}\n\ntitle.done(true)\nconsole.log(title.done())\n`}\n{`Pretty straight forward eh? Note that we used only `}{`const`}{` values, and that `}{`myFirstTodo`}{` itself should be treated as an immutable objects to keep the conceptuel model simple.\n(In fact, it would be recommended to use `}{`Object.freeze(myFirstTodo)`}{`, but it turns out that RVal will take care of that as well in most cases, as we will discover later).`}\n{`A first object factory`}\n{`Probably you don't want to create multiple todo's in your application, intead of one.\nTo ease that process we can make a `}{`factory`}{` funtion:`}\n{`function createTodo(initialTitle) {\n const title = val(initialTitle)\n const done = val(false)\n return {\n title,\n done,\n }\n}\n\nconst myFirstTodo = createTodo(\"Get coffee\")\nmyFirstTodo.done(true)\n`}\n{`Ok, that was easy! But our factory function can do more than just instating some reactive values and combining them into an object.\nWe can add define derived data using `}{`drv`}{`, and actions using `}{`act`}{`, and make them part of the object as well:`}\n{`function createTodo(initialTitle) {\n const title = val(initialTitle)\n const done = val(false)\n const asMarkdown(() => done() ? \" * [x] ~\" + title() + \"~\" : \" * [ ] \" +title())\n const toggle = act(() {\n done(!done())\n })\n\n return {\n title, done, toggle, asMarkdown\n }\n}\n`}\n{`So, we now have a factory that creates an immutable object, containing some reactive values, derivations and actions.\nNote that we are only creating `}{`const`}{`s in these listing, and we neatly avoided using `}{`this`}{`, which might save some headaches down the road!`}{`2`}\n{`Let's put our code to the test and create a `}{`sub`}{` to observe the effects of our state updates:`}\n{`const myFirstTodo = createTodo(\"Get coffee\")\nsub(myFirstTodo.asMarkdown, md => {\n console.log(md)\n}\n\nmyFirstTodo.title(\"Get coffee and cookie\")\n// Prints: * [ ] Get coffee and cookie\n\nmyFirstTodo.toggle()\n// Prints: * [x] ~Get coffee and cookie~\n`}\n{`Yeah, our first factory is a fact!`}\n{`Tip: When starting with RVal, it will take mere seconds before you will forget parenthesis for the first and write `}{`if (todo.done) ...`}{` instead of `}{`if (todo.done())`}{`. So be smart. Or, use TypeScript so that you don't have be (Granted, TypeScript won't catch all of those mistakes, but hopefully enough to learn the right habits).`}{` `}\n{`Creating collections`}\n{`At this point you might be wondering, ok, you tricked me with objects. But how do I organize a collection of todo items, with just using `}{`val`}{`.\nThe answer is: we'll repeat the same trick.\nLet's quickly design a factory for a \"todoStore\":`}\n{`function createTodoStore() {\n const todos = val([])\n\n function addTodo(title) {\n todos([\n ...todos(),\n createTodo(title)\n ])\n }\n\n return { todos, addTodo }\n}\n\nconst store = createTodoStore()\nstore.addTodo(\"Go for a walk\")\nconsole.log(tore.todos().map(todo => todo.title())) // prints: [\"Go for a walk\"]\n`}\n{`See what we did there? We introduced a `}{`val`}{` to maintain our collection of todos, but the value we assign to it/ read from it, we still consider it as immutable!\nSo, we always replace the entire collection. But, we recycle all the contents, so it isn't to involved.\nSo, when using RVal, the recommended approach is to always produces those trees that are immutable themselves, but have stateful reactive values inside them, which always store a scalar value, but their contents aren't actively mutated.\nIn fact, by default RVal will help you with that; it will automatically deeply freeze any value you store in `}{`val`}{`!\nThis makes sure that an error will throw if you accidentally write something that would otherwise mutate the contents, like `}{`store.todos().push(createTodo(\"Go for a walk))`}{`.\nThis way of organizing could be expressed as: using `}{`immutable, but stateful objects`}{`.`}\n{`Note: that this approach doesn't suffer too much from writing complex deep updates, because a deep update is just reads until you arrive at the location for the update. You don't have to produce an entire new state tree. For example this is a valid \"deep update\": `}{`store.todos()[0].done(true)`}\n{`Tip: The autofreeze behavior can be disabled for performance reasons, by using `}{`configure({ autoFreeze: false })`}{`.`}\n{`Using classes`}\n{`You might be wondering whether it is possible to use classes instead of factory functions.\nThe answer is, yes that is perfectly possible.\nThe reason for the chose approach in this documentation however, is that it hopefully set's you up for the `}{`Pit of Success`}{`.\nOnce you get used to this approach, there should be less places where you can accidentally error, you can't forget to bind a function,\nand the mental model becomes really trivial: Nothing should or can't be modified. Except `}{`val`}{`s.`}\n{`That being said, in an existing codebase it might be easier to start with introducing reactive values at certain places and keep the rest as is.\nIf you are using TypeScript, it is highly recommended to use the `}{`readonly`}{` keyword when `}{`val`}{` as classfield: `}{`readonly done = val(false)`}{`.\nThis will protect you against accidental reassignments of the field.`}\n{`Next steps`}\n{`TODO: fix links`}\n{`This page covered the basics of working with objects and collections in RVal.\nTo dive a bit deeper, you might want to check these sections out later:`}\n\n{`Using updaters to simplify writing the update functions`}\n{`Using models to simplify and reduce the boilerplate of writing factories`}\n\n\n\n\n{`In MobX, roughly 75% of the code base is dealing with decorators, making plain data structures observable and dealing with the various different ways that people have to work with objects.`}{`↩`}\n{`For `}{`super`}{` performance critical applications (measure before optimizing!), one could use `}{`Object.create`}{` and store all methods on the `}{`prototype`}{`. Those methods would then rely on using `}{`this`}{`, but it would avoid creating a closure for each method on each instance.`}{`↩`}\n\n\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-30-with-react.d61b86e3a14b0f31e0d0.js.map b/docs/static/js/docs-source-0-introduction-30-with-react.d61b86e3a14b0f31e0d0.js.map new file mode 100644 index 0000000..9fe55f5 --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-30-with-react.d61b86e3a14b0f31e0d0.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./docs_source/0_introduction/30_with-react.mdx"],"names":["MDXContent","props","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","layout","React","Component","_this$props","components","_objectWithoutProperties","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","_mdx_js_tag__WEBPACK_IMPORTED_MODULE_1__","name"],"mappings":"y7CAKqBA,cACnB,SAAAA,EAAYC,GAAO,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACjBE,EAAAG,EAAAD,KAAAE,EAAAN,GAAAO,KAAAH,KAAMH,KACDO,OAAS,KAFGN,yPADmBO,IAAMC,kDAKnC,IAAAC,EAC0BP,KAAKH,MAA9BW,EADDD,EACCC,WADDC,EAAAF,EAAA,gBAGP,OAAOG,EAAAC,EAAAC,cAACC,EAAA,OAAD,CACEC,KAAK,UAELN,WAAYA","file":"static/js/docs-source-0-introduction-30-with-react.e2437ad7.js","sourcesContent":["\n import React from 'react'\n import { MDXTag } from '@mdx-js/tag'\n \n\nexport default class MDXContent extends React.Component {\n constructor(props) {\n super(props)\n this.layout = null\n }\n render() {\n const { components, ...props } = this.props\n\n return \n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-30-with-react.e2437ad7.js b/docs/static/js/docs-source-0-introduction-30-with-react.e2437ad7.js new file mode 100644 index 0000000..4bab71d --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-30-with-react.e2437ad7.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"./docs_source/0_introduction/30_with-react.mdx":function(t,e,n){"use strict";n.r(e),n.d(e,"default",function(){return s});var o=n("./node_modules/react/index.js"),r=n.n(o),u=n("./node_modules/@mdx-js/tag/dist/index.js");function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(null==t)return{};var n,o,r=function(t,e){if(null==t)return{};var n,o,r={},u=Object.keys(t);for(o=0;o=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function f(t,e){for(var n=0;n=0||(o[a]=e[a]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}function c(e,n){for(var a=0;aHello ${user.fullName}\n')),o.a.createElement(r.MDXTag,{name:"p",components:n},"This simple snippet introduces a redundant copy of the original user's name in the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"fullName")," property, and in the DOM.\nNow it has become the programmers responsibility to make sure any futher changes to the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"user")," are propagated properly:"),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},'function updateFirstName(newName) {\n user.firstName = newName\n user.fullName = user.firstName + " " + user.lastName\n document.body.innerHTML = `

Hello ${user.fullName}

\n}\n')),o.a.createElement(r.MDXTag,{name:"p",components:n},"This is the problem that any state management abstraction, regardless the framework or paradigm that is used, is trying to solve.\nRVal introduces a handful of primitives that help you to solve this problem in any context, by automating the question:\n",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"when")," should ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"which")," transformation be applied?"),o.a.createElement(r.MDXTag,{name:"p",components:n},"Here is a quick overview in how RVal helps solving that problem.\nFirst, we should recognize that imperatively computing new information, such as the DOM represantation, introduces stale values.\nHowever, we can avoid ever storing such information by storing ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"computations"),", rather than ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"values"),".\nThe process for that is as simple as creating a ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"thunk")," (argumentless function) that capture the computation, rather than imperatively producing new values:"),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},'const user = {\n firstName: "Jane",\n lastName: "Stanford",\n fullName: () => user.firstName + " " + user.lastName\n}\n\nconst rendering = () => `

Hello ${user.fullName()}

`\n\ndocument.body.innerHTML = rendering()\n\nfunction updateFirstName(newName) {\n user.firstName = newName\n document.body.innerHTML = rendering()\n}\n')),o.a.createElement(r.MDXTag,{name:"p",components:n},"We've made things slightly better now; we don't have to imperatively update ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"user.fullName")," anymore if the name changes.\nSimilarly, we could captured the rendered representation of the user in the thunk called ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"rendering"),"."),o.a.createElement(r.MDXTag,{name:"p",components:n},"By storing computations instead of values, we have reduced the amount of redundant information.\nHowever, we still have to make sure that our changes are propagated, for example by updating the DOM whenever we change the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"firstName")," property."),o.a.createElement(r.MDXTag,{name:"p",components:n},"But, what if we could ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"subscribe")," to our thunks? And thereby avoid the need to manually propagate state changes, and increasing decoupling in the process?\nIn other words, what if we could write something like:"),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},"const user = { /* as-is */ }\nconst rendering = () => `

Hello ${user.fullName()}

`\n\non(rendering, () => {\n document.body.innerHTML = rendering()\n})\n\nfunction updateFirstName(newName) {\n user.firstName = newName\n}\n")),o.a.createElement(r.MDXTag,{name:"p",components:n},"Well, here is the good news: This is exactly the kind of things RVal allows you to write, by introducing three concepts:"),o.a.createElement(r.MDXTag,{name:"ol",components:n},o.a.createElement(r.MDXTag,{name:"li",components:n,parentName:"ol"},o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"li"},"val(value)")," to create pieces of information that can change over time"),o.a.createElement(r.MDXTag,{name:"li",components:n,parentName:"ol"},o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"li"},"drv(thunk)")," to create thunks that can be subscribed to"),o.a.createElement(r.MDXTag,{name:"li",components:n,parentName:"ol"},o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"li"},"sub(something, listener)")," to create a listener that fires whenever the provided reactive value or thunk changes")),o.a.createElement(r.MDXTag,{name:"p",components:n},"With those concepts, we can rewrite our above listing as a combination of reactive values and thunks, that propagate the changes when needed!"),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},'import { val, drv, sub } from "rval"\n\nconst user = {\n firstName: val("Jane"),\n lastName: val("Stanford"),\n fullName: drv(() => user.firstName() + " " + user.lastName())\n}\n\nconst rendering = drv(`

Hello ${user.fullName()}

`)\n\n// subscribe to the \'rendering\' thunk\nsub(rendering, () => {\n document.body.innerHTML = rendering()\n})\n\nfunction updateFirstName(newName) {\n // change the `firstName` reactive value to \'newName\'\n // rval will make sure that any derivation and subscription impacted by this\n // change will be re-evaluated (and nothing more).\n user.firstName(newName)\n}\n')),o.a.createElement(r.MDXTag,{name:"h2",components:n,props:{id:"functions-solidify-state"}},"Functions solidify state"),o.a.createElement(r.MDXTag,{name:"p",components:n},'At this point you might be wondering:\n"But ',o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"why")," is it interesting to trap our state inside these ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val"),' functions?"'),o.a.createElement(r.MDXTag,{name:"p",components:n},"By trapping all our pieces of state inside ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val")," functions,\nwe achieved a very interesting property:\nWe've practically forced ourselfs to have a single source of truth.\nInstead of passing the ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"values of our state")," around, we can now pass a ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"references to our state")," around.\nThe benefit of this that it will stop us from accidentally creating redundant copies of our state."),o.a.createElement(r.MDXTag,{name:"p",components:n},"Take for example the following contrived function.\nIt creates a random number generator, which is more likely to generate our lucky number than any other number: "),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},"function createNumberGenerator(luckyNumber) {\n return function numberGenerator() {\n return Math.random() < 0.5 ? luckyNumber : Math.round(Math.random() * 100)\n }\n}\n\nlet luckyNumber = 13\nconst generator = createNumberGenerator(luckyNumber)\nconsole.log(generator()) // 13\nconsole.log(generator()) // 50\nconsole.log(generator()) // 49\n\nluckyNumber = 42\nconsole.log(generator()) // 28\nconsole.log(generator()) // 13\nconsole.log(generator()) // 13\n")),o.a.createElement(r.MDXTag,{name:"p",components:n},"Now at this point, updating our ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"luckyNumber")," variable doesn't get reflected in the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"numberGenerator")," anymore.\nWe are forced now to create a new number generator to reflect the change in our preference.\nThe problem is that the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"luckyNumber"),' has been "trapped" as argument to ',o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"createNumberGenerator"),".\nThe argument is basically a ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"copy")," of the original ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"luckyNumber")," variable. "),o.a.createElement(r.MDXTag,{name:"p",components:n},"However, it is easy to see that by passing ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"functions")," around, we avoid this whole problem.\nBecause ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"luckyNumber")," itself now becomes a ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"const")," reference to the function that traps our lucky number.\n(Yes, ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"let")," and ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"var")," really become anti-patterns when using ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"rval"),")."),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},"function createNumberGenerator(luckyNumber) {\n return function numberGenerator() {\n // luckyNumber get's evaluated lazily when generating numbers\n return Math.random() < 0.5 ? luckyNumber() : Math.round(Math.random() * 100)\n }\n}\n\nconst luckyNumber = val(13) // luckyNumber is a const now!\nconst generator = createNumberGenerator(luckyNumber)\nconsole.log(generator()) // 13\nconsole.log(generator()) // 13\nconsole.log(generator()) // 22\n\nluckyNumber(42) // change our minds\nconsole.log(generator()) // 42\nconsole.log(generator()) // 8\nconsole.log(generator()) // 42\n")),o.a.createElement(r.MDXTag,{name:"p",components:n},"By capturing values in functions, it becomes much more explicit when we want to pass a ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"reference"),", and when a ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"value"),".\nIf we want our number generator to take a one-time snapshot of the state as ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"luckyNumber")," we can be explicit about it and ",o.a.createElement(r.MDXTag,{name:"em",components:n,parentName:"p"},"explicitly")," pass a copy of the current state ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"createNumberGenerator(luckyNumber())"),".\nOn the other hand, we can also explicitly pass a reference to the state by just passing the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"luckyNumber")," function itself as we did above. "),o.a.createElement(r.MDXTag,{name:"p",components:n},"As it turns out, in many cases it is very intersting to pass around a reference instead of a value.\nEspecially when we are building systems that are supposed to be reactive, such as a user interface.\nBut that for later sections. "),o.a.createElement(r.MDXTag,{name:"hr",components:n}),o.a.createElement(r.MDXTag,{name:"p",components:n},"Note that the essence of ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val")," is simply this: "),o.a.createElement(r.MDXTag,{name:"pre",components:n},o.a.createElement(r.MDXTag,{name:"code",components:n,parentName:"pre",props:{className:"language-javascript"}},"function val(initial) {\n let state = initial\n return function() {\n if (!arguments.length)\n return state\n state = arguments[0]\n }\n}\n")),o.a.createElement(r.MDXTag,{name:"p",components:n},"RVal's implementation is a little more involved, but that is because it is possible to subscribe to the ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"state")," of a ",o.a.createElement(r.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"val"),".\nBut the above is how you can conceptually think about them. "),o.a.createElement(r.MDXTag,{name:"p",components:n},"But, let's ",o.a.createElement(r.MDXTag,{name:"a",components:n,parentName:"p",props:{href:"http://localhost:3000/docs-getting-started"}},"get started"),' with the core "rval" api first!'))}}])&&c(a.prototype,t),m&&c(a,m),n}();u.__docgenInfo={description:"",methods:[],displayName:"MDXContent"}}}]); +//# sourceMappingURL=docs-source-0-introduction-40-philosophy.d61b86e3a14b0f31e0d0.js.map \ No newline at end of file diff --git a/docs/static/js/docs-source-0-introduction-40-philosophy.d61b86e3a14b0f31e0d0.js.map b/docs/static/js/docs-source-0-introduction-40-philosophy.d61b86e3a14b0f31e0d0.js.map new file mode 100644 index 0000000..9723b5c --- /dev/null +++ b/docs/static/js/docs-source-0-introduction-40-philosophy.d61b86e3a14b0f31e0d0.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./docs_source/0_introduction/40_philosophy.mdx"],"names":["MDXContent","props","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","layout","React","Component","_this$props","components","_objectWithoutProperties","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","_mdx_js_tag__WEBPACK_IMPORTED_MODULE_1__","name","id","parentName","className","href"],"mappings":"y7CAKqBA,cACnB,SAAAA,EAAYC,GAAO,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACjBE,EAAAG,EAAAD,KAAAE,EAAAN,GAAAO,KAAAH,KAAMH,KACDO,OAAS,KAFGN,yPADmBO,IAAMC,kDAKnC,IAAAC,EAC0BP,KAAKH,MAA9BW,EADDD,EACCC,WADDC,EAAAF,EAAA,gBAGP,OAAOG,EAAAC,EAAAC,cAACC,EAAA,OAAD,CACEC,KAAK,UAELN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,2BAAvD,0BACrCL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,+ZAGAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,wKAQ3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,sFAAgIE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,YAAhI,uHAC0FN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,QAD1F,6BAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,qMAM3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,+PAEEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,QAFF,WAEwFN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,SAFxF,+BAGAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,sQAEiEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,gBAFjE,iBAEqKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,UAFrK,sDAGkDN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,SAHlD,yGAIAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,gWAe3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,+EAAyHE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,iBAAzH,2HAC2FN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,aAD3F,KAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,gOAC8HE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,aAD9H,cAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,yBAAmEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,aAAnE,qLAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,gPAW3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,4HACAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,GAC9BE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,MAAKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,cAA1D,8DACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,MAAKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,cAA1D,+CACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,MAAKN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,MAA7D,4BAA1D,2FAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,iJACAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,8nBAsB3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,6BAAvD,4BACAL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,+CACOE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,OADP,qDACsIN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OADtI,gBAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,8CAAwFE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAxF,sJAGyBN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,uBAHzB,8BAGiJN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,2BAHjJ,gHAKAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,uKAEAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,6dAiB3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,mCAA6EE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,eAA7E,0CAAiNN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,mBAAjN,mIAE0BN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,eAF1B,sCAE0JN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,yBAF1J,kCAG8BN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,QAH9B,oBAG6HN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,eAH7H,eAIAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,8CAAwFE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,aAAxF,kDACUN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,eADV,yBAC6HN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,SAD7H,kEAEQN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAFR,QAEkGN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAFlG,2CAE+NN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,QAF/N,MAGAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,8lBAkB3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,0FAAoIE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,aAApI,gBAAoON,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,SAApO,kFAC8EN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,eAD9E,oCAC4MN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYQ,WAAW,KAArD,cAD5M,qCACkUN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,wCADlU,kGAE8FN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,eAF9F,sCAGAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,2OAGAE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,IAC9BE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,4BAAsEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAtE,qBACAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,MAAMN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,OAAON,WAAYA,EAAYQ,WAAW,MAAMnB,MAAO,CAACoB,UAAY,wBAAjF,kLAS3CP,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,2GAAqJE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,SAArJ,SAAkPN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,OAAlP,mEAEAN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,cAAwDE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,EAAYQ,WAAW,IAAInB,MAAO,CAACqB,KAAO,+CAAvE,eAAxD","file":"static/js/docs-source-0-introduction-40-philosophy.1e050d71.js","sourcesContent":["\n import React from 'react'\n import { MDXTag } from '@mdx-js/tag'\n \n\nexport default class MDXContent extends React.Component {\n constructor(props) {\n super(props)\n this.layout = null\n }\n render() {\n const { components, ...props } = this.props\n\n return {`The Philosophy of RVal`}\n{`Why reactive values? In essence most of our programming work consists of transfering in-memory information from one place to another, transforming the information into new information, that is either human or machine digestable.\nData tranformations always introduces reduces redundant copies of data that need to be kept in sync with the original data.\nIn very trivial example of this problem might look like:`}\n{`const user = {\n firstName: \"Jane\",\n lastName: \"Stanford\",\n fullName: \"Jane Stanford\"\n}\n\ndocument.body.innerHTML = \\`

Hello \\${user.fullName}

\n`}
\n{`This simple snippet introduces a redundant copy of the original user's name in the `}{`fullName`}{` property, and in the DOM.\nNow it has become the programmers responsibility to make sure any futher changes to the `}{`user`}{` are propagated properly:`}\n{`function updateFirstName(newName) {\n user.firstName = newName\n user.fullName = user.firstName + \" \" + user.lastName\n document.body.innerHTML = \\`

Hello \\${user.fullName}

\n}\n`}
\n{`This is the problem that any state management abstraction, regardless the framework or paradigm that is used, is trying to solve.\nRVal introduces a handful of primitives that help you to solve this problem in any context, by automating the question:\n`}{`when`}{` should `}{`which`}{` transformation be applied?`}\n{`Here is a quick overview in how RVal helps solving that problem.\nFirst, we should recognize that imperatively computing new information, such as the DOM represantation, introduces stale values.\nHowever, we can avoid ever storing such information by storing `}{`computations`}{`, rather than `}{`values`}{`.\nThe process for that is as simple as creating a `}{`thunk`}{` (argumentless function) that capture the computation, rather than imperatively producing new values:`}\n{`const user = {\n firstName: \"Jane\",\n lastName: \"Stanford\",\n fullName: () => user.firstName + \" \" + user.lastName\n}\n\nconst rendering = () => \\`

Hello \\${user.fullName()}

\\`\n\ndocument.body.innerHTML = rendering()\n\nfunction updateFirstName(newName) {\n user.firstName = newName\n document.body.innerHTML = rendering()\n}\n`}
\n{`We've made things slightly better now; we don't have to imperatively update `}{`user.fullName`}{` anymore if the name changes.\nSimilarly, we could captured the rendered representation of the user in the thunk called `}{`rendering`}{`.`}\n{`By storing computations instead of values, we have reduced the amount of redundant information.\nHowever, we still have to make sure that our changes are propagated, for example by updating the DOM whenever we change the `}{`firstName`}{` property.`}\n{`But, what if we could `}{`subscribe`}{` to our thunks? And thereby avoid the need to manually propagate state changes, and increasing decoupling in the process?\nIn other words, what if we could write something like:`}\n{`const user = { /* as-is */ }\nconst rendering = () => \\`

Hello \\${user.fullName()}

\\`\n\non(rendering, () => {\n document.body.innerHTML = rendering()\n})\n\nfunction updateFirstName(newName) {\n user.firstName = newName\n}\n`}
\n{`Well, here is the good news: This is exactly the kind of things RVal allows you to write, by introducing three concepts:`}\n\n{`val(value)`}{` to create pieces of information that can change over time`}\n{`drv(thunk)`}{` to create thunks that can be subscribed to`}\n{`sub(something, listener)`}{` to create a listener that fires whenever the provided reactive value or thunk changes`}\n\n{`With those concepts, we can rewrite our above listing as a combination of reactive values and thunks, that propagate the changes when needed!`}\n{`import { val, drv, sub } from \"rval\"\n\nconst user = {\n firstName: val(\"Jane\"),\n lastName: val(\"Stanford\"),\n fullName: drv(() => user.firstName() + \" \" + user.lastName())\n}\n\nconst rendering = drv(\\`

Hello \\${user.fullName()}

\\`)\n\n// subscribe to the 'rendering' thunk\nsub(rendering, () => {\n document.body.innerHTML = rendering()\n})\n\nfunction updateFirstName(newName) {\n // change the \\`firstName\\` reactive value to 'newName'\n // rval will make sure that any derivation and subscription impacted by this\n // change will be re-evaluated (and nothing more).\n user.firstName(newName)\n}\n`}
\n{`Functions solidify state`}\n{`At this point you might be wondering:\n\"But `}{`why`}{` is it interesting to trap our state inside these `}{`val`}{` functions?\"`}\n{`By trapping all our pieces of state inside `}{`val`}{` functions,\nwe achieved a very interesting property:\nWe've practically forced ourselfs to have a single source of truth.\nInstead of passing the `}{`values of our state`}{` around, we can now pass a `}{`references to our state`}{` around.\nThe benefit of this that it will stop us from accidentally creating redundant copies of our state.`}\n{`Take for example the following contrived function.\nIt creates a random number generator, which is more likely to generate our lucky number than any other number: `}\n{`function createNumberGenerator(luckyNumber) {\n return function numberGenerator() {\n return Math.random() < 0.5 ? luckyNumber : Math.round(Math.random() * 100)\n }\n}\n\nlet luckyNumber = 13\nconst generator = createNumberGenerator(luckyNumber)\nconsole.log(generator()) // 13\nconsole.log(generator()) // 50\nconsole.log(generator()) // 49\n\nluckyNumber = 42\nconsole.log(generator()) // 28\nconsole.log(generator()) // 13\nconsole.log(generator()) // 13\n`}\n{`Now at this point, updating our `}{`luckyNumber`}{` variable doesn't get reflected in the `}{`numberGenerator`}{` anymore.\nWe are forced now to create a new number generator to reflect the change in our preference.\nThe problem is that the `}{`luckyNumber`}{` has been \"trapped\" as argument to `}{`createNumberGenerator`}{`.\nThe argument is basically a `}{`copy`}{` of the original `}{`luckyNumber`}{` variable. `}\n{`However, it is easy to see that by passing `}{`functions`}{` around, we avoid this whole problem.\nBecause `}{`luckyNumber`}{` itself now becomes a `}{`const`}{` reference to the function that traps our lucky number.\n(Yes, `}{`let`}{` and `}{`var`}{` really become anti-patterns when using `}{`rval`}{`).`}\n{`function createNumberGenerator(luckyNumber) {\n return function numberGenerator() {\n // luckyNumber get's evaluated lazily when generating numbers\n return Math.random() < 0.5 ? luckyNumber() : Math.round(Math.random() * 100)\n }\n}\n\nconst luckyNumber = val(13) // luckyNumber is a const now!\nconst generator = createNumberGenerator(luckyNumber)\nconsole.log(generator()) // 13\nconsole.log(generator()) // 13\nconsole.log(generator()) // 22\n\nluckyNumber(42) // change our minds\nconsole.log(generator()) // 42\nconsole.log(generator()) // 8\nconsole.log(generator()) // 42\n`}\n{`By capturing values in functions, it becomes much more explicit when we want to pass a `}{`reference`}{`, and when a `}{`value`}{`.\nIf we want our number generator to take a one-time snapshot of the state as `}{`luckyNumber`}{` we can be explicit about it and `}{`explicitly`}{` pass a copy of the current state `}{`createNumberGenerator(luckyNumber())`}{`.\nOn the other hand, we can also explicitly pass a reference to the state by just passing the `}{`luckyNumber`}{` function itself as we did above. `}\n{`As it turns out, in many cases it is very intersting to pass around a reference instead of a value.\nEspecially when we are building systems that are supposed to be reactive, such as a user interface.\nBut that for later sections. `}\n\n{`Note that the essence of `}{`val`}{` is simply this: `}\n{`function val(initial) {\n let state = initial\n return function() {\n if (!arguments.length)\n return state\n state = arguments[0]\n }\n}\n`}\n{`RVal's implementation is a little more involved, but that is because it is possible to subscribe to the `}{`state`}{` of a `}{`val`}{`.\nBut the above is how you can conceptually think about them. `}\n{`But, let's `}{`get started`}{` with the core \"rval\" api first!`}\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-1-advanced-examples.3d617ef8.js b/docs/static/js/docs-source-1-advanced-examples.3d617ef8.js new file mode 100644 index 0000000..935d317 --- /dev/null +++ b/docs/static/js/docs-source-1-advanced-examples.3d617ef8.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{"./docs_source/1_advanced/examples.mdx":function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return s});var o=n("./node_modules/react/index.js"),r=n.n(o),u=n("./node_modules/@mdx-js/tag/dist/index.js");function c(e){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},u=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f(e,t){for(var n=0;n\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-1-advanced-models.d61b86e3a14b0f31e0d0.js.map b/docs/static/js/docs-source-1-advanced-models.d61b86e3a14b0f31e0d0.js.map new file mode 100644 index 0000000..225f9a6 --- /dev/null +++ b/docs/static/js/docs-source-1-advanced-models.d61b86e3a14b0f31e0d0.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./docs_source/1_advanced/models.mdx"],"names":["MDXContent","props","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","layout","React","Component","_this$props","components","_objectWithoutProperties","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","_mdx_js_tag__WEBPACK_IMPORTED_MODULE_1__","name"],"mappings":"86CAKqBA,cACnB,SAAAA,EAAYC,GAAO,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACjBE,EAAAG,EAAAD,KAAAE,EAAAN,GAAAO,KAAAH,KAAMH,KACDO,OAAS,KAFGN,yPADmBO,IAAMC,kDAKnC,IAAAC,EAC0BP,KAAKH,MAA9BW,EADDD,EACCC,WADDC,EAAAF,EAAA,gBAGP,OAAOG,EAAAC,EAAAC,cAACC,EAAA,OAAD,CACEC,KAAK,UAELN,WAAYA","file":"static/js/docs-source-1-advanced-models.e6984dce.js","sourcesContent":["\n import React from 'react'\n import { MDXTag } from '@mdx-js/tag'\n \n\nexport default class MDXContent extends React.Component {\n constructor(props) {\n super(props)\n this.layout = null\n }\n render() {\n const { components, ...props } = this.props\n\n return \n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-1-advanced-models.e6984dce.js b/docs/static/js/docs-source-1-advanced-models.e6984dce.js new file mode 100644 index 0000000..58d3ee3 --- /dev/null +++ b/docs/static/js/docs-source-1-advanced-models.e6984dce.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"./docs_source/1_advanced/models.mdx":function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return s});var o=n("./node_modules/react/index.js"),r=n.n(o),u=n("./node_modules/@mdx-js/tag/dist/index.js");function c(e){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},u=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f(e,t){for(var n=0;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f(e,t){for(var n=0;n\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/docs-source-1-advanced-updaters.34d005c0.js b/docs/static/js/docs-source-1-advanced-updaters.34d005c0.js new file mode 100644 index 0000000..d653bd5 --- /dev/null +++ b/docs/static/js/docs-source-1-advanced-updaters.34d005c0.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{"./docs_source/1_advanced/updaters.mdx":function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return l});var o=n("./node_modules/react/index.js"),r=n.n(o),c=n("./node_modules/@mdx-js/tag/dist/index.js");function u(e){return(u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function i(e,t){for(var n=0;n{`Updaters package`}\n{`Immer`}\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/pkgs-core-readme.2ff9f0a1.js b/docs/static/js/pkgs-core-readme.2ff9f0a1.js new file mode 100644 index 0000000..1152a8f --- /dev/null +++ b/docs/static/js/pkgs-core-readme.2ff9f0a1.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"./pkgs/core/README.mdx":function(e,n,t){"use strict";t.r(n),t.d(n,"default",function(){return s});var o=t("./node_modules/react/index.js"),r=t.n(o),a=t("./node_modules/@mdx-js/tag/dist/index.js");function c(e){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,n){if(null==e)return{};var t,o,r=function(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function u(e,n){for(var t=0;t fn)")," or ",r.a.createElement(a.MDXTag,{name:"inlineCode",components:n,parentName:"p"},"fnHolder(replace(fn))")))}}])&&u(t.prototype,o),c&&u(t,c),n}();s.__docgenInfo={description:"",methods:[],displayName:"MDXContent"}}}]); +//# sourceMappingURL=pkgs-core-readme.d61b86e3a14b0f31e0d0.js.map \ No newline at end of file diff --git a/docs/static/js/pkgs-core-readme.d61b86e3a14b0f31e0d0.js.map b/docs/static/js/pkgs-core-readme.d61b86e3a14b0f31e0d0.js.map new file mode 100644 index 0000000..6b1fb0d --- /dev/null +++ b/docs/static/js/pkgs-core-readme.d61b86e3a14b0f31e0d0.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./pkgs/core/README.mdx"],"names":["MDXContent","props","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","layout","React","Component","_this$props","components","_objectWithoutProperties","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","_mdx_js_tag__WEBPACK_IMPORTED_MODULE_1__","name","id","parentName"],"mappings":"k6CAKqBA,cACnB,SAAAA,EAAYC,GAAO,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACjBE,EAAAG,EAAAD,KAAAE,EAAAN,GAAAO,KAAAH,KAAMH,KACDO,OAAS,KAFGN,yPADmBO,IAAMC,kDAKnC,IAAAC,EAC0BP,KAAKH,MAA9BW,EADDD,EACCC,WADDC,EAAAF,EAAA,gBAGP,OAAOG,EAAAC,EAAAC,cAACC,EAAA,OAAD,CACEC,KAAK,UAELN,WAAYA,GAAYE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,kBAAvD,mBACrCL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,KAAKN,WAAYA,EAAYX,MAAO,CAACkB,GAAK,QAAvD,OACAL,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,IAAIN,WAAYA,GAA7B,0BAAoEE,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D,sBAApE,OAA4KN,EAAAC,EAAAC,cAACC,EAAA,OAAD,CAAQC,KAAK,aAAaN,WAAYA,EAAYQ,WAAW,KAA7D","file":"static/js/pkgs-core-readme.2ff9f0a1.js","sourcesContent":["\n import React from 'react'\n import { MDXTag } from '@mdx-js/tag'\n \n\nexport default class MDXContent extends React.Component {\n constructor(props) {\n super(props)\n this.layout = null\n }\n render() {\n const { components, ...props } = this.props\n\n return {`@r-val/core api`}\n{`val`}\n{`How to set a function? `}{`fnHolder(() => fn)`}{` or `}{`fnHolder(replace(fn))`}\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/pkgs-react-readme.05b56ebd.js b/docs/static/js/pkgs-react-readme.05b56ebd.js new file mode 100644 index 0000000..3654487 --- /dev/null +++ b/docs/static/js/pkgs-react-readme.05b56ebd.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{"./pkgs/react/README.mdx":function(e,n,t){"use strict";t.r(n),t.d(n,"default",function(){return s});var o=t("./node_modules/react/index.js"),r=t.n(o),a=t("./node_modules/@mdx-js/tag/dist/index.js");function c(e){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,n){if(null==e)return{};var t,o,r=function(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function u(e,n){for(var t=0;t{`useVal`}\n\n{`context`}\n\n{`useLocalVal`}\n\n{`context`}\n\n{`useLocalDrv`}\n\n{`inputs`}\n{`context`}\n\n{`rview`}\n\n{`chidren`}\n{`memo (true, false, array)`}\n{`context`}\n\n \n }\n}\n "],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/runtime~app.d61b86e3a14b0f31e0d0.js b/docs/static/js/runtime~app.d61b86e3a14b0f31e0d0.js new file mode 100644 index 0000000..dd3caf9 --- /dev/null +++ b/docs/static/js/runtime~app.d61b86e3a14b0f31e0d0.js @@ -0,0 +1,2 @@ +!function(e){function r(r){for(var t,o,c=r[0],i=r[1],d=r[2],a=r[3]||[],s=0,u=[];s=0&&r._disposeHandlers.splice(n,1)},check:E,apply:x,status:function(e){if(!e)return f;p.push(e)},addStatusHandler:function(e){p.push(e)},removeStatusHandler:function(e){var r=p.indexOf(e);r>=0&&p.splice(r,1)},data:a[e]};return o=void 0,r}var p=[],f="idle";function h(e){f=e;for(var r=0;r0;){var o=t.pop(),i=o.id,d=o.chain;if((c=H[i])&&!c.hot._selfAccepted){if(c.hot._selfDeclined)return{type:"self-declined",chain:d,moduleId:i};if(c.hot._main)return{type:"unaccepted",chain:d,moduleId:i};for(var a=0;a ")),O.type){case"self-declined":r.onDeclined&&r.onDeclined(O),r.ignoreDeclined||(E=new Error("Aborted because of self decline: "+O.moduleId+x));break;case"declined":r.onDeclined&&r.onDeclined(O),r.ignoreDeclined||(E=new Error("Aborted because of declined dependency: "+O.moduleId+" in "+O.parentId+x));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(O),r.ignoreUnaccepted||(E=new Error("Aborted because "+d+" is not accepted"+x));break;case"accepted":r.onAccepted&&r.onAccepted(O),D=!0;break;case"disposed":r.onDisposed&&r.onDisposed(O),P=!0;break;default:throw new Error("Unexception type "+O.type)}if(E)return h("abort"),Promise.reject(E);if(D)for(d in b[d]=y[d],l(v,O.outdatedModules),O.outdatedDependencies)Object.prototype.hasOwnProperty.call(O.outdatedDependencies,d)&&(p[d]||(p[d]=[]),l(p[d],O.outdatedDependencies[d]));P&&(l(v,[O.moduleId]),b[d]=g)}var I,A=[];for(t=0;t0;)if(d=q.pop(),c=H[d]){var U={},N=c.hot._disposeHandlers;for(o=0;o=0&&R.parents.splice(I,1))}}for(d in p)if(Object.prototype.hasOwnProperty.call(p,d)&&(c=H[d]))for(T=p[d],o=0;o=0&&c.children.splice(I,1);for(d in h("apply"),i=m,b)Object.prototype.hasOwnProperty.call(b,d)&&(e[d]=b[d]);var B=null;for(d in p)if(Object.prototype.hasOwnProperty.call(p,d)&&(c=H[d])){T=p[d];var C=[];for(t=0;t= 0) hot._disposeHandlers.splice(idx, 1);\n \t\t\t},\n\n \t\t\t// Management API\n \t\t\tcheck: hotCheck,\n \t\t\tapply: hotApply,\n \t\t\tstatus: function(l) {\n \t\t\t\tif (!l) return hotStatus;\n \t\t\t\thotStatusHandlers.push(l);\n \t\t\t},\n \t\t\taddStatusHandler: function(l) {\n \t\t\t\thotStatusHandlers.push(l);\n \t\t\t},\n \t\t\tremoveStatusHandler: function(l) {\n \t\t\t\tvar idx = hotStatusHandlers.indexOf(l);\n \t\t\t\tif (idx >= 0) hotStatusHandlers.splice(idx, 1);\n \t\t\t},\n\n \t\t\t//inherit from previous dispose call\n \t\t\tdata: hotCurrentModuleData[moduleId]\n \t\t};\n \t\thotCurrentChildModule = undefined;\n \t\treturn hot;\n \t}\n\n \tvar hotStatusHandlers = [];\n \tvar hotStatus = \"idle\";\n\n \tfunction hotSetStatus(newStatus) {\n \t\thotStatus = newStatus;\n \t\tfor (var i = 0; i < hotStatusHandlers.length; i++)\n \t\t\thotStatusHandlers[i].call(null, newStatus);\n \t}\n\n \t// while downloading\n \tvar hotWaitingFiles = 0;\n \tvar hotChunksLoading = 0;\n \tvar hotWaitingFilesMap = {};\n \tvar hotRequestedFilesMap = {};\n \tvar hotAvailableFilesMap = {};\n \tvar hotDeferred;\n\n \t// The update info\n \tvar hotUpdate, hotUpdateNewHash;\n\n \tfunction toModuleId(id) {\n \t\tvar isNumber = +id + \"\" === id;\n \t\treturn isNumber ? +id : id;\n \t}\n\n \tfunction hotCheck(apply) {\n \t\tif (hotStatus !== \"idle\") {\n \t\t\tthrow new Error(\"check() is only allowed in idle status\");\n \t\t}\n \t\thotApplyOnUpdate = apply;\n \t\thotSetStatus(\"check\");\n \t\treturn hotDownloadManifest(hotRequestTimeout).then(function(update) {\n \t\t\tif (!update) {\n \t\t\t\thotSetStatus(\"idle\");\n \t\t\t\treturn null;\n \t\t\t}\n \t\t\thotRequestedFilesMap = {};\n \t\t\thotWaitingFilesMap = {};\n \t\t\thotAvailableFilesMap = update.c;\n \t\t\thotUpdateNewHash = update.h;\n\n \t\t\thotSetStatus(\"prepare\");\n \t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\thotDeferred = {\n \t\t\t\t\tresolve: resolve,\n \t\t\t\t\treject: reject\n \t\t\t\t};\n \t\t\t});\n \t\t\thotUpdate = {};\n \t\t\tfor(var chunkId in installedChunks)\n \t\t\t// eslint-disable-next-line no-lone-blocks\n \t\t\t{\n \t\t\t\t/*globals chunkId */\n \t\t\t\thotEnsureUpdateChunk(chunkId);\n \t\t\t}\n \t\t\tif (\n \t\t\t\thotStatus === \"prepare\" &&\n \t\t\t\thotChunksLoading === 0 &&\n \t\t\t\thotWaitingFiles === 0\n \t\t\t) {\n \t\t\t\thotUpdateDownloaded();\n \t\t\t}\n \t\t\treturn promise;\n \t\t});\n \t}\n\n \t// eslint-disable-next-line no-unused-vars\n \tfunction hotAddUpdateChunk(chunkId, moreModules) {\n \t\tif (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])\n \t\t\treturn;\n \t\thotRequestedFilesMap[chunkId] = false;\n \t\tfor (var moduleId in moreModules) {\n \t\t\tif (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\thotUpdate[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif (--hotWaitingFiles === 0 && hotChunksLoading === 0) {\n \t\t\thotUpdateDownloaded();\n \t\t}\n \t}\n\n \tfunction hotEnsureUpdateChunk(chunkId) {\n \t\tif (!hotAvailableFilesMap[chunkId]) {\n \t\t\thotWaitingFilesMap[chunkId] = true;\n \t\t} else {\n \t\t\thotRequestedFilesMap[chunkId] = true;\n \t\t\thotWaitingFiles++;\n \t\t\thotDownloadUpdateChunk(chunkId);\n \t\t}\n \t}\n\n \tfunction hotUpdateDownloaded() {\n \t\thotSetStatus(\"ready\");\n \t\tvar deferred = hotDeferred;\n \t\thotDeferred = null;\n \t\tif (!deferred) return;\n \t\tif (hotApplyOnUpdate) {\n \t\t\t// Wrap deferred object in Promise to mark it as a well-handled Promise to\n \t\t\t// avoid triggering uncaught exception warning in Chrome.\n \t\t\t// See https://bugs.chromium.org/p/chromium/issues/detail?id=465666\n \t\t\tPromise.resolve()\n \t\t\t\t.then(function() {\n \t\t\t\t\treturn hotApply(hotApplyOnUpdate);\n \t\t\t\t})\n \t\t\t\t.then(\n \t\t\t\t\tfunction(result) {\n \t\t\t\t\t\tdeferred.resolve(result);\n \t\t\t\t\t},\n \t\t\t\t\tfunction(err) {\n \t\t\t\t\t\tdeferred.reject(err);\n \t\t\t\t\t}\n \t\t\t\t);\n \t\t} else {\n \t\t\tvar outdatedModules = [];\n \t\t\tfor (var id in hotUpdate) {\n \t\t\t\tif (Object.prototype.hasOwnProperty.call(hotUpdate, id)) {\n \t\t\t\t\toutdatedModules.push(toModuleId(id));\n \t\t\t\t}\n \t\t\t}\n \t\t\tdeferred.resolve(outdatedModules);\n \t\t}\n \t}\n\n \tfunction hotApply(options) {\n \t\tif (hotStatus !== \"ready\")\n \t\t\tthrow new Error(\"apply() is only allowed in ready status\");\n \t\toptions = options || {};\n\n \t\tvar cb;\n \t\tvar i;\n \t\tvar j;\n \t\tvar module;\n \t\tvar moduleId;\n\n \t\tfunction getAffectedStuff(updateModuleId) {\n \t\t\tvar outdatedModules = [updateModuleId];\n \t\t\tvar outdatedDependencies = {};\n\n \t\t\tvar queue = outdatedModules.slice().map(function(id) {\n \t\t\t\treturn {\n \t\t\t\t\tchain: [id],\n \t\t\t\t\tid: id\n \t\t\t\t};\n \t\t\t});\n \t\t\twhile (queue.length > 0) {\n \t\t\t\tvar queueItem = queue.pop();\n \t\t\t\tvar moduleId = queueItem.id;\n \t\t\t\tvar chain = queueItem.chain;\n \t\t\t\tmodule = installedModules[moduleId];\n \t\t\t\tif (!module || module.hot._selfAccepted) continue;\n \t\t\t\tif (module.hot._selfDeclined) {\n \t\t\t\t\treturn {\n \t\t\t\t\t\ttype: \"self-declined\",\n \t\t\t\t\t\tchain: chain,\n \t\t\t\t\t\tmoduleId: moduleId\n \t\t\t\t\t};\n \t\t\t\t}\n \t\t\t\tif (module.hot._main) {\n \t\t\t\t\treturn {\n \t\t\t\t\t\ttype: \"unaccepted\",\n \t\t\t\t\t\tchain: chain,\n \t\t\t\t\t\tmoduleId: moduleId\n \t\t\t\t\t};\n \t\t\t\t}\n \t\t\t\tfor (var i = 0; i < module.parents.length; i++) {\n \t\t\t\t\tvar parentId = module.parents[i];\n \t\t\t\t\tvar parent = installedModules[parentId];\n \t\t\t\t\tif (!parent) continue;\n \t\t\t\t\tif (parent.hot._declinedDependencies[moduleId]) {\n \t\t\t\t\t\treturn {\n \t\t\t\t\t\t\ttype: \"declined\",\n \t\t\t\t\t\t\tchain: chain.concat([parentId]),\n \t\t\t\t\t\t\tmoduleId: moduleId,\n \t\t\t\t\t\t\tparentId: parentId\n \t\t\t\t\t\t};\n \t\t\t\t\t}\n \t\t\t\t\tif (outdatedModules.indexOf(parentId) !== -1) continue;\n \t\t\t\t\tif (parent.hot._acceptedDependencies[moduleId]) {\n \t\t\t\t\t\tif (!outdatedDependencies[parentId])\n \t\t\t\t\t\t\toutdatedDependencies[parentId] = [];\n \t\t\t\t\t\taddAllToSet(outdatedDependencies[parentId], [moduleId]);\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tdelete outdatedDependencies[parentId];\n \t\t\t\t\toutdatedModules.push(parentId);\n \t\t\t\t\tqueue.push({\n \t\t\t\t\t\tchain: chain.concat([parentId]),\n \t\t\t\t\t\tid: parentId\n \t\t\t\t\t});\n \t\t\t\t}\n \t\t\t}\n\n \t\t\treturn {\n \t\t\t\ttype: \"accepted\",\n \t\t\t\tmoduleId: updateModuleId,\n \t\t\t\toutdatedModules: outdatedModules,\n \t\t\t\toutdatedDependencies: outdatedDependencies\n \t\t\t};\n \t\t}\n\n \t\tfunction addAllToSet(a, b) {\n \t\t\tfor (var i = 0; i < b.length; i++) {\n \t\t\t\tvar item = b[i];\n \t\t\t\tif (a.indexOf(item) === -1) a.push(item);\n \t\t\t}\n \t\t}\n\n \t\t// at begin all updates modules are outdated\n \t\t// the \"outdated\" status can propagate to parents if they don't accept the children\n \t\tvar outdatedDependencies = {};\n \t\tvar outdatedModules = [];\n \t\tvar appliedUpdate = {};\n\n \t\tvar warnUnexpectedRequire = function warnUnexpectedRequire() {\n \t\t\tconsole.warn(\n \t\t\t\t\"[HMR] unexpected require(\" + result.moduleId + \") to disposed module\"\n \t\t\t);\n \t\t};\n\n \t\tfor (var id in hotUpdate) {\n \t\t\tif (Object.prototype.hasOwnProperty.call(hotUpdate, id)) {\n \t\t\t\tmoduleId = toModuleId(id);\n \t\t\t\t/** @type {TODO} */\n \t\t\t\tvar result;\n \t\t\t\tif (hotUpdate[id]) {\n \t\t\t\t\tresult = getAffectedStuff(moduleId);\n \t\t\t\t} else {\n \t\t\t\t\tresult = {\n \t\t\t\t\t\ttype: \"disposed\",\n \t\t\t\t\t\tmoduleId: id\n \t\t\t\t\t};\n \t\t\t\t}\n \t\t\t\t/** @type {Error|false} */\n \t\t\t\tvar abortError = false;\n \t\t\t\tvar doApply = false;\n \t\t\t\tvar doDispose = false;\n \t\t\t\tvar chainInfo = \"\";\n \t\t\t\tif (result.chain) {\n \t\t\t\t\tchainInfo = \"\\nUpdate propagation: \" + result.chain.join(\" -> \");\n \t\t\t\t}\n \t\t\t\tswitch (result.type) {\n \t\t\t\t\tcase \"self-declined\":\n \t\t\t\t\t\tif (options.onDeclined) options.onDeclined(result);\n \t\t\t\t\t\tif (!options.ignoreDeclined)\n \t\t\t\t\t\t\tabortError = new Error(\n \t\t\t\t\t\t\t\t\"Aborted because of self decline: \" +\n \t\t\t\t\t\t\t\t\tresult.moduleId +\n \t\t\t\t\t\t\t\t\tchainInfo\n \t\t\t\t\t\t\t);\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase \"declined\":\n \t\t\t\t\t\tif (options.onDeclined) options.onDeclined(result);\n \t\t\t\t\t\tif (!options.ignoreDeclined)\n \t\t\t\t\t\t\tabortError = new Error(\n \t\t\t\t\t\t\t\t\"Aborted because of declined dependency: \" +\n \t\t\t\t\t\t\t\t\tresult.moduleId +\n \t\t\t\t\t\t\t\t\t\" in \" +\n \t\t\t\t\t\t\t\t\tresult.parentId +\n \t\t\t\t\t\t\t\t\tchainInfo\n \t\t\t\t\t\t\t);\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase \"unaccepted\":\n \t\t\t\t\t\tif (options.onUnaccepted) options.onUnaccepted(result);\n \t\t\t\t\t\tif (!options.ignoreUnaccepted)\n \t\t\t\t\t\t\tabortError = new Error(\n \t\t\t\t\t\t\t\t\"Aborted because \" + moduleId + \" is not accepted\" + chainInfo\n \t\t\t\t\t\t\t);\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase \"accepted\":\n \t\t\t\t\t\tif (options.onAccepted) options.onAccepted(result);\n \t\t\t\t\t\tdoApply = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase \"disposed\":\n \t\t\t\t\t\tif (options.onDisposed) options.onDisposed(result);\n \t\t\t\t\t\tdoDispose = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tdefault:\n \t\t\t\t\t\tthrow new Error(\"Unexception type \" + result.type);\n \t\t\t\t}\n \t\t\t\tif (abortError) {\n \t\t\t\t\thotSetStatus(\"abort\");\n \t\t\t\t\treturn Promise.reject(abortError);\n \t\t\t\t}\n \t\t\t\tif (doApply) {\n \t\t\t\t\tappliedUpdate[moduleId] = hotUpdate[moduleId];\n \t\t\t\t\taddAllToSet(outdatedModules, result.outdatedModules);\n \t\t\t\t\tfor (moduleId in result.outdatedDependencies) {\n \t\t\t\t\t\tif (\n \t\t\t\t\t\t\tObject.prototype.hasOwnProperty.call(\n \t\t\t\t\t\t\t\tresult.outdatedDependencies,\n \t\t\t\t\t\t\t\tmoduleId\n \t\t\t\t\t\t\t)\n \t\t\t\t\t\t) {\n \t\t\t\t\t\t\tif (!outdatedDependencies[moduleId])\n \t\t\t\t\t\t\t\toutdatedDependencies[moduleId] = [];\n \t\t\t\t\t\t\taddAllToSet(\n \t\t\t\t\t\t\t\toutdatedDependencies[moduleId],\n \t\t\t\t\t\t\t\tresult.outdatedDependencies[moduleId]\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\tif (doDispose) {\n \t\t\t\t\taddAllToSet(outdatedModules, [result.moduleId]);\n \t\t\t\t\tappliedUpdate[moduleId] = warnUnexpectedRequire;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// Store self accepted outdated modules to require them later by the module system\n \t\tvar outdatedSelfAcceptedModules = [];\n \t\tfor (i = 0; i < outdatedModules.length; i++) {\n \t\t\tmoduleId = outdatedModules[i];\n \t\t\tif (\n \t\t\t\tinstalledModules[moduleId] &&\n \t\t\t\tinstalledModules[moduleId].hot._selfAccepted\n \t\t\t)\n \t\t\t\toutdatedSelfAcceptedModules.push({\n \t\t\t\t\tmodule: moduleId,\n \t\t\t\t\terrorHandler: installedModules[moduleId].hot._selfAccepted\n \t\t\t\t});\n \t\t}\n\n \t\t// Now in \"dispose\" phase\n \t\thotSetStatus(\"dispose\");\n \t\tObject.keys(hotAvailableFilesMap).forEach(function(chunkId) {\n \t\t\tif (hotAvailableFilesMap[chunkId] === false) {\n \t\t\t\thotDisposeChunk(chunkId);\n \t\t\t}\n \t\t});\n\n \t\tvar idx;\n \t\tvar queue = outdatedModules.slice();\n \t\twhile (queue.length > 0) {\n \t\t\tmoduleId = queue.pop();\n \t\t\tmodule = installedModules[moduleId];\n \t\t\tif (!module) continue;\n\n \t\t\tvar data = {};\n\n \t\t\t// Call dispose handlers\n \t\t\tvar disposeHandlers = module.hot._disposeHandlers;\n \t\t\tfor (j = 0; j < disposeHandlers.length; j++) {\n \t\t\t\tcb = disposeHandlers[j];\n \t\t\t\tcb(data);\n \t\t\t}\n \t\t\thotCurrentModuleData[moduleId] = data;\n\n \t\t\t// disable module (this disables requires from this module)\n \t\t\tmodule.hot.active = false;\n\n \t\t\t// remove module from cache\n \t\t\tdelete installedModules[moduleId];\n\n \t\t\t// when disposing there is no need to call dispose handler\n \t\t\tdelete outdatedDependencies[moduleId];\n\n \t\t\t// remove \"parents\" references from all children\n \t\t\tfor (j = 0; j < module.children.length; j++) {\n \t\t\t\tvar child = installedModules[module.children[j]];\n \t\t\t\tif (!child) continue;\n \t\t\t\tidx = child.parents.indexOf(moduleId);\n \t\t\t\tif (idx >= 0) {\n \t\t\t\t\tchild.parents.splice(idx, 1);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// remove outdated dependency from module children\n \t\tvar dependency;\n \t\tvar moduleOutdatedDependencies;\n \t\tfor (moduleId in outdatedDependencies) {\n \t\t\tif (\n \t\t\t\tObject.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)\n \t\t\t) {\n \t\t\t\tmodule = installedModules[moduleId];\n \t\t\t\tif (module) {\n \t\t\t\t\tmoduleOutdatedDependencies = outdatedDependencies[moduleId];\n \t\t\t\t\tfor (j = 0; j < moduleOutdatedDependencies.length; j++) {\n \t\t\t\t\t\tdependency = moduleOutdatedDependencies[j];\n \t\t\t\t\t\tidx = module.children.indexOf(dependency);\n \t\t\t\t\t\tif (idx >= 0) module.children.splice(idx, 1);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// Not in \"apply\" phase\n \t\thotSetStatus(\"apply\");\n\n \t\thotCurrentHash = hotUpdateNewHash;\n\n \t\t// insert new code\n \t\tfor (moduleId in appliedUpdate) {\n \t\t\tif (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) {\n \t\t\t\tmodules[moduleId] = appliedUpdate[moduleId];\n \t\t\t}\n \t\t}\n\n \t\t// call accept handlers\n \t\tvar error = null;\n \t\tfor (moduleId in outdatedDependencies) {\n \t\t\tif (\n \t\t\t\tObject.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)\n \t\t\t) {\n \t\t\t\tmodule = installedModules[moduleId];\n \t\t\t\tif (module) {\n \t\t\t\t\tmoduleOutdatedDependencies = outdatedDependencies[moduleId];\n \t\t\t\t\tvar callbacks = [];\n \t\t\t\t\tfor (i = 0; i < moduleOutdatedDependencies.length; i++) {\n \t\t\t\t\t\tdependency = moduleOutdatedDependencies[i];\n \t\t\t\t\t\tcb = module.hot._acceptedDependencies[dependency];\n \t\t\t\t\t\tif (cb) {\n \t\t\t\t\t\t\tif (callbacks.indexOf(cb) !== -1) continue;\n \t\t\t\t\t\t\tcallbacks.push(cb);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tfor (i = 0; i < callbacks.length; i++) {\n \t\t\t\t\t\tcb = callbacks[i];\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tcb(moduleOutdatedDependencies);\n \t\t\t\t\t\t} catch (err) {\n \t\t\t\t\t\t\tif (options.onErrored) {\n \t\t\t\t\t\t\t\toptions.onErrored({\n \t\t\t\t\t\t\t\t\ttype: \"accept-errored\",\n \t\t\t\t\t\t\t\t\tmoduleId: moduleId,\n \t\t\t\t\t\t\t\t\tdependencyId: moduleOutdatedDependencies[i],\n \t\t\t\t\t\t\t\t\terror: err\n \t\t\t\t\t\t\t\t});\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tif (!options.ignoreErrored) {\n \t\t\t\t\t\t\t\tif (!error) error = err;\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\t// Load self accepted modules\n \t\tfor (i = 0; i < outdatedSelfAcceptedModules.length; i++) {\n \t\t\tvar item = outdatedSelfAcceptedModules[i];\n \t\t\tmoduleId = item.module;\n \t\t\thotCurrentParents = [moduleId];\n \t\t\ttry {\n \t\t\t\t__webpack_require__(moduleId);\n \t\t\t} catch (err) {\n \t\t\t\tif (typeof item.errorHandler === \"function\") {\n \t\t\t\t\ttry {\n \t\t\t\t\t\titem.errorHandler(err);\n \t\t\t\t\t} catch (err2) {\n \t\t\t\t\t\tif (options.onErrored) {\n \t\t\t\t\t\t\toptions.onErrored({\n \t\t\t\t\t\t\t\ttype: \"self-accept-error-handler-errored\",\n \t\t\t\t\t\t\t\tmoduleId: moduleId,\n \t\t\t\t\t\t\t\terror: err2,\n \t\t\t\t\t\t\t\toriginalError: err\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (!options.ignoreErrored) {\n \t\t\t\t\t\t\tif (!error) error = err2;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (!error) error = err;\n \t\t\t\t\t}\n \t\t\t\t} else {\n \t\t\t\t\tif (options.onErrored) {\n \t\t\t\t\t\toptions.onErrored({\n \t\t\t\t\t\t\ttype: \"self-accept-errored\",\n \t\t\t\t\t\t\tmoduleId: moduleId,\n \t\t\t\t\t\t\terror: err\n \t\t\t\t\t\t});\n \t\t\t\t\t}\n \t\t\t\t\tif (!options.ignoreErrored) {\n \t\t\t\t\t\tif (!error) error = err;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// handle errors in accept handlers and self accepted module load\n \t\tif (error) {\n \t\t\thotSetStatus(\"fail\");\n \t\t\treturn Promise.reject(error);\n \t\t}\n\n \t\thotSetStatus(\"idle\");\n \t\treturn new Promise(function(resolve) {\n \t\t\tresolve(outdatedModules);\n \t\t});\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t13: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"static/js/\" + ({\"1\":\"docs-source-0-introduction-00-about\",\"2\":\"docs-source-0-introduction-05-installation\",\"3\":\"docs-source-0-introduction-10-getting-started\",\"4\":\"docs-source-0-introduction-20-objects-and-factories\",\"5\":\"docs-source-0-introduction-30-with-react\",\"6\":\"docs-source-0-introduction-40-philosophy\",\"7\":\"docs-source-1-advanced-examples\",\"8\":\"docs-source-1-advanced-models\",\"9\":\"docs-source-1-advanced-preprocessors\",\"10\":\"docs-source-1-advanced-updaters\",\"11\":\"pkgs-core-readme\",\"12\":\"pkgs-react-readme\"}[chunkId]||chunkId) + \".\" + {\"1\":\"205fe912\",\"2\":\"99c9851c\",\"3\":\"2a7df790\",\"4\":\"65e655c9\",\"5\":\"e2437ad7\",\"6\":\"1e050d71\",\"7\":\"3d617ef8\",\"8\":\"e6984dce\",\"9\":\"978d3bc1\",\"10\":\"34d005c0\",\"11\":\"2ff9f0a1\",\"12\":\"05b56ebd\",\"15\":\"0b8c79ca\"}[chunkId] + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {},\n \t\t\thot: hotCreateModule(moduleId),\n \t\t\tparents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp),\n \t\t\tchildren: []\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar head = document.getElementsByTagName('head')[0];\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n \t\t\t\tif (script.src.indexOf(window.location.origin + '/') !== 0) {\n \t\t\t\t\tscript.crossOrigin = \"anonymous\";\n \t\t\t\t}\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\tvar error = new Error('Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')');\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\thead.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \t// __webpack_hash__\n \t__webpack_require__.h = function() { return hotCurrentHash; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/vendors.3d24669e.js b/docs/static/js/vendors.3d24669e.js new file mode 100644 index 0000000..2024d1a --- /dev/null +++ b/docs/static/js/vendors.3d24669e.js @@ -0,0 +1,1109 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{"./node_modules/@babel/polyfill/lib/index.js":function(e,t,n){"use strict";(function(e){n("./node_modules/core-js/es6/index.js"),n("./node_modules/core-js/fn/array/includes.js"),n("./node_modules/core-js/fn/string/pad-start.js"),n("./node_modules/core-js/fn/string/pad-end.js"),n("./node_modules/core-js/fn/symbol/async-iterator.js"),n("./node_modules/core-js/fn/object/get-own-property-descriptors.js"),n("./node_modules/core-js/fn/object/values.js"),n("./node_modules/core-js/fn/object/entries.js"),n("./node_modules/core-js/fn/promise/finally.js"),n("./node_modules/core-js/web/index.js"),n("./node_modules/regenerator-runtime/runtime.js"),e._babelPolyfill&&"undefined"!==typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e._babelPolyfill=!0}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/@mdx-js/tag/dist/index.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("./node_modules/@mdx-js/tag/dist/mdx-tag.js");Object.defineProperty(t,"MDXTag",{enumerable:!0,get:function(){return i(r).default}});var o=n("./node_modules/@mdx-js/tag/dist/mdx-provider.js");function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"MDXProvider",{enumerable:!0,get:function(){return i(o).default}})},"./node_modules/@mdx-js/tag/dist/mdx-provider.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withMDXComponents=void 0;var r,o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["components"]);return s.default.createElement(l,null,function(t){return s.default.createElement(e,o({components:n||t},r))})}};t.default=function(e){var t=e.components,n=e.children;return s.default.createElement(u,{value:t},n)}},"./node_modules/@mdx-js/tag/dist/mdx-tag.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=Object.assign||function(e){for(var t=1;t<]/g}},"./node_modules/ansi-styles/index.js":function(e,t,n){"use strict";(function(e){const t=n("./node_modules/color-convert/index.js"),r=(e,n)=>(function(){return`\x1b[${e.apply(t,arguments)+n}m`}),o=(e,n)=>(function(){const r=e.apply(t,arguments);return`\x1b[${38+n};5;${r}m`}),i=(e,n)=>(function(){const r=e.apply(t,arguments);return`\x1b[${38+n};2;${r[0]};${r[1]};${r[2]}m`});Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,n={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};n.color.grey=n.color.gray;for(const t of Object.keys(n)){const r=n[t];for(const t of Object.keys(r)){const o=r[t];n[t]={open:`\x1b[${o[0]}m`,close:`\x1b[${o[1]}m`},r[t]=n[t],e.set(o[0],o[1])}Object.defineProperty(n,t,{value:r,enumerable:!1}),Object.defineProperty(n,"codes",{value:e,enumerable:!1})}const s=e=>e,a=(e,t,n)=>[e,t,n];n.color.close="\x1b[39m",n.bgColor.close="\x1b[49m",n.color.ansi={ansi:r(s,0)},n.color.ansi256={ansi256:o(s,0)},n.color.ansi16m={rgb:i(a,0)},n.bgColor.ansi={ansi:r(s,10)},n.bgColor.ansi256={ansi256:o(s,10)},n.bgColor.ansi16m={rgb:i(a,10)};for(let u of Object.keys(t)){if("object"!==typeof t[u])continue;const e=t[u];"ansi16"===u&&(u="ansi"),"ansi16"in e&&(n.color.ansi[u]=r(e.ansi16,0),n.bgColor.ansi[u]=r(e.ansi16,10)),"ansi256"in e&&(n.color.ansi256[u]=o(e.ansi256,0),n.bgColor.ansi256[u]=o(e.ansi256,10)),"rgb"in e&&(n.color.ansi16m[u]=i(e.rgb,0),n.bgColor.ansi16m[u]=i(e.rgb,10))}return n}})}).call(this,n("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/array-sort/index.js":function(e,t,n){"use strict";var r=n("./node_modules/default-compare/index.js"),o=n("./node_modules/kind-of/index.js"),i=n("./node_modules/get-value/index.js");function s(e,t,n){return"function"===typeof e?e(t,n,s.bind(null,null)):e&&"object"===typeof t&&"object"===typeof n?s(null,i(t,e),i(n,e)):r(t,n)}e.exports=function(e,t,n){if(null==e)return[];if(!Array.isArray(e))throw new TypeError("array-sort expects an array.");if(1===arguments.length)return e.sort();var r=function(e){return[].concat.apply([],e)}([].slice.call(arguments,1));return"object"===o(r[r.length-1])&&(n=r.pop()),e.sort(function(e,t){return t=t||{},function(n,r){for(var o,i=e.length,a=-1;++a=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},"./node_modules/babel-runtime/helpers/possibleConstructorReturn.js":function(e,t,n){"use strict";t.__esModule=!0;var r,o=n("./node_modules/babel-runtime/helpers/typeof.js"),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"===typeof t?"undefined":(0,i.default)(t))&&"function"!==typeof t?e:t}},"./node_modules/babel-runtime/helpers/typeof.js":function(e,t,n){"use strict";t.__esModule=!0;var r=s(n("./node_modules/babel-runtime/core-js/symbol/iterator.js")),o=s(n("./node_modules/babel-runtime/core-js/symbol.js")),i="function"===typeof o.default&&"symbol"===typeof r.default?function(e){return typeof e}:function(e){return e&&"function"===typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};function s(e){return e&&e.__esModule?e:{default:e}}t.default="function"===typeof o.default&&"symbol"===i(r.default)?function(e){return"undefined"===typeof e?"undefined":i(e)}:function(e){return e&&"function"===typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":"undefined"===typeof e?"undefined":i(e)}},"./node_modules/base64-js/index.js":function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=l(e),r=n[0],s=n[1],a=new i(function(e,t,n){return 3*(t+n)/4-n}(0,r,s)),u=0,c=s>0?r-4:r,d=0;d>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===s&&(t=o[e.charCodeAt(d)]<<2|o[e.charCodeAt(d+1)]>>4,a[u++]=255&t);1===s&&(t=o[e.charCodeAt(d)]<<10|o[e.charCodeAt(d+1)]<<4|o[e.charCodeAt(d+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=0,a=n-o;sa?a:s+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var o,i,s=[],a=t;a>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},"./node_modules/buffer/index.js":function(e,t,n){"use strict";(function(e){var r=n("./node_modules/base64-js/index.js"),o=n("./node_modules/ieee754/index.js"),i=n("./node_modules/isarray/index.js");function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var c=-1;for(i=n;ia&&(n=a-u),i=n;i>=0;i--){for(var d=!0,f=0;fo&&(r=o):r=o;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:l>223?3:l>191?2:1;if(o+d<=n)switch(d){case 1:l<128&&(c=l);break;case 2:128===(192&(i=e[o+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=e[o+1],s=e[o+2],128===(192&i)&&128===(192&s)&&(u=(15&l)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128===(192&i)&&128===(192&s)&&128===(192&a)&&(u=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),o+=d}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return D(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(i,s),l=this.slice(r,o),c=e.slice(t,n),d=0;do)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return j(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function D(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function P(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function L(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function M(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,i){return i||M(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,i){return i||M(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||F(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||F(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||F(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||F(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||F(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);O(this,e,t,n,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);O(this,e,t,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function W(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(R,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function U(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/callbag-observe/index.js":function(e,t){e.exports=(e=>t=>{t(0,(t,n)=>{1===t&&e(n)})})},"./node_modules/callbag-subject/index.js":function(e,t){e.exports=function(){let e=[];return(t,n)=>{if(0===t){const t=n;e.push(t),t(0,n=>{if(2===n){const n=e.indexOf(t);n>-1&&e.splice(n,1)}})}else{const r=e.slice(0);for(let o,i=0,s=r.length;i-1&&o(t,n)}}}},"./node_modules/capitalize/index.js":function(e,t){e.exports=function(e){return(e=e.toLowerCase()).charAt(0).toUpperCase()+e.substring(1)},e.exports.words=function(e){return e.toLowerCase().replace(/(^|[^a-zA-Z\u00C0-\u017F'])([a-zA-Z\u00C0-\u017F])/g,function(e){return e.toUpperCase()})}},"./node_modules/chalk/index.js":function(e,t,n){"use strict";(function(t){const r=n("./node_modules/escape-string-regexp/index.js"),o=n("./node_modules/ansi-styles/index.js"),i=n("./node_modules/supports-color/browser.js").stdout,s=n("./node_modules/chalk/templates.js"),a="win32"===t.platform&&!(Object({NODE_ENV:"production",PUBLIC_URL:"/",npm_package_scripts_docz_build:"docz build && rm -rf docs && cp -r .docz/dist docs",npm_package_devDependencies_docz_theme_default:"^0.13.4",npm_package_scripts_docz_dev:"docz dev"}).TERM||"").toLowerCase().startsWith("xterm"),u=["ansi","ansi","ansi256","ansi16m"],l=new Set(["gray"]),c=Object.create(null);function d(e,t){t=t||{};const n=i?i.level:0;e.level=void 0===t.level?n:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function f(e){if(!this||!(this instanceof f)||this.template){const t={};return d(t,e),t.template=function(){const e=[].slice.call(arguments);return function(e,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");const n=[].slice.call(arguments,2),r=[t.raw[0]];for(let o=1;o{},c);function h(e,t,n){const r=function(){return function(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let o=1;oi.level,set(e){i.level=e}}),Object.defineProperty(r,"enabled",{enumerable:!0,get:()=>i.enabled,set(e){i.enabled=e}}),r.hasGrey=this.hasGrey||"gray"===n||"grey"===n,r.__proto__=p,r}Object.defineProperties(f.prototype,c),e.exports=f(),e.exports.supportsColor=i,e.exports.default=e.exports}).call(this,n("./node_modules/process/browser.js"))},"./node_modules/chalk/templates.js":function(e,t,n){"use strict";const r=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,o=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,i=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,a=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1b"],["a","\x07"]]);function u(e){return"u"===e[0]&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):a.get(e)||e}function l(e,t){const n=[],r=t.trim().split(/\s*,\s*/g);let o;for(const a of r)if(isNaN(a)){if(!(o=a.match(i)))throw new Error(`Invalid Chalk template style argument: ${a} (in style '${e}')`);n.push(o[2].replace(s,(e,t,n)=>t?u(t):n))}else n.push(Number(a));return n}function c(e){o.lastIndex=0;const t=[];let n;for(;null!==(n=o.exec(e));){const e=n[1];if(n[2]){const r=l(e,n[2]);t.push([e].concat(r))}else t.push([e])}return t}function d(e,t){const n={};for(const o of t)for(const e of o.styles)n[e[0]]=o.inverse?null:e.slice(1);let r=e;for(const o of Object.keys(n))if(Array.isArray(n[o])){if(!(o in r))throw new Error(`Unknown Chalk style: ${o}`);r=n[o].length>0?r[o].apply(r,n[o]):r[o]}return r}e.exports=((e,t)=>{const n=[],o=[];let i=[];if(t.replace(r,(t,r,s,a,l,f)=>{if(r)i.push(u(r));else if(a){const t=i.join("");i=[],o.push(0===n.length?t:d(e,n)(t)),n.push({inverse:s,styles:c(a)})}else if(l){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");o.push(d(e,n)(i.join(""))),i=[],n.pop()}else i.push(f)}),o.push(i.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return o.join("")})},"./node_modules/classnames/index.js":function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t'"]=function(r){return function(r){if(r.getOption("disableInput"))return e.Pass;for(var s=r.listSelections(),a=[],u=r.getOption("autoCloseTags"),l=0;lc.ch&&(v=v.slice(0,v.length-d.end+c.ch));var y=v.toLowerCase();if(!v||"string"==d.type&&(d.end!=c.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&"closeTag"==p.type||d.string.indexOf("/")==d.string.length-1||m&&o(m,y)>-1||i(r,v,c,p,!0))return e.Pass;var b=g&&o(g,y)>-1;a[l]={indent:b,text:">"+(b?"\n\n":"")+"",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var _="object"==typeof u&&u.dontIndentOnAutoClose,l=s.length-1;l>=0;l--){var x=a[l];r.replaceRange(x.text,s[l].head,s[l].anchor,"+insert");var j=r.listSelections().slice(0);j[l]={head:x.newPos,anchor:x.newPos},r.setSelections(j),!_&&x.indent&&(r.indentLine(x.newPos.line,null,!0),r.indentLine(x.newPos.line+1,null,!0))}}(r)}),s.addKeyMap(l)}});var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function r(t,n){for(var r=t.listSelections(),o=[],s=n?"/":""!=t.getLine(d.line).charAt(f.end)&&(c+=">"),o[l]=c}if(t.replaceSelections(o),r=t.listSelections(),!u)for(var l=0;l",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function o(e,t,o){var s=e.getLineHandle(t.line),a=t.ch-1,u=o&&o.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var l=!u&&a>=0&&r[s.text.charAt(a)]||r[s.text.charAt(++a)];if(!l)return null;var c=">"==l.charAt(1)?1:-1;if(o&&o.strict&&c>0!=(a==t.ch))return null;var d=e.getTokenTypeAt(n(t.line,a+1)),f=i(e,n(t.line,a+(c>0?1:0)),c,d||null,o);return null==f?null:{from:n(t.line,a),to:f&&f.pos,match:f&&f.ch==l.charAt(0),forward:c>0}}function i(e,t,o,i,s){for(var a=s&&s.maxScanLineLength||1e4,u=s&&s.maxScanLines||1e3,l=[],c=s&&s.bracketRegex?s.bracketRegex:/[(){}[\]]/,d=o>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),f=t.line;f!=d;f+=o){var p=e.getLine(f);if(p){var h=o>0?0:p.length-1,m=o>0?p.length:-1;if(!(p.length>a))for(f==t.line&&(h=t.ch-(o<0?1:0));h!=m;h+=o){var g=p.charAt(h);if(c.test(g)&&(void 0===i||e.getTokenTypeAt(n(f,h+1))==i)){var v=r[g];if(">"==v.charAt(1)==o>0)l.push(g);else{if(!l.length)return{pos:n(f,h),ch:g};l.pop()}}}}}return f-o!=(o>0?e.lastLine():e.firstLine())&&null}function s(e,r,i){for(var s=e.state.matchBrackets.maxHighlightLineLength||1e3,a=[],u=e.listSelections(),l=0;l=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function u(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function l(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(a(e))continue;return}if(s(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(u(e))continue;return}if(s(e,t+1)){o.lastIndex=t,e.ch=t;var n=o.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function d(e){for(;;){o.lastIndex=e.ch;var t=o.exec(e.text);if(!t){if(a(e))continue;return}if(s(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(u(e))continue;return}if(s(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var r=[];;){var o,i=d(e),s=e.line,a=e.ch-(i?i[0].length:0);if(!i||!(o=l(e)))return;if("selfClose"!=o)if(i[1]){for(var u=r.length-1;u>=0;--u)if(r[u]==i[2]){r.length=u;break}if(u<0&&(!n||n==i[2]))return{tag:i[2],from:t(s,a),to:t(e.line,e.ch)}}else r.push(i[2])}}function h(e,n){for(var r=[];;){var o=f(e);if(!o)return;if("selfClose"!=o){var i=e.line,s=e.ch,a=c(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var u=r.length-1;u>=0;--u)if(r[u]==a[2]){r.length=u;break}if(u<0&&(!n||n==a[2]))return{tag:a[2],from:t(e.line,e.ch),to:t(i,s)}}}else c(e)}}e.registerHelper("fold","xml",function(e,r){for(var o=new i(e,r.line,0);;){var s=d(o);if(!s||o.line!=r.line)return;var a=l(o);if(!a)return;if(!s[1]&&"selfClose"!=a){var u=t(o.line,o.ch),c=p(o,s[2]);return c&&n(c.from,u)>0?{from:u,to:c.from}:null}}}),e.findMatchingTag=function(e,r,o){var s=new i(e,r.line,r.ch,o);if(-1!=s.text.indexOf(">")||-1!=s.text.indexOf("<")){var a=l(s),u=a&&t(s.line,s.ch),d=a&&c(s);if(a&&d&&!(n(s,r)>0)){var f={from:t(s.line,s.ch),to:u,tag:d[2]};return"selfClose"==a?{open:f,close:null,at:"open"}:d[1]?{open:h(s,d[2]),close:f,at:"close"}:(s=new i(e,u.line,u.ch,o),{open:f,close:p(s,d[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n,r){for(var o=new i(e,t.line,t.ch,n);;){var s=h(o,r);if(!s)break;var a=new i(e,t.line,t.ch,n),u=p(a,s.tag);if(u)return{open:s,close:u}}},e.scanForClosingTag=function(e,t,n,r){var o=new i(e,t.line,t.ch,r?{from:0,to:r}:null);return p(o,n)}}(n("./node_modules/codemirror/lib/codemirror.js"))},"./node_modules/codemirror/lib/codemirror.js":function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),s=r||o||i,a=s&&(r?document.documentMode||6:+(i||o)[1]),u=!i&&/WebKit\//.test(e),l=u&&/Qt\/\d+\.\d+/.test(e),c=!i&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),_=/win/i.test(t),x=d&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,u=!0);var j=y&&(l||d&&(null==x||x<12.11)),w=n||s&&a>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,E=function(e,t){var n=e.className,r=C(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return D(e).appendChild(t)}function S(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i=t)return s+(t-i);s+=a-i,s+=n-s%n,i=a+1}}m?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(M=function(e){try{e.select()}catch(t){}});var I=function(){this.id=null};function z(e,t){for(var n=0;n=t)return r+Math.min(s,t-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=t)return r}}var G=[""];function Y(e){for(;G.length<=e;)G.push(K(G)+" ");return G[e]}function K(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&re.test(e)}function ie(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}function ae(e,t,r){var o=this;this.input=r,o.scrollbarFiller=S("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=S("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=T("div",null,"CodeMirror-code"),o.selectionDiv=S("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=S("div",null,"CodeMirror-cursors"),o.measure=S("div",null,"CodeMirror-measure"),o.lineMeasure=S("div",null,"CodeMirror-measure"),o.lineSpace=T("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var i=T("div",[o.lineSpace],"CodeMirror-lines");o.mover=S("div",[i],null,"position: relative"),o.sizer=S("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=S("div",null,null,"position: absolute; height: "+W+"px; width: 1px;"),o.gutters=S("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=S("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=S("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),s&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),u||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,r.init(o)}function ue(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(t=e.first&&tn?ge(n,ue(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?ge(e.line,t):n<0?ge(e.line,0):e}(t,ue(e,t.line).text.length)}function Ce(e,t){for(var n=[],r=0;r=t:i.to>t);(r||(r=[])).push(new De(s,i.from,u?null:i.to))}}return r}(n,o,s),u=function(e,t,n){var r;if(e)for(var o=0;o=t:i.to>t);if(a||i.from==t&&"bookmark"==s.type&&(!n||i.marker.insertLeft)){var u=null==i.from||(s.inclusiveLeft?i.from<=t:i.from0&&a)for(var _=0;_t)&&(!n||Be(n,i.marker)<0)&&(n=i.marker)}return n}function We(e,t,n,r,o){var i=ue(e,t),s=Ee&&i.markedSpans;if(s)for(var a=0;a=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(u.marker.inclusiveRight&&o.inclusiveLeft?ve(l.to,n)>=0:ve(l.to,n)>0)||c>=0&&(u.marker.inclusiveRight&&o.inclusiveLeft?ve(l.from,r)<=0:ve(l.from,r)<0)))return!0}}}function Ue(e){for(var t;t=Re(e);)e=t.find(-1,!0).line;return e}function He(e,t){var n=ue(e,t),r=Ue(n);return n==r?t:fe(r)}function qe(e,t){if(t>e.lastLine())return t;var n,r=ue(e,t);if(!Ve(e,r))return t;for(;n=Ie(r);)r=n.find(1,!0).line;return fe(r)+1}function Ve(e,t){var n=Ee&&t.markedSpans;if(n)for(var r=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Xe=null;function Je(e,t,n){var r;Xe=null;for(var o=0;ot)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:Xe=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:Xe=o)}return null!=r?r:Xe}var Ze=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,i=/[Lb1n]/,s=/[1n]/;function a(e,t,n){this.level=e,this.from=t,this.to=n}return function(u,l){var c,d="ltr"==l?"L":"R";if(0==u.length||"ltr"==l&&!n.test(u))return!1;for(var f=u.length,p=[],h=0;h-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function ot(e,t){var n=nt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o0}function ut(e){e.prototype.on=function(e,t){tt(this,e,t)},e.prototype.off=function(e,t){rt(this,e,t)}}function lt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ct(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dt(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ft(e){lt(e),ct(e)}function pt(e){return e.target||e.srcElement}function ht(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var mt,gt,vt=function(){if(s&&a<9)return!1;var e=S("div");return"draggable"in e||"dragDrop"in e}();function yt(e){if(null==mt){var t=S("span","\u200b");A(e,S("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(mt=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&a<8))}var n=mt?S("span","\u200b"):S("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function bt(e){if(null!=gt)return gt;var t=A(e,document.createTextNode("A\u062eA")),n=k(t,0,1).getBoundingClientRect(),r=k(t,1,2).getBoundingClientRect();return D(e),!(!n||n.left==n.right)&&(gt=r.right-n.right<3)}var _t,xt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),s=i.indexOf("\r");-1!=s?(n.push(i.slice(0,s)),t+=s+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},jt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(_t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(_t){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},wt="oncopy"in(_t=S("div"))||(_t.setAttribute("oncopy","return;"),"function"==typeof _t.oncopy),Ct=null,kt={},Et={};function Dt(e){if("string"==typeof e&&Et.hasOwnProperty(e))e=Et[e];else if(e&&"string"==typeof e.name&&Et.hasOwnProperty(e.name)){var t=Et[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Dt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Dt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function At(e,t){t=Dt(t);var n=kt[t.name];if(!n)return At(e,"text/plain");var r=n(e,t);if(St.hasOwnProperty(t.name)){var o=St[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}var St={};function Tt(e,t){var n=St.hasOwnProperty(e)?St[e]:St[e]={};N(t,n)}function Ft(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Ot(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Pt(e,t,n){return!e.startState||e.startState(t,n)}var Lt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Lt.prototype.eol=function(){return this.pos>=this.string.length},Lt.prototype.sol=function(){return this.pos==this.lineStart},Lt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Lt.prototype.next=function(){if(this.post},Lt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Lt.prototype.skipToEnd=function(){this.pos=this.string.length},Lt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Lt.prototype.backUp=function(e){this.pos-=e},Lt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(o(i)==o(e))return!1!==t&&(this.pos+=e.length),!0},Lt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Lt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Lt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Lt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Mt=function(e,t){this.state=e,this.lookAhead=t},Bt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function Nt(e,t,n,r){var o=[e.state.modeGen],i={};$t(e,t.text,e.doc.mode,n,function(e,t){return o.push(e,t)},i,r);for(var s=n.state,a=function(r){n.baseTokens=o;var a=e.state.overlays[r],u=1,l=0;n.state=!0,$t(e,t.text,a.mode,n,function(e,t){for(var n=u;le&&o.splice(u,1,e,o[u+1],r),u+=2,l=Math.min(e,r)}if(t)if(a.opaque)o.splice(n,u-n,e,"overlay "+t),u=n+2;else for(;ne.options.maxHighlightLength&&Ft(e.doc.mode,r.state),i=Nt(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function It(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new Bt(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=i.first)return i.first;var u=ue(i,a-1),l=u.stateAfter;if(l&&(!n||a+(l instanceof Mt?l.lookAhead:0)<=i.modeFrontier))return a;var c=R(u.text,null,e.options.tabSize);(null==o||r>c)&&(o=a-1,r=c)}return o}(e,t,n),s=i>r.first&&ue(r,i-1).stateAfter,a=s?Bt.fromSaved(r,s,i):new Bt(r,Pt(r.mode),i);return r.iter(i,t,function(n){zt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&rt.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}Bt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Bt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Bt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Bt.fromSaved=function(e,t,n){return t instanceof Mt?new Bt(e,Ft(e.mode,t.state),n,t.lookAhead):new Bt(e,Ft(e.mode,t),n)},Bt.prototype.save=function(e){var t=!1!==e?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Mt(t,this.maxLookAhead):t};var Ht=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function qt(e,t,n,r){var o,i=e.doc,s=i.mode;t=we(i,t);var a,u=ue(i,t.line),l=It(e,t.line,n),c=new Lt(u.text,e.options.tabSize,l);for(r&&(a=[]);(r||c.pose.options.maxHighlightLength?(a=!1,s&&zt(e,t,r,d.pos),d.pos=t.length,u=null):u=Vt(Ut(n,d,r.state,f),i),f){var p=f[0].name;p&&(u="m-"+(u?p+" "+u:p))}if(!a||c!=u){for(;l1&&!/ /.test(e))return e;for(var n=t,r="",o=0;ol&&d.from<=l);f++);if(d.to>=c)return e(n,r,o,i,s,a,u);e(n,r.slice(0,d.to-l),o,i,null,a,u),i=null,r=r.slice(d.to-l),l=d.to}}}function nn(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var s,a,u,l,c,d,f,p=o.length,h=0,m=1,g="",v=0;;){if(v==h){u=l=c=a="",f=null,d=null,v=1/0;for(var y=[],b=void 0,_=0;_h||j.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,l=""),j.className&&(u+=" "+j.className),j.css&&(a=(a?a+";":"")+j.css),j.startStyle&&x.from==h&&(c+=" "+j.startStyle),j.endStyle&&x.to==v&&(b||(b=[])).push(j.endStyle,x.to),j.title&&((f||(f={})).title=j.title),j.attributes)for(var w in j.attributes)(f||(f={}))[w]=j.attributes[w];j.collapsed&&(!d||Be(d.marker,j)<0)&&(d=x)}else x.from>h&&v>x.from&&(v=x.from)}if(b)for(var C=0;C=p)break;for(var E=Math.min(p,v);;){if(g){var D=h+g.length;if(!d){var A=D>E?g.slice(0,E-h):g;t.addToken(t,A,s?s+u:u,c,h+A.length==v?l:"",a,f)}if(D>=E){g=g.slice(E-h),h=E;break}h=D,c=""}g=o.slice(i,i=n[m++]),s=Jt(n[m++],t.cm.options)}}else for(var S=1;Sn)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Fn(e,t,n,r){return Ln(e,Pn(e,t),n,r)}function On(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&i.push((u.bottom+l.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,n,r){var o,i=Nn(t.map,n,r),u=i.node,l=i.start,c=i.end,d=i.collapse;if(3==u.nodeType){for(var f=0;f<4;f++){for(;l&&oe(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+c1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,o))}else{var p;l>0&&(d=r="right"),o=e.options.lineWrapping&&(p=u.getClientRects()).length>1?p["right"==r?p.length-1:0]:u.getBoundingClientRect()}if(s&&a<9&&!l&&(!o||!o.left&&!o.right)){var h=u.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+rr(e.display),top:h.top,bottom:h.bottom}:Bn}for(var m=o.top-t.rect.top,g=o.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;bt)&&(o=(i=u-a)-1,t>=u&&(s="right")),null!=o){if(r=e[l+2],a==u&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==o)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[2+(l-=3)],s="left";if("right"==n&&o==u-a)for(;l=0&&(n=e[o]).left==n.right;o--);return n}function In(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(u=r.text.length,l="before"):u<=0&&(u=0,l="after"),!a)return s("before"==l?u-1:u,"before"==l);function c(e,t,n){var r=a[t],o=1==r.level;return s(n?e-1:e,o!=n)}var d=Je(a,u,l),f=Xe,p=c(u,d,"before"==l);return null!=f&&(p.other=c(u,f,"before"!=l)),p}function Kn(e,t){var n=0;t=we(e.doc,t),e.options.lineWrapping||(n=rr(e.display)*t.ch);var r=ue(e.doc,t.line),o=Ge(r)+Cn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Xn(e,t,n,r,o){var i=ge(e,t,n);return i.xRel=o,r&&(i.outside=!0),i}function Jn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Xn(r.first,0,null,!0,-1);var o=pe(r,n),i=r.first+r.size-1;if(o>i)return Xn(r.first+r.size-1,ue(r,i).text.length,null,!0,1);t<0&&(t=0);for(var s=ue(r,o);;){var a=tr(e,s,o,t,n),u=ze(s,a.ch+(a.xRel>0?1:0));if(!u)return a;var l=u.find(1);if(l.line==o)return l;s=ue(r,o=l.line)}}function Zn(e,t,n,r){r-=qn(t);var o=t.text.length,i=se(function(t){return Ln(e,n,t-1).bottom<=r},o,0);return o=se(function(t){return Ln(e,n,t).top>r},i,o),{begin:i,end:o}}function Qn(e,t,n,r){n||(n=Pn(e,t));var o=Vn(e,t,Ln(e,n,r),"line").top;return Zn(e,t,n,o)}function er(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function tr(e,t,n,r,o){o-=Ge(t);var i=Pn(e,t),s=qn(t),a=0,u=t.text.length,l=!0,c=Qe(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?function(e,t,n,r,o,i,s){var a=Zn(e,t,r,s),u=a.begin,l=a.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var c=null,d=null,f=0;f=l||p.to<=u)){var h=1!=p.level,m=Ln(e,r,h?Math.min(l,p.to)-1:Math.max(u,p.from)).right,g=mg)&&(c=p,d=g)}}return c||(c=o[o.length-1]),c.froml&&(c={from:c.from,to:l,level:c.level}),c}:function(e,t,n,r,o,i,s){var a=se(function(a){var u=o[a],l=1!=u.level;return er(Yn(e,ge(n,l?u.to:u.from,l?"before":"after"),"line",t,r),i,s,!0)},0,o.length-1),u=o[a];if(a>0){var l=1!=u.level,c=Yn(e,ge(n,l?u.from:u.to,l?"after":"before"),"line",t,r);er(c,i,s,!0)&&c.top>s&&(u=o[a-1])}return u})(e,t,n,i,c,r,o);l=1!=d.level,a=l?d.from:d.to-1,u=l?d.to:d.from-1}var f,p,h=null,m=null,g=se(function(t){var n=Ln(e,i,t);return n.top+=s,n.bottom+=s,!!er(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,m=n),!0)},a,u),v=!1;if(m){var y=r-m.left=_.bottom}return g=ie(t.text,g,1),Xn(n,g,p,v,r-f)}function nr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Mn){Mn=S("pre");for(var t=0;t<49;++t)Mn.appendChild(document.createTextNode("x")),Mn.appendChild(S("br"));Mn.appendChild(document.createTextNode("x"))}A(e.measure,Mn);var n=Mn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),D(e.measure),n||1}function rr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=S("span","xxxxxxxxxx"),n=S("pre",[t]);A(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function or(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,s=0;i;i=i.nextSibling,++s)n[e.options.gutters[s]]=i.offsetLeft+i.clientLeft+o,r[e.options.gutters[s]]=i.clientWidth;return{fixedPos:ir(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ir(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=nr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/rr(e.display)-3);return function(o){if(Ve(e.doc,o))return 0;var i=0;if(o.widgets)for(var s=0;s=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r=e.display.viewTo||a.to().linet||t==n&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}(m,n||0,null==r?f:r,function(e,t,o,d){var g="ltr"==o,v=p(e,g?"left":"right"),y=p(t-1,g?"right":"left"),b=null==n&&0==e,_=null==r&&t==f,x=0==d,j=!m||d==m.length-1;if(y.top-v.top<=3){var w=(l?b:_)&&x,C=(l?_:b)&&j,k=w?a:(g?v:y).left,E=C?u:(g?y:v).right;c(k,v.top,E-k,v.bottom)}else{var D,A,S,T;g?(D=l&&b&&x?a:v.left,A=l?u:h(e,o,"before"),S=l?a:h(t,o,"after"),T=l&&_&&j?u:y.right):(D=l?h(e,o,"before"):a,A=!l&&b&&x?u:v.right,S=!l&&_&&j?a:y.left,T=l?h(t,o,"after"):u),c(D,v.top,A-D,v.bottom),v.bottom0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function gr(e){e.state.focused||(e.display.input.focus(),yr(e))}function vr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,br(e))},100)}function yr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ot(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),mr(e))}function br(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ot(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function _r(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||f<-.005)&&(de(o.line,u),xr(o.line),o.rest))for(var p=0;pe.display.sizerWidth){var h=Math.ceil(l/rr(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}}function xr(e){if(e.widgets)for(var t=0;t=s&&(i=pe(t,Ge(ue(t,u))-e.wrapper.clientHeight),s=u)}return{from:i,to:Math.max(s,i+1)}}function wr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ir(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",s=0;si&&(t.bottom=t.top+i);var a=e.doc.height+kn(n),u=t.topa-r;if(t.topo+i){var c=Math.min(t.top,(l?a:t.bottom)-i);c!=o&&(s.scrollTop=c)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=An(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?s.scrollLeft=0:t.leftf+d-3&&(s.scrollLeft=t.right+(p?0:10)-f),s}function Er(e,t){null!=t&&(Sr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Dr(e){Sr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ar(e,t,n){null==t&&null==n||Sr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Sr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Kn(e,t.from),r=Kn(e,t.to);Tr(e,n,r,t.margin)}}function Tr(e,t,n,r){var o=kr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Ar(e,o.scrollLeft,o.scrollTop)}function Fr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||uo(e,{top:t}),Or(e,t,!0),n&&uo(e),ro(e,100))}function Or(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Pr(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Lr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+kn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Dn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Mr=function(e,t,n){this.cm=n;var r=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),tt(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),tt(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Mr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Mr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Mr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Mr.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new I,this.disableVert=new I},Mr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,function r(){var o=e.getBoundingClientRect(),i="vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)})},Mr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Br=function(){};function Nr(e,t){t||(t=Lr(e));var n=e.display.barWidth,r=e.display.barHeight;Rr(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&_r(e),Rr(e,Lr(e)),n=e.display.barWidth,r=e.display.barHeight}function Rr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Br.prototype.update=function(){return{bottom:0,right:0}},Br.prototype.setScrollLeft=function(){},Br.prototype.setScrollTop=function(){},Br.prototype.clear=function(){};var Ir={native:Mr,null:Br};function zr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ir[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),tt(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Pr(e,t):Fr(e,t)},e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Wr=0;function Ur(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Wr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Hr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Vr(e){var t=e.cm,n=t.display;e.updatedDisplay&&_r(t),e.barMeasure=Lr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Fn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Dn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-An(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function $r(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft1&&(s=!0)),null!=l.scrollLeft&&(Pr(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(s=!0)),!s)break}return o}(t,we(r,e.scrollToPos.from),we(r,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!it(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!h){var i=S("div","\u200b",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+Dn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,o)}var i=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(i)for(var a=0;at)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Ee&&He(e.doc,t)o.viewFrom?eo(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)eo(e);else if(t<=o.viewFrom){var i=to(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):eo(e)}else if(n>=o.viewTo){var s=to(e,t,t,-1);s?(o.view=o.view.slice(0,s.index),o.viewTo=s.lineN):eo(e)}else{var a=to(e,t,t,-1),u=to(e,n,n+r,1);a&&u?(o.view=o.view.slice(0,a.index).concat(sn(e,a.lineN,u.lineN)).concat(o.view.slice(u.index)),o.viewTo+=r):eo(e)}var l=o.externalMeasured;l&&(n=o.lineN&&t=r.viewTo)){var i=r.view[lr(e,t)];if(null!=i.node){var s=i.changes||(i.changes=[]);-1==z(s,n)&&s.push(n)}}}function eo(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function to(e,t,n,r){var o,i=lr(e,t),s=e.display.view;if(!Ee||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,u=0;u0){if(i==s.length-1)return null;o=a+s[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;He(e.doc,n)!=n;){if(i==(r<0?0:s.length-1))return null;n+=r*s[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function no(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo)){var n=+new Date+e.options.workTime,r=It(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(i){if(r.line>=e.display.viewFrom){var s=i.styles,a=i.text.length>e.options.maxHighlightLength?Ft(t.mode,r.state):null,u=Nt(e,i,r,!0);a&&(r.state=a),i.styles=u.styles;var l=i.styleClasses,c=u.classes;c?i.styleClasses=c:l&&(i.styleClasses=null);for(var d=!s||s.length!=i.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),f=0;!d&&fn)return ro(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&Yr(e,function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==no(e))return!1;Cr(e)&&(eo(e),t.dims=or(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(o,n.viewTo)),Ee&&(i=He(e.doc,i),s=qe(e.doc,s));var a=i!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=sn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=sn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,lr(e,n)))),r.viewTo=n}(e,i,s),n.viewOffset=Ge(ue(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=no(e);if(!a&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=O();if(!t||!F(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&F(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,o=e.options.lineNumbers,i=r.lineDiv,s=i.firstChild;function a(t){var n=t.nextSibling;return u&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,c=r.viewFrom,d=0;d-1&&(p=!1),dn(e,f,c,n)),p&&(D(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(me(e.options,c)))),s=f.node.nextSibling}else{var h=yn(e,f,c,n);i.insertBefore(h,s)}c+=f.size}for(;s;)s=a(s)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=O()&&(e.activeElt.focus(),e.anchorNode&&F(document.body,e.anchorNode)&&F(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ro(e,400)),n.updateLineNumbers=null,!0}function ao(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=An(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+kn(e.display)-Sn(e),n.top)}),t.visible=jr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&so(e,t);r=!1){_r(e);var o=Lr(e);cr(e),Nr(e,o),co(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function uo(e,t){var n=new io(e,t);if(so(e,n)){_r(e),ao(e,n);var r=Lr(e);cr(e),Nr(e,r),co(e,r),n.finish()}}function lo(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function co(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Dn(e)+"px"}function fo(e){var t=e.display.gutters,n=e.options.gutters;D(t);for(var r=0;r-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}io.prototype.signal=function(e,t){at(e,t)&&this.events.push(arguments)},io.prototype.finish=function(){for(var e=0;ea.clientWidth,c=a.scrollHeight>a.clientHeight;if(o&&l||i&&c){if(i&&y&&u)e:for(var f=t.target,p=s.view;f!=a;f=f.parentNode)for(var h=0;h=0&&ve(e,r.to())<=0)return n}return-1};var _o=function(e,t){this.anchor=e,this.head=t};function xo(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort(function(e,t){return ve(e.from(),t.from())}),n=z(t,o);for(var i=1;i0:u>=0){var l=xe(a.from(),s.from()),c=_e(a.to(),s.to()),d=a.empty()?s.from()==s.head:a.from()==a.head;i<=n&&--n,t.splice(--i,2,new _o(d?c:l,d?l:c))}}return new bo(t,n)}function jo(e,t){return new bo([new _o(e,t||e)],0)}function wo(e){return e.text?ge(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Co(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return wo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wo(t).ch-t.to.ch),ge(n,r)}function ko(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,h-1),e.insert(a.line+1,v)}ln(e,"change",e,t)}function Fo(e,t,n){!function e(r,o,i){if(r.linked)for(var s=0;sa-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(Bo(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(o,o.lastOp==r)))s=K(i.changes),0==ve(t.from,t.to)&&0==ve(t.from,s.to)?s.to=wo(t):i.changes.push(Mo(e,t));else{var u=K(o.done);for(u&&u.ranges||Io(e.sel,o.done),i={changes:[Mo(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=a,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,s||ot(e,"historyAdded")}function Ro(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,K(o.done),t))?o.done[o.done.length-1]=t:Io(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&Bo(o.undone)}function Io(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function zo(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i})}function Wo(e){if(!e)return null;for(var t,n=0;n-1&&(K(a)[d]=l[d],delete l[d])}}}return r}function qo(e,t,n,r){if(r){var o=e.anchor;if(n){var i=ve(t,o)<0;i!=ve(n,o)<0?(o=t,t=n):i!=ve(t,n)<0&&(t=n)}return new _o(o,t)}return new _o(n||t,t)}function Vo(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Xo(e,new bo([qo(e.sel.primary(),t,n,o)],0),r)}function $o(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i=t.ch:a.to>t.ch))){if(o&&(ot(u,"beforeCursorEnter"),u.explicitlyCleared)){if(i.markedSpans){--s;continue}break}if(!u.atomic)continue;if(n){var l=u.find(r<0?1:-1),c=void 0;if((r<0?u.inclusiveRight:u.inclusiveLeft)&&(l=ri(e,l,-r,l&&l.line==t.line?i:null)),l&&l.line==t.line&&(c=ve(l,n))&&(r<0?c<0:c>0))return ti(e,l,t,r,o)}var d=u.find(r<0?-1:1);return(r<0?u.inclusiveLeft:u.inclusiveRight)&&(d=ri(e,d,r,d.line==t.line?i:null)),d?ti(e,d,t,r,o):null}}return t}function ni(e,t,n,r,o){var i=r||1,s=ti(e,t,n,i,o)||!o&&ti(e,t,n,i,!0)||ti(e,t,n,-i,o)||!o&&ti(e,t,n,-i,!0);return s||(e.cantEdit=!0,ge(e.first,0))}function ri(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?we(e,ge(t.line-1)):null:n>0&&t.ch==(r||ue(e,t.line)).text.length?t.line0)){var c=[u,1],d=ve(l.from,a.from),f=ve(l.to,a.to);(d<0||!s.inclusiveLeft&&!d)&&c.push({from:l.from,to:a.from}),(f>0||!s.inclusiveRight&&!f)&&c.push({from:a.to,to:l.to}),o.splice.apply(o,c),u+=c.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)ai(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else ai(e,t)}}function ai(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ve(t.from,t.to)){var n=ko(e,t);No(e,t,n,e.cm?e.cm.curOp.id:NaN),ci(e,t,n,Te(e,t));var r=[];Fo(e,function(e,n){n||-1!=z(r,e.history)||(hi(e.history,t),r.push(e.history)),ci(e,t,null,Te(e,t))})}}function ui(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,i=e.history,s=e.sel,a="undo"==t?i.done:i.undone,u="undo"==t?i.undone:i.done,l=0;l=0;--p){var h=f(p);if(h)return h.v}}}}function li(e,t){if(0!=t&&(e.first+=t,e.sel=new bo(X(e.sel.ranges,function(e){return new _o(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Zr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.linei&&(t={from:t.from,to:ge(i,ue(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=le(e,t.from,t.to),n||(n=ko(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,s=t.to,a=!1,u=i.line;e.options.lineWrapping||(u=fe(Ue(ue(r,i.line))),r.iter(u,s.line+1,function(e){if(e==o.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&st(e),To(r,t,n,sr(e)),e.options.lineWrapping||(r.iter(u,i.line+t.text.length,function(e){var t=Ye(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var o=ue(e,r).stateAfter;if(o&&(!(o instanceof Mt)||r+o.lookAhead1||!(this.children[0]instanceof gi))){var a=[];this.collapse(a),this.children=[new gi(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=o.lines.length%25+25,a=s;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==s&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=T("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(We(e,t.line,t,n,i)||t.line!=n.line&&We(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ee=!0}i.addToHistory&&No(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,u=t.line,l=e.cm;if(e.iter(u,n.line+1,function(e){l&&i.collapsed&&!l.options.lineWrapping&&Ue(e)==l.display.maxLine&&(a=!0),i.collapsed&&u!=t.line&&de(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new De(i,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u}),i.collapsed&&e.iter(t.line,n.line+1,function(t){Ve(e,t)&&de(t,0)}),i.clearOnEnter&&tt(i,"beforeCursorEnter",function(){return i.clear()}),i.readOnly&&(ke=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++_i,i.atomic=!0),l){if(a&&(l.curOp.updateMaxLine=!0),i.collapsed)Zr(l,t.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var c=t.line;c<=n.line;c++)Qr(l,c,"text");i.atomic&&Qo(l.doc),ln(l,"markerAdded",l,i)}return i}xi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ur(e),at(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;ie.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Zr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Qo(e.doc)),e&&ln(e,"markerCleared",e,this,r,o),t&&Hr(e),this.parent&&this.parent.clear()}},xi.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;u--)si(this,r[u]);a?Ko(this,a):this.cm&&Dr(this.cm)}),undo:Jr(function(){ui(this,"undo")}),redo:Jr(function(){ui(this,"redo")}),undoSelection:Jr(function(){ui(this,"undo",!0)}),redoSelection:Jr(function(){ui(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=we(this,e),t=we(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,function(i){var s=i.markedSpans;if(s)for(var a=0;a=u.to||null==u.from&&o!=e.line||null!=u.from&&o==t.line&&u.from>=t.ch||n&&!n(u.marker)||r.push(u.marker.parent||u.marker)}++o}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=i,++n}),we(this,ge(n,t))},indexFromPos:function(e){var t=(e=we(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Jo(t.doc,jo(n,n)),d)for(var f=0;f=0;t--)di(e.doc,"",r[t].from,r[t].to,"+delete");Dr(e)})}function Yi(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ki(e,t,n){var r=Yi(e,t.ch,n);return null==r?null:new ge(t.line,r,n<0?"after":"before")}function Xi(e,t,n,r,o){if(e){var i=Qe(n,t.doc.direction);if(i){var s,a=o<0?K(i):i[0],u=o<0==(1==a.level),l=u?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=Pn(t,n);s=o<0?n.text.length-1:0;var d=Ln(t,c,s).top;s=se(function(e){return Ln(t,c,e).top==d},o<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Yi(n,s,1))}else s=o<0?a.to:a.from;return new ge(r,s,l)}}return new ge(r,o<0?n.text.length:0,o<0?"before":"after")}Ii.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ii.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ii.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ii.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ii.default=y?Ii.macDefault:Ii.pcDefault;var Ji={selectAll:oi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),H)},killLine:function(e){return Gi(e,function(t){if(t.empty()){var n=ue(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)o=new ge(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),ge(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var s=ue(e.doc,o.line-1).text;s&&(o=new ge(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),ge(o.line-1,s.length-1),o,"+transpose"))}n.push(new _o(o,o))}e.setSelections(n)})},newlineAndIndent:function(e){return Yr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(ve((o=l.ranges[o]).from(),t)<0||t.xRel>0)&&(ve(o.to(),t)>0||t.xRel<0)?function(e,t,n,r){var o=e.display,i=!1,l=Kr(e,function(t){u&&(o.scroller.draggable=!1),e.state.draggingText=!1,rt(o.wrapper.ownerDocument,"mouseup",l),rt(o.wrapper.ownerDocument,"mousemove",c),rt(o.scroller,"dragstart",d),rt(o.scroller,"drop",l),i||(lt(t),r.addNew||Vo(e.doc,n,null,null,r.extend),u||s&&9==a?setTimeout(function(){o.wrapper.ownerDocument.body.focus(),o.input.focus()},20):o.input.focus())}),c=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return i=!0};u&&(o.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),tt(o.wrapper.ownerDocument,"mouseup",l),tt(o.wrapper.ownerDocument,"mousemove",c),tt(o.scroller,"dragstart",d),tt(o.scroller,"drop",l),vr(e),setTimeout(function(){return o.input.focus()},20)}(e,r,t,i):function(e,t,n,r){var o=e.display,i=e.doc;lt(t);var s,a,u=i.sel,l=u.ranges;if(r.addNew&&!r.extend?(a=i.sel.contains(n),s=a>-1?l[a]:new _o(n,n)):(s=i.sel.primary(),a=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new _o(n,n)),n=ur(e,t,!0,!0),a=-1;else{var c=ps(e,n,r.unit);s=r.extend?qo(s,c.anchor,c.head,r.extend):c}r.addNew?-1==a?(a=l.length,Xo(i,xo(e,l.concat([s]),a),{scroll:!1,origin:"*mouse"})):l.length>1&&l[a].empty()&&"char"==r.unit&&!r.extend?(Xo(i,xo(e,l.slice(0,a).concat(l.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),u=i.sel):Go(i,a,s,q):(a=0,Xo(i,new bo([s],0),q),u=i.sel);var d=n;function f(t){if(0!=ve(d,t))if(d=t,"rectangle"==r.unit){for(var o=[],l=e.options.tabSize,c=R(ue(i,n.line).text,n.ch,l),f=R(ue(i,t.line).text,t.ch,l),p=Math.min(c,f),h=Math.max(c,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=ue(i,m).text,y=$(v,p,l);p==h?o.push(new _o(ge(m,y),ge(m,y))):v.length>y&&o.push(new _o(ge(m,y),ge(m,$(v,h,l))))}o.length||o.push(new _o(n,n)),Xo(i,xo(e,u.ranges.slice(0,a).concat(o),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,_=s,x=ps(e,t,r.unit),j=_.anchor;ve(x.anchor,j)>0?(b=x.head,j=xe(_.from(),x.anchor)):(b=x.anchor,j=_e(_.to(),x.head));var w=u.ranges.slice(0);w[a]=function(e,t){var n=t.anchor,r=t.head,o=ue(e.doc,n.line);if(0==ve(n,r)&&n.sticky==r.sticky)return t;var i=Qe(o);if(!i)return t;var s=Je(i,n.ch,n.sticky),a=i[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var u,l=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==l||l==i.length)return t;if(r.line!=n.line)u=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=Je(i,r.ch,r.sticky),d=c-s||(r.ch-n.ch)*(1==a.level?-1:1);u=c==l-1||c==l?d<0:d>0}var f=i[l+(u?-1:0)],p=u==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new _o(new ge(n.line,h,m),r)}(e,new _o(we(i,j),b)),Xo(i,xo(e,w,a),q)}}var p=o.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,lt(t),o.input.focus(),rt(o.wrapper.ownerDocument,"mousemove",g),rt(o.wrapper.ownerDocument,"mouseup",v),i.history.lastSelOrigin=null}var g=Kr(e,function(t){0!==t.buttons&&ht(t)?function t(n){var s=++h,a=ur(e,n,!0,"rectangle"==r.unit);if(a)if(0!=ve(a,d)){e.curOp.focus=O(),f(a);var u=jr(o,i);(a.line>=u.to||a.linep.bottom?20:0;l&&setTimeout(Kr(e,function(){h==s&&(o.scroller.scrollTop+=l,t(n))}),50)}}(t):m(t)}),v=Kr(e,m);e.state.selectingText=v,tt(o.wrapper.ownerDocument,"mousemove",g),tt(o.wrapper.ownerDocument,"mouseup",v)}(e,r,t,i)}(t,r,i,e):pt(e)==n.scroller&<(e):2==o?(r&&Vo(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==o&&(w?t.display.input.onContextMenu(e):vr(t)))}}function ps(e,t,n){if("char"==n)return new _o(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new _o(ge(t.line,0),we(e.doc,ge(t.line+1,0)));var r=n(e,t);return new _o(r.from,r.to)}function hs(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&<(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(i>a.bottom||!at(e,n))return dt(t);i-=a.top-s.viewOffset;for(var u=0;u=o){var c=pe(e.doc,i),d=e.options.gutters[u];return ot(e,n,e,c,d,t),dt(t)}}}function ms(e,t){return hs(e,t,"gutterClick",!0)}function gs(e,t){wn(e.display,t)||function(e,t){return!!at(e,"gutterContextMenu")&&hs(e,t,"gutterContextMenu",!1)}(e,t)||it(e,t,"contextmenu")||w||e.display.input.onContextMenu(t)}function vs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wn(e)}ds.prototype.compare=function(e,t,n){return this.time+400>e&&0==ve(t,this.pos)&&n==this.button};var ys={toString:function(){return"CodeMirror.Init"}},bs={},_s={};function xs(e){fo(e),Zr(e),wr(e)}function js(e,t,n){var r=n&&n!=ys;if(!t!=!r){var o=e.display.dragFunctions,i=t?tt:rt;i(e.display.scroller,"dragstart",o.start),i(e.display.scroller,"dragenter",o.enter),i(e.display.scroller,"dragover",o.over),i(e.display.scroller,"dragleave",o.leave),i(e.display.scroller,"drop",o.drop)}}function ws(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),Ke(e)),ar(e),Zr(e),Wn(e),setTimeout(function(){return Nr(e)},100)}function Cs(e,t){var n=this;if(!(this instanceof Cs))return new Cs(e,t);this.options=t=t?N(t):{},N(bs,t,!1),po(t);var r=t.value;"string"==typeof r?r=new Di(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new Cs.inputStyles[t.inputStyle](this),i=this.display=new ae(e,r,o);for(var l in i.wrapper.CodeMirror=this,fo(this),vs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new I,keySeq:null,specialChars:null},t.autofocus&&!v&&i.input.focus(),s&&a<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(e){var t=e.display;tt(t.scroller,"mousedown",Kr(e,fs)),tt(t.scroller,"dblclick",s&&a<11?Kr(e,function(t){if(!it(e,t)){var n=ur(e,t);if(n&&!ms(e,t)&&!wn(e.display,t)){lt(t);var r=e.findWordAt(n);Vo(e.doc,r.anchor,r.head)}}}):function(t){return it(e,t)||lt(t)}),tt(t.scroller,"contextmenu",function(t){return gs(e,t)});var n,r={end:0};function o(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function i(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}tt(t.scroller,"touchstart",function(o){if(!it(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!ms(e,o)){t.input.ensurePolled(),clearTimeout(n);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}}),tt(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),tt(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!wn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var s,a=e.coordsChar(t.activeTouch,"page");s=!r.prev||i(r,r.prev)?new _o(a,a):!r.prev.prev||i(r,r.prev.prev)?e.findWordAt(a):new _o(ge(a.line,0),we(e.doc,ge(a.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),lt(n)}o()}),tt(t.scroller,"touchcancel",o),tt(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Fr(e,t.scroller.scrollTop),Pr(e,t.scroller.scrollLeft,!0),ot(e,"scroll",e))}),tt(t.scroller,"mousewheel",function(t){return yo(e,t)}),tt(t.scroller,"DOMMouseScroll",function(t){return yo(e,t)}),tt(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){it(e,t)||ft(t)},over:function(t){it(e,t)||(function(e,t){var n=ur(e,t);if(n){var r=document.createDocumentFragment();fr(e,n,r),e.display.dragCursor||(e.display.dragCursor=S("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,r)}}(e,t),ft(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Ai<100))ft(t);else if(!it(e,t)&&!wn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=S("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:Kr(e,Si),leave:function(t){it(e,t)||Ti(e)}};var u=t.input.getField();tt(u,"keyup",function(t){return as.call(e,t)}),tt(u,"keydown",Kr(e,ss)),tt(u,"keypress",Kr(e,us)),tt(u,"focus",function(t){return yr(e,t)}),tt(u,"blur",function(t){return br(e,t)})}(this),Pi(),Ur(this),this.curOp.forceUpdate=!0,Oo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(B(yr,this),20):br(this),_s)_s.hasOwnProperty(l)&&_s[l](n,t[l],ys);Cr(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=t>i.first?R(ue(i,t-1).text,null,s):0:"add"==n?l=u+e.options.indentUnit:"subtract"==n?l=u-e.options.indentUnit:"number"==typeof n&&(l=u+n),l=Math.max(0,l);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(l/s);p;--p)f+=s,d+="\t";if(f1)if(Ds&&Ds.text.join("\n")==t){if(r.ranges.length%Ds.text.length==0){l=[];for(var c=0;c=0;d--){var f=r.ranges[d],p=f.from(),h=f.to();f.empty()&&(n&&n>0?p=ge(p.line,p.ch-n):e.state.overwrite&&!a?h=ge(h.line,Math.min(ue(i,h.line).text.length,h.ch+K(u).length)):a&&Ds&&Ds.lineWise&&Ds.text.join("\n")==t&&(p=h=ge(p.line,0))),s=e.curOp.updateInput;var m={from:p,to:h,text:l?l[d%l.length]:u,origin:o||(a?"paste":e.state.cutIncoming?"cut":"+input")};si(e.doc,m),ln(e,"inputRead",e,m)}t&&!a&&Fs(e,t),Dr(e),e.curOp.updateInput=s,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Ts(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Yr(t,function(){return Ss(t,n,0,null,"paste")}),!0}function Fs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),s=!1;if(i.electricChars){for(var a=0;a-1){s=Es(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(ue(e.doc,o.head.line).text.slice(0,o.head.ch))&&(s=Es(e,o.head.line,"smart"));s&&ln(e,"electricInput",e,o.head.line)}}}function Os(e){for(var t=[],n=[],r=0;r=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=Je(o,n.ch,n.sticky),s=o[i];if("ltr"==e.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from=s.from&&f>=c.begin)){var p=d?"before":"after";return new ge(n.line,f,p)}}var h=function(e,t,r){for(var i=function(e,t){return t?new ge(n.line,u(e,1),"before"):new ge(n.line,e,"after")};e>=0&&e0==(1!=s.level),l=a?r.begin:u(r.end,-1);if(s.from<=l&&l0?c.end:u(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=h(r>0?0:o.length-1,r,l(g)))?null:m}(e.cm,a,t,n):Ki(a,t,n))){if(r||((s=t.line+n)=e.first+e.size||(t=new ge(s,t.ch,t.sticky),!(a=ue(e,s)))))return!1;t=Xi(o,e.cm,a,t.line,n)}else t=i;return!0}if("char"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var l=null,c="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var p=a.text.charAt(t.ch)||"\n",h=te(p,d)?"w":c&&"\n"==p?"n":!c||/\s/.test(p)?null:"p";if(!c||f||h||(h="s"),l&&l!=h){n<0&&(n=1,u(),t.sticky="after");break}if(h&&(l=h),n>0&&!u(!f))break}var m=ni(e,t,i,s,!0);return ye(i,m)&&(m.hitSide=!0),m}function Bs(e,t,n,r){var o,i,s=e.doc,a=t.left;if("page"==r){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(u-.5*nr(e.display),3);o=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;(i=Jn(e,a,o)).outside;){if(n<0?o<=0:o>=s.height){i.hitSide=!0;break}o+=5*n}return i}var Ns=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Rs(e,t){var n=On(e,t.line);if(!n||n.hidden)return null;var r=ue(e.doc,t.line),o=Tn(n,r,t.line),i=Qe(r,e.doc.direction),s="left";if(i){var a=Je(i,t.ch);s=a%2?"right":"left"}var u=Nn(o.map,t.ch,s);return u.offset="right"==u.collapse?u.end:u.start,u}function Is(e,t){return t&&(e.bad=!0),e}function zs(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Is(e.clipPos(ge(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o=t.display.viewTo||i.line=t.display.viewFrom&&Rs(t,o)||{node:u[0].measure.map[2],offset:0},c=i.liner.firstLine()&&(s=ge(s.line-1,ue(r.doc,s.line-1).length)),a.ch==ue(r.doc,a.line).text.length&&a.lineo.viewTo-1)return!1;s.line==o.viewFrom||0==(e=lr(r,s.line))?(t=fe(o.view[0].line),n=o.view[0].node):(t=fe(o.view[e].line),n=o.view[e-1].node.nextSibling);var u,l,c=lr(r,a.line);if(c==o.view.length-1?(u=o.viewTo-1,l=o.lineDiv.lastChild):(u=fe(o.view[c+1].line)-1,l=o.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,o){var i="",s=!1,a=e.doc.lineSeparator(),u=!1;function l(){s&&(i+=a,u&&(i+=a),s=u=!1)}function c(e){e&&(l(),i+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var i,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(ge(r,0),ge(o+1,0),(g=+f,function(e){return e.id==g}));return void(p.length&&(i=p[0].find(0))&&c(le(e.doc,i.from,i.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&l();for(var m=0;m1&&f.length>1;)if(K(d)==K(f))d.pop(),f.pop(),u--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);ps.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var x=ge(t,p),j=ge(u,f.length?K(f).length-h:0);return d.length>1||d[0]||ve(x,j)?(di(r.doc,d,x,j,"+input"),!0):void 0},Ns.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ns.prototype.reset=function(){this.forceCompositionEnd()},Ns.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ns.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Ns.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Yr(this.cm,function(){return Zr(e.cm)})},Ns.prototype.setUneditable=function(e){e.contentEditable="false"},Ns.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Kr(this.cm,Ss)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ns.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ns.prototype.onContextMenu=function(){},Ns.prototype.resetPosition=function(){},Ns.prototype.needsContentAttribute=!0;var Us=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};Us.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!it(r,e)){if(r.somethingSelected())As({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Os(r);As({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,H):(n.prevInput="",o.value=t.text.join("\n"),M(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(o.style.width="0px"),tt(o,"input",function(){s&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),tt(o,"paste",function(e){it(r,e)||Ts(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),tt(o,"cut",i),tt(o,"copy",i),tt(e.scroller,"paste",function(t){wn(e,t)||it(r,t)||(r.state.pasteIncoming=!0,n.focus())}),tt(e.lineSpace,"selectstart",function(t){wn(e,t)||lt(t)}),tt(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),tt(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Us.prototype.createField=function(e){this.wrapper=Ls(),this.textarea=this.wrapper.firstChild},Us.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=dr(e);if(e.options.moveInputWithCursor){var o=Yn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+s.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+s.left-i.left))}return r},Us.prototype.showSelection=function(e){var t=this.cm,n=t.display;A(n.cursorDiv,e.cursors),A(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Us.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&M(this.textarea),s&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},Us.prototype.getField=function(){return this.textarea},Us.prototype.supportsTouch=function(){return!1},Us.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||O()!=this.textarea))try{this.textarea.focus()}catch(_t){}},Us.prototype.blur=function(){this.textarea.blur()},Us.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Us.prototype.receivedFocus=function(){this.slowPoll()},Us.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Us.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},Us.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||jt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r="\u200b"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var u=0,l=Math.min(r.length,o.length);u1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Us.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Us.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},Us.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea,i=ur(n,e),l=r.scroller.scrollTop;if(i&&!d){var c=n.options.resetSelectionOnContextMenu;c&&-1==n.doc.sel.contains(i)&&Kr(n,Xo)(n.doc,jo(i),H);var f=o.style.cssText,p=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var h,m=t.wrapper.getBoundingClientRect();if(o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(h=window.scrollY),r.input.focus(),u&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&a>=9&&v(),w){ft(e);var g=function(){rt(window,"mouseup",g),setTimeout(y,20)};tt(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=o.selectionStart){var e=n.somethingSelected(),i="\u200b"+(e?o.value:"");o.value="\u21da",o.value=i,t.prevInput=e?"":"\u200b",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=p,o.style.cssText=f,s&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=o.selectionStart){(!s||s&&a<9)&&v();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"\u200b"==t.prevInput?Kr(n,oi)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},Us.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Us.prototype.setUneditable=function(){},Us.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=ys&&o(e,t,n)}:o)}e.defineOption=n,e.Init=ys,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Do(e)},!0),n("indentUnit",2,Do,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Ao(e),Wn(e),Zr(e)},!0),n("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(ge(r,i))}r++});for(var o=n.length-1;o>=0;o--)di(e.doc,t,n[o],ge(n[o].line,n[o].ch+t.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ys&&e.refresh()}),n("specialCharPlaceholder",Qt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){vs(e),xs(e)},!0),n("keyMap","default",function(e,t,n){var r=$i(t),o=n!=ys&&$i(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ws,!0),n("gutters",[],function(e){po(e.options),xs(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ir(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return Nr(e)},!0),n("scrollbarStyle","native",function(e){zr(e),Nr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){po(e.options),xs(e)},!0),n("firstLineNumber",1,xs,!0),n("lineNumberFormatter",function(e){return e},xs,!0),n("showCursorWhenSelecting",!1,cr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(e,t){"nocursor"==t&&(br(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,js),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,cr,!0),n("singleCursorHeightPerLine",!0,cr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ao,!0),n("addModeClass",!1,Ao,!0),n("pollInterval",100),n("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),n("historyEventDelay",1250),n("viewportMargin",10,function(e){return e.refresh()},!0),n("maxHighlightLength",1e4,Ao,!0),n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),n("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),n("autofocus",null),n("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),n("phrases",null)}(Cs),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Kr(this,t[e])(this,n,o),ot(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($i(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Es(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&Dr(this));else{var i=o.from(),s=o.to(),a=Math.max(n,i.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var u=a;u0&&Go(this.doc,r,new _o(i,l[r].to()),H)}}}),getTokenAt:function(e,t){return qt(this,e,t)},getLineTokens:function(e,t){return qt(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=we(this.doc,e);var t,n=Rt(this,ue(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var s=r+o>>1;if((s?n[2*s-1]:0)>=i)o=s;else{if(!(n[2*s+1]i&&(e=i,o=!0),r=ue(this.doc,e)}else r=e;return Vn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Ge(r):0)},defaultTextHeight:function(){return nr(this.display)},defaultCharWidth:function(){return rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i,s,a,u=this.display,l=(e=Yn(this,we(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),u.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var d=Math.max(u.wrapper.clientHeight,this.doc.height),f=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(l=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==o?(c=u.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?c=0:"middle"==o&&(c=(u.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(i=this,s={left:c,top:l,right:c+t.offsetWidth,bottom:l+t.offsetHeight},null!=(a=kr(i,s)).scrollTop&&Fr(i,a.scrollTop),null!=a.scrollLeft&&Pr(i,a.scrollLeft))},triggerOnKeyDown:Xr(ss),triggerOnKeyPress:Xr(us),triggerOnKeyUp:as,triggerOnMouseDown:Xr(fs),execCommand:function(e){if(Ji.hasOwnProperty(e))return Ji[e].call(null,this)},triggerElectric:Xr(function(e){Fs(this,e)}),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=we(this.doc,e),s=0;s0&&a(n.charAt(r-1));)--r;for(;o.5)&&ar(this),ot(this,"refresh",this)}),swapDoc:Xr(function(e){var t=this.doc;return t.cm=null,Oo(this,e),Wn(this),this.display.input.reset(),Ar(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ut(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}(Cs);var Hs="iter insert remove copy getEditor constructor".split(" ");for(var qs in Di.prototype)Di.prototype.hasOwnProperty(qs)&&z(Hs,qs)<0&&(Cs.prototype[qs]=function(e){return function(){return e.apply(this.doc,arguments)}}(Di.prototype[qs]));return ut(Di),Cs.inputStyles={textarea:Us,contenteditable:Ns},Cs.defineMode=function(e){Cs.defaults.mode||"null"==e||(Cs.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),kt[e]=t}.apply(this,arguments)},Cs.defineMIME=function(e,t){Et[e]=t},Cs.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Cs.defineMIME("text/plain","null"),Cs.defineExtension=function(e,t){Cs.prototype[e]=t},Cs.defineDocExtension=function(e,t){Di.prototype[e]=t},Cs.fromTextArea=function(e,t){if((t=t?N(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=O();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var o;if(e.form&&(tt(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var s=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=s}}catch(_t){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=o))}},e.style.display="none";var a=Cs(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a},function(e){e.off=rt,e.on=tt,e.wheelEventPixels=vo,e.Doc=Di,e.splitLines=xt,e.countColumn=R,e.findColumn=$,e.isWordChar=ee,e.Pass=U,e.signal=ot,e.Line=Gt,e.changeEnd=wo,e.scrollbarModel=Ir,e.Pos=ge,e.cmpPos=ve,e.modes=kt,e.mimeModes=Et,e.resolveMode=Dt,e.getMode=At,e.modeExtensions=St,e.extendMode=Tt,e.copyState=Ft,e.startState=Pt,e.innerMode=Ot,e.commands=Ji,e.keyMap=Ii,e.keyName=Vi,e.isModifierKey=Hi,e.lookupKey=Ui,e.normalizeKeyMap=Wi,e.StringStream=Lt,e.SharedTextMarker=wi,e.TextMarker=xi,e.LineWidget=yi,e.e_preventDefault=lt,e.e_stopPropagation=ct,e.e_stop=ft,e.addClass=P,e.contains=F,e.rmClass=E,e.keyNames=Mi}(Cs),Cs.version="5.42.0",Cs}()},"./node_modules/codemirror/mode/css/css.js":function(e,t,n){!function(e){"use strict";function t(e){for(var t={},n=0;n0;o--)n.context=n.context.prev;return D(e,t,n)}function S(e){var t=e.current().toLowerCase();i=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var T={top:function(e,t,n){if("{"==e)return k(n,t,"block");if("}"==e&&n.context.prev)return E(n);if(_&&/@component/i.test(e))return k(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return k(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return k(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return k(n,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return k(n,t,"interpolation");if(":"==e)return"pseudo";if(y&&"("==e)return k(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return f.hasOwnProperty(r)?(i="property","maybeprop"):p.hasOwnProperty(r)?(i="string-2","maybeprop"):y?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":y||"hash"!=e&&"qualifier"!=e?T.top(e,t,n):(i="error","block")},maybeprop:function(e,t,n){return":"==e?k(n,t,"prop"):D(e,t,n)},prop:function(e,t,n){if(";"==e)return E(n);if("{"==e&&y)return k(n,t,"propBlock");if("}"==e||"{"==e)return A(e,t,n);if("("==e)return k(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)S(t);else if("interpolation"==e)return k(n,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?E(n):"word"==e?(i="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?A(e,t,n):")"==e?E(n):"("==e?k(n,t,"parens"):"interpolation"==e?k(n,t,"interpolation"):("word"==e&&S(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):D(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&u.hasOwnProperty(t.current())?(i="tag",n.context.type):T.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return k(n,t,"atBlock_parens");if("}"==e||";"==e)return A(e,t,n);if("{"==e)return E(n)&&k(n,t,y?"block":"top");if("interpolation"==e)return k(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":l.hasOwnProperty(r)?"attribute":c.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":f.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?"string-2":v.hasOwnProperty(r)?"atom":g.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?A(e,t,n):"{"==e?E(n)&&k(n,t,y?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?E(n):"{"==e||"}"==e?A(e,t,n,2):T.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?k(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):D(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,E(n)):"word"==e?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?k(n,t,"top"):D(e,t,n)},at:function(e,t,n){return";"==e?E(n):"{"==e||"}"==e?A(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?E(n):"{"==e||";"==e?A(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new C(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||function(e,t){var n=e.next();if(a[n]){var r=a[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),x("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?x(null,"compare"):'"'==n||"'"==n?(t.tokenize=j(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),x("atom","hash")):"!"==n?(e.match(/^\s*\w*/),x("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),x("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?x(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):("u"==n||"U"==n)&&e.match(/rl(-prefix)?\(/i)||("d"==n||"D"==n)&&e.match("omain(",!0,!0)||("r"==n||"R"==n)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=w,x("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0})(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(t.state=T[t.state](o,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-s)):(n=n.prev,o=n.indent)),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],r=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=t(o),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],a=t(s),u=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],l=t(u),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(c),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(f),h=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(g),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=t(y),_=n.concat(o).concat(s).concat(u).concat(c).concat(f).concat(g).concat(y);function x(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:h,counterDescriptors:m,colorKeywords:v,valueKeywords:b,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x,x(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x,x(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x,x(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:h,counterDescriptors:m,colorKeywords:v,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x,x(e,t))}},name:"css",helperType:"gss"})}(n("./node_modules/codemirror/lib/codemirror.js"))},"./node_modules/codemirror/mode/javascript/javascript.js":function(e,t,n){!function(e){"use strict";e.defineMode("javascript",function(t,n){var r,o,i=t.indentUnit,s=n.statementIndent,a=n.jsonld,u=n.json||a,l=n.typescript,c=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),o=e("keyword d"),i=e("operator"),s={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),f=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e,t,n){return r=e,o=n,t}function m(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,o=!1;if(a&&"@"==e.peek()&&e.match(p))return t.tokenize=m,h("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||o);)o=!o&&"\\"==r;return o||(t.tokenize=m),h("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return h("number","number");if("."==r&&e.match(".."))return h("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return h(r);if("="==r&&e.eat(">"))return h("=>","operator");if("0"==r&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return h("number","number");if(/\d/.test(r))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),h("number","number");if("/"==r)return e.eat("*")?(t.tokenize=g,g(e,t)):e.eat("/")?(e.skipToEnd(),h("comment","comment")):Ge(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),h("regexp","string-2")):(e.eat("="),h("operator","operator",e.current()));if("`"==r)return t.tokenize=v,v(e,t);if("#"==r)return e.skipToEnd(),h("error","error");if(f.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),h("operator","operator",e.current());if(c.test(r)){e.eatWhile(c);var o=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(o)){var i=d[o];return h(i.type,i.style,o)}if("async"==o&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return h("async","keyword",o)}return h("variable","variable",o)}}function g(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=m;break}r="*"==n}return h("comment","comment")}function v(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=m;break}r=!r&&"\\"==n}return h("quasi","string-2",e.current())}var y="([{}])";function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(l){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var o=0,i=!1,s=n-1;s>=0;--s){var a=e.string.charAt(s),u=y.indexOf(a);if(u>=0&&u<3){if(!o){++s;break}if(0==--o){"("==a&&(i=!0);break}}else if(u>=3&&u<6)++o;else if(c.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!o){++s;break}}}i&&!o&&(t.fatArrowAt=s)}}var _={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function x(e,t,n,r,o,i){this.indented=e,this.column=t,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function j(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}var w={state:null,column:null,marked:null,cc:null};function C(){for(var e=arguments.length-1;e>=0;e--)w.cc.push(arguments[e])}function k(){return C.apply(null,arguments),!0}function E(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function D(e){var t=w.state;if(w.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,n){if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new S(r,n.vars,!0):null}return E(t,n.vars)?n:new S(n.prev,new T(t,n.vars),!1)}return null}(e,t.context);if(null!=r)return void(t.context=r)}else if(!E(e,t.localVars))return void(t.localVars=new T(e,t.localVars));n.globalVars&&!E(e,t.globalVars)&&(t.globalVars=new T(e,t.globalVars))}function A(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function S(e,t,n){this.prev=e,this.vars=t,this.block=n}function T(e,t){this.name=e,this.next=t}var F=new T("this",new T("arguments",null));function O(){w.state.context=new S(w.state.context,w.state.localVars,!1),w.state.localVars=F}function P(){w.state.context=new S(w.state.context,w.state.localVars,!0),w.state.localVars=null}function L(){w.state.localVars=w.state.context.vars,w.state.context=w.state.context.prev}function M(e,t){var n=function(){var n=w.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new x(r,w.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function B(){var e=w.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function N(e){return function t(n){return n==e?k():";"==e||"}"==n||")"==n||"]"==n?C():k(t)}}function R(e,t){return"var"==e?k(M("vardef",t),ye,N(";"),B):"keyword a"==e?k(M("form"),U,R,B):"keyword b"==e?k(M("form"),R,B):"keyword d"==e?w.stream.match(/^\s*$/,!1)?k():k(M("stat"),q,N(";"),B):"debugger"==e?k(N(";")):"{"==e?k(M("}"),P,se,B,L):";"==e?k():"if"==e?("else"==w.state.lexical.info&&w.state.cc[w.state.cc.length-1]==B&&w.state.cc.pop()(),k(M("form"),U,R,B,Ce)):"function"==e?k(Te):"for"==e?k(M("form"),ke,R,B):"class"==e||l&&"interface"==t?(w.marked="keyword",k(M("form"),Pe,B)):"variable"==e?l&&"declare"==t?(w.marked="keyword",k(R)):l&&("module"==t||"enum"==t||"type"==t)&&w.stream.match(/^\s*\w/,!1)?(w.marked="keyword","enum"==t?k(Ve):"type"==t?k(ce,N("operator"),ce,N(";")):k(M("form"),be,N("{"),M("}"),se,B,B)):l&&"namespace"==t?(w.marked="keyword",k(M("form"),z,se,B)):l&&"abstract"==t?(w.marked="keyword",k(R)):k(M("stat"),Q):"switch"==e?k(M("form"),U,N("{"),M("}","switch"),P,se,B,B,L):"case"==e?k(z,N(":")):"default"==e?k(N(":")):"catch"==e?k(M("form"),O,I,R,B,L):"export"==e?k(M("stat"),Ne,B):"import"==e?k(M("stat"),Ie,B):"async"==e?k(R):"@"==t?k(z,R):C(M("stat"),z,N(";"),B)}function I(e){if("("==e)return k(Fe,N(")"))}function z(e,t){return H(e,t,!1)}function W(e,t){return H(e,t,!0)}function U(e){return"("!=e?C():k(M(")"),z,N(")"),B)}function H(e,t,n){if(w.state.fatArrowAt==w.stream.start){var r=n?X:K;if("("==e)return k(O,M(")"),oe(Fe,")"),B,N("=>"),r,L);if("variable"==e)return C(O,be,N("=>"),r,L)}var o=n?$:V;return _.hasOwnProperty(e)?k(o):"function"==e?k(Te,o):"class"==e||l&&"interface"==t?(w.marked="keyword",k(M("form"),Oe,B)):"keyword c"==e||"async"==e?k(n?W:z):"("==e?k(M(")"),q,N(")"),B,o):"operator"==e||"spread"==e?k(n?W:z):"["==e?k(M("]"),qe,B,o):"{"==e?ie(te,"}",null,o):"quasi"==e?C(G,o):"new"==e?k(function(e){return function(t){return"."==t?k(e?Z:J):"variable"==t&&l?k(me,e?$:V):C(e?W:z)}}(n)):"import"==e?k(z):k()}function q(e){return e.match(/[;\}\)\],]/)?C():C(z)}function V(e,t){return","==e?k(z):$(e,t,!1)}function $(e,t,n){var r=0==n?V:$,o=0==n?z:W;return"=>"==e?k(O,n?X:K,L):"operator"==e?/\+\+|--/.test(t)||l&&"!"==t?k(r):l&&"<"==t&&w.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?k(M(">"),oe(ce,">"),B,r):"?"==t?k(z,N(":"),o):k(o):"quasi"==e?C(G,r):";"!=e?"("==e?ie(W,")","call",r):"."==e?k(ee,r):"["==e?k(M("]"),q,N("]"),B,r):l&&"as"==t?(w.marked="keyword",k(ce,r)):"regexp"==e?(w.state.lastType=w.marked="operator",w.stream.backUp(w.stream.pos-w.stream.start-1),k(o)):void 0:void 0}function G(e,t){return"quasi"!=e?C():"${"!=t.slice(t.length-2)?k(G):k(z,Y)}function Y(e){if("}"==e)return w.marked="string-2",w.state.tokenize=v,k(G)}function K(e){return b(w.stream,w.state),C("{"==e?R:z)}function X(e){return b(w.stream,w.state),C("{"==e?R:W)}function J(e,t){if("target"==t)return w.marked="keyword",k(V)}function Z(e,t){if("target"==t)return w.marked="keyword",k($)}function Q(e){return":"==e?k(B,R):C(V,N(";"),B)}function ee(e){if("variable"==e)return w.marked="property",k()}function te(e,t){return"async"==e?(w.marked="property",k(te)):"variable"==e||"keyword"==w.style?(w.marked="property","get"==t||"set"==t?k(ne):(l&&w.state.fatArrowAt==w.stream.start&&(n=w.stream.match(/^\s*:\s*/,!1))&&(w.state.fatArrowAt=w.stream.pos+n[0].length),k(re))):"number"==e||"string"==e?(w.marked=a?"property":w.style+" property",k(re)):"jsonld-keyword"==e?k(re):l&&A(t)?(w.marked="keyword",k(te)):"["==e?k(z,ae,N("]"),re):"spread"==e?k(W,re):"*"==t?(w.marked="keyword",k(te)):":"==e?C(re):void 0;var n}function ne(e){return"variable"!=e?C(re):(w.marked="property",k(Te))}function re(e){return":"==e?k(W):"("==e?C(Te):void 0}function oe(e,t,n){function r(o,i){if(n?n.indexOf(o)>-1:","==o){var s=w.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),k(function(n,r){return n==t||r==t?C():C(e)},r)}return o==t||i==t?k():k(N(t))}return function(n,o){return n==t||o==t?k():C(e,r)}}function ie(e,t,n){for(var r=3;r"),ce):void 0}function de(e){if("=>"==e)return k(ce)}function fe(e,t){return"variable"==e||"keyword"==w.style?(w.marked="property",k(fe)):"?"==t?k(fe):":"==e?k(ce):"["==e?k(z,ae,N("]"),fe):void 0}function pe(e,t){return"variable"==e&&w.stream.match(/^\s*[?:]/,!1)||"?"==t?k(pe):":"==e?k(ce):C(ce)}function he(e,t){return"<"==t?k(M(">"),oe(ce,">"),B,he):"|"==t||"."==e||"&"==t?k(ce):"["==e?k(N("]"),he):"extends"==t||"implements"==t?(w.marked="keyword",k(ce)):void 0}function me(e,t){if("<"==t)return k(M(">"),oe(ce,">"),B,he)}function ge(){return C(ce,ve)}function ve(e,t){if("="==t)return k(ce)}function ye(e,t){return"enum"==t?(w.marked="keyword",k(Ve)):C(be,ae,je,we)}function be(e,t){return l&&A(t)?(w.marked="keyword",k(be)):"variable"==e?(D(t),k()):"spread"==e?k(be):"["==e?ie(xe,"]"):"{"==e?ie(_e,"}"):void 0}function _e(e,t){return"variable"!=e||w.stream.match(/^\s*:/,!1)?("variable"==e&&(w.marked="property"),"spread"==e?k(be):"}"==e?C():"["==e?k(z,N("]"),N(":"),_e):k(N(":"),be,je)):(D(t),k(je))}function xe(){return C(be,je)}function je(e,t){if("="==t)return k(W)}function we(e){if(","==e)return k(ye)}function Ce(e,t){if("keyword b"==e&&"else"==t)return k(M("form","else"),R,B)}function ke(e,t){return"await"==t?k(ke):"("==e?k(M(")"),Ee,N(")"),B):void 0}function Ee(e){return"var"==e?k(ye,N(";"),Ae):";"==e?k(Ae):"variable"==e?k(De):C(z,N(";"),Ae)}function De(e,t){return"in"==t||"of"==t?(w.marked="keyword",k(z)):k(V,Ae)}function Ae(e,t){return";"==e?k(Se):"in"==t||"of"==t?(w.marked="keyword",k(z)):C(z,N(";"),Se)}function Se(e){")"!=e&&k(z)}function Te(e,t){return"*"==t?(w.marked="keyword",k(Te)):"variable"==e?(D(t),k(Te)):"("==e?k(O,M(")"),oe(Fe,")"),B,ue,R,L):l&&"<"==t?k(M(">"),oe(ge,">"),B,Te):void 0}function Fe(e,t){return"@"==t&&k(z,Fe),"spread"==e?k(Fe):l&&A(t)?(w.marked="keyword",k(Fe)):C(be,ae,je)}function Oe(e,t){return"variable"==e?Pe(e,t):Le(e,t)}function Pe(e,t){if("variable"==e)return D(t),k(Le)}function Le(e,t){return"<"==t?k(M(">"),oe(ge,">"),B,Le):"extends"==t||"implements"==t||l&&","==e?("implements"==t&&(w.marked="keyword"),k(l?ce:z,Le)):"{"==e?k(M("}"),Me,B):void 0}function Me(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||l&&A(t))&&w.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(w.marked="keyword",k(Me)):"variable"==e||"keyword"==w.style?(w.marked="property",k(l?Be:Te,Me)):"["==e?k(z,ae,N("]"),l?Be:Te,Me):"*"==t?(w.marked="keyword",k(Me)):";"==e?k(Me):"}"==e?k():"@"==t?k(z,Me):void 0}function Be(e,t){return"?"==t?k(Be):":"==e?k(ce,je):"="==t?k(W):C(Te)}function Ne(e,t){return"*"==t?(w.marked="keyword",k(He,N(";"))):"default"==t?(w.marked="keyword",k(z,N(";"))):"{"==e?k(oe(Re,"}"),He,N(";")):C(R)}function Re(e,t){return"as"==t?(w.marked="keyword",k(N("variable"))):"variable"==e?C(W,Re):void 0}function Ie(e){return"string"==e?k():"("==e?C(z):C(ze,We,He)}function ze(e,t){return"{"==e?ie(ze,"}"):("variable"==e&&D(t),"*"==t&&(w.marked="keyword"),k(Ue))}function We(e){if(","==e)return k(ze,We)}function Ue(e,t){if("as"==t)return w.marked="keyword",k(ze)}function He(e,t){if("from"==t)return w.marked="keyword",k(z)}function qe(e){return"]"==e?k():C(oe(W,"]"))}function Ve(){return C(M("form"),be,N("{"),M("}"),oe($e,"}"),B,B)}function $e(){return C(be,je)}function Ge(e,t,n){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return L.lex=!0,B.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new x((e||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&new S(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=g&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=o&&"--"!=o?r:"incdec",function(e,t,n,r,o){var i=e.cc;for(w.state=e,w.stream=o,w.marked=null,w.cc=i,w.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var s=i.length?i.pop():u?z:R;if(s(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return w.marked?w.marked:"variable"==n&&j(e,r)?"variable-2":t}}}(t,n,r,o,e))},indent:function(t,r){if(t.tokenize==g)return e.Pass;if(t.tokenize!=m)return 0;var o,a=r&&r.charAt(0),u=t.lexical;if(!/^\s*else\b/.test(r))for(var l=t.cc.length-1;l>=0;--l){var c=t.cc[l];if(c==B)u=u.prev;else if(c!=Ce)break}for(;("stat"==u.type||"form"==u.type)&&("}"==a||(o=t.cc[t.cc.length-1])&&(o==V||o==$)&&!/^[,\.=+\-*:?[\(]/.test(r));)u=u.prev;s&&")"==u.type&&"stat"==u.prev.type&&(u=u.prev);var d=u.type,p=a==d;return"vardef"==d?u.indented+("operator"==t.lastType||","==t.lastType?u.info.length+1:0):"form"==d&&"{"==a?u.indented:"form"==d?u.indented+i:"stat"==d?u.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?s||i:0):"switch"!=u.info||p||0==n.doubleIndentSwitch?u.align?u.column+(p?0:1):u.indented+(p?0:i):u.indented+(/^(?:case|default)\b/.test(r)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:a,jsonMode:u,expressionAllowed:Ge,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=z&&t!=W||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n("./node_modules/codemirror/lib/codemirror.js"))},"./node_modules/codemirror/mode/jsx/jsx.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,r){this.state=e,this.mode=t,this.depth=n,this.prev=r}function n(r){return new t(e.copyState(r.mode,r.state),r.mode,r.depth,r.prev&&n(r.prev))}e.defineMode("jsx",function(r,o){var i=e.getMode(r,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1,allowMissingTagName:!0}),s=e.getMode(r,o&&o.base||"javascript");function a(e){var t=e.tagName;e.tagName=null;var n=i.indent(e,"");return e.tagName=t,n}function u(n,o){return o.context.mode==i?function(n,o,l){if(2==l.depth)return n.match(/^.*?\*\//)?l.depth=1:n.skipToEnd(),"comment";if("{"==n.peek()){i.skipAttribute(l.state);var c=a(l.state),d=l.state.context;if(d&&n.match(/^[^>]*>\s*$/,!1)){for(;d.prev&&!d.startOfLine;)d=d.prev;d.startOfLine?c-=r.indentUnit:l.prev.state.lexical&&(c=l.prev.state.lexical.indented)}else 1==l.depth&&(c+=r.indentUnit);return o.context=new t(e.startState(s,c),s,0,o.context),null}if(1==l.depth){if("<"==n.peek())return i.skipAttribute(l.state),o.context=new t(e.startState(i,a(l.state)),i,0,o.context),null;if(n.match("//"))return n.skipToEnd(),"comment";if(n.match("/*"))return l.depth=2,u(n,o)}var f,p=i.token(n,l.state),h=n.current();return/\btag\b/.test(p)?/>$/.test(h)?l.state.context?l.depth=0:o.context=o.context.prev:/^-1&&n.backUp(h.length-f),p}(n,o,o.context):function(n,r,o){if("<"==n.peek()&&s.expressionAllowed(n,o.state))return s.skipExpression(o.state),r.context=new t(e.startState(i,s.indent(o.state,"")),i,0,r.context),null;var a=s.token(n,o.state);if(!a&&null!=o.depth){var u=n.current();"{"==u?o.depth++:"}"==u&&0==--o.depth&&(r.context=r.context.prev)}return a}(n,o,o.context)}return{startState:function(){return{context:new t(e.startState(s),s)}},copyState:function(e){return{context:n(e.context)}},token:u,indent:function(e,t,n){return e.context.mode.indent(e.context.state,t,n)},innerMode:function(e){return e.context}}},"xml","javascript"),e.defineMIME("text/jsx","jsx"),e.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})}(n("./node_modules/codemirror/lib/codemirror.js"),n("./node_modules/codemirror/mode/xml/xml.js"),n("./node_modules/codemirror/mode/javascript/javascript.js"))},"./node_modules/codemirror/mode/markdown/markdown.js":function(e,t,n){!function(e){"use strict";e.defineMode("markdown",function(t,n){var r=e.getMode(t,"text/html"),o="null"==r.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var i={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var s in i)i.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(i[s]=n.tokenTypeOverrides[s]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,u=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,l=/^\[(x| )\](?=\s)/i,c=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ *(?:\={1,}|-{1,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(e,t,n){return t.f=t.inline=n,n(e,t)}function v(e,t,n){return t.f=t.block=n,n(e,t)}function y(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==_){var n=o;if(!n){var i=e.innerMode(r,t.htmlState);n="xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText}n&&(t.f=C,t.block=b,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function b(r,o){var s,f=r.column()===o.indentation,m=!(s=o.prevLine.stream)||!/\S/.test(s.string),v=o.indentedCode,y=o.prevLine.hr,b=!1!==o.list,_=(o.listStack[o.listStack.length-1]||0)+3;o.indentedCode=!1;var w=o.indentation;if(null===o.indentationDiff&&(o.indentationDiff=o.indentation,b)){for(o.em=!1,o.strong=!1,o.code=!1,o.strikethrough=!1,o.list=null;w=4&&(v||o.prevLine.fencedCodeEnd||o.prevLine.header||m))return r.skipToEnd(),o.indentedCode=!0,i.code;if(r.eatSpace())return null;if(f&&o.indentation<=_&&(E=r.match(c))&&E[1].length<=6)return o.quote=0,o.header=E[1].length,o.thisLine.header=!0,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,j(o);if(o.indentation<=_&&r.eat(">"))return o.quote=f?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),r.eatSpace(),j(o);if(!k&&!o.setext&&f&&o.indentation<=_&&(E=r.match(u))){var D=E[1]?"ol":"ul";return o.indentation=w+r.current().length,o.list=!0,o.quote=0,o.listStack.push(o.indentation),n.taskLists&&r.match(l,!1)&&(o.taskList=!0),o.f=o.inline,n.highlightFormatting&&(o.formatting=["list","list-"+D]),j(o)}return f&&o.indentation<=_&&(E=r.match(p,!0))?(o.quote=0,o.fencedEndRE=new RegExp(E[1]+"+ *$"),o.localMode=n.fencedCodeBlockHighlighting&&function(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var o=e.getMode(t,n);return"null"==o.name?null:o}(E[2]),o.localMode&&(o.localState=e.startState(o.localMode)),o.f=o.block=x,n.highlightFormatting&&(o.formatting="code-block"),o.code=-1,j(o)):o.setext||!(C&&b||o.quote||!1!==o.list||o.code||k||h.test(r.string))&&(E=r.lookAhead(1))&&(E=E.match(d))?(o.setext?(o.header=o.setext,o.setext=0,r.skipToEnd(),n.highlightFormatting&&(o.formatting="header")):(o.header="="==E[0].charAt(0)?1:2,o.setext=o.header),o.thisLine.header=!0,o.f=o.inline,j(o)):k?(r.skipToEnd(),o.hr=!0,o.thisLine.hr=!0,i.hr):"["===r.peek()?g(r,o,A):g(r,o,o.inline)}function _(t,n){var i=r.token(t,n.htmlState);if(!o){var s=e.innerMode(r,n.htmlState);("xml"==s.mode.name&&null===s.state.tagStart&&!s.state.context&&s.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=C,n.block=b,n.htmlState=null)}return i}function x(e,t){var r,o=t.listStack[t.listStack.length-1]||0,s=t.indentation=e.quote?t.push(i.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(i.linkHref,"url"):(e.strong&&t.push(i.strong),e.em&&t.push(i.em),e.strikethrough&&t.push(i.strikethrough),e.emoji&&t.push(i.emoji),e.linkText&&t.push(i.linkText),e.code&&t.push(i.code),e.image&&t.push(i.image),e.imageAltText&&t.push(i.imageAltText,"link"),e.imageMarker&&t.push(i.imageMarker)),e.header&&t.push(i.header,i.header+"-"+e.header),e.quote&&(t.push(i.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(i.quote+"-"+e.quote):t.push(i.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var o=(e.listStack.length-1)%3;o?1===o?t.push(i.list2):t.push(i.list3):t.push(i.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function w(e,t){if(e.match(f,!0))return j(t)}function C(t,o){var s=o.text(t,o);if("undefined"!==typeof s)return s;if(o.list)return o.list=null,j(o);if(o.taskList){var a=" "===t.match(l,!0)[1];return a?o.taskOpen=!0:o.taskClosed=!0,n.highlightFormatting&&(o.formatting="task"),o.taskList=!1,j(o)}if(o.taskOpen=!1,o.taskClosed=!1,o.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(o.formatting="header"),j(o);var u=t.next();if(o.linkTitle){o.linkTitle=!1;var c=u;"("===u&&(c=")");var d="^\\s*(?:[^"+(c=(c+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+c;if(t.match(new RegExp(d),!0))return i.linkHref}if("`"===u){var f=o.formatting;n.highlightFormatting&&(o.formatting="code"),t.eatWhile("`");var p=t.current().length;if(0!=o.code||o.quote&&1!=p){if(p==o.code){var h=j(o);return o.code=0,h}return o.formatting=f,j(o)}return o.code=p,j(o)}if(o.code)return j(o);if("\\"===u&&(t.next(),n.highlightFormatting)){var g=j(o),y=i.formatting+"-escape";return g?g+" "+y:y}if("!"===u&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return o.imageMarker=!0,o.image=!0,n.highlightFormatting&&(o.formatting="image"),j(o);if("["===u&&o.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return o.imageMarker=!1,o.imageAltText=!0,n.highlightFormatting&&(o.formatting="image"),j(o);if("]"===u&&o.imageAltText){n.highlightFormatting&&(o.formatting="image");var g=j(o);return o.imageAltText=!1,o.image=!1,o.inline=o.f=E,g}if("["===u&&!o.image)return o.linkText&&t.match(/^.*?\]/)?j(o):(o.linkText=!0,n.highlightFormatting&&(o.formatting="link"),j(o));if("]"===u&&o.linkText){n.highlightFormatting&&(o.formatting="link");var g=j(o);return o.linkText=!1,o.inline=o.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?E:C,g}if("<"===u&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){o.f=o.inline=k,n.highlightFormatting&&(o.formatting="link");var g=j(o);return g?g+=" ":g="",g+i.linkInline}if("<"===u&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){o.f=o.inline=k,n.highlightFormatting&&(o.formatting="link");var g=j(o);return g?g+=" ":g="",g+i.linkEmail}if(n.xml&&"<"===u&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var b=t.string.indexOf(">",t.pos);if(-1!=b){var x=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(o.md_inside=!0)}return t.backUp(1),o.htmlState=e.startState(r),v(t,o,_)}if(n.xml&&"<"===u&&t.match(/^\/\w*?>/))return o.md_inside=!1,"tag";if("*"===u||"_"===u){for(var w=1,D=1==t.pos?" ":t.string.charAt(t.pos-2);w<3&&t.eat(u);)w++;var A=t.peek()||" ",S=!/\s/.test(A)&&(!m.test(A)||/\s/.test(D)||m.test(D)),T=!/\s/.test(D)&&(!m.test(D)||/\s/.test(A)||m.test(A)),F=null,O=null;if(w%2&&(o.em||!S||"*"!==u&&T&&!m.test(D)?o.em!=u||!T||"*"!==u&&S&&!m.test(A)||(F=!1):F=!0),w>1&&(o.strong||!S||"*"!==u&&T&&!m.test(D)?o.strong!=u||!T||"*"!==u&&S&&!m.test(A)||(O=!1):O=!0),null!=O||null!=F){n.highlightFormatting&&(o.formatting=null==F?"strong":null==O?"em":"strong em"),!0===F&&(o.em=u),!0===O&&(o.strong=u);var h=j(o);return!1===F&&(o.em=!1),!1===O&&(o.strong=!1),h}}else if(" "===u&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return j(o);t.backUp(1)}if(n.strikethrough)if("~"===u&&t.eatWhile(u)){if(o.strikethrough){n.highlightFormatting&&(o.formatting="strikethrough");var h=j(o);return o.strikethrough=!1,h}if(t.match(/^[^\s]/,!1))return o.strikethrough=!0,n.highlightFormatting&&(o.formatting="strikethrough"),j(o)}else if(" "===u&&t.match(/^~~/,!0)){if(" "===t.peek())return j(o);t.backUp(2)}if(n.emoji&&":"===u&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){o.emoji=!0,n.highlightFormatting&&(o.formatting="emoji");var P=j(o);return o.emoji=!1,P}return" "===u&&(t.match(/^ +$/,!1)?o.trailingSpace++:o.trailingSpace&&(o.trailingSpaceNewLine=!0)),j(o)}function k(e,t){var r=e.next();if(">"===r){t.f=t.inline=C,n.highlightFormatting&&(t.formatting="link");var o=j(t);return o?o+=" ":o="",o+i.linkInline}return e.match(/^[^>]+/,!0),i.linkInline}function E(e,t){if(e.eatSpace())return null;var r,o=e.next();return"("===o||"["===o?(t.f=t.inline=(r="("===o?")":"]",function(e,t){var o=e.next();if(o===r){t.f=t.inline=C,n.highlightFormatting&&(t.formatting="link-string");var i=j(t);return t.linkHref=!1,i}return e.match(D[r]),t.linkHref=!0,j(t)}),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,j(t)):"error"}var D={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=S,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,j(t)):g(e,t,C)}function S(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=T,n.highlightFormatting&&(t.formatting="link");var r=j(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),i.linkText}function T(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=C,i.linkHref+" url")}var F={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:C,text:w,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=_)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==_?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:F}},indent:function(t,n,o){return t.block==_&&r.indent?r.indent(t.htmlState,n,o):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,o):e.Pass},blankLine:y,getType:j,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F},"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(n("./node_modules/codemirror/lib/codemirror.js"),n("./node_modules/codemirror/mode/xml/xml.js"),n("./node_modules/codemirror/mode/meta.js"))},"./node_modules/codemirror/mode/meta.js":function(e,t,n){!function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t-1&&t.substring(o+1,t.length);if(i)return e.findModeByExtension(i)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,r){for(var o;null!=(o=n.next());){if("<"==o)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==o){if(1==t){r.tokenize=d;break}return r.tokenize=e(t-1),r.tokenize(n,r)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(i=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var n,r,o=e.next();if(">"==o||"/"==o&&e.eat(">"))return t.tokenize=d,i=">"==o?"endTag":"selfcloseTag","tag bracket";if("="==o)return i="equals",null;if("<"==o){t.tokenize=d,t.state=v,t.tagName=t.tagStart=null;var s=t.tokenize(e,t);return s?s+" tag error":"tag error"}return/[\'\"]/.test(o)?(t.tokenize=(n=o,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(u.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function g(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!u.contextGrabbers.hasOwnProperty(n)||!u.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function v(e,t,n){return"openTag"==e?(n.tagStart=t.column(),y):"closeTag"==e?b:v}function y(e,t,n){return"word"==e?(n.tagName=t.current(),s="tag",j):u.allowMissingTagName&&"endTag"==e?(s="tag bracket",j(e,0,n)):(s="error",y)}function b(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&u.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==r||!1===u.matchClosing?(s="tag",_):(s="tag error",x)}return u.allowMissingTagName&&"endTag"==e?(s="tag bracket",_(e,0,n)):(s="error",x)}function _(e,t,n){return"endTag"!=e?(s="error",_):(m(n),v)}function x(e,t,n){return s="error",_(e,0,n)}function j(e,t,n){if("word"==e)return s="attribute",w;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||u.autoSelfClosers.hasOwnProperty(r)?g(n,r):(g(n,r),n.context=new h(n,r,o==n.indented)),v}return s="error",j}function w(e,t,n){return"equals"==e?C:(u.allowMissing||(s="error"),j(e,0,n))}function C(e,t,n){return"string"==e?k:"word"==e&&u.allowUnquoted?(s="string",j):(s="error",j(e,0,n))}function k(e,t,n){return"string"==e?k:j(e,0,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:v,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;i=null;var n=t.tokenize(e,t);return(n||i)&&"comment"!=n&&(s=null,t.state=t.state(i||n,e,t),s&&(n="error"==s?n+" error":s)),n},indent:function(t,n,r){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(o&&o.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==u.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+a*(u.multilineTagIndentFactor||1);if(u.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:u.htmlMode?"html":"xml",helperType:u.htmlMode?"html":"xml",skipAttribute:function(e){e.state==C&&(e.state=j)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n("./node_modules/codemirror/lib/codemirror.js"))},"./node_modules/color-convert/conversions.js":function(e,t,n){var r=n("./node_modules/color-name/index.js"),o={};for(var i in r)r.hasOwnProperty(i)&&(o[r[i]]=i);var s=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in s)if(s.hasOwnProperty(a)){if(!("channels"in s[a]))throw new Error("missing channels property: "+a);if(!("labels"in s[a]))throw new Error("missing channel labels property: "+a);if(s[a].labels.length!==s[a].channels)throw new Error("channel and label counts mismatch: "+a);var u=s[a].channels,l=s[a].labels;delete s[a].channels,delete s[a].labels,Object.defineProperty(s[a],"channels",{value:u}),Object.defineProperty(s[a],"labels",{value:l})}s.rgb.hsl=function(e){var t,n,r=e[0]/255,o=e[1]/255,i=e[2]/255,s=Math.min(r,o,i),a=Math.max(r,o,i),u=a-s;return a===s?t=0:r===a?t=(o-i)/u:o===a?t=2+(i-r)/u:i===a&&(t=4+(r-o)/u),(t=Math.min(60*t,360))<0&&(t+=360),n=(s+a)/2,[t,100*(a===s?0:n<=.5?u/(a+s):u/(2-a-s)),100*n]},s.rgb.hsv=function(e){var t,n,r,o,i,s=e[0]/255,a=e[1]/255,u=e[2]/255,l=Math.max(s,a,u),c=l-Math.min(s,a,u),d=function(e){return(l-e)/6/c+.5};return 0===c?o=i=0:(i=c/l,t=d(s),n=d(a),r=d(u),s===l?o=r-n:a===l?o=1/3+t-r:u===l&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*l]},s.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[s.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(n,r))),100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},s.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,o=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-o)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},s.rgb.keyword=function(e){var t=o[e];if(t)return t;var n,i,s,a=1/0;for(var u in r)if(r.hasOwnProperty(u)){var l=r[u],c=(i=e,s=l,Math.pow(i[0]-s[0],2)+Math.pow(i[1]-s[1],2)+Math.pow(i[2]-s[2],2));c.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},s.rgb.lab=function(e){var t=s.rgb.xyz(e),n=t[0],r=t[1],o=t[2];return r/=100,o/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},s.hsl.rgb=function(e){var t,n,r,o,i,s=e[0]/360,a=e[1]/100,u=e[2]/100;if(0===a)return[i=255*u,i,i];t=2*u-(n=u<.5?u*(1+a):u+a-u*a),o=[0,0,0];for(var l=0;l<3;l++)(r=s+1/3*-(l-1))<0&&r++,r>1&&r--,i=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,o[l]=255*i;return o},s.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,o=n,i=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,o*=i<=1?i:2-i,[t,100*(0===r?2*o/(i+o):2*n/(r+n)),100*((r+n)/2)]},s.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,o=Math.floor(t)%6,i=t-Math.floor(t),s=255*r*(1-n),a=255*r*(1-n*i),u=255*r*(1-n*(1-i));switch(r*=255,o){case 0:return[r,u,s];case 1:return[a,r,s];case 2:return[s,r,u];case 3:return[s,a,r];case 4:return[u,s,r];case 5:return[r,s,a]}},s.hsv.hsl=function(e){var t,n,r,o=e[0],i=e[1]/100,s=e[2]/100,a=Math.max(s,.01);return r=(2-i)*s,n=i*a,[o,100*(n=(n/=(t=(2-i)*a)<=1?t:2-t)||0),100*(r/=2)]},s.hwb.rgb=function(e){var t,n,r,o,i,s,a,u=e[0]/360,l=e[1]/100,c=e[2]/100,d=l+c;switch(d>1&&(l/=d,c/=d),r=6*u-(t=Math.floor(6*u)),0!==(1&t)&&(r=1-r),o=l+r*((n=1-c)-l),t){default:case 6:case 0:i=n,s=o,a=l;break;case 1:i=o,s=n,a=l;break;case 2:i=l,s=n,a=o;break;case 3:i=l,s=o,a=n;break;case 4:i=o,s=l,a=n;break;case 5:i=n,s=l,a=o}return[255*i,255*s,255*a]},s.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},s.xyz.rgb=function(e){var t,n,r,o=e[0]/100,i=e[1]/100,s=e[2]/100;return n=-.9689*o+1.8758*i+.0415*s,r=.0557*o+-.204*i+1.057*s,t=(t=3.2406*o+-1.5372*i+-.4986*s)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},s.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},s.lab.xyz=function(e){var t,n,r,o=e[0];t=e[1]/500+(n=(o+16)/116),r=n-e[2]/200;var i=Math.pow(n,3),s=Math.pow(t,3),a=Math.pow(r,3);return n=i>.008856?i:(n-16/116)/7.787,t=s>.008856?s:(t-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},s.lab.lch=function(e){var t,n=e[0],r=e[1],o=e[2];return(t=360*Math.atan2(o,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+o*o),t]},s.lch.lab=function(e){var t,n=e[0],r=e[1];return t=e[2]/360*2*Math.PI,[n,r*Math.cos(t),r*Math.sin(t)]},s.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],o=1 in arguments?arguments[1]:s.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var i=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===o&&(i+=60),i},s.hsv.ansi16=function(e){return s.rgb.ansi16(s.hsv.rgb(e),e[2])},s.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},s.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},s.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},s.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},s.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map(function(e){return e+e}).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},s.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,o=e[2]/255,i=Math.max(Math.max(n,r),o),s=Math.min(Math.min(n,r),o),a=i-s;return t=a<=0?0:i===n?(r-o)/a%6:i===r?2+(o-n)/a:4+(n-r)/a+4,t/=6,[360*(t%=1),100*a,100*(a<1?s/(1-a):0)]},s.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,o=0;return(r=n<.5?2*t*n:2*t*(1-n))<1&&(o=(n-.5*r)/(1-r)),[e[0],100*r,100*o]},s.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},s.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var o,i=[0,0,0],s=t%1*6,a=s%1,u=1-a;switch(Math.floor(s)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return o=(1-n)*r,[255*(n*i[0]+o),255*(n*i[1]+o),255*(n*i[2]+o)]},s.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},s.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},s.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},s.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},s.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},s.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},s.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},s.gray.hsl=s.gray.hsv=function(e){return[0,0,e[0]]},s.gray.hwb=function(e){return[0,100,e[0]]},s.gray.cmyk=function(e){return[0,0,0,e[0]]},s.gray.lab=function(e){return[e[0],0,0]},s.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},s.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},"./node_modules/color-convert/index.js":function(e,t,n){var r=n("./node_modules/color-convert/conversions.js"),o=n("./node_modules/color-convert/route.js"),i={};Object.keys(r).forEach(function(e){i[e]={},Object.defineProperty(i[e],"channels",{value:r[e].channels}),Object.defineProperty(i[e],"labels",{value:r[e].labels});var t=o(e);Object.keys(t).forEach(function(n){var r=t[n];i[e][n]=function(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"===typeof n)for(var r=n.length,o=0;o1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})}),e.exports=i},"./node_modules/color-convert/route.js":function(e,t,n){var r=n("./node_modules/color-convert/conversions.js");function o(e){var t=function(){for(var e={},t=Object.keys(r),n=t.length,o=0;o{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const n=document.getSelection();let r=!1;n.rangeCount>0&&(r=n.getRangeAt(0)),document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch(i){}return document.body.removeChild(t),r&&(n.removeAllRanges(),n.addRange(r)),o})},"./node_modules/core-js/es6/index.js":function(e,t,n){n("./node_modules/core-js/modules/es6.symbol.js"),n("./node_modules/core-js/modules/es6.object.create.js"),n("./node_modules/core-js/modules/es6.object.define-property.js"),n("./node_modules/core-js/modules/es6.object.define-properties.js"),n("./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js"),n("./node_modules/core-js/modules/es6.object.get-prototype-of.js"),n("./node_modules/core-js/modules/es6.object.keys.js"),n("./node_modules/core-js/modules/es6.object.get-own-property-names.js"),n("./node_modules/core-js/modules/es6.object.freeze.js"),n("./node_modules/core-js/modules/es6.object.seal.js"),n("./node_modules/core-js/modules/es6.object.prevent-extensions.js"),n("./node_modules/core-js/modules/es6.object.is-frozen.js"),n("./node_modules/core-js/modules/es6.object.is-sealed.js"),n("./node_modules/core-js/modules/es6.object.is-extensible.js"),n("./node_modules/core-js/modules/es6.object.assign.js"),n("./node_modules/core-js/modules/es6.object.is.js"),n("./node_modules/core-js/modules/es6.object.set-prototype-of.js"),n("./node_modules/core-js/modules/es6.object.to-string.js"),n("./node_modules/core-js/modules/es6.function.bind.js"),n("./node_modules/core-js/modules/es6.function.name.js"),n("./node_modules/core-js/modules/es6.function.has-instance.js"),n("./node_modules/core-js/modules/es6.parse-int.js"),n("./node_modules/core-js/modules/es6.parse-float.js"),n("./node_modules/core-js/modules/es6.number.constructor.js"),n("./node_modules/core-js/modules/es6.number.to-fixed.js"),n("./node_modules/core-js/modules/es6.number.to-precision.js"),n("./node_modules/core-js/modules/es6.number.epsilon.js"),n("./node_modules/core-js/modules/es6.number.is-finite.js"),n("./node_modules/core-js/modules/es6.number.is-integer.js"),n("./node_modules/core-js/modules/es6.number.is-nan.js"),n("./node_modules/core-js/modules/es6.number.is-safe-integer.js"),n("./node_modules/core-js/modules/es6.number.max-safe-integer.js"),n("./node_modules/core-js/modules/es6.number.min-safe-integer.js"),n("./node_modules/core-js/modules/es6.number.parse-float.js"),n("./node_modules/core-js/modules/es6.number.parse-int.js"),n("./node_modules/core-js/modules/es6.math.acosh.js"),n("./node_modules/core-js/modules/es6.math.asinh.js"),n("./node_modules/core-js/modules/es6.math.atanh.js"),n("./node_modules/core-js/modules/es6.math.cbrt.js"),n("./node_modules/core-js/modules/es6.math.clz32.js"),n("./node_modules/core-js/modules/es6.math.cosh.js"),n("./node_modules/core-js/modules/es6.math.expm1.js"),n("./node_modules/core-js/modules/es6.math.fround.js"),n("./node_modules/core-js/modules/es6.math.hypot.js"),n("./node_modules/core-js/modules/es6.math.imul.js"),n("./node_modules/core-js/modules/es6.math.log10.js"),n("./node_modules/core-js/modules/es6.math.log1p.js"),n("./node_modules/core-js/modules/es6.math.log2.js"),n("./node_modules/core-js/modules/es6.math.sign.js"),n("./node_modules/core-js/modules/es6.math.sinh.js"),n("./node_modules/core-js/modules/es6.math.tanh.js"),n("./node_modules/core-js/modules/es6.math.trunc.js"),n("./node_modules/core-js/modules/es6.string.from-code-point.js"),n("./node_modules/core-js/modules/es6.string.raw.js"),n("./node_modules/core-js/modules/es6.string.trim.js"),n("./node_modules/core-js/modules/es6.string.iterator.js"),n("./node_modules/core-js/modules/es6.string.code-point-at.js"),n("./node_modules/core-js/modules/es6.string.ends-with.js"),n("./node_modules/core-js/modules/es6.string.includes.js"),n("./node_modules/core-js/modules/es6.string.repeat.js"),n("./node_modules/core-js/modules/es6.string.starts-with.js"),n("./node_modules/core-js/modules/es6.string.anchor.js"),n("./node_modules/core-js/modules/es6.string.big.js"),n("./node_modules/core-js/modules/es6.string.blink.js"),n("./node_modules/core-js/modules/es6.string.bold.js"),n("./node_modules/core-js/modules/es6.string.fixed.js"),n("./node_modules/core-js/modules/es6.string.fontcolor.js"),n("./node_modules/core-js/modules/es6.string.fontsize.js"),n("./node_modules/core-js/modules/es6.string.italics.js"),n("./node_modules/core-js/modules/es6.string.link.js"),n("./node_modules/core-js/modules/es6.string.small.js"),n("./node_modules/core-js/modules/es6.string.strike.js"),n("./node_modules/core-js/modules/es6.string.sub.js"),n("./node_modules/core-js/modules/es6.string.sup.js"),n("./node_modules/core-js/modules/es6.date.now.js"),n("./node_modules/core-js/modules/es6.date.to-json.js"),n("./node_modules/core-js/modules/es6.date.to-iso-string.js"),n("./node_modules/core-js/modules/es6.date.to-string.js"),n("./node_modules/core-js/modules/es6.date.to-primitive.js"),n("./node_modules/core-js/modules/es6.array.is-array.js"),n("./node_modules/core-js/modules/es6.array.from.js"),n("./node_modules/core-js/modules/es6.array.of.js"),n("./node_modules/core-js/modules/es6.array.join.js"),n("./node_modules/core-js/modules/es6.array.slice.js"),n("./node_modules/core-js/modules/es6.array.sort.js"),n("./node_modules/core-js/modules/es6.array.for-each.js"),n("./node_modules/core-js/modules/es6.array.map.js"),n("./node_modules/core-js/modules/es6.array.filter.js"),n("./node_modules/core-js/modules/es6.array.some.js"),n("./node_modules/core-js/modules/es6.array.every.js"),n("./node_modules/core-js/modules/es6.array.reduce.js"),n("./node_modules/core-js/modules/es6.array.reduce-right.js"),n("./node_modules/core-js/modules/es6.array.index-of.js"),n("./node_modules/core-js/modules/es6.array.last-index-of.js"),n("./node_modules/core-js/modules/es6.array.copy-within.js"),n("./node_modules/core-js/modules/es6.array.fill.js"),n("./node_modules/core-js/modules/es6.array.find.js"),n("./node_modules/core-js/modules/es6.array.find-index.js"),n("./node_modules/core-js/modules/es6.array.species.js"),n("./node_modules/core-js/modules/es6.array.iterator.js"),n("./node_modules/core-js/modules/es6.regexp.constructor.js"),n("./node_modules/core-js/modules/es6.regexp.to-string.js"),n("./node_modules/core-js/modules/es6.regexp.flags.js"),n("./node_modules/core-js/modules/es6.regexp.match.js"),n("./node_modules/core-js/modules/es6.regexp.replace.js"),n("./node_modules/core-js/modules/es6.regexp.search.js"),n("./node_modules/core-js/modules/es6.regexp.split.js"),n("./node_modules/core-js/modules/es6.promise.js"),n("./node_modules/core-js/modules/es6.map.js"),n("./node_modules/core-js/modules/es6.set.js"),n("./node_modules/core-js/modules/es6.weak-map.js"),n("./node_modules/core-js/modules/es6.weak-set.js"),n("./node_modules/core-js/modules/es6.typed.array-buffer.js"),n("./node_modules/core-js/modules/es6.typed.data-view.js"),n("./node_modules/core-js/modules/es6.typed.int8-array.js"),n("./node_modules/core-js/modules/es6.typed.uint8-array.js"),n("./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js"),n("./node_modules/core-js/modules/es6.typed.int16-array.js"),n("./node_modules/core-js/modules/es6.typed.uint16-array.js"),n("./node_modules/core-js/modules/es6.typed.int32-array.js"),n("./node_modules/core-js/modules/es6.typed.uint32-array.js"),n("./node_modules/core-js/modules/es6.typed.float32-array.js"),n("./node_modules/core-js/modules/es6.typed.float64-array.js"),n("./node_modules/core-js/modules/es6.reflect.apply.js"),n("./node_modules/core-js/modules/es6.reflect.construct.js"),n("./node_modules/core-js/modules/es6.reflect.define-property.js"),n("./node_modules/core-js/modules/es6.reflect.delete-property.js"),n("./node_modules/core-js/modules/es6.reflect.enumerate.js"),n("./node_modules/core-js/modules/es6.reflect.get.js"),n("./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js"),n("./node_modules/core-js/modules/es6.reflect.get-prototype-of.js"),n("./node_modules/core-js/modules/es6.reflect.has.js"),n("./node_modules/core-js/modules/es6.reflect.is-extensible.js"),n("./node_modules/core-js/modules/es6.reflect.own-keys.js"),n("./node_modules/core-js/modules/es6.reflect.prevent-extensions.js"),n("./node_modules/core-js/modules/es6.reflect.set.js"),n("./node_modules/core-js/modules/es6.reflect.set-prototype-of.js"),e.exports=n("./node_modules/core-js/modules/_core.js")},"./node_modules/core-js/fn/array/includes.js":function(e,t,n){n("./node_modules/core-js/modules/es7.array.includes.js"),e.exports=n("./node_modules/core-js/modules/_core.js").Array.includes},"./node_modules/core-js/fn/object/assign.js":function(e,t,n){n("./node_modules/core-js/modules/es6.object.assign.js"),e.exports=n("./node_modules/core-js/modules/_core.js").Object.assign},"./node_modules/core-js/fn/object/entries.js":function(e,t,n){n("./node_modules/core-js/modules/es7.object.entries.js"),e.exports=n("./node_modules/core-js/modules/_core.js").Object.entries},"./node_modules/core-js/fn/object/get-own-property-descriptors.js":function(e,t,n){n("./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js"),e.exports=n("./node_modules/core-js/modules/_core.js").Object.getOwnPropertyDescriptors},"./node_modules/core-js/fn/object/values.js":function(e,t,n){n("./node_modules/core-js/modules/es7.object.values.js"),e.exports=n("./node_modules/core-js/modules/_core.js").Object.values},"./node_modules/core-js/fn/promise/finally.js":function(e,t,n){"use strict";n("./node_modules/core-js/modules/es6.promise.js"),n("./node_modules/core-js/modules/es7.promise.finally.js"),e.exports=n("./node_modules/core-js/modules/_core.js").Promise.finally},"./node_modules/core-js/fn/string/pad-end.js":function(e,t,n){n("./node_modules/core-js/modules/es7.string.pad-end.js"),e.exports=n("./node_modules/core-js/modules/_core.js").String.padEnd},"./node_modules/core-js/fn/string/pad-start.js":function(e,t,n){n("./node_modules/core-js/modules/es7.string.pad-start.js"),e.exports=n("./node_modules/core-js/modules/_core.js").String.padStart},"./node_modules/core-js/fn/symbol/async-iterator.js":function(e,t,n){n("./node_modules/core-js/modules/es7.symbol.async-iterator.js"),e.exports=n("./node_modules/core-js/modules/_wks-ext.js").f("asyncIterator")},"./node_modules/core-js/library/fn/object/assign.js":function(e,t,n){n("./node_modules/core-js/library/modules/es6.object.assign.js"),e.exports=n("./node_modules/core-js/library/modules/_core.js").Object.assign},"./node_modules/core-js/library/fn/object/create.js":function(e,t,n){n("./node_modules/core-js/library/modules/es6.object.create.js");var r=n("./node_modules/core-js/library/modules/_core.js").Object;e.exports=function(e,t){return r.create(e,t)}},"./node_modules/core-js/library/fn/object/define-property.js":function(e,t,n){n("./node_modules/core-js/library/modules/es6.object.define-property.js");var r=n("./node_modules/core-js/library/modules/_core.js").Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},"./node_modules/core-js/library/fn/object/set-prototype-of.js":function(e,t,n){n("./node_modules/core-js/library/modules/es6.object.set-prototype-of.js"),e.exports=n("./node_modules/core-js/library/modules/_core.js").Object.setPrototypeOf},"./node_modules/core-js/library/fn/symbol/index.js":function(e,t,n){n("./node_modules/core-js/library/modules/es6.symbol.js"),n("./node_modules/core-js/library/modules/es6.object.to-string.js"),n("./node_modules/core-js/library/modules/es7.symbol.async-iterator.js"),n("./node_modules/core-js/library/modules/es7.symbol.observable.js"),e.exports=n("./node_modules/core-js/library/modules/_core.js").Symbol},"./node_modules/core-js/library/fn/symbol/iterator.js":function(e,t,n){n("./node_modules/core-js/library/modules/es6.string.iterator.js"),n("./node_modules/core-js/library/modules/web.dom.iterable.js"),e.exports=n("./node_modules/core-js/library/modules/_wks-ext.js").f("iterator")},"./node_modules/core-js/library/modules/_a-function.js":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},"./node_modules/core-js/library/modules/_add-to-unscopables.js":function(e,t){e.exports=function(){}},"./node_modules/core-js/library/modules/_an-object.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_is-object.js");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},"./node_modules/core-js/library/modules/_array-includes.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_to-iobject.js"),o=n("./node_modules/core-js/library/modules/_to-length.js"),i=n("./node_modules/core-js/library/modules/_to-absolute-index.js");e.exports=function(e){return function(t,n,s){var a,u=r(t),l=o(u.length),c=i(s,l);if(e&&n!=n){for(;l>c;)if((a=u[c++])!=a)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},"./node_modules/core-js/library/modules/_cof.js":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"./node_modules/core-js/library/modules/_core.js":function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},"./node_modules/core-js/library/modules/_ctx.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_a-function.js");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},"./node_modules/core-js/library/modules/_defined.js":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"./node_modules/core-js/library/modules/_descriptors.js":function(e,t,n){e.exports=!n("./node_modules/core-js/library/modules/_fails.js")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"./node_modules/core-js/library/modules/_dom-create.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_is-object.js"),o=n("./node_modules/core-js/library/modules/_global.js").document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},"./node_modules/core-js/library/modules/_enum-bug-keys.js":function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"./node_modules/core-js/library/modules/_enum-keys.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_object-keys.js"),o=n("./node_modules/core-js/library/modules/_object-gops.js"),i=n("./node_modules/core-js/library/modules/_object-pie.js");e.exports=function(e){var t=r(e),n=o.f;if(n)for(var s,a=n(e),u=i.f,l=0;a.length>l;)u.call(e,s=a[l++])&&t.push(s);return t}},"./node_modules/core-js/library/modules/_export.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_global.js"),o=n("./node_modules/core-js/library/modules/_core.js"),i=n("./node_modules/core-js/library/modules/_ctx.js"),s=n("./node_modules/core-js/library/modules/_hide.js"),a=n("./node_modules/core-js/library/modules/_has.js"),u=function(e,t,n){var l,c,d,f=e&u.F,p=e&u.G,h=e&u.S,m=e&u.P,g=e&u.B,v=e&u.W,y=p?o:o[t]||(o[t]={}),b=y.prototype,_=p?r:h?r[t]:(r[t]||{}).prototype;for(l in p&&(n=t),n)(c=!f&&_&&void 0!==_[l])&&a(y,l)||(d=c?_[l]:n[l],y[l]=p&&"function"!=typeof _[l]?n[l]:g&&c?i(d,r):v&&_[l]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):m&&"function"==typeof d?i(Function.call,d):d,m&&((y.virtual||(y.virtual={}))[l]=d,e&u.R&&b&&!b[l]&&s(b,l,d)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},"./node_modules/core-js/library/modules/_fails.js":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"./node_modules/core-js/library/modules/_global.js":function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"./node_modules/core-js/library/modules/_has.js":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},"./node_modules/core-js/library/modules/_hide.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_object-dp.js"),o=n("./node_modules/core-js/library/modules/_property-desc.js");e.exports=n("./node_modules/core-js/library/modules/_descriptors.js")?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},"./node_modules/core-js/library/modules/_html.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_global.js").document;e.exports=r&&r.documentElement},"./node_modules/core-js/library/modules/_ie8-dom-define.js":function(e,t,n){e.exports=!n("./node_modules/core-js/library/modules/_descriptors.js")&&!n("./node_modules/core-js/library/modules/_fails.js")(function(){return 7!=Object.defineProperty(n("./node_modules/core-js/library/modules/_dom-create.js")("div"),"a",{get:function(){return 7}}).a})},"./node_modules/core-js/library/modules/_iobject.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_cof.js");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},"./node_modules/core-js/library/modules/_is-array.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_cof.js");e.exports=Array.isArray||function(e){return"Array"==r(e)}},"./node_modules/core-js/library/modules/_is-object.js":function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},"./node_modules/core-js/library/modules/_iter-create.js":function(e,t,n){"use strict";var r=n("./node_modules/core-js/library/modules/_object-create.js"),o=n("./node_modules/core-js/library/modules/_property-desc.js"),i=n("./node_modules/core-js/library/modules/_set-to-string-tag.js"),s={};n("./node_modules/core-js/library/modules/_hide.js")(s,n("./node_modules/core-js/library/modules/_wks.js")("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(s,{next:o(1,n)}),i(e,t+" Iterator")}},"./node_modules/core-js/library/modules/_iter-define.js":function(e,t,n){"use strict";var r=n("./node_modules/core-js/library/modules/_library.js"),o=n("./node_modules/core-js/library/modules/_export.js"),i=n("./node_modules/core-js/library/modules/_redefine.js"),s=n("./node_modules/core-js/library/modules/_hide.js"),a=n("./node_modules/core-js/library/modules/_iterators.js"),u=n("./node_modules/core-js/library/modules/_iter-create.js"),l=n("./node_modules/core-js/library/modules/_set-to-string-tag.js"),c=n("./node_modules/core-js/library/modules/_object-gpo.js"),d=n("./node_modules/core-js/library/modules/_wks.js")("iterator"),f=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,h,m,g,v){u(n,t,h);var y,b,_,x=function(e){if(!f&&e in k)return k[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},j=t+" Iterator",w="values"==m,C=!1,k=e.prototype,E=k[d]||k["@@iterator"]||m&&k[m],D=E||x(m),A=m?w?x("entries"):D:void 0,S="Array"==t&&k.entries||E;if(S&&(_=c(S.call(new e)))!==Object.prototype&&_.next&&(l(_,j,!0),r||"function"==typeof _[d]||s(_,d,p)),w&&E&&"values"!==E.name&&(C=!0,D=function(){return E.call(this)}),r&&!v||!f&&!C&&k[d]||s(k,d,D),a[t]=D,a[j]=p,m)if(y={values:w?D:x("values"),keys:g?D:x("keys"),entries:A},v)for(b in y)b in k||i(k,b,y[b]);else o(o.P+o.F*(f||C),t,y);return y}},"./node_modules/core-js/library/modules/_iter-step.js":function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},"./node_modules/core-js/library/modules/_iterators.js":function(e,t){e.exports={}},"./node_modules/core-js/library/modules/_library.js":function(e,t){e.exports=!0},"./node_modules/core-js/library/modules/_meta.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_uid.js")("meta"),o=n("./node_modules/core-js/library/modules/_is-object.js"),i=n("./node_modules/core-js/library/modules/_has.js"),s=n("./node_modules/core-js/library/modules/_object-dp.js").f,a=0,u=Object.isExtensible||function(){return!0},l=!n("./node_modules/core-js/library/modules/_fails.js")(function(){return u(Object.preventExtensions({}))}),c=function(e){s(e,r,{value:{i:"O"+ ++a,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return l&&d.NEED&&u(e)&&!i(e,r)&&c(e),e}}},"./node_modules/core-js/library/modules/_object-assign.js":function(e,t,n){"use strict";var r=n("./node_modules/core-js/library/modules/_object-keys.js"),o=n("./node_modules/core-js/library/modules/_object-gops.js"),i=n("./node_modules/core-js/library/modules/_object-pie.js"),s=n("./node_modules/core-js/library/modules/_to-object.js"),a=n("./node_modules/core-js/library/modules/_iobject.js"),u=Object.assign;e.exports=!u||n("./node_modules/core-js/library/modules/_fails.js")(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=s(e),u=arguments.length,l=1,c=o.f,d=i.f;u>l;)for(var f,p=a(arguments[l++]),h=c?r(p).concat(c(p)):r(p),m=h.length,g=0;m>g;)d.call(p,f=h[g++])&&(n[f]=p[f]);return n}:u},"./node_modules/core-js/library/modules/_object-create.js":function(e,t,n){var r=n("./node_modules/core-js/library/modules/_an-object.js"),o=n("./node_modules/core-js/library/modules/_object-dps.js"),i=n("./node_modules/core-js/library/modules/_enum-bug-keys.js"),s=n("./node_modules/core-js/library/modules/_shared-key.js")("IE_PROTO"),a=function(){},u=function(){var e,t=n("./node_modules/core-js/library/modules/_dom-create.js")("iframe"),r=i.length;for(t.style.display="none",n("./node_modules/core-js/library/modules/_html.js").appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("\";\n};\n\nexports.default = LOADABLE_MARKS;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _scrollbar = require('./scrollbar');\n\nvar _scrollbar2 = _interopRequireDefault(_scrollbar);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _scrollbar2.default;\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _perfectScrollbar = require('perfect-scrollbar');\n\nvar _perfectScrollbar2 = _interopRequireDefault(_perfectScrollbar);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar handlerNameByEvent = {\n 'ps-scroll-y': 'onScrollY',\n 'ps-scroll-x': 'onScrollX',\n 'ps-scroll-up': 'onScrollUp',\n 'ps-scroll-down': 'onScrollDown',\n 'ps-scroll-left': 'onScrollLeft',\n 'ps-scroll-right': 'onScrollRight',\n 'ps-y-reach-start': 'onYReachStart',\n 'ps-y-reach-end': 'onYReachEnd',\n 'ps-x-reach-start': 'onXReachStart',\n 'ps-x-reach-end': 'onXReachEnd'\n};\nObject.freeze(handlerNameByEvent);\n\nvar ScrollBar = function (_Component) {\n _inherits(ScrollBar, _Component);\n\n function ScrollBar(props) {\n _classCallCheck(this, ScrollBar);\n\n var _this = _possibleConstructorReturn(this, (ScrollBar.__proto__ || Object.getPrototypeOf(ScrollBar)).call(this, props));\n\n _this.handleRef = _this.handleRef.bind(_this);\n _this._handlerByEvent = {};\n return _this;\n }\n\n _createClass(ScrollBar, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this._ps = new _perfectScrollbar2.default(this._container, this.props.option);\n // hook up events\n this._updateEventHook();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n this._updateEventHook(prevProps);\n this._ps.update();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n var _this2 = this;\n\n // unhook up evens\n Object.keys(this._handlerByEvent).forEach(function (key) {\n var value = _this2._handlerByEvent[key];\n\n if (value) {\n _this2._container.removeEventListener(key, value, false);\n }\n });\n this._handlerByEvent = {};\n this._ps.destroy();\n this._ps = null;\n }\n }, {\n key: '_updateEventHook',\n value: function _updateEventHook() {\n var _this3 = this;\n\n var prevProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n // hook up events\n Object.keys(handlerNameByEvent).forEach(function (key) {\n var callback = _this3.props[handlerNameByEvent[key]];\n var prevCallback = prevProps[handlerNameByEvent[key]];\n if (callback !== prevCallback) {\n if (prevCallback) {\n var prevHandler = _this3._handlerByEvent[key];\n _this3._container.removeEventListener(key, prevHandler, false);\n _this3._handlerByEvent[key] = null;\n }\n if (callback) {\n var handler = function handler() {\n return callback(_this3._container);\n };\n _this3._container.addEventListener(key, handler, false);\n _this3._handlerByEvent[key] = handler;\n }\n }\n });\n }\n }, {\n key: 'updateScroll',\n value: function updateScroll() {\n this._ps.update();\n }\n }, {\n key: 'handleRef',\n value: function handleRef(ref) {\n this._container = ref;\n this.props.containerRef(ref);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n children = _props.children,\n component = _props.component,\n className = _props.className,\n style = _props.style;\n\n var Comp = component;\n\n return _react2.default.createElement(\n Comp,\n { style: style, className: 'scrollbar-container ' + className, ref: this.handleRef },\n children\n );\n }\n }]);\n\n return ScrollBar;\n}(_react.Component);\n\nexports.default = ScrollBar;\n\n\nScrollBar.defaultProps = {\n className: '',\n style: undefined,\n option: undefined,\n containerRef: function containerRef() {},\n onScrollY: undefined,\n onScrollX: undefined,\n onScrollUp: undefined,\n onScrollDown: undefined,\n onScrollLeft: undefined,\n onScrollRight: undefined,\n onYReachStart: undefined,\n onYReachEnd: undefined,\n onXReachStart: undefined,\n onXReachEnd: undefined,\n component: 'div'\n};\n\nScrollBar.propTypes = {\n children: _propTypes.PropTypes.node.isRequired,\n className: _propTypes.PropTypes.string,\n style: _propTypes.PropTypes.object,\n option: _propTypes.PropTypes.object,\n containerRef: _propTypes.PropTypes.func,\n onScrollY: _propTypes.PropTypes.func,\n onScrollX: _propTypes.PropTypes.func,\n onScrollUp: _propTypes.PropTypes.func,\n onScrollDown: _propTypes.PropTypes.func,\n onScrollLeft: _propTypes.PropTypes.func,\n onScrollRight: _propTypes.PropTypes.func,\n onYReachStart: _propTypes.PropTypes.func,\n onYReachEnd: _propTypes.PropTypes.func,\n onXReachStart: _propTypes.PropTypes.func,\n onXReachEnd: _propTypes.PropTypes.func,\n component: _propTypes.PropTypes.string\n};\nmodule.exports = exports['default'];","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport warning from \"warning\";\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createBrowserHistory as createHistory } from \"history\";\nimport Router from \"./Router\";\n\n/**\n * The public API for a that uses HTML5 history.\n */\n\nvar BrowserRouter = function (_React$Component) {\n _inherits(BrowserRouter, _React$Component);\n\n function BrowserRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, BrowserRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n BrowserRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, \" ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { BrowserRouter as Router }`.\");\n };\n\n BrowserRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return BrowserRouter;\n}(React.Component);\n\nBrowserRouter.propTypes = {\n basename: PropTypes.string,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n};\n\n\nexport default BrowserRouter;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport warning from \"warning\";\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createHashHistory as createHistory } from \"history\";\nimport Router from \"./Router\";\n\n/**\n * The public API for a that uses window.location.hash.\n */\n\nvar HashRouter = function (_React$Component) {\n _inherits(HashRouter, _React$Component);\n\n function HashRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, HashRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n HashRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, \" ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { HashRouter as Router }`.\");\n };\n\n HashRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return HashRouter;\n}(React.Component);\n\nHashRouter.propTypes = {\n basename: PropTypes.string,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf([\"hashbang\", \"noslash\", \"slash\"]),\n children: PropTypes.node\n};\n\n\nexport default HashRouter;","// Written in this round about way for babel-transform-imports\nimport Route from \"react-router/es/Route\";\n\nexport default Route;","// Written in this round about way for babel-transform-imports\nimport Router from \"react-router/es/Router\";\n\nexport default Router;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport warning from \"warning\";\nimport invariant from \"invariant\";\nimport matchPath from \"./matchPath\";\n\n/**\n * The public API for rendering the first that matches.\n */\n\nvar Switch = function (_React$Component) {\n _inherits(Switch, _React$Component);\n\n function Switch() {\n _classCallCheck(this, Switch);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Switch.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, \"You should not use outside a \");\n };\n\n Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n warning(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.');\n\n warning(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.');\n };\n\n Switch.prototype.render = function render() {\n var route = this.context.router.route;\n var children = this.props.children;\n\n var location = this.props.location || route.location;\n\n var match = void 0,\n child = void 0;\n React.Children.forEach(children, function (element) {\n if (match == null && React.isValidElement(element)) {\n var _element$props = element.props,\n pathProp = _element$props.path,\n exact = _element$props.exact,\n strict = _element$props.strict,\n sensitive = _element$props.sensitive,\n from = _element$props.from;\n\n var path = pathProp || from;\n\n child = element;\n match = matchPath(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }, route.match);\n }\n });\n\n return match ? React.cloneElement(child, { location: location, computedMatch: match }) : null;\n };\n\n return Switch;\n}(React.Component);\n\nSwitch.contextTypes = {\n router: PropTypes.shape({\n route: PropTypes.object.isRequired\n }).isRequired\n};\nSwitch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n};\n\n\nexport default Switch;","// Written in this round about way for babel-transform-imports\nimport Switch from \"react-router/es/Switch\";\n\nexport default Switch;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"invariant\";\nimport { createLocation } from \"history\";\n\nvar isModifiedEvent = function isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n};\n\n/**\n * The public API for rendering a history-aware .\n */\n\nvar Link = function (_React$Component) {\n _inherits(Link, _React$Component);\n\n function Link() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Link);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {\n if (_this.props.onClick) _this.props.onClick(event);\n\n if (!event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore everything but left clicks\n !_this.props.target && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n\n var history = _this.context.router.history;\n var _this$props = _this.props,\n replace = _this$props.replace,\n to = _this$props.to;\n\n\n if (replace) {\n history.replace(to);\n } else {\n history.push(to);\n }\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Link.prototype.render = function render() {\n var _props = this.props,\n replace = _props.replace,\n to = _props.to,\n innerRef = _props.innerRef,\n props = _objectWithoutProperties(_props, [\"replace\", \"to\", \"innerRef\"]); // eslint-disable-line no-unused-vars\n\n invariant(this.context.router, \"You should not use outside a \");\n\n invariant(to !== undefined, 'You must specify the \"to\" property');\n\n var history = this.context.router.history;\n\n var location = typeof to === \"string\" ? createLocation(to, null, null, history.location) : to;\n\n var href = history.createHref(location);\n return React.createElement(\"a\", _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));\n };\n\n return Link;\n}(React.Component);\n\nLink.propTypes = {\n onClick: PropTypes.func,\n target: PropTypes.string,\n replace: PropTypes.bool,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n innerRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func])\n};\nLink.defaultProps = {\n replace: false\n};\nLink.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n push: PropTypes.func.isRequired,\n replace: PropTypes.func.isRequired,\n createHref: PropTypes.func.isRequired\n }).isRequired\n }).isRequired\n};\n\n\nexport default Link;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport warning from \"warning\";\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createMemoryHistory as createHistory } from \"history\";\nimport Router from \"./Router\";\n\n/**\n * The public API for a that stores location in memory.\n */\n\nvar MemoryRouter = function (_React$Component) {\n _inherits(MemoryRouter, _React$Component);\n\n function MemoryRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, MemoryRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n MemoryRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, \" ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { MemoryRouter as Router }`.\");\n };\n\n MemoryRouter.prototype.render = function render() {\n return React.createElement(Router, { history: this.history, children: this.props.children });\n };\n\n return MemoryRouter;\n}(React.Component);\n\nMemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n};\n\n\nexport default MemoryRouter;","// Written in this round about way for babel-transform-imports\nimport MemoryRouter from \"react-router/es/MemoryRouter\";\n\nexport default MemoryRouter;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Route from \"./Route\";\nimport Link from \"./Link\";\n\n/**\n * A wrapper that knows if it's \"active\" or not.\n */\nvar NavLink = function NavLink(_ref) {\n var to = _ref.to,\n exact = _ref.exact,\n strict = _ref.strict,\n location = _ref.location,\n activeClassName = _ref.activeClassName,\n className = _ref.className,\n activeStyle = _ref.activeStyle,\n style = _ref.style,\n getIsActive = _ref.isActive,\n ariaCurrent = _ref[\"aria-current\"],\n rest = _objectWithoutProperties(_ref, [\"to\", \"exact\", \"strict\", \"location\", \"activeClassName\", \"className\", \"activeStyle\", \"style\", \"isActive\", \"aria-current\"]);\n\n var path = (typeof to === \"undefined\" ? \"undefined\" : _typeof(to)) === \"object\" ? to.pathname : to;\n\n // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n var escapedPath = path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n\n return React.createElement(Route, {\n path: escapedPath,\n exact: exact,\n strict: strict,\n location: location,\n children: function children(_ref2) {\n var location = _ref2.location,\n match = _ref2.match;\n\n var isActive = !!(getIsActive ? getIsActive(match, location) : match);\n\n return React.createElement(Link, _extends({\n to: to,\n className: isActive ? [className, activeClassName].filter(function (i) {\n return i;\n }).join(\" \") : className,\n style: isActive ? _extends({}, style, activeStyle) : style,\n \"aria-current\": isActive && ariaCurrent || null\n }, rest));\n }\n });\n};\n\nNavLink.propTypes = {\n to: Link.propTypes.to,\n exact: PropTypes.bool,\n strict: PropTypes.bool,\n location: PropTypes.object,\n activeClassName: PropTypes.string,\n className: PropTypes.string,\n activeStyle: PropTypes.object,\n style: PropTypes.object,\n isActive: PropTypes.func,\n \"aria-current\": PropTypes.oneOf([\"page\", \"step\", \"location\", \"date\", \"time\", \"true\"])\n};\n\nNavLink.defaultProps = {\n activeClassName: \"active\",\n \"aria-current\": \"page\"\n};\n\nexport default NavLink;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"invariant\";\n\n/**\n * The public API for prompting the user before navigating away\n * from a screen with a component.\n */\n\nvar Prompt = function (_React$Component) {\n _inherits(Prompt, _React$Component);\n\n function Prompt() {\n _classCallCheck(this, Prompt);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Prompt.prototype.enable = function enable(message) {\n if (this.unblock) this.unblock();\n\n this.unblock = this.context.router.history.block(message);\n };\n\n Prompt.prototype.disable = function disable() {\n if (this.unblock) {\n this.unblock();\n this.unblock = null;\n }\n };\n\n Prompt.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, \"You should not use outside a \");\n\n if (this.props.when) this.enable(this.props.message);\n };\n\n Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (nextProps.when) {\n if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message);\n } else {\n this.disable();\n }\n };\n\n Prompt.prototype.componentWillUnmount = function componentWillUnmount() {\n this.disable();\n };\n\n Prompt.prototype.render = function render() {\n return null;\n };\n\n return Prompt;\n}(React.Component);\n\nPrompt.propTypes = {\n when: PropTypes.bool,\n message: PropTypes.oneOfType([PropTypes.func, PropTypes.string]).isRequired\n};\nPrompt.defaultProps = {\n when: true\n};\nPrompt.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n block: PropTypes.func.isRequired\n }).isRequired\n }).isRequired\n};\n\n\nexport default Prompt;","// Written in this round about way for babel-transform-imports\nimport Prompt from \"react-router/es/Prompt\";\n\nexport default Prompt;","import pathToRegexp from \"path-to-regexp\";\n\nvar patternCache = {};\nvar cacheLimit = 10000;\nvar cacheCount = 0;\n\nvar compileGenerator = function compileGenerator(pattern) {\n var cacheKey = pattern;\n var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});\n\n if (cache[pattern]) return cache[pattern];\n\n var compiledGenerator = pathToRegexp.compile(pattern);\n\n if (cacheCount < cacheLimit) {\n cache[pattern] = compiledGenerator;\n cacheCount++;\n }\n\n return compiledGenerator;\n};\n\n/**\n * Public API for generating a URL pathname from a pattern and parameters.\n */\nvar generatePath = function generatePath() {\n var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"/\";\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (pattern === \"/\") {\n return pattern;\n }\n var generator = compileGenerator(pattern);\n return generator(params, { pretty: true });\n};\n\nexport default generatePath;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport warning from \"warning\";\nimport invariant from \"invariant\";\nimport { createLocation, locationsAreEqual } from \"history\";\nimport generatePath from \"./generatePath\";\n\n/**\n * The public API for updating the location programmatically\n * with a component.\n */\n\nvar Redirect = function (_React$Component) {\n _inherits(Redirect, _React$Component);\n\n function Redirect() {\n _classCallCheck(this, Redirect);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n Redirect.prototype.isStatic = function isStatic() {\n return this.context.router && this.context.router.staticContext;\n };\n\n Redirect.prototype.componentWillMount = function componentWillMount() {\n invariant(this.context.router, \"You should not use outside a \");\n\n if (this.isStatic()) this.perform();\n };\n\n Redirect.prototype.componentDidMount = function componentDidMount() {\n if (!this.isStatic()) this.perform();\n };\n\n Redirect.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {\n var prevTo = createLocation(prevProps.to);\n var nextTo = createLocation(this.props.to);\n\n if (locationsAreEqual(prevTo, nextTo)) {\n warning(false, \"You tried to redirect to the same route you're currently on: \" + (\"\\\"\" + nextTo.pathname + nextTo.search + \"\\\"\"));\n return;\n }\n\n this.perform();\n };\n\n Redirect.prototype.computeTo = function computeTo(_ref) {\n var computedMatch = _ref.computedMatch,\n to = _ref.to;\n\n if (computedMatch) {\n if (typeof to === \"string\") {\n return generatePath(to, computedMatch.params);\n } else {\n return _extends({}, to, {\n pathname: generatePath(to.pathname, computedMatch.params)\n });\n }\n }\n\n return to;\n };\n\n Redirect.prototype.perform = function perform() {\n var history = this.context.router.history;\n var push = this.props.push;\n\n var to = this.computeTo(this.props);\n\n if (push) {\n history.push(to);\n } else {\n history.replace(to);\n }\n };\n\n Redirect.prototype.render = function render() {\n return null;\n };\n\n return Redirect;\n}(React.Component);\n\nRedirect.propTypes = {\n computedMatch: PropTypes.object, // private, from \n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n};\nRedirect.defaultProps = {\n push: false\n};\nRedirect.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.shape({\n push: PropTypes.func.isRequired,\n replace: PropTypes.func.isRequired\n }).isRequired,\n staticContext: PropTypes.object\n }).isRequired\n};\n\n\nexport default Redirect;","// Written in this round about way for babel-transform-imports\nimport Redirect from \"react-router/es/Redirect\";\n\nexport default Redirect;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport warning from \"warning\";\nimport invariant from \"invariant\";\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, createPath } from \"history\";\nimport Router from \"./Router\";\n\nvar addLeadingSlash = function addLeadingSlash(path) {\n return path.charAt(0) === \"/\" ? path : \"/\" + path;\n};\n\nvar addBasename = function addBasename(basename, location) {\n if (!basename) return location;\n\n return _extends({}, location, {\n pathname: addLeadingSlash(basename) + location.pathname\n });\n};\n\nvar stripBasename = function stripBasename(basename, location) {\n if (!basename) return location;\n\n var base = addLeadingSlash(basename);\n\n if (location.pathname.indexOf(base) !== 0) return location;\n\n return _extends({}, location, {\n pathname: location.pathname.substr(base.length)\n });\n};\n\nvar createURL = function createURL(location) {\n return typeof location === \"string\" ? location : createPath(location);\n};\n\nvar staticHandler = function staticHandler(methodName) {\n return function () {\n invariant(false, \"You cannot %s with \", methodName);\n };\n};\n\nvar noop = function noop() {};\n\n/**\n * The public top-level API for a \"static\" , so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\n\nvar StaticRouter = function (_React$Component) {\n _inherits(StaticRouter, _React$Component);\n\n function StaticRouter() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, StaticRouter);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {\n return addLeadingSlash(_this.props.basename + createURL(path));\n }, _this.handlePush = function (location) {\n var _this$props = _this.props,\n basename = _this$props.basename,\n context = _this$props.context;\n\n context.action = \"PUSH\";\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }, _this.handleReplace = function (location) {\n var _this$props2 = _this.props,\n basename = _this$props2.basename,\n context = _this$props2.context;\n\n context.action = \"REPLACE\";\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }, _this.handleListen = function () {\n return noop;\n }, _this.handleBlock = function () {\n return noop;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n StaticRouter.prototype.getChildContext = function getChildContext() {\n return {\n router: {\n staticContext: this.props.context\n }\n };\n };\n\n StaticRouter.prototype.componentWillMount = function componentWillMount() {\n warning(!this.props.history, \" ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { StaticRouter as Router }`.\");\n };\n\n StaticRouter.prototype.render = function render() {\n var _props = this.props,\n basename = _props.basename,\n context = _props.context,\n location = _props.location,\n props = _objectWithoutProperties(_props, [\"basename\", \"context\", \"location\"]);\n\n var history = {\n createHref: this.createHref,\n action: \"POP\",\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler(\"go\"),\n goBack: staticHandler(\"goBack\"),\n goForward: staticHandler(\"goForward\"),\n listen: this.handleListen,\n block: this.handleBlock\n };\n\n return React.createElement(Router, _extends({}, props, { history: history }));\n };\n\n return StaticRouter;\n}(React.Component);\n\nStaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object.isRequired,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n};\nStaticRouter.defaultProps = {\n basename: \"\",\n location: \"/\"\n};\nStaticRouter.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default StaticRouter;","// Written in this round about way for babel-transform-imports\nimport StaticRouter from \"react-router/es/StaticRouter\";\n\nexport default StaticRouter;","// Written in this round about way for babel-transform-imports\nimport generatePath from \"react-router/es/generatePath\";\n\nexport default generatePath;","// Written in this round about way for babel-transform-imports\nimport matchPath from \"react-router/es/matchPath\";\n\nexport default matchPath;","// Written in this round about way for babel-transform-imports\nimport withRouter from \"react-router/es/withRouter\";\n\nexport default withRouter;","import _BrowserRouter from \"./BrowserRouter\";\nexport { _BrowserRouter as BrowserRouter };\nimport _HashRouter from \"./HashRouter\";\nexport { _HashRouter as HashRouter };\nimport _Link from \"./Link\";\nexport { _Link as Link };\nimport _MemoryRouter from \"./MemoryRouter\";\nexport { _MemoryRouter as MemoryRouter };\nimport _NavLink from \"./NavLink\";\nexport { _NavLink as NavLink };\nimport _Prompt from \"./Prompt\";\nexport { _Prompt as Prompt };\nimport _Redirect from \"./Redirect\";\nexport { _Redirect as Redirect };\nimport _Route from \"./Route\";\nexport { _Route as Route };\nimport _Router from \"./Router\";\nexport { _Router as Router };\nimport _StaticRouter from \"./StaticRouter\";\nexport { _StaticRouter as StaticRouter };\nimport _Switch from \"./Switch\";\nexport { _Switch as Switch };\nimport _generatePath from \"./generatePath\";\nexport { _generatePath as generatePath };\nimport _matchPath from \"./matchPath\";\nexport { _matchPath as matchPath };\nimport _withRouter from \"./withRouter\";\nexport { _withRouter as withRouter };","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.genericHashLink = genericHashLink;\nexports.HashLink = HashLink;\nexports.NavHashLink = NavHashLink;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactRouterDom = require('react-router-dom');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nvar hashFragment = '';\nvar observer = null;\nvar asyncTimerId = null;\nvar scrollFunction = null;\n\nfunction reset() {\n hashFragment = '';\n if (observer !== null) observer.disconnect();\n if (asyncTimerId !== null) {\n window.clearTimeout(asyncTimerId);\n asyncTimerId = null;\n }\n}\n\nfunction getElAndScroll() {\n var element = document.getElementById(hashFragment);\n if (element !== null) {\n scrollFunction(element);\n reset();\n return true;\n }\n return false;\n}\n\nfunction hashLinkScroll() {\n // Push onto callback queue so it runs after the DOM is updated\n window.setTimeout(function () {\n if (getElAndScroll() === false) {\n if (observer === null) {\n observer = new MutationObserver(getElAndScroll);\n }\n observer.observe(document, {\n attributes: true,\n childList: true,\n subtree: true\n });\n // if the element doesn't show up in 10 seconds, stop checking\n asyncTimerId = window.setTimeout(function () {\n reset();\n }, 10000);\n }\n }, 0);\n}\n\nfunction genericHashLink(props, As) {\n function handleClick(e) {\n reset();\n if (props.onClick) props.onClick(e);\n if (typeof props.to === 'string') {\n hashFragment = props.to.split('#').slice(1).join('#');\n } else if (_typeof(props.to) === 'object' && typeof props.to.hash === 'string') {\n hashFragment = props.to.hash.replace('#', '');\n }\n if (hashFragment !== '') {\n scrollFunction = props.scroll || function (el) {\n return props.smooth ? el.scrollIntoView({ behavior: \"smooth\" }) : el.scrollIntoView();\n };\n hashLinkScroll();\n }\n }\n\n var scroll = props.scroll,\n smooth = props.smooth,\n filteredProps = _objectWithoutProperties(props, ['scroll', 'smooth']);\n\n return _react2.default.createElement(\n As,\n _extends({}, filteredProps, { onClick: handleClick }),\n props.children\n );\n}\n\nfunction HashLink(props) {\n return genericHashLink(props, _reactRouterDom.Link);\n}\n\nfunction NavHashLink(props) {\n return genericHashLink(props, _reactRouterDom.NavLink);\n}\n\nvar propTypes = {\n onClick: _propTypes2.default.func,\n children: _propTypes2.default.node,\n scroll: _propTypes2.default.func,\n to: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object])\n};\n\nHashLink.propTypes = propTypes;\nNavHashLink.propTypes = propTypes;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport warning from \"warning\";\nimport invariant from \"invariant\";\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport matchPath from \"./matchPath\";\n\nvar isEmptyChildren = function isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n};\n\n/**\n * The public API for matching a single path and rendering.\n */\n\nvar Route = function (_React$Component) {\n _inherits(Route, _React$Component);\n\n function Route() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Route);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n match: _this.computeMatch(_this.props, _this.context.router)\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Route.prototype.getChildContext = function getChildContext() {\n return {\n router: _extends({}, this.context.router, {\n route: {\n location: this.props.location || this.context.router.route.location,\n match: this.state.match\n }\n })\n };\n };\n\n Route.prototype.computeMatch = function computeMatch(_ref, router) {\n var computedMatch = _ref.computedMatch,\n location = _ref.location,\n path = _ref.path,\n strict = _ref.strict,\n exact = _ref.exact,\n sensitive = _ref.sensitive;\n\n if (computedMatch) return computedMatch; // already computed the match for us\n\n invariant(router, \"You should not use or withRouter() outside a \");\n\n var route = router.route;\n\n var pathname = (location || route.location).pathname;\n\n return matchPath(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);\n };\n\n Route.prototype.componentWillMount = function componentWillMount() {\n warning(!(this.props.component && this.props.render), \"You should not use and in the same route; will be ignored\");\n\n warning(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), \"You should not use and in the same route; will be ignored\");\n\n warning(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), \"You should not use and in the same route; will be ignored\");\n };\n\n Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {\n warning(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.');\n\n warning(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.');\n\n this.setState({\n match: this.computeMatch(nextProps, nextContext.router)\n });\n };\n\n Route.prototype.render = function render() {\n var match = this.state.match;\n var _props = this.props,\n children = _props.children,\n component = _props.component,\n render = _props.render;\n var _context$router = this.context.router,\n history = _context$router.history,\n route = _context$router.route,\n staticContext = _context$router.staticContext;\n\n var location = this.props.location || route.location;\n var props = { match: match, location: location, history: history, staticContext: staticContext };\n\n if (component) return match ? React.createElement(component, props) : null;\n\n if (render) return match ? render(props) : null;\n\n if (typeof children === \"function\") return children(props);\n\n if (children && !isEmptyChildren(children)) return React.Children.only(children);\n\n return null;\n };\n\n return Route;\n}(React.Component);\n\nRoute.propTypes = {\n computedMatch: PropTypes.object, // private, from \n path: PropTypes.string,\n exact: PropTypes.bool,\n strict: PropTypes.bool,\n sensitive: PropTypes.bool,\n component: PropTypes.func,\n render: PropTypes.func,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n location: PropTypes.object\n};\nRoute.contextTypes = {\n router: PropTypes.shape({\n history: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n })\n};\nRoute.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default Route;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport warning from \"warning\";\nimport invariant from \"invariant\";\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\n/**\n * The public API for putting history on context.\n */\n\nvar Router = function (_React$Component) {\n _inherits(Router, _React$Component);\n\n function Router() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Router);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n match: _this.computeMatch(_this.props.history.location.pathname)\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Router.prototype.getChildContext = function getChildContext() {\n return {\n router: _extends({}, this.context.router, {\n history: this.props.history,\n route: {\n location: this.props.history.location,\n match: this.state.match\n }\n })\n };\n };\n\n Router.prototype.computeMatch = function computeMatch(pathname) {\n return {\n path: \"/\",\n url: \"/\",\n params: {},\n isExact: pathname === \"/\"\n };\n };\n\n Router.prototype.componentWillMount = function componentWillMount() {\n var _this2 = this;\n\n var _props = this.props,\n children = _props.children,\n history = _props.history;\n\n\n invariant(children == null || React.Children.count(children) === 1, \"A may have only one child element\");\n\n // Do this here so we can setState when a changes the\n // location in componentWillMount. This happens e.g. when doing\n // server rendering using a .\n this.unlisten = history.listen(function () {\n _this2.setState({\n match: _this2.computeMatch(history.location.pathname)\n });\n });\n };\n\n Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n warning(this.props.history === nextProps.history, \"You cannot change \");\n };\n\n Router.prototype.componentWillUnmount = function componentWillUnmount() {\n this.unlisten();\n };\n\n Router.prototype.render = function render() {\n var children = this.props.children;\n\n return children ? React.Children.only(children) : null;\n };\n\n return Router;\n}(React.Component);\n\nRouter.propTypes = {\n history: PropTypes.object.isRequired,\n children: PropTypes.node\n};\nRouter.contextTypes = {\n router: PropTypes.object\n};\nRouter.childContextTypes = {\n router: PropTypes.object.isRequired\n};\n\n\nexport default Router;","import pathToRegexp from \"path-to-regexp\";\n\nvar patternCache = {};\nvar cacheLimit = 10000;\nvar cacheCount = 0;\n\nvar compilePath = function compilePath(pattern, options) {\n var cacheKey = \"\" + options.end + options.strict + options.sensitive;\n var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});\n\n if (cache[pattern]) return cache[pattern];\n\n var keys = [];\n var re = pathToRegexp(pattern, keys, options);\n var compiledPattern = { re: re, keys: keys };\n\n if (cacheCount < cacheLimit) {\n cache[pattern] = compiledPattern;\n cacheCount++;\n }\n\n return compiledPattern;\n};\n\n/**\n * Public API for matching a URL pathname to a path pattern.\n */\nvar matchPath = function matchPath(pathname) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var parent = arguments[2];\n\n if (typeof options === \"string\") options = { path: options };\n\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === undefined ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === undefined ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === undefined ? false : _options$sensitive;\n\n\n if (path == null) return parent;\n\n var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),\n re = _compilePath.re,\n keys = _compilePath.keys;\n\n var match = re.exec(pathname);\n\n if (!match) return null;\n\n var url = match[0],\n values = match.slice(1);\n\n var isExact = pathname === url;\n\n if (exact && !isExact) return null;\n\n return {\n path: path, // the path pattern used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url, // the matched portion of the URL\n isExact: isExact, // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n};\n\nexport default matchPath;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nimport Route from \"./Route\";\n\n/**\n * A public higher-order component to access the imperative API\n */\nvar withRouter = function withRouter(Component) {\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = _objectWithoutProperties(props, [\"wrappedComponentRef\"]);\n\n return React.createElement(Route, {\n children: function children(routeComponentProps) {\n return React.createElement(Component, _extends({}, remainingProps, routeComponentProps, {\n ref: wrappedComponentRef\n }));\n }\n });\n };\n\n C.displayName = \"withRouter(\" + (Component.displayName || Component.name) + \")\";\n C.WrappedComponent = Component;\n C.propTypes = {\n wrappedComponentRef: PropTypes.func\n };\n\n return hoistStatics(C, Component);\n};\n\nexport default withRouter;","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports,require(\"react\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"react\"],e):e(t.ReactSizes={},t.React)}(this,function(t,e){\"use strict\";function n(t,e,n){function o(e){var n=l,r=p;return l=p=void 0,v=e,h=t.apply(r,n)}function a(t){var n=t-y;return void 0===y||n>=e||0>n||m&&t-v>=d}function u(){var t=T();if(a(t))return c(t);b=setTimeout(u,function(t){var n=e-(t-y);return m?O(n,d-(t-v)):n}(t))}function c(t){return b=void 0,k&&l?o(t):(l=p=void 0,h)}function s(){var t=T(),n=a(t);if(l=arguments,p=this,y=t,n){if(void 0===b)return function(t){return v=t,b=setTimeout(u,e),g?o(t):h}(y);if(m)return b=setTimeout(u,e),o(y)}return void 0===b&&(b=setTimeout(u,e)),h}var l,p,d,h,b,y,v=0,g=!1,m=!1,k=!0;if(\"function\"!=typeof t)throw new TypeError(f);return e=i(e)||0,r(n)&&(g=!!n.leading,d=(m=\"maxWait\"in n)?w(i(n.maxWait)||0,e):d,k=\"trailing\"in n?!!n.trailing:k),s.cancel=function(){void 0!==b&&clearTimeout(b),v=0,l=y=p=b=void 0},s.flush=function(){return void 0===b?h:c(T())},s}function r(t){var e=typeof t;return!!t&&(\"object\"==e||\"function\"==e)}function i(t){if(\"number\"==typeof t)return t;if(function(t){return\"symbol\"==typeof t||!!t&&\"object\"==typeof t&&m.call(t)==s}(t))return c;if(r(t)){var e=\"function\"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+\"\":e}if(\"string\"!=typeof t)return 0===t?t:+t;t=t.replace(l,\"\");var n=d.test(t);return n||h.test(t)?b(t.slice(2),n?2:8):p.test(t)?c:+t}function o(t){return function(){return t}}var a=\"default\"in e?e.default:e,u=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{},f=\"Expected a function\",c=NaN,s=\"[object Symbol]\",l=/^\\s+|\\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,h=/^0o[0-7]+$/i,b=parseInt,y=\"object\"==typeof u&&u&&u.Object===Object&&u,v=\"object\"==typeof self&&self&&self.Object===Object&&self,g=y||v||Function(\"return this\")(),m=Object.prototype.toString,w=Math.max,O=Math.min,T=function(){return g.Date.now()},k=function(t,e,i){var o=!0,a=!0;if(\"function\"!=typeof t)throw new TypeError(f);return r(i)&&(o=\"leading\"in i?!!i.leading:o,a=\"trailing\"in i?!!i.trailing:a),n(t,e,{leading:o,maxWait:e,trailing:a})},j=function(t,e){for(var n in t)if(!(n in e))return!0;for(var r in e)if(t[r]!==e[r])return!0;return!1},P=function(t){var e=t.fallbackWidth,n=void 0===e?null:e,r=t.fallbackHeight,i=void 0===r?null:r,o=\"undefined\"!=typeof window;return{width:o?window.innerWidth:n,height:o?window.innerHeight:i,canUseDOM:o}},S=function(){};S.thatReturns=o,S.thatReturnsFalse=o(!1),S.thatReturnsTrue=o(!0),S.thatReturnsNull=o(null),S.thatReturnsThis=function(){return this},S.thatReturnsArgument=function(t){return t};var _=S,x=function(t,e,n,r,i,o,a,u){if(!t){var f;if(void 0===e)f=Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else{var c=[n,r,i,o,a,u],s=0;(f=Error(e.replace(/%s/g,function(){return c[s++]}))).name=\"Invariant Violation\"}throw f.framesToPop=1,f}},z=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\",W=function(t,e){return e={exports:{}},t(e,e.exports),e.exports}(function(t){t.exports=function(){function t(t,e,n,r,i,o){o!==z&&x(!1,\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types\")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=_,n.PropTypes=n,n}()}),E=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},R=function(){function t(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),C=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},D=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},M=function(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e},A=\"_ReactSizesConfig_\",F=C({},A,W.shape({fallbackWidth:W.number,fallbackHeight:W.number,throttle:W.number})),N=function(t){return 480>t.width},I=function(t){return t.width>=1024},U=function(t){return!I(t)},L=Object.freeze({isMobile:N,isTablet:function(t){var e=t.width;return e>=480&&1024>e},isDesktop:I,isGtMobile:function(t){return!N(t)},isGtTablet:function(t){return I(t)},isStTablet:function(t){return N(t)},isStDesktop:U,isTabletAndGreater:function(t){return!N(t)},isTabletAndSmaller:function(t){return!U(t)}}),$=Object.assign(function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return function(t){var r,i,o=function(t,e){return n.map(function(n){return n(t,e)}).reduce(function(t,e){return D({},t,e)},{})};return i=r=function(n){function r(t,e){E(this,r);var n=M(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));return n.dispatchSizes=function(){var t=n.getPropsToPass();j(t,n.state.propsToPass)&&n.setState({propsToPass:t})},n.throttledDispatchSizes=k(n.dispatchSizes,(n.context[A]||{}).throttle||200),n.getWindowSizesWithFallback=function(){var t=n.context[A]||{},e=t.fallbackHeight,r=t.fallbackWidth;return P({fallbackHeight:void 0===e?null:e,fallbackWidth:void 0===r?null:r})},n.getPropsToPass=function(){return o(n.getWindowSizesWithFallback(),n.props)},n.state={initialSizes:n.getWindowSizesWithFallback(),propsToPass:n.getPropsToPass()},n}return H(r,e.Component),R(r,[{key:\"componentDidMount\",value:function(){window.addEventListener(\"resize\",this.throttledDispatchSizes),this.dispatchSizes()}},{key:\"componentWillUnmount\",value:function(){window.removeEventListener(\"resize\",this.throttledDispatchSizes)}},{key:\"render\",value:function(){return a.createElement(t,D({},this.props,this.state.propsToPass))}}]),r}(),r.displayName=\"withSizes(\"+(t.displayName||t.name||(\"string\"==typeof t&&t.length>0?t:\"Unknown\"))+\")\",r.contextTypes=F,i}},D({},L)),G=function(t){function n(){return E(this,n),M(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return H(n,e.Component),R(n,[{key:\"getChildContext\",value:function(){var t=this.props.config,e=void 0===t?{}:t;return C({},A,{fallbackWidth:e.fallbackWidth||null,fallbackHeight:e.fallbackHeight||null,throttle:e.throttle||200})}},{key:\"render\",value:function(){return this.props.children}}]),n}();G.childContextTypes=F;var q=function(t){var e=t.children,n=t.render,r=function(t,e){var n={};for(var r in t)0>e.indexOf(r)&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(t,[\"children\",\"render\"]),i=e||n;return i?i(r):null};t.withSizes=$,t.SizesProvider=G,t.createSizedComponent=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return $(e)(q)},t.presets=L,t.default=$,Object.defineProperty(t,\"__esModule\",{value:!0})});\n","/** @license React v16.7.0-alpha.2\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var k=require(\"object-assign\"),l=\"function\"===typeof Symbol&&Symbol.for,p=l?Symbol.for(\"react.element\"):60103,q=l?Symbol.for(\"react.portal\"):60106,r=l?Symbol.for(\"react.fragment\"):60107,t=l?Symbol.for(\"react.strict_mode\"):60108,u=l?Symbol.for(\"react.profiler\"):60114,v=l?Symbol.for(\"react.provider\"):60109,w=l?Symbol.for(\"react.context\"):60110,x=l?Symbol.for(\"react.concurrent_mode\"):60111,y=l?Symbol.for(\"react.forward_ref\"):60112,z=l?Symbol.for(\"react.suspense\"):60113,A=l?Symbol.for(\"react.memo\"):\n60115,aa=l?Symbol.for(\"react.lazy\"):60116,B=\"function\"===typeof Symbol&&Symbol.iterator;function ba(a,b,d,c,e,g,h,f){if(!a){a=void 0;if(void 0===b)a=Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else{var m=[d,c,e,g,h,f],n=0;a=Error(b.replace(/%s/g,function(){return m[n++]}));a.name=\"Invariant Violation\"}a.framesToPop=1;throw a;}}\nfunction C(a){for(var b=arguments.length-1,d=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=0;cP.length&&P.push(a)}\nfunction S(a,b,d,c){var e=typeof a;if(\"undefined\"===e||\"boolean\"===e)a=null;var g=!1;if(null===a)g=!0;else switch(e){case \"string\":case \"number\":g=!0;break;case \"object\":switch(a.$$typeof){case p:case q:g=!0}}if(g)return d(c,a,\"\"===b?\".\"+T(a,0):b),1;g=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var h=0;h= start && codePoint < end) {\n\t\t\t\t// Modify this pair.\n\t\t\t\tif (codePoint == start) {\n\t\t\t\t\tif (end == start + 1) {\n\t\t\t\t\t\t// Just remove `start` and `end`.\n\t\t\t\t\t\tdata.splice(index, 2);\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Just replace `start` with a new value.\n\t\t\t\t\t\tdata[index] = codePoint + 1;\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t} else if (codePoint == end - 1) {\n\t\t\t\t\t// Just replace `end` with a new value.\n\t\t\t\t\tdata[index + 1] = codePoint;\n\t\t\t\t\treturn data;\n\t\t\t\t} else {\n\t\t\t\t\t// Replace `[start, end]` with `[startA, endA, startB, endB]`.\n\t\t\t\t\tdata.splice(index, 2, start, codePoint, codePoint + 1, end);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataRemoveRange = function(data, rangeStart, rangeEnd) {\n\t\tif (rangeEnd < rangeStart) {\n\t\t\tthrow Error(ERRORS.rangeOrder);\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\twhile (index < data.length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\n\t\t\t// Exit as soon as no more matching pairs can be found.\n\t\t\tif (start > rangeEnd) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if this range pair is equal to, or forms a subset of, the range\n\t\t\t// to be removed.\n\t\t\t// E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`.\n\t\t\t// E.g. we have `[40, 51]` and want to remove 0-100 → `[]`.\n\t\t\tif (rangeStart <= start && rangeEnd >= end) {\n\t\t\t\t// Remove this pair.\n\t\t\t\tdata.splice(index, 2);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check if both `rangeStart` and `rangeEnd` are within the bounds of\n\t\t\t// this pair.\n\t\t\t// E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`.\n\t\t\tif (rangeStart >= start && rangeEnd < end) {\n\t\t\t\tif (rangeStart == start) {\n\t\t\t\t\t// Replace `[start, end]` with `[startB, endB]`.\n\t\t\t\t\tdata[index] = rangeEnd + 1;\n\t\t\t\t\tdata[index + 1] = end + 1;\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t\t// Replace `[start, end]` with `[startA, endA, startB, endB]`.\n\t\t\t\tdata.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if only `rangeStart` is within the bounds of this pair.\n\t\t\t// E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`.\n\t\t\tif (rangeStart >= start && rangeStart <= end) {\n\t\t\t\t// Replace `end` with `rangeStart`.\n\t\t\t\tdata[index + 1] = rangeStart;\n\t\t\t\t// Note: we cannot `return` just yet, in case any following pairs still\n\t\t\t\t// contain matching code points.\n\t\t\t\t// E.g. we have `[0, 11, 14, 31]` and want to remove 4-20\n\t\t\t\t// → `[0, 4, 21, 31]`.\n\t\t\t}\n\n\t\t\t// Check if only `rangeEnd` is within the bounds of this pair.\n\t\t\t// E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`.\n\t\t\telse if (rangeEnd >= start && rangeEnd <= end) {\n\t\t\t\t// Just replace `start`.\n\t\t\t\tdata[index] = rangeEnd + 1;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\t var dataAdd = function(data, codePoint) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar lastIndex = null;\n\t\tvar length = data.length;\n\t\tif (codePoint < 0x0 || codePoint > 0x10FFFF) {\n\t\t\tthrow RangeError(ERRORS.codePointRange);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\n\t\t\t// Check if the code point is already in the set.\n\t\t\tif (codePoint >= start && codePoint < end) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tif (codePoint == start - 1) {\n\t\t\t\t// Just replace `start` with a new value.\n\t\t\t\tdata[index] = codePoint;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// At this point, if `start` is `greater` than `codePoint`, insert a new\n\t\t\t// `[start, end]` pair before the current pair, or after the current pair\n\t\t\t// if there is a known `lastIndex`.\n\t\t\tif (start > codePoint) {\n\t\t\t\tdata.splice(\n\t\t\t\t\tlastIndex != null ? lastIndex + 2 : 0,\n\t\t\t\t\t0,\n\t\t\t\t\tcodePoint,\n\t\t\t\t\tcodePoint + 1\n\t\t\t\t);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tif (codePoint == end) {\n\t\t\t\t// Check if adding this code point causes two separate ranges to become\n\t\t\t\t// a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`.\n\t\t\t\tif (codePoint + 1 == data[index + 2]) {\n\t\t\t\t\tdata.splice(index, 4, start, data[index + 3]);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t\t// Else, just replace `end` with a new value.\n\t\t\t\tdata[index + 1] = codePoint + 1;\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\tlastIndex = index;\n\t\t\tindex += 2;\n\t\t}\n\t\t// The loop has finished; add the new pair to the end of the data set.\n\t\tdata.push(codePoint, codePoint + 1);\n\t\treturn data;\n\t};\n\n\tvar dataAddData = function(dataA, dataB) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar data = dataA.slice();\n\t\tvar length = dataB.length;\n\t\twhile (index < length) {\n\t\t\tstart = dataB[index];\n\t\t\tend = dataB[index + 1] - 1;\n\t\t\tif (start == end) {\n\t\t\t\tdata = dataAdd(data, start);\n\t\t\t} else {\n\t\t\t\tdata = dataAddRange(data, start, end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataRemoveData = function(dataA, dataB) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar data = dataA.slice();\n\t\tvar length = dataB.length;\n\t\twhile (index < length) {\n\t\t\tstart = dataB[index];\n\t\t\tend = dataB[index + 1] - 1;\n\t\t\tif (start == end) {\n\t\t\t\tdata = dataRemove(data, start);\n\t\t\t} else {\n\t\t\t\tdata = dataRemoveRange(data, start, end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataAddRange = function(data, rangeStart, rangeEnd) {\n\t\tif (rangeEnd < rangeStart) {\n\t\t\tthrow Error(ERRORS.rangeOrder);\n\t\t}\n\t\tif (\n\t\t\trangeStart < 0x0 || rangeStart > 0x10FFFF ||\n\t\t\trangeEnd < 0x0 || rangeEnd > 0x10FFFF\n\t\t) {\n\t\t\tthrow RangeError(ERRORS.codePointRange);\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar added = false;\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\n\t\t\tif (added) {\n\t\t\t\t// The range has already been added to the set; at this point, we just\n\t\t\t\t// need to get rid of the following ranges in case they overlap.\n\n\t\t\t\t// Check if this range can be combined with the previous range.\n\t\t\t\tif (start == rangeEnd + 1) {\n\t\t\t\t\tdata.splice(index - 1, 2);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Exit as soon as no more possibly overlapping pairs can be found.\n\t\t\t\tif (start > rangeEnd) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// E.g. `[0, 11, 12, 16]` and we’ve added 5-15, so we now have\n\t\t\t\t// `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the\n\t\t\t\t// `0,16` range that was previously added.\n\t\t\t\tif (start >= rangeStart && start <= rangeEnd) {\n\t\t\t\t\t// `start` lies within the range that was previously added.\n\n\t\t\t\t\tif (end > rangeStart && end - 1 <= rangeEnd) {\n\t\t\t\t\t\t// `end` lies within the range that was previously added as well,\n\t\t\t\t\t\t// so remove this pair.\n\t\t\t\t\t\tdata.splice(index, 2);\n\t\t\t\t\t\tindex -= 2;\n\t\t\t\t\t\t// Note: we cannot `return` just yet, as there may still be other\n\t\t\t\t\t\t// overlapping pairs.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// `start` lies within the range that was previously added, but\n\t\t\t\t\t\t// `end` doesn’t. E.g. `[0, 11, 12, 31]` and we’ve added 5-15, so\n\t\t\t\t\t\t// now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`.\n\t\t\t\t\t\t// Remove the previously added `end` and the current `start`.\n\t\t\t\t\t\tdata.splice(index - 1, 2);\n\t\t\t\t\t\tindex -= 2;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Note: we cannot return yet.\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse if (start == rangeEnd + 1) {\n\t\t\t\tdata[index] = rangeStart;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if a new pair must be inserted *before* the current one.\n\t\t\telse if (start > rangeEnd) {\n\t\t\t\tdata.splice(index, 0, rangeStart, rangeEnd + 1);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\telse if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {\n\t\t\t\t// The new range lies entirely within an existing range pair. No action\n\t\t\t\t// needed.\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\telse if (\n\t\t\t\t// E.g. `[0, 11]` and you add 5-15 → `[0, 16]`.\n\t\t\t\t(rangeStart >= start && rangeStart < end) ||\n\t\t\t\t// E.g. `[0, 3]` and you add 3-6 → `[0, 7]`.\n\t\t\t\tend == rangeStart\n\t\t\t) {\n\t\t\t\t// Replace `end` with the new value.\n\t\t\t\tdata[index + 1] = rangeEnd + 1;\n\t\t\t\t// Make sure the next range pair doesn’t overlap, e.g. `[0, 11, 12, 14]`\n\t\t\t\t// and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part.\n\t\t\t\tadded = true;\n\t\t\t\t// Note: we cannot `return` just yet.\n\t\t\t}\n\n\t\t\telse if (rangeStart <= start && rangeEnd + 1 >= end) {\n\t\t\t\t// The new range is a superset of the old range.\n\t\t\t\tdata[index] = rangeStart;\n\t\t\t\tdata[index + 1] = rangeEnd + 1;\n\t\t\t\tadded = true;\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\t// The loop has finished without doing anything; add the new pair to the end\n\t\t// of the data set.\n\t\tif (!added) {\n\t\t\tdata.push(rangeStart, rangeEnd + 1);\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataContains = function(data, codePoint) {\n\t\tvar index = 0;\n\t\tvar length = data.length;\n\t\t// Exit early if `codePoint` is not within `data`’s overall range.\n\t\tvar start = data[index];\n\t\tvar end = data[length - 1];\n\t\tif (length >= 2) {\n\t\t\tif (codePoint < start || codePoint > end) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\t\t\tif (codePoint >= start && codePoint < end) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn false;\n\t};\n\n\tvar dataIntersection = function(data, codePoints) {\n\t\tvar index = 0;\n\t\tvar length = codePoints.length;\n\t\tvar codePoint;\n\t\tvar result = [];\n\t\twhile (index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tif (dataContains(data, codePoint)) {\n\t\t\t\tresult.push(codePoint);\n\t\t\t}\n\t\t\t++index;\n\t\t}\n\t\treturn dataFromCodePoints(result);\n\t};\n\n\tvar dataIsEmpty = function(data) {\n\t\treturn !data.length;\n\t};\n\n\tvar dataIsSingleton = function(data) {\n\t\t// Check if the set only represents a single code point.\n\t\treturn data.length == 2 && data[0] + 1 == data[1];\n\t};\n\n\tvar dataToArray = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar result = [];\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\t\t\twhile (start < end) {\n\t\t\t\tresult.push(start);\n\t\t\t\t++start;\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn result;\n\t};\n\n\t/*--------------------------------------------------------------------------*/\n\n\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\tvar floor = Math.floor;\n\tvar highSurrogate = function(codePoint) {\n\t\treturn parseInt(\n\t\t\tfloor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN,\n\t\t\t10\n\t\t);\n\t};\n\n\tvar lowSurrogate = function(codePoint) {\n\t\treturn parseInt(\n\t\t\t(codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN,\n\t\t\t10\n\t\t);\n\t};\n\n\tvar stringFromCharCode = String.fromCharCode;\n\tvar codePointToString = function(codePoint) {\n\t\tvar string;\n\t\t// https://mathiasbynens.be/notes/javascript-escapes#single\n\t\t// Note: the `\\b` escape sequence for U+0008 BACKSPACE in strings has a\n\t\t// different meaning in regular expressions (word boundary), so it cannot\n\t\t// be used here.\n\t\tif (codePoint == 0x09) {\n\t\t\tstring = '\\\\t';\n\t\t}\n\t\t// Note: IE < 9 treats `'\\v'` as `'v'`, so avoid using it.\n\t\t// else if (codePoint == 0x0B) {\n\t\t// \tstring = '\\\\v';\n\t\t// }\n\t\telse if (codePoint == 0x0A) {\n\t\t\tstring = '\\\\n';\n\t\t}\n\t\telse if (codePoint == 0x0C) {\n\t\t\tstring = '\\\\f';\n\t\t}\n\t\telse if (codePoint == 0x0D) {\n\t\t\tstring = '\\\\r';\n\t\t}\n\t\telse if (codePoint == 0x2D) {\n\t\t\t// https://mathiasbynens.be/notes/javascript-escapes#hexadecimal\n\t\t\t// Note: `-` (U+002D HYPHEN-MINUS) is escaped in this way rather\n\t\t\t// than by backslash-escaping, in case the output is used outside\n\t\t\t// of a character class in a `u` RegExp. /\\-/u throws, but\n\t\t\t// /\\x2D/u is fine.\n\t\t\tstring = '\\\\x2D';\n\t\t}\n\t\telse if (codePoint == 0x5C) {\n\t\t\tstring = '\\\\\\\\';\n\t\t}\n\t\telse if (\n\t\t\tcodePoint == 0x24 ||\n\t\t\t(codePoint >= 0x28 && codePoint <= 0x2B) ||\n\t\t\tcodePoint == 0x2E || codePoint == 0x2F ||\n\t\t\tcodePoint == 0x3F ||\n\t\t\t(codePoint >= 0x5B && codePoint <= 0x5E) ||\n\t\t\t(codePoint >= 0x7B && codePoint <= 0x7D)\n\t\t) {\n\t\t\t// The code point maps to an unsafe printable ASCII character;\n\t\t\t// backslash-escape it. Here’s the list of those symbols:\n\t\t\t//\n\t\t\t// $()*+./?[\\]^{|}\n\t\t\t//\n\t\t\t// This matches SyntaxCharacters as well as `/` (U+002F SOLIDUS).\n\t\t\t// https://tc39.github.io/ecma262/#prod-SyntaxCharacter\n\t\t\tstring = '\\\\' + stringFromCharCode(codePoint);\n\t\t}\n\t\telse if (codePoint >= 0x20 && codePoint <= 0x7E) {\n\t\t\t// The code point maps to one of these printable ASCII symbols\n\t\t\t// (including the space character):\n\t\t\t//\n\t\t\t// !\"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO\n\t\t\t// PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~\n\t\t\t//\n\t\t\t// These can safely be used directly.\n\t\t\tstring = stringFromCharCode(codePoint);\n\t\t}\n\t\telse if (codePoint <= 0xFF) {\n\t\t\tstring = '\\\\x' + pad(hex(codePoint), 2);\n\t\t}\n\t\telse { // `codePoint <= 0xFFFF` holds true.\n\t\t\t// https://mathiasbynens.be/notes/javascript-escapes#unicode\n\t\t\tstring = '\\\\u' + pad(hex(codePoint), 4);\n\t\t}\n\n\t\t// There’s no need to account for astral symbols / surrogate pairs here,\n\t\t// since `codePointToString` is private and only used for BMP code points.\n\t\t// But if that’s what you need, just add an `else` block with this code:\n\t\t//\n\t\t// string = '\\\\u' + pad(hex(highSurrogate(codePoint)), 4)\n\t\t// \t+ '\\\\u' + pad(hex(lowSurrogate(codePoint)), 4);\n\n\t\treturn string;\n\t};\n\n\tvar codePointToStringUnicode = function(codePoint) {\n\t\tif (codePoint <= 0xFFFF) {\n\t\t\treturn codePointToString(codePoint);\n\t\t}\n\t\treturn '\\\\u{' + codePoint.toString(16).toUpperCase() + '}';\n\t};\n\n\tvar symbolToCodePoint = function(symbol) {\n\t\tvar length = symbol.length;\n\t\tvar first = symbol.charCodeAt(0);\n\t\tvar second;\n\t\tif (\n\t\t\tfirst >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX &&\n\t\t\tlength > 1 // There is a next code unit.\n\t\t) {\n\t\t\t// `first` is a high surrogate, and there is a next character. Assume\n\t\t\t// it’s a low surrogate (else it’s invalid usage of Regenerate anyway).\n\t\t\tsecond = symbol.charCodeAt(1);\n\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\treturn (first - HIGH_SURROGATE_MIN) * 0x400 +\n\t\t\t\tsecond - LOW_SURROGATE_MIN + 0x10000;\n\t\t}\n\t\treturn first;\n\t};\n\n\tvar createBMPCharacterClasses = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar result = '';\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\tif (dataIsSingleton(data)) {\n\t\t\treturn codePointToString(data[0]);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\t\t\tif (start == end) {\n\t\t\t\tresult += codePointToString(start);\n\t\t\t} else if (start + 1 == end) {\n\t\t\t\tresult += codePointToString(start) + codePointToString(end);\n\t\t\t} else {\n\t\t\t\tresult += codePointToString(start) + '-' + codePointToString(end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn '[' + result + ']';\n\t};\n\n\tvar createUnicodeCharacterClasses = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar result = '';\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\tif (dataIsSingleton(data)) {\n\t\t\treturn codePointToStringUnicode(data[0]);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\t\t\tif (start == end) {\n\t\t\t\tresult += codePointToStringUnicode(start);\n\t\t\t} else if (start + 1 == end) {\n\t\t\t\tresult += codePointToStringUnicode(start) + codePointToStringUnicode(end);\n\t\t\t} else {\n\t\t\t\tresult += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn '[' + result + ']';\n\t};\n\n\tvar splitAtBMP = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar loneHighSurrogates = [];\n\t\tvar loneLowSurrogates = [];\n\t\tvar bmp = [];\n\t\tvar astral = [];\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\n\t\t\tif (start < HIGH_SURROGATE_MIN) {\n\n\t\t\t\t// The range starts and ends before the high surrogate range.\n\t\t\t\t// E.g. (0, 0x10).\n\t\t\t\tif (end < HIGH_SURROGATE_MIN) {\n\t\t\t\t\tbmp.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends within it.\n\t\t\t\t// E.g. (0, 0xD855).\n\t\t\t\tif (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends in the low\n\t\t\t\t// surrogate range. E.g. (0, 0xDCFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends after the\n\t\t\t\t// low surrogate range. E.g. (0, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {\n\n\t\t\t\t// The range starts and ends in the high surrogate range.\n\t\t\t\t// E.g. (0xD855, 0xD866).\n\t\t\t\tif (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the high surrogate range and ends in the low\n\t\t\t\t// surrogate range. E.g. (0xD855, 0xDCFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the high surrogate range and ends after the low\n\t\t\t\t// surrogate range. E.g. (0xD855, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) {\n\n\t\t\t\t// The range starts and ends in the low surrogate range.\n\t\t\t\t// E.g. (0xDCFF, 0xDDFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneLowSurrogates.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the low surrogate range and ends after the low\n\t\t\t\t// surrogate range. E.g. (0xDCFF, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) {\n\n\t\t\t\t// The range starts and ends after the low surrogate range.\n\t\t\t\t// E.g. (0xFFAA, 0x10FFFF).\n\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\tbmp.push(start, end + 1);\n\t\t\t\t} else {\n\t\t\t\t\tbmp.push(start, 0xFFFF + 1);\n\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// The range starts and ends in the astral range.\n\t\t\t\tastral.push(start, end + 1);\n\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\treturn {\n\t\t\t'loneHighSurrogates': loneHighSurrogates,\n\t\t\t'loneLowSurrogates': loneLowSurrogates,\n\t\t\t'bmp': bmp,\n\t\t\t'astral': astral\n\t\t};\n\t};\n\n\tvar optimizeSurrogateMappings = function(surrogateMappings) {\n\t\tvar result = [];\n\t\tvar tmpLow = [];\n\t\tvar addLow = false;\n\t\tvar mapping;\n\t\tvar nextMapping;\n\t\tvar highSurrogates;\n\t\tvar lowSurrogates;\n\t\tvar nextHighSurrogates;\n\t\tvar nextLowSurrogates;\n\t\tvar index = -1;\n\t\tvar length = surrogateMappings.length;\n\t\twhile (++index < length) {\n\t\t\tmapping = surrogateMappings[index];\n\t\t\tnextMapping = surrogateMappings[index + 1];\n\t\t\tif (!nextMapping) {\n\t\t\t\tresult.push(mapping);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\thighSurrogates = mapping[0];\n\t\t\tlowSurrogates = mapping[1];\n\t\t\tnextHighSurrogates = nextMapping[0];\n\t\t\tnextLowSurrogates = nextMapping[1];\n\n\t\t\t// Check for identical high surrogate ranges.\n\t\t\ttmpLow = lowSurrogates;\n\t\t\twhile (\n\t\t\t\tnextHighSurrogates &&\n\t\t\t\thighSurrogates[0] == nextHighSurrogates[0] &&\n\t\t\t\thighSurrogates[1] == nextHighSurrogates[1]\n\t\t\t) {\n\t\t\t\t// Merge with the next item.\n\t\t\t\tif (dataIsSingleton(nextLowSurrogates)) {\n\t\t\t\t\ttmpLow = dataAdd(tmpLow, nextLowSurrogates[0]);\n\t\t\t\t} else {\n\t\t\t\t\ttmpLow = dataAddRange(\n\t\t\t\t\t\ttmpLow,\n\t\t\t\t\t\tnextLowSurrogates[0],\n\t\t\t\t\t\tnextLowSurrogates[1] - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t++index;\n\t\t\t\tmapping = surrogateMappings[index];\n\t\t\t\thighSurrogates = mapping[0];\n\t\t\t\tlowSurrogates = mapping[1];\n\t\t\t\tnextMapping = surrogateMappings[index + 1];\n\t\t\t\tnextHighSurrogates = nextMapping && nextMapping[0];\n\t\t\t\tnextLowSurrogates = nextMapping && nextMapping[1];\n\t\t\t\taddLow = true;\n\t\t\t}\n\t\t\tresult.push([\n\t\t\t\thighSurrogates,\n\t\t\t\taddLow ? tmpLow : lowSurrogates\n\t\t\t]);\n\t\t\taddLow = false;\n\t\t}\n\t\treturn optimizeByLowSurrogates(result);\n\t};\n\n\tvar optimizeByLowSurrogates = function(surrogateMappings) {\n\t\tif (surrogateMappings.length == 1) {\n\t\t\treturn surrogateMappings;\n\t\t}\n\t\tvar index = -1;\n\t\tvar innerIndex = -1;\n\t\twhile (++index < surrogateMappings.length) {\n\t\t\tvar mapping = surrogateMappings[index];\n\t\t\tvar lowSurrogates = mapping[1];\n\t\t\tvar lowSurrogateStart = lowSurrogates[0];\n\t\t\tvar lowSurrogateEnd = lowSurrogates[1];\n\t\t\tinnerIndex = index; // Note: the loop starts at the next index.\n\t\t\twhile (++innerIndex < surrogateMappings.length) {\n\t\t\t\tvar otherMapping = surrogateMappings[innerIndex];\n\t\t\t\tvar otherLowSurrogates = otherMapping[1];\n\t\t\t\tvar otherLowSurrogateStart = otherLowSurrogates[0];\n\t\t\t\tvar otherLowSurrogateEnd = otherLowSurrogates[1];\n\t\t\t\tif (\n\t\t\t\t\tlowSurrogateStart == otherLowSurrogateStart &&\n\t\t\t\t\tlowSurrogateEnd == otherLowSurrogateEnd\n\t\t\t\t) {\n\t\t\t\t\t// Add the code points in the other item to this one.\n\t\t\t\t\tif (dataIsSingleton(otherMapping[0])) {\n\t\t\t\t\t\tmapping[0] = dataAdd(mapping[0], otherMapping[0][0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapping[0] = dataAddRange(\n\t\t\t\t\t\t\tmapping[0],\n\t\t\t\t\t\t\totherMapping[0][0],\n\t\t\t\t\t\t\totherMapping[0][1] - 1\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Remove the other, now redundant, item.\n\t\t\t\t\tsurrogateMappings.splice(innerIndex, 1);\n\t\t\t\t\t--innerIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn surrogateMappings;\n\t};\n\n\tvar surrogateSet = function(data) {\n\t\t// Exit early if `data` is an empty set.\n\t\tif (!data.length) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar startHigh;\n\t\tvar startLow;\n\t\tvar endHigh;\n\t\tvar endLow;\n\t\tvar surrogateMappings = [];\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1;\n\n\t\t\tstartHigh = highSurrogate(start);\n\t\t\tstartLow = lowSurrogate(start);\n\t\t\tendHigh = highSurrogate(end);\n\t\t\tendLow = lowSurrogate(end);\n\n\t\t\tvar startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN;\n\t\t\tvar endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX;\n\t\t\tvar complete = false;\n\n\t\t\t// Append the previous high-surrogate-to-low-surrogate mappings.\n\t\t\t// Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`.\n\t\t\tif (\n\t\t\t\tstartHigh == endHigh ||\n\t\t\t\tstartsWithLowestLowSurrogate && endsWithHighestLowSurrogate\n\t\t\t) {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[startHigh, endHigh + 1],\n\t\t\t\t\t[startLow, endLow + 1]\n\t\t\t\t]);\n\t\t\t\tcomplete = true;\n\t\t\t} else {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[startHigh, startHigh + 1],\n\t\t\t\t\t[startLow, LOW_SURROGATE_MAX + 1]\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t// Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to\n\t\t\t// `(endHigh - 1, LOW_SURROGATE_MAX)`.\n\t\t\tif (!complete && startHigh + 1 < endHigh) {\n\t\t\t\tif (endsWithHighestLowSurrogate) {\n\t\t\t\t\t// Combine step 2 and step 3.\n\t\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t\t[startHigh + 1, endHigh + 1],\n\t\t\t\t\t\t[LOW_SURROGATE_MIN, endLow + 1]\n\t\t\t\t\t]);\n\t\t\t\t\tcomplete = true;\n\t\t\t\t} else {\n\t\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t\t[startHigh + 1, endHigh],\n\t\t\t\t\t\t[LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`.\n\t\t\tif (!complete) {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[endHigh, endHigh + 1],\n\t\t\t\t\t[LOW_SURROGATE_MIN, endLow + 1]\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\n\t\t// The format of `surrogateMappings` is as follows:\n\t\t//\n\t\t// [ surrogateMapping1, surrogateMapping2 ]\n\t\t//\n\t\t// i.e.:\n\t\t//\n\t\t// [\n\t\t// [ highSurrogates1, lowSurrogates1 ],\n\t\t// [ highSurrogates2, lowSurrogates2 ]\n\t\t// ]\n\t\treturn optimizeSurrogateMappings(surrogateMappings);\n\t};\n\n\tvar createSurrogateCharacterClasses = function(surrogateMappings) {\n\t\tvar result = [];\n\t\tforEach(surrogateMappings, function(surrogateMapping) {\n\t\t\tvar highSurrogates = surrogateMapping[0];\n\t\t\tvar lowSurrogates = surrogateMapping[1];\n\t\t\tresult.push(\n\t\t\t\tcreateBMPCharacterClasses(highSurrogates) +\n\t\t\t\tcreateBMPCharacterClasses(lowSurrogates)\n\t\t\t);\n\t\t});\n\t\treturn result.join('|');\n\t};\n\n\tvar createCharacterClassesFromData = function(data, bmpOnly, hasUnicodeFlag) {\n\t\tif (hasUnicodeFlag) {\n\t\t\treturn createUnicodeCharacterClasses(data);\n\t\t}\n\t\tvar result = [];\n\n\t\tvar parts = splitAtBMP(data);\n\t\tvar loneHighSurrogates = parts.loneHighSurrogates;\n\t\tvar loneLowSurrogates = parts.loneLowSurrogates;\n\t\tvar bmp = parts.bmp;\n\t\tvar astral = parts.astral;\n\t\tvar hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates);\n\t\tvar hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates);\n\n\t\tvar surrogateMappings = surrogateSet(astral);\n\n\t\tif (bmpOnly) {\n\t\t\tbmp = dataAddData(bmp, loneHighSurrogates);\n\t\t\thasLoneHighSurrogates = false;\n\t\t\tbmp = dataAddData(bmp, loneLowSurrogates);\n\t\t\thasLoneLowSurrogates = false;\n\t\t}\n\n\t\tif (!dataIsEmpty(bmp)) {\n\t\t\t// The data set contains BMP code points that are not high surrogates\n\t\t\t// needed for astral code points in the set.\n\t\t\tresult.push(createBMPCharacterClasses(bmp));\n\t\t}\n\t\tif (surrogateMappings.length) {\n\t\t\t// The data set contains astral code points; append character classes\n\t\t\t// based on their surrogate pairs.\n\t\t\tresult.push(createSurrogateCharacterClasses(surrogateMappings));\n\t\t}\n\t\t// https://gist.github.com/mathiasbynens/bbe7f870208abcfec860\n\t\tif (hasLoneHighSurrogates) {\n\t\t\tresult.push(\n\t\t\t\tcreateBMPCharacterClasses(loneHighSurrogates) +\n\t\t\t\t// Make sure the high surrogates aren’t part of a surrogate pair.\n\t\t\t\t'(?![\\\\uDC00-\\\\uDFFF])'\n\t\t\t);\n\t\t}\n\t\tif (hasLoneLowSurrogates) {\n\t\t\tresult.push(\n\t\t\t\t// It is not possible to accurately assert the low surrogates aren’t\n\t\t\t\t// part of a surrogate pair, since JavaScript regular expressions do\n\t\t\t\t// not support lookbehind.\n\t\t\t\t'(?:[^\\\\uD800-\\\\uDBFF]|^)' +\n\t\t\t\tcreateBMPCharacterClasses(loneLowSurrogates)\n\t\t\t);\n\t\t}\n\t\treturn result.join('|');\n\t};\n\n\t/*--------------------------------------------------------------------------*/\n\n\t// `regenerate` can be used as a constructor (and new methods can be added to\n\t// its prototype) but also as a regular function, the latter of which is the\n\t// documented and most common usage. For that reason, it’s not capitalized.\n\tvar regenerate = function(value) {\n\t\tif (arguments.length > 1) {\n\t\t\tvalue = slice.call(arguments);\n\t\t}\n\t\tif (this instanceof regenerate) {\n\t\t\tthis.data = [];\n\t\t\treturn value ? this.add(value) : this;\n\t\t}\n\t\treturn (new regenerate).add(value);\n\t};\n\n\tregenerate.version = '1.3.3';\n\n\tvar proto = regenerate.prototype;\n\textend(proto, {\n\t\t'add': function(value) {\n\t\t\tvar $this = this;\n\t\t\tif (value == null) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (value instanceof regenerate) {\n\t\t\t\t// Allow passing other Regenerate instances.\n\t\t\t\t$this.data = dataAddData($this.data, value.data);\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tvalue = slice.call(arguments);\n\t\t\t}\n\t\t\tif (isArray(value)) {\n\t\t\t\tforEach(value, function(item) {\n\t\t\t\t\t$this.add(item);\n\t\t\t\t});\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\t$this.data = dataAdd(\n\t\t\t\t$this.data,\n\t\t\t\tisNumber(value) ? value : symbolToCodePoint(value)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'remove': function(value) {\n\t\t\tvar $this = this;\n\t\t\tif (value == null) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (value instanceof regenerate) {\n\t\t\t\t// Allow passing other Regenerate instances.\n\t\t\t\t$this.data = dataRemoveData($this.data, value.data);\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tvalue = slice.call(arguments);\n\t\t\t}\n\t\t\tif (isArray(value)) {\n\t\t\t\tforEach(value, function(item) {\n\t\t\t\t\t$this.remove(item);\n\t\t\t\t});\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\t$this.data = dataRemove(\n\t\t\t\t$this.data,\n\t\t\t\tisNumber(value) ? value : symbolToCodePoint(value)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'addRange': function(start, end) {\n\t\t\tvar $this = this;\n\t\t\t$this.data = dataAddRange($this.data,\n\t\t\t\tisNumber(start) ? start : symbolToCodePoint(start),\n\t\t\t\tisNumber(end) ? end : symbolToCodePoint(end)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'removeRange': function(start, end) {\n\t\t\tvar $this = this;\n\t\t\tvar startCodePoint = isNumber(start) ? start : symbolToCodePoint(start);\n\t\t\tvar endCodePoint = isNumber(end) ? end : symbolToCodePoint(end);\n\t\t\t$this.data = dataRemoveRange(\n\t\t\t\t$this.data,\n\t\t\t\tstartCodePoint,\n\t\t\t\tendCodePoint\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'intersection': function(argument) {\n\t\t\tvar $this = this;\n\t\t\t// Allow passing other Regenerate instances.\n\t\t\t// TODO: Optimize this by writing and using `dataIntersectionData()`.\n\t\t\tvar array = argument instanceof regenerate ?\n\t\t\t\tdataToArray(argument.data) :\n\t\t\t\targument;\n\t\t\t$this.data = dataIntersection($this.data, array);\n\t\t\treturn $this;\n\t\t},\n\t\t'contains': function(codePoint) {\n\t\t\treturn dataContains(\n\t\t\t\tthis.data,\n\t\t\t\tisNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint)\n\t\t\t);\n\t\t},\n\t\t'clone': function() {\n\t\t\tvar set = new regenerate;\n\t\t\tset.data = this.data.slice(0);\n\t\t\treturn set;\n\t\t},\n\t\t'toString': function(options) {\n\t\t\tvar result = createCharacterClassesFromData(\n\t\t\t\tthis.data,\n\t\t\t\toptions ? options.bmpOnly : false,\n\t\t\t\toptions ? options.hasUnicodeFlag : false\n\t\t\t);\n\t\t\tif (!result) {\n\t\t\t\t// For an empty set, return something that can be inserted `/here/` to\n\t\t\t\t// form a valid regular expression. Avoid `(?:)` since that matches the\n\t\t\t\t// empty string.\n\t\t\t\treturn '[]';\n\t\t\t}\n\t\t\t// Use `\\0` instead of `\\x00` where possible.\n\t\t\treturn result.replace(regexNull, '\\\\0$1');\n\t\t},\n\t\t'toRegExp': function(flags) {\n\t\t\tvar pattern = this.toString(\n\t\t\t\tflags && flags.indexOf('u') != -1 ?\n\t\t\t\t\t{ 'hasUnicodeFlag': true } :\n\t\t\t\t\tnull\n\t\t\t);\n\t\t\treturn RegExp(pattern, flags || '');\n\t\t},\n\t\t'valueOf': function() { // Note: `valueOf` is aliased as `toArray`.\n\t\t\treturn dataToArray(this.data);\n\t\t}\n\t});\n\n\tproto.toArray = proto.valueOf;\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn regenerate;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = regenerate;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfreeExports.regenerate = regenerate;\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.regenerate = regenerate;\n\t}\n\n}(this));\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // In sloppy mode, unbound `this` refers to the global object, fallback to\n // Function constructor if we're in global strict mode. That is sadly a form\n // of indirect eval which violates Content Security Policy.\n (function() { return this })() || Function(\"return this\")()\n);\n","// Generated using `npm run build`. Do not edit.\n'use strict';\n\nconst regenerate = require('regenerate');\n\nexports.REGULAR = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0xFFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0xFFFF)],\n\t['w', regenerate(0x5F)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0xFFFF)]\n]);\n\nexports.UNICODE = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x10FFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0x10FFFF)],\n\t['w', regenerate(0x5F)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0x10FFFF)]\n]);\n\nexports.UNICODE_IGNORE_CASE = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x10FFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0x10FFFF)],\n\t['w', regenerate(0x5F, 0x17F, 0x212A)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0x17E)\n\t\t.addRange(0x180, 0x2129)\n\t\t.addRange(0x212B, 0x10FFFF)]\n]);\n","module.exports = new Map([\n\t[0x4B, 0x212A],\n\t[0x53, 0x17F],\n\t[0x6B, 0x212A],\n\t[0x73, 0x17F],\n\t[0xB5, 0x39C],\n\t[0xC5, 0x212B],\n\t[0xDF, 0x1E9E],\n\t[0xE5, 0x212B],\n\t[0x17F, 0x53],\n\t[0x1C4, 0x1C5],\n\t[0x1C5, 0x1C4],\n\t[0x1C7, 0x1C8],\n\t[0x1C8, 0x1C7],\n\t[0x1CA, 0x1CB],\n\t[0x1CB, 0x1CA],\n\t[0x1F1, 0x1F2],\n\t[0x1F2, 0x1F1],\n\t[0x26A, 0xA7AE],\n\t[0x29D, 0xA7B2],\n\t[0x345, 0x1FBE],\n\t[0x392, 0x3D0],\n\t[0x395, 0x3F5],\n\t[0x398, 0x3F4],\n\t[0x399, 0x1FBE],\n\t[0x39A, 0x3F0],\n\t[0x39C, 0xB5],\n\t[0x3A0, 0x3D6],\n\t[0x3A1, 0x3F1],\n\t[0x3A3, 0x3C2],\n\t[0x3A6, 0x3D5],\n\t[0x3A9, 0x2126],\n\t[0x3B8, 0x3F4],\n\t[0x3C2, 0x3A3],\n\t[0x3C9, 0x2126],\n\t[0x3D0, 0x392],\n\t[0x3D1, 0x3F4],\n\t[0x3D5, 0x3A6],\n\t[0x3D6, 0x3A0],\n\t[0x3F0, 0x39A],\n\t[0x3F1, 0x3A1],\n\t[0x3F4, [\n\t\t0x398,\n\t\t0x3D1,\n\t\t0x3B8\n\t]],\n\t[0x3F5, 0x395],\n\t[0x412, 0x1C80],\n\t[0x414, 0x1C81],\n\t[0x41E, 0x1C82],\n\t[0x421, 0x1C83],\n\t[0x422, 0x1C85],\n\t[0x42A, 0x1C86],\n\t[0x432, 0x1C80],\n\t[0x434, 0x1C81],\n\t[0x43E, 0x1C82],\n\t[0x441, 0x1C83],\n\t[0x442, [\n\t\t0x1C84,\n\t\t0x1C85\n\t]],\n\t[0x44A, 0x1C86],\n\t[0x462, 0x1C87],\n\t[0x463, 0x1C87],\n\t[0x10D0, 0x1C90],\n\t[0x10D1, 0x1C91],\n\t[0x10D2, 0x1C92],\n\t[0x10D3, 0x1C93],\n\t[0x10D4, 0x1C94],\n\t[0x10D5, 0x1C95],\n\t[0x10D6, 0x1C96],\n\t[0x10D7, 0x1C97],\n\t[0x10D8, 0x1C98],\n\t[0x10D9, 0x1C99],\n\t[0x10DA, 0x1C9A],\n\t[0x10DB, 0x1C9B],\n\t[0x10DC, 0x1C9C],\n\t[0x10DD, 0x1C9D],\n\t[0x10DE, 0x1C9E],\n\t[0x10DF, 0x1C9F],\n\t[0x10E0, 0x1CA0],\n\t[0x10E1, 0x1CA1],\n\t[0x10E2, 0x1CA2],\n\t[0x10E3, 0x1CA3],\n\t[0x10E4, 0x1CA4],\n\t[0x10E5, 0x1CA5],\n\t[0x10E6, 0x1CA6],\n\t[0x10E7, 0x1CA7],\n\t[0x10E8, 0x1CA8],\n\t[0x10E9, 0x1CA9],\n\t[0x10EA, 0x1CAA],\n\t[0x10EB, 0x1CAB],\n\t[0x10EC, 0x1CAC],\n\t[0x10ED, 0x1CAD],\n\t[0x10EE, 0x1CAE],\n\t[0x10EF, 0x1CAF],\n\t[0x10F0, 0x1CB0],\n\t[0x10F1, 0x1CB1],\n\t[0x10F2, 0x1CB2],\n\t[0x10F3, 0x1CB3],\n\t[0x10F4, 0x1CB4],\n\t[0x10F5, 0x1CB5],\n\t[0x10F6, 0x1CB6],\n\t[0x10F7, 0x1CB7],\n\t[0x10F8, 0x1CB8],\n\t[0x10F9, 0x1CB9],\n\t[0x10FA, 0x1CBA],\n\t[0x10FD, 0x1CBD],\n\t[0x10FE, 0x1CBE],\n\t[0x10FF, 0x1CBF],\n\t[0x13A0, 0xAB70],\n\t[0x13A1, 0xAB71],\n\t[0x13A2, 0xAB72],\n\t[0x13A3, 0xAB73],\n\t[0x13A4, 0xAB74],\n\t[0x13A5, 0xAB75],\n\t[0x13A6, 0xAB76],\n\t[0x13A7, 0xAB77],\n\t[0x13A8, 0xAB78],\n\t[0x13A9, 0xAB79],\n\t[0x13AA, 0xAB7A],\n\t[0x13AB, 0xAB7B],\n\t[0x13AC, 0xAB7C],\n\t[0x13AD, 0xAB7D],\n\t[0x13AE, 0xAB7E],\n\t[0x13AF, 0xAB7F],\n\t[0x13B0, 0xAB80],\n\t[0x13B1, 0xAB81],\n\t[0x13B2, 0xAB82],\n\t[0x13B3, 0xAB83],\n\t[0x13B4, 0xAB84],\n\t[0x13B5, 0xAB85],\n\t[0x13B6, 0xAB86],\n\t[0x13B7, 0xAB87],\n\t[0x13B8, 0xAB88],\n\t[0x13B9, 0xAB89],\n\t[0x13BA, 0xAB8A],\n\t[0x13BB, 0xAB8B],\n\t[0x13BC, 0xAB8C],\n\t[0x13BD, 0xAB8D],\n\t[0x13BE, 0xAB8E],\n\t[0x13BF, 0xAB8F],\n\t[0x13C0, 0xAB90],\n\t[0x13C1, 0xAB91],\n\t[0x13C2, 0xAB92],\n\t[0x13C3, 0xAB93],\n\t[0x13C4, 0xAB94],\n\t[0x13C5, 0xAB95],\n\t[0x13C6, 0xAB96],\n\t[0x13C7, 0xAB97],\n\t[0x13C8, 0xAB98],\n\t[0x13C9, 0xAB99],\n\t[0x13CA, 0xAB9A],\n\t[0x13CB, 0xAB9B],\n\t[0x13CC, 0xAB9C],\n\t[0x13CD, 0xAB9D],\n\t[0x13CE, 0xAB9E],\n\t[0x13CF, 0xAB9F],\n\t[0x13D0, 0xABA0],\n\t[0x13D1, 0xABA1],\n\t[0x13D2, 0xABA2],\n\t[0x13D3, 0xABA3],\n\t[0x13D4, 0xABA4],\n\t[0x13D5, 0xABA5],\n\t[0x13D6, 0xABA6],\n\t[0x13D7, 0xABA7],\n\t[0x13D8, 0xABA8],\n\t[0x13D9, 0xABA9],\n\t[0x13DA, 0xABAA],\n\t[0x13DB, 0xABAB],\n\t[0x13DC, 0xABAC],\n\t[0x13DD, 0xABAD],\n\t[0x13DE, 0xABAE],\n\t[0x13DF, 0xABAF],\n\t[0x13E0, 0xABB0],\n\t[0x13E1, 0xABB1],\n\t[0x13E2, 0xABB2],\n\t[0x13E3, 0xABB3],\n\t[0x13E4, 0xABB4],\n\t[0x13E5, 0xABB5],\n\t[0x13E6, 0xABB6],\n\t[0x13E7, 0xABB7],\n\t[0x13E8, 0xABB8],\n\t[0x13E9, 0xABB9],\n\t[0x13EA, 0xABBA],\n\t[0x13EB, 0xABBB],\n\t[0x13EC, 0xABBC],\n\t[0x13ED, 0xABBD],\n\t[0x13EE, 0xABBE],\n\t[0x13EF, 0xABBF],\n\t[0x13F0, 0x13F8],\n\t[0x13F1, 0x13F9],\n\t[0x13F2, 0x13FA],\n\t[0x13F3, 0x13FB],\n\t[0x13F4, 0x13FC],\n\t[0x13F5, 0x13FD],\n\t[0x13F8, 0x13F0],\n\t[0x13F9, 0x13F1],\n\t[0x13FA, 0x13F2],\n\t[0x13FB, 0x13F3],\n\t[0x13FC, 0x13F4],\n\t[0x13FD, 0x13F5],\n\t[0x1C80, [\n\t\t0x412,\n\t\t0x432\n\t]],\n\t[0x1C81, [\n\t\t0x414,\n\t\t0x434\n\t]],\n\t[0x1C82, [\n\t\t0x41E,\n\t\t0x43E\n\t]],\n\t[0x1C83, [\n\t\t0x421,\n\t\t0x441\n\t]],\n\t[0x1C84, [\n\t\t0x1C85,\n\t\t0x442\n\t]],\n\t[0x1C85, [\n\t\t0x422,\n\t\t0x1C84,\n\t\t0x442\n\t]],\n\t[0x1C86, [\n\t\t0x42A,\n\t\t0x44A\n\t]],\n\t[0x1C87, [\n\t\t0x462,\n\t\t0x463\n\t]],\n\t[0x1C88, [\n\t\t0xA64A,\n\t\t0xA64B\n\t]],\n\t[0x1C90, 0x10D0],\n\t[0x1C91, 0x10D1],\n\t[0x1C92, 0x10D2],\n\t[0x1C93, 0x10D3],\n\t[0x1C94, 0x10D4],\n\t[0x1C95, 0x10D5],\n\t[0x1C96, 0x10D6],\n\t[0x1C97, 0x10D7],\n\t[0x1C98, 0x10D8],\n\t[0x1C99, 0x10D9],\n\t[0x1C9A, 0x10DA],\n\t[0x1C9B, 0x10DB],\n\t[0x1C9C, 0x10DC],\n\t[0x1C9D, 0x10DD],\n\t[0x1C9E, 0x10DE],\n\t[0x1C9F, 0x10DF],\n\t[0x1CA0, 0x10E0],\n\t[0x1CA1, 0x10E1],\n\t[0x1CA2, 0x10E2],\n\t[0x1CA3, 0x10E3],\n\t[0x1CA4, 0x10E4],\n\t[0x1CA5, 0x10E5],\n\t[0x1CA6, 0x10E6],\n\t[0x1CA7, 0x10E7],\n\t[0x1CA8, 0x10E8],\n\t[0x1CA9, 0x10E9],\n\t[0x1CAA, 0x10EA],\n\t[0x1CAB, 0x10EB],\n\t[0x1CAC, 0x10EC],\n\t[0x1CAD, 0x10ED],\n\t[0x1CAE, 0x10EE],\n\t[0x1CAF, 0x10EF],\n\t[0x1CB0, 0x10F0],\n\t[0x1CB1, 0x10F1],\n\t[0x1CB2, 0x10F2],\n\t[0x1CB3, 0x10F3],\n\t[0x1CB4, 0x10F4],\n\t[0x1CB5, 0x10F5],\n\t[0x1CB6, 0x10F6],\n\t[0x1CB7, 0x10F7],\n\t[0x1CB8, 0x10F8],\n\t[0x1CB9, 0x10F9],\n\t[0x1CBA, 0x10FA],\n\t[0x1CBD, 0x10FD],\n\t[0x1CBE, 0x10FE],\n\t[0x1CBF, 0x10FF],\n\t[0x1E60, 0x1E9B],\n\t[0x1E9B, 0x1E60],\n\t[0x1E9E, 0xDF],\n\t[0x1F80, 0x1F88],\n\t[0x1F81, 0x1F89],\n\t[0x1F82, 0x1F8A],\n\t[0x1F83, 0x1F8B],\n\t[0x1F84, 0x1F8C],\n\t[0x1F85, 0x1F8D],\n\t[0x1F86, 0x1F8E],\n\t[0x1F87, 0x1F8F],\n\t[0x1F88, 0x1F80],\n\t[0x1F89, 0x1F81],\n\t[0x1F8A, 0x1F82],\n\t[0x1F8B, 0x1F83],\n\t[0x1F8C, 0x1F84],\n\t[0x1F8D, 0x1F85],\n\t[0x1F8E, 0x1F86],\n\t[0x1F8F, 0x1F87],\n\t[0x1F90, 0x1F98],\n\t[0x1F91, 0x1F99],\n\t[0x1F92, 0x1F9A],\n\t[0x1F93, 0x1F9B],\n\t[0x1F94, 0x1F9C],\n\t[0x1F95, 0x1F9D],\n\t[0x1F96, 0x1F9E],\n\t[0x1F97, 0x1F9F],\n\t[0x1F98, 0x1F90],\n\t[0x1F99, 0x1F91],\n\t[0x1F9A, 0x1F92],\n\t[0x1F9B, 0x1F93],\n\t[0x1F9C, 0x1F94],\n\t[0x1F9D, 0x1F95],\n\t[0x1F9E, 0x1F96],\n\t[0x1F9F, 0x1F97],\n\t[0x1FA0, 0x1FA8],\n\t[0x1FA1, 0x1FA9],\n\t[0x1FA2, 0x1FAA],\n\t[0x1FA3, 0x1FAB],\n\t[0x1FA4, 0x1FAC],\n\t[0x1FA5, 0x1FAD],\n\t[0x1FA6, 0x1FAE],\n\t[0x1FA7, 0x1FAF],\n\t[0x1FA8, 0x1FA0],\n\t[0x1FA9, 0x1FA1],\n\t[0x1FAA, 0x1FA2],\n\t[0x1FAB, 0x1FA3],\n\t[0x1FAC, 0x1FA4],\n\t[0x1FAD, 0x1FA5],\n\t[0x1FAE, 0x1FA6],\n\t[0x1FAF, 0x1FA7],\n\t[0x1FB3, 0x1FBC],\n\t[0x1FBC, 0x1FB3],\n\t[0x1FBE, [\n\t\t0x345,\n\t\t0x399\n\t]],\n\t[0x1FC3, 0x1FCC],\n\t[0x1FCC, 0x1FC3],\n\t[0x1FF3, 0x1FFC],\n\t[0x1FFC, 0x1FF3],\n\t[0x2126, [\n\t\t0x3A9,\n\t\t0x3C9\n\t]],\n\t[0x212A, 0x4B],\n\t[0x212B, [\n\t\t0xC5,\n\t\t0xE5\n\t]],\n\t[0xA64A, 0x1C88],\n\t[0xA64B, 0x1C88],\n\t[0xA7AE, 0x26A],\n\t[0xA7B2, 0x29D],\n\t[0xA7B3, 0xAB53],\n\t[0xA7B4, 0xA7B5],\n\t[0xA7B5, 0xA7B4],\n\t[0xA7B6, 0xA7B7],\n\t[0xA7B7, 0xA7B6],\n\t[0xA7B8, 0xA7B9],\n\t[0xA7B9, 0xA7B8],\n\t[0xAB53, 0xA7B3],\n\t[0xAB70, 0x13A0],\n\t[0xAB71, 0x13A1],\n\t[0xAB72, 0x13A2],\n\t[0xAB73, 0x13A3],\n\t[0xAB74, 0x13A4],\n\t[0xAB75, 0x13A5],\n\t[0xAB76, 0x13A6],\n\t[0xAB77, 0x13A7],\n\t[0xAB78, 0x13A8],\n\t[0xAB79, 0x13A9],\n\t[0xAB7A, 0x13AA],\n\t[0xAB7B, 0x13AB],\n\t[0xAB7C, 0x13AC],\n\t[0xAB7D, 0x13AD],\n\t[0xAB7E, 0x13AE],\n\t[0xAB7F, 0x13AF],\n\t[0xAB80, 0x13B0],\n\t[0xAB81, 0x13B1],\n\t[0xAB82, 0x13B2],\n\t[0xAB83, 0x13B3],\n\t[0xAB84, 0x13B4],\n\t[0xAB85, 0x13B5],\n\t[0xAB86, 0x13B6],\n\t[0xAB87, 0x13B7],\n\t[0xAB88, 0x13B8],\n\t[0xAB89, 0x13B9],\n\t[0xAB8A, 0x13BA],\n\t[0xAB8B, 0x13BB],\n\t[0xAB8C, 0x13BC],\n\t[0xAB8D, 0x13BD],\n\t[0xAB8E, 0x13BE],\n\t[0xAB8F, 0x13BF],\n\t[0xAB90, 0x13C0],\n\t[0xAB91, 0x13C1],\n\t[0xAB92, 0x13C2],\n\t[0xAB93, 0x13C3],\n\t[0xAB94, 0x13C4],\n\t[0xAB95, 0x13C5],\n\t[0xAB96, 0x13C6],\n\t[0xAB97, 0x13C7],\n\t[0xAB98, 0x13C8],\n\t[0xAB99, 0x13C9],\n\t[0xAB9A, 0x13CA],\n\t[0xAB9B, 0x13CB],\n\t[0xAB9C, 0x13CC],\n\t[0xAB9D, 0x13CD],\n\t[0xAB9E, 0x13CE],\n\t[0xAB9F, 0x13CF],\n\t[0xABA0, 0x13D0],\n\t[0xABA1, 0x13D1],\n\t[0xABA2, 0x13D2],\n\t[0xABA3, 0x13D3],\n\t[0xABA4, 0x13D4],\n\t[0xABA5, 0x13D5],\n\t[0xABA6, 0x13D6],\n\t[0xABA7, 0x13D7],\n\t[0xABA8, 0x13D8],\n\t[0xABA9, 0x13D9],\n\t[0xABAA, 0x13DA],\n\t[0xABAB, 0x13DB],\n\t[0xABAC, 0x13DC],\n\t[0xABAD, 0x13DD],\n\t[0xABAE, 0x13DE],\n\t[0xABAF, 0x13DF],\n\t[0xABB0, 0x13E0],\n\t[0xABB1, 0x13E1],\n\t[0xABB2, 0x13E2],\n\t[0xABB3, 0x13E3],\n\t[0xABB4, 0x13E4],\n\t[0xABB5, 0x13E5],\n\t[0xABB6, 0x13E6],\n\t[0xABB7, 0x13E7],\n\t[0xABB8, 0x13E8],\n\t[0xABB9, 0x13E9],\n\t[0xABBA, 0x13EA],\n\t[0xABBB, 0x13EB],\n\t[0xABBC, 0x13EC],\n\t[0xABBD, 0x13ED],\n\t[0xABBE, 0x13EE],\n\t[0xABBF, 0x13EF],\n\t[0x10400, 0x10428],\n\t[0x10401, 0x10429],\n\t[0x10402, 0x1042A],\n\t[0x10403, 0x1042B],\n\t[0x10404, 0x1042C],\n\t[0x10405, 0x1042D],\n\t[0x10406, 0x1042E],\n\t[0x10407, 0x1042F],\n\t[0x10408, 0x10430],\n\t[0x10409, 0x10431],\n\t[0x1040A, 0x10432],\n\t[0x1040B, 0x10433],\n\t[0x1040C, 0x10434],\n\t[0x1040D, 0x10435],\n\t[0x1040E, 0x10436],\n\t[0x1040F, 0x10437],\n\t[0x10410, 0x10438],\n\t[0x10411, 0x10439],\n\t[0x10412, 0x1043A],\n\t[0x10413, 0x1043B],\n\t[0x10414, 0x1043C],\n\t[0x10415, 0x1043D],\n\t[0x10416, 0x1043E],\n\t[0x10417, 0x1043F],\n\t[0x10418, 0x10440],\n\t[0x10419, 0x10441],\n\t[0x1041A, 0x10442],\n\t[0x1041B, 0x10443],\n\t[0x1041C, 0x10444],\n\t[0x1041D, 0x10445],\n\t[0x1041E, 0x10446],\n\t[0x1041F, 0x10447],\n\t[0x10420, 0x10448],\n\t[0x10421, 0x10449],\n\t[0x10422, 0x1044A],\n\t[0x10423, 0x1044B],\n\t[0x10424, 0x1044C],\n\t[0x10425, 0x1044D],\n\t[0x10426, 0x1044E],\n\t[0x10427, 0x1044F],\n\t[0x10428, 0x10400],\n\t[0x10429, 0x10401],\n\t[0x1042A, 0x10402],\n\t[0x1042B, 0x10403],\n\t[0x1042C, 0x10404],\n\t[0x1042D, 0x10405],\n\t[0x1042E, 0x10406],\n\t[0x1042F, 0x10407],\n\t[0x10430, 0x10408],\n\t[0x10431, 0x10409],\n\t[0x10432, 0x1040A],\n\t[0x10433, 0x1040B],\n\t[0x10434, 0x1040C],\n\t[0x10435, 0x1040D],\n\t[0x10436, 0x1040E],\n\t[0x10437, 0x1040F],\n\t[0x10438, 0x10410],\n\t[0x10439, 0x10411],\n\t[0x1043A, 0x10412],\n\t[0x1043B, 0x10413],\n\t[0x1043C, 0x10414],\n\t[0x1043D, 0x10415],\n\t[0x1043E, 0x10416],\n\t[0x1043F, 0x10417],\n\t[0x10440, 0x10418],\n\t[0x10441, 0x10419],\n\t[0x10442, 0x1041A],\n\t[0x10443, 0x1041B],\n\t[0x10444, 0x1041C],\n\t[0x10445, 0x1041D],\n\t[0x10446, 0x1041E],\n\t[0x10447, 0x1041F],\n\t[0x10448, 0x10420],\n\t[0x10449, 0x10421],\n\t[0x1044A, 0x10422],\n\t[0x1044B, 0x10423],\n\t[0x1044C, 0x10424],\n\t[0x1044D, 0x10425],\n\t[0x1044E, 0x10426],\n\t[0x1044F, 0x10427],\n\t[0x104B0, 0x104D8],\n\t[0x104B1, 0x104D9],\n\t[0x104B2, 0x104DA],\n\t[0x104B3, 0x104DB],\n\t[0x104B4, 0x104DC],\n\t[0x104B5, 0x104DD],\n\t[0x104B6, 0x104DE],\n\t[0x104B7, 0x104DF],\n\t[0x104B8, 0x104E0],\n\t[0x104B9, 0x104E1],\n\t[0x104BA, 0x104E2],\n\t[0x104BB, 0x104E3],\n\t[0x104BC, 0x104E4],\n\t[0x104BD, 0x104E5],\n\t[0x104BE, 0x104E6],\n\t[0x104BF, 0x104E7],\n\t[0x104C0, 0x104E8],\n\t[0x104C1, 0x104E9],\n\t[0x104C2, 0x104EA],\n\t[0x104C3, 0x104EB],\n\t[0x104C4, 0x104EC],\n\t[0x104C5, 0x104ED],\n\t[0x104C6, 0x104EE],\n\t[0x104C7, 0x104EF],\n\t[0x104C8, 0x104F0],\n\t[0x104C9, 0x104F1],\n\t[0x104CA, 0x104F2],\n\t[0x104CB, 0x104F3],\n\t[0x104CC, 0x104F4],\n\t[0x104CD, 0x104F5],\n\t[0x104CE, 0x104F6],\n\t[0x104CF, 0x104F7],\n\t[0x104D0, 0x104F8],\n\t[0x104D1, 0x104F9],\n\t[0x104D2, 0x104FA],\n\t[0x104D3, 0x104FB],\n\t[0x104D8, 0x104B0],\n\t[0x104D9, 0x104B1],\n\t[0x104DA, 0x104B2],\n\t[0x104DB, 0x104B3],\n\t[0x104DC, 0x104B4],\n\t[0x104DD, 0x104B5],\n\t[0x104DE, 0x104B6],\n\t[0x104DF, 0x104B7],\n\t[0x104E0, 0x104B8],\n\t[0x104E1, 0x104B9],\n\t[0x104E2, 0x104BA],\n\t[0x104E3, 0x104BB],\n\t[0x104E4, 0x104BC],\n\t[0x104E5, 0x104BD],\n\t[0x104E6, 0x104BE],\n\t[0x104E7, 0x104BF],\n\t[0x104E8, 0x104C0],\n\t[0x104E9, 0x104C1],\n\t[0x104EA, 0x104C2],\n\t[0x104EB, 0x104C3],\n\t[0x104EC, 0x104C4],\n\t[0x104ED, 0x104C5],\n\t[0x104EE, 0x104C6],\n\t[0x104EF, 0x104C7],\n\t[0x104F0, 0x104C8],\n\t[0x104F1, 0x104C9],\n\t[0x104F2, 0x104CA],\n\t[0x104F3, 0x104CB],\n\t[0x104F4, 0x104CC],\n\t[0x104F5, 0x104CD],\n\t[0x104F6, 0x104CE],\n\t[0x104F7, 0x104CF],\n\t[0x104F8, 0x104D0],\n\t[0x104F9, 0x104D1],\n\t[0x104FA, 0x104D2],\n\t[0x104FB, 0x104D3],\n\t[0x10C80, 0x10CC0],\n\t[0x10C81, 0x10CC1],\n\t[0x10C82, 0x10CC2],\n\t[0x10C83, 0x10CC3],\n\t[0x10C84, 0x10CC4],\n\t[0x10C85, 0x10CC5],\n\t[0x10C86, 0x10CC6],\n\t[0x10C87, 0x10CC7],\n\t[0x10C88, 0x10CC8],\n\t[0x10C89, 0x10CC9],\n\t[0x10C8A, 0x10CCA],\n\t[0x10C8B, 0x10CCB],\n\t[0x10C8C, 0x10CCC],\n\t[0x10C8D, 0x10CCD],\n\t[0x10C8E, 0x10CCE],\n\t[0x10C8F, 0x10CCF],\n\t[0x10C90, 0x10CD0],\n\t[0x10C91, 0x10CD1],\n\t[0x10C92, 0x10CD2],\n\t[0x10C93, 0x10CD3],\n\t[0x10C94, 0x10CD4],\n\t[0x10C95, 0x10CD5],\n\t[0x10C96, 0x10CD6],\n\t[0x10C97, 0x10CD7],\n\t[0x10C98, 0x10CD8],\n\t[0x10C99, 0x10CD9],\n\t[0x10C9A, 0x10CDA],\n\t[0x10C9B, 0x10CDB],\n\t[0x10C9C, 0x10CDC],\n\t[0x10C9D, 0x10CDD],\n\t[0x10C9E, 0x10CDE],\n\t[0x10C9F, 0x10CDF],\n\t[0x10CA0, 0x10CE0],\n\t[0x10CA1, 0x10CE1],\n\t[0x10CA2, 0x10CE2],\n\t[0x10CA3, 0x10CE3],\n\t[0x10CA4, 0x10CE4],\n\t[0x10CA5, 0x10CE5],\n\t[0x10CA6, 0x10CE6],\n\t[0x10CA7, 0x10CE7],\n\t[0x10CA8, 0x10CE8],\n\t[0x10CA9, 0x10CE9],\n\t[0x10CAA, 0x10CEA],\n\t[0x10CAB, 0x10CEB],\n\t[0x10CAC, 0x10CEC],\n\t[0x10CAD, 0x10CED],\n\t[0x10CAE, 0x10CEE],\n\t[0x10CAF, 0x10CEF],\n\t[0x10CB0, 0x10CF0],\n\t[0x10CB1, 0x10CF1],\n\t[0x10CB2, 0x10CF2],\n\t[0x10CC0, 0x10C80],\n\t[0x10CC1, 0x10C81],\n\t[0x10CC2, 0x10C82],\n\t[0x10CC3, 0x10C83],\n\t[0x10CC4, 0x10C84],\n\t[0x10CC5, 0x10C85],\n\t[0x10CC6, 0x10C86],\n\t[0x10CC7, 0x10C87],\n\t[0x10CC8, 0x10C88],\n\t[0x10CC9, 0x10C89],\n\t[0x10CCA, 0x10C8A],\n\t[0x10CCB, 0x10C8B],\n\t[0x10CCC, 0x10C8C],\n\t[0x10CCD, 0x10C8D],\n\t[0x10CCE, 0x10C8E],\n\t[0x10CCF, 0x10C8F],\n\t[0x10CD0, 0x10C90],\n\t[0x10CD1, 0x10C91],\n\t[0x10CD2, 0x10C92],\n\t[0x10CD3, 0x10C93],\n\t[0x10CD4, 0x10C94],\n\t[0x10CD5, 0x10C95],\n\t[0x10CD6, 0x10C96],\n\t[0x10CD7, 0x10C97],\n\t[0x10CD8, 0x10C98],\n\t[0x10CD9, 0x10C99],\n\t[0x10CDA, 0x10C9A],\n\t[0x10CDB, 0x10C9B],\n\t[0x10CDC, 0x10C9C],\n\t[0x10CDD, 0x10C9D],\n\t[0x10CDE, 0x10C9E],\n\t[0x10CDF, 0x10C9F],\n\t[0x10CE0, 0x10CA0],\n\t[0x10CE1, 0x10CA1],\n\t[0x10CE2, 0x10CA2],\n\t[0x10CE3, 0x10CA3],\n\t[0x10CE4, 0x10CA4],\n\t[0x10CE5, 0x10CA5],\n\t[0x10CE6, 0x10CA6],\n\t[0x10CE7, 0x10CA7],\n\t[0x10CE8, 0x10CA8],\n\t[0x10CE9, 0x10CA9],\n\t[0x10CEA, 0x10CAA],\n\t[0x10CEB, 0x10CAB],\n\t[0x10CEC, 0x10CAC],\n\t[0x10CED, 0x10CAD],\n\t[0x10CEE, 0x10CAE],\n\t[0x10CEF, 0x10CAF],\n\t[0x10CF0, 0x10CB0],\n\t[0x10CF1, 0x10CB1],\n\t[0x10CF2, 0x10CB2],\n\t[0x118A0, 0x118C0],\n\t[0x118A1, 0x118C1],\n\t[0x118A2, 0x118C2],\n\t[0x118A3, 0x118C3],\n\t[0x118A4, 0x118C4],\n\t[0x118A5, 0x118C5],\n\t[0x118A6, 0x118C6],\n\t[0x118A7, 0x118C7],\n\t[0x118A8, 0x118C8],\n\t[0x118A9, 0x118C9],\n\t[0x118AA, 0x118CA],\n\t[0x118AB, 0x118CB],\n\t[0x118AC, 0x118CC],\n\t[0x118AD, 0x118CD],\n\t[0x118AE, 0x118CE],\n\t[0x118AF, 0x118CF],\n\t[0x118B0, 0x118D0],\n\t[0x118B1, 0x118D1],\n\t[0x118B2, 0x118D2],\n\t[0x118B3, 0x118D3],\n\t[0x118B4, 0x118D4],\n\t[0x118B5, 0x118D5],\n\t[0x118B6, 0x118D6],\n\t[0x118B7, 0x118D7],\n\t[0x118B8, 0x118D8],\n\t[0x118B9, 0x118D9],\n\t[0x118BA, 0x118DA],\n\t[0x118BB, 0x118DB],\n\t[0x118BC, 0x118DC],\n\t[0x118BD, 0x118DD],\n\t[0x118BE, 0x118DE],\n\t[0x118BF, 0x118DF],\n\t[0x118C0, 0x118A0],\n\t[0x118C1, 0x118A1],\n\t[0x118C2, 0x118A2],\n\t[0x118C3, 0x118A3],\n\t[0x118C4, 0x118A4],\n\t[0x118C5, 0x118A5],\n\t[0x118C6, 0x118A6],\n\t[0x118C7, 0x118A7],\n\t[0x118C8, 0x118A8],\n\t[0x118C9, 0x118A9],\n\t[0x118CA, 0x118AA],\n\t[0x118CB, 0x118AB],\n\t[0x118CC, 0x118AC],\n\t[0x118CD, 0x118AD],\n\t[0x118CE, 0x118AE],\n\t[0x118CF, 0x118AF],\n\t[0x118D0, 0x118B0],\n\t[0x118D1, 0x118B1],\n\t[0x118D2, 0x118B2],\n\t[0x118D3, 0x118B3],\n\t[0x118D4, 0x118B4],\n\t[0x118D5, 0x118B5],\n\t[0x118D6, 0x118B6],\n\t[0x118D7, 0x118B7],\n\t[0x118D8, 0x118B8],\n\t[0x118D9, 0x118B9],\n\t[0x118DA, 0x118BA],\n\t[0x118DB, 0x118BB],\n\t[0x118DC, 0x118BC],\n\t[0x118DD, 0x118BD],\n\t[0x118DE, 0x118BE],\n\t[0x118DF, 0x118BF],\n\t[0x16E40, 0x16E60],\n\t[0x16E41, 0x16E61],\n\t[0x16E42, 0x16E62],\n\t[0x16E43, 0x16E63],\n\t[0x16E44, 0x16E64],\n\t[0x16E45, 0x16E65],\n\t[0x16E46, 0x16E66],\n\t[0x16E47, 0x16E67],\n\t[0x16E48, 0x16E68],\n\t[0x16E49, 0x16E69],\n\t[0x16E4A, 0x16E6A],\n\t[0x16E4B, 0x16E6B],\n\t[0x16E4C, 0x16E6C],\n\t[0x16E4D, 0x16E6D],\n\t[0x16E4E, 0x16E6E],\n\t[0x16E4F, 0x16E6F],\n\t[0x16E50, 0x16E70],\n\t[0x16E51, 0x16E71],\n\t[0x16E52, 0x16E72],\n\t[0x16E53, 0x16E73],\n\t[0x16E54, 0x16E74],\n\t[0x16E55, 0x16E75],\n\t[0x16E56, 0x16E76],\n\t[0x16E57, 0x16E77],\n\t[0x16E58, 0x16E78],\n\t[0x16E59, 0x16E79],\n\t[0x16E5A, 0x16E7A],\n\t[0x16E5B, 0x16E7B],\n\t[0x16E5C, 0x16E7C],\n\t[0x16E5D, 0x16E7D],\n\t[0x16E5E, 0x16E7E],\n\t[0x16E5F, 0x16E7F],\n\t[0x16E60, 0x16E40],\n\t[0x16E61, 0x16E41],\n\t[0x16E62, 0x16E42],\n\t[0x16E63, 0x16E43],\n\t[0x16E64, 0x16E44],\n\t[0x16E65, 0x16E45],\n\t[0x16E66, 0x16E46],\n\t[0x16E67, 0x16E47],\n\t[0x16E68, 0x16E48],\n\t[0x16E69, 0x16E49],\n\t[0x16E6A, 0x16E4A],\n\t[0x16E6B, 0x16E4B],\n\t[0x16E6C, 0x16E4C],\n\t[0x16E6D, 0x16E4D],\n\t[0x16E6E, 0x16E4E],\n\t[0x16E6F, 0x16E4F],\n\t[0x16E70, 0x16E50],\n\t[0x16E71, 0x16E51],\n\t[0x16E72, 0x16E52],\n\t[0x16E73, 0x16E53],\n\t[0x16E74, 0x16E54],\n\t[0x16E75, 0x16E55],\n\t[0x16E76, 0x16E56],\n\t[0x16E77, 0x16E57],\n\t[0x16E78, 0x16E58],\n\t[0x16E79, 0x16E59],\n\t[0x16E7A, 0x16E5A],\n\t[0x16E7B, 0x16E5B],\n\t[0x16E7C, 0x16E5C],\n\t[0x16E7D, 0x16E5D],\n\t[0x16E7E, 0x16E5E],\n\t[0x16E7F, 0x16E5F],\n\t[0x1E900, 0x1E922],\n\t[0x1E901, 0x1E923],\n\t[0x1E902, 0x1E924],\n\t[0x1E903, 0x1E925],\n\t[0x1E904, 0x1E926],\n\t[0x1E905, 0x1E927],\n\t[0x1E906, 0x1E928],\n\t[0x1E907, 0x1E929],\n\t[0x1E908, 0x1E92A],\n\t[0x1E909, 0x1E92B],\n\t[0x1E90A, 0x1E92C],\n\t[0x1E90B, 0x1E92D],\n\t[0x1E90C, 0x1E92E],\n\t[0x1E90D, 0x1E92F],\n\t[0x1E90E, 0x1E930],\n\t[0x1E90F, 0x1E931],\n\t[0x1E910, 0x1E932],\n\t[0x1E911, 0x1E933],\n\t[0x1E912, 0x1E934],\n\t[0x1E913, 0x1E935],\n\t[0x1E914, 0x1E936],\n\t[0x1E915, 0x1E937],\n\t[0x1E916, 0x1E938],\n\t[0x1E917, 0x1E939],\n\t[0x1E918, 0x1E93A],\n\t[0x1E919, 0x1E93B],\n\t[0x1E91A, 0x1E93C],\n\t[0x1E91B, 0x1E93D],\n\t[0x1E91C, 0x1E93E],\n\t[0x1E91D, 0x1E93F],\n\t[0x1E91E, 0x1E940],\n\t[0x1E91F, 0x1E941],\n\t[0x1E920, 0x1E942],\n\t[0x1E921, 0x1E943],\n\t[0x1E922, 0x1E900],\n\t[0x1E923, 0x1E901],\n\t[0x1E924, 0x1E902],\n\t[0x1E925, 0x1E903],\n\t[0x1E926, 0x1E904],\n\t[0x1E927, 0x1E905],\n\t[0x1E928, 0x1E906],\n\t[0x1E929, 0x1E907],\n\t[0x1E92A, 0x1E908],\n\t[0x1E92B, 0x1E909],\n\t[0x1E92C, 0x1E90A],\n\t[0x1E92D, 0x1E90B],\n\t[0x1E92E, 0x1E90C],\n\t[0x1E92F, 0x1E90D],\n\t[0x1E930, 0x1E90E],\n\t[0x1E931, 0x1E90F],\n\t[0x1E932, 0x1E910],\n\t[0x1E933, 0x1E911],\n\t[0x1E934, 0x1E912],\n\t[0x1E935, 0x1E913],\n\t[0x1E936, 0x1E914],\n\t[0x1E937, 0x1E915],\n\t[0x1E938, 0x1E916],\n\t[0x1E939, 0x1E917],\n\t[0x1E93A, 0x1E918],\n\t[0x1E93B, 0x1E919],\n\t[0x1E93C, 0x1E91A],\n\t[0x1E93D, 0x1E91B],\n\t[0x1E93E, 0x1E91C],\n\t[0x1E93F, 0x1E91D],\n\t[0x1E940, 0x1E91E],\n\t[0x1E941, 0x1E91F],\n\t[0x1E942, 0x1E920],\n\t[0x1E943, 0x1E921]\n]);\n","'use strict';\n\nconst generate = require('regjsgen').generate;\nconst parse = require('regjsparser').parse;\nconst regenerate = require('regenerate');\nconst unicodeMatchProperty = require('unicode-match-property-ecmascript');\nconst unicodeMatchPropertyValue = require('unicode-match-property-value-ecmascript');\nconst iuMappings = require('./data/iu-mappings.js');\nconst ESCAPE_SETS = require('./data/character-class-escape-sets.js');\n\n// Prepare a Regenerate set containing all code points, used for negative\n// character classes (if any).\nconst UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF);\n// Without the `u` flag, the range stops at 0xFFFF.\n// https://mths.be/es6#sec-pattern-semantics\nconst BMP_SET = regenerate().addRange(0x0, 0xFFFF);\n\n// Prepare a Regenerate set containing all code points that are supposed to be\n// matched by `/./u`. https://mths.be/es6#sec-atom\nconst DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points\n\t.remove(\n\t\t// minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators):\n\t\t0x000A, // Line Feed \n\t\t0x000D, // Carriage Return \n\t\t0x2028, // Line Separator \n\t\t0x2029 // Paragraph Separator \n\t);\n// Prepare a Regenerate set containing all code points that are supposed to be\n// matched by `/./` (only BMP code points).\nconst DOT_SET = DOT_SET_UNICODE.clone()\n\t.intersection(BMP_SET);\n\nconst getCharacterClassEscapeSet = (character, unicode, ignoreCase) => {\n\tif (unicode) {\n\t\tif (ignoreCase) {\n\t\t\treturn ESCAPE_SETS.UNICODE_IGNORE_CASE.get(character);\n\t\t}\n\t\treturn ESCAPE_SETS.UNICODE.get(character);\n\t}\n\treturn ESCAPE_SETS.REGULAR.get(character);\n};\n\nconst getDotSet = (unicode, dotAll) => {\n\tif (dotAll) {\n\t\treturn unicode ? UNICODE_SET : BMP_SET;\n\t}\n\treturn unicode ? DOT_SET_UNICODE : DOT_SET;\n};\n\nconst getUnicodePropertyValueSet = (property, value) => {\n\tconst path = value ?\n\t\t`${ property }/${ value }` :\n\t\t`Binary_Property/${ property }`;\n\ttry {\n\t\treturn require(`regenerate-unicode-properties/${ path }.js`);\n\t} catch (exception) {\n\t\tthrow new Error(\n\t\t\t`Failed to recognize value \\`${ value }\\` for property ` +\n\t\t\t`\\`${ property }\\`.`\n\t\t);\n\t}\n};\n\nconst handleLoneUnicodePropertyNameOrValue = (value) => {\n\t// It could be a `General_Category` value or a binary property.\n\t// Note: `unicodeMatchPropertyValue` throws on invalid values.\n\ttry {\n\t\tconst property = 'General_Category';\n\t\tconst category = unicodeMatchPropertyValue(property, value);\n\t\treturn getUnicodePropertyValueSet(property, category);\n\t} catch (exception) {}\n\t// It’s not a `General_Category` value, so check if it’s a binary\n\t// property. Note: `unicodeMatchProperty` throws on invalid properties.\n\tconst property = unicodeMatchProperty(value);\n\treturn getUnicodePropertyValueSet(property);\n};\n\nconst getUnicodePropertyEscapeSet = (value, isNegative) => {\n\tconst parts = value.split('=');\n\tconst firstPart = parts[0];\n\tlet set;\n\tif (parts.length == 1) {\n\t\tset = handleLoneUnicodePropertyNameOrValue(firstPart);\n\t} else {\n\t\t// The pattern consists of two parts, i.e. `Property=Value`.\n\t\tconst property = unicodeMatchProperty(firstPart);\n\t\tconst value = unicodeMatchPropertyValue(property, parts[1]);\n\t\tset = getUnicodePropertyValueSet(property, value);\n\t}\n\tif (isNegative) {\n\t\treturn UNICODE_SET.clone().remove(set);\n\t}\n\treturn set.clone();\n};\n\n// Given a range of code points, add any case-folded code points in that range\n// to a set.\nregenerate.prototype.iuAddRange = function(min, max) {\n\tconst $this = this;\n\tdo {\n\t\tconst folded = caseFold(min);\n\t\tif (folded) {\n\t\t\t$this.add(folded);\n\t\t}\n\t} while (++min <= max);\n\treturn $this;\n};\n\nconst update = (item, pattern) => {\n\tlet tree = parse(pattern, config.useUnicodeFlag ? 'u' : '');\n\tswitch (tree.type) {\n\t\tcase 'characterClass':\n\t\tcase 'group':\n\t\tcase 'value':\n\t\t\t// No wrapping needed.\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Wrap the pattern in a non-capturing group.\n\t\t\ttree = wrap(tree, pattern);\n\t}\n\tObject.assign(item, tree);\n};\n\nconst wrap = (tree, pattern) => {\n\t// Wrap the pattern in a non-capturing group.\n\treturn {\n\t\t'type': 'group',\n\t\t'behavior': 'ignore',\n\t\t'body': [tree],\n\t\t'raw': `(?:${ pattern })`\n\t};\n};\n\nconst caseFold = (codePoint) => {\n\treturn iuMappings.get(codePoint) || false;\n};\n\nconst processCharacterClass = (characterClassItem, regenerateOptions) => {\n\tlet set = regenerate();\n\tfor (const item of characterClassItem.body) {\n\t\tswitch (item.type) {\n\t\t\tcase 'value':\n\t\t\t\tset.add(item.codePoint);\n\t\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\t\tconst folded = caseFold(item.codePoint);\n\t\t\t\t\tif (folded) {\n\t\t\t\t\t\tset.add(folded);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'characterClassRange':\n\t\t\t\tconst min = item.min.codePoint;\n\t\t\t\tconst max = item.max.codePoint;\n\t\t\t\tset.addRange(min, max);\n\t\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\t\tset.iuAddRange(min, max);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'characterClassEscape':\n\t\t\t\tset.add(getCharacterClassEscapeSet(\n\t\t\t\t\titem.value,\n\t\t\t\t\tconfig.unicode,\n\t\t\t\t\tconfig.ignoreCase\n\t\t\t\t));\n\t\t\t\tbreak;\n\t\t\tcase 'unicodePropertyEscape':\n\t\t\t\tset.add(getUnicodePropertyEscapeSet(item.value, item.negative));\n\t\t\t\tbreak;\n\t\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t\t// reached. Code coverage tools should ignore it.\n\t\t\t/* istanbul ignore next */\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown term type: ${ item.type }`);\n\t\t}\n\t}\n\tif (characterClassItem.negative) {\n\t\tset = (config.unicode ? UNICODE_SET : BMP_SET).clone().remove(set);\n\t}\n\tupdate(characterClassItem, set.toString(regenerateOptions));\n\treturn characterClassItem;\n};\n\nconst updateNamedReference = (item, index) => {\n\tdelete item.name;\n\titem.matchIndex = index;\n};\n\nconst assertNoUnmatchedReferences = (groups) => {\n\tconst unmatchedReferencesNames = Object.keys(groups.unmatchedReferences);\n\tif (unmatchedReferencesNames.length > 0) {\n\t\tthrow new Error(`Unknown group names: ${unmatchedReferencesNames}`);\n\t}\n};\n\nconst processTerm = (item, regenerateOptions, groups) => {\n\tswitch (item.type) {\n\t\tcase 'dot':\n\t\t\tupdate(\n\t\t\t\titem,\n\t\t\t\tgetDotSet(config.unicode, config.dotAll).toString(regenerateOptions)\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'characterClass':\n\t\t\titem = processCharacterClass(item, regenerateOptions);\n\t\t\tbreak;\n\t\tcase 'unicodePropertyEscape':\n\t\t\tupdate(\n\t\t\t\titem,\n\t\t\t\tgetUnicodePropertyEscapeSet(item.value, item.negative)\n\t\t\t\t\t.toString(regenerateOptions)\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'characterClassEscape':\n\t\t\tupdate(\n\t\t\t\titem,\n\t\t\t\tgetCharacterClassEscapeSet(\n\t\t\t\t\titem.value,\n\t\t\t\t\tconfig.unicode,\n\t\t\t\t\tconfig.ignoreCase\n\t\t\t\t).toString(regenerateOptions)\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'group':\n\t\t\tgroups.lastIndex++;\n\t\t\tif (item.name) {\n\t\t\t\tconst name = item.name.value;\n\n\t\t\t\tif (groups.names[name]) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Multiple groups with the same name (${ name }) are not allowed.`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst index = groups.lastIndex;\n\t\t\t\tdelete item.name;\n\n\t\t\t\tgroups.names[name] = index;\n\t\t\t\tif (groups.onNamedGroup) {\n\t\t\t\t\tgroups.onNamedGroup.call(null, name, index);\n\t\t\t\t}\n\n\t\t\t\tif (groups.unmatchedReferences[name]) {\n\t\t\t\t\tgroups.unmatchedReferences[name].forEach(reference => {\n\t\t\t\t\t\tupdateNamedReference(reference, index);\n\t\t\t\t\t});\n\t\t\t\t\tdelete groups.unmatchedReferences[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* falls through */\n\t\tcase 'alternative':\n\t\tcase 'disjunction':\n\t\tcase 'quantifier':\n\t\t\titem.body = item.body.map(term => {\n\t\t\t\treturn processTerm(term, regenerateOptions, groups);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'value':\n\t\t\tconst codePoint = item.codePoint;\n\t\t\tconst set = regenerate(codePoint);\n\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\tconst folded = caseFold(codePoint);\n\t\t\t\tif (folded) {\n\t\t\t\t\tset.add(folded);\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdate(item, set.toString(regenerateOptions));\n\t\t\tbreak;\n\t\tcase 'reference':\n\t\t\tif (item.name) {\n\t\t\t\tconst name = item.name.value;\n\t\t\t\tconst index = groups.names[name];\n\t\t\t\tif (index) {\n\t\t\t\t\tupdateNamedReference(item, index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!groups.unmatchedReferences[name]) {\n\t\t\t\t\tgroups.unmatchedReferences[name] = [];\n\t\t\t\t}\n\t\t\t\t// Keep track of references used before the corresponding group.\n\t\t\t\tgroups.unmatchedReferences[name].push(item);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'anchor':\n\t\tcase 'empty':\n\t\tcase 'group':\n\t\t\t// Nothing to do here.\n\t\t\tbreak;\n\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t// reached. Code coverage tools should ignore it.\n\t\t/* istanbul ignore next */\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown term type: ${ item.type }`);\n\t}\n\treturn item;\n};\n\nconst config = {\n\t'ignoreCase': false,\n\t'unicode': false,\n\t'dotAll': false,\n\t'useUnicodeFlag': false\n};\nconst rewritePattern = (pattern, flags, options) => {\n\tconst regjsparserFeatures = {\n\t\t'unicodePropertyEscape': options && options.unicodePropertyEscape,\n\t\t'namedGroups': options && options.namedGroup,\n\t\t'lookbehind': options && options.lookbehind\n\t};\n\tconfig.ignoreCase = flags && flags.includes('i');\n\tconfig.unicode = flags && flags.includes('u');\n\tconst supportDotAllFlag = options && options.dotAllFlag;\n\tconfig.dotAll = supportDotAllFlag && flags && flags.includes('s');\n\tconfig.useUnicodeFlag = options && options.useUnicodeFlag;\n\tconst regenerateOptions = {\n\t\t'hasUnicodeFlag': config.useUnicodeFlag,\n\t\t'bmpOnly': !config.unicode\n\t};\n\tconst groups = {\n\t\t'onNamedGroup': options && options.onNamedGroup,\n\t\t'lastIndex': 0,\n\t\t'names': Object.create(null), // { [name]: index }\n\t\t'unmatchedReferences': Object.create(null) // { [name]: Array }\n\t};\n\tconst tree = parse(pattern, flags, regjsparserFeatures);\n\t// Note: `processTerm` mutates `tree` and `groups`.\n\tprocessTerm(tree, regenerateOptions, groups);\n\tassertNoUnmatchedReferences(groups);\n\treturn generate(tree);\n};\n\nmodule.exports = rewritePattern;\n","/*!\n * regjsgen 0.5.0\n * Copyright 2014-2018 Benjamin Tan \n * Available under MIT license \n */\n;(function() {\n 'use strict';\n\n // Used to determine if values are of the language type `Object`.\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n // Used as a reference to the global object.\n var root = (objectTypes[typeof window] && window) || this;\n\n // Detect free variable `exports`.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Detect free variable `module`.\n var hasFreeModule = objectTypes[typeof module] && module && !module.nodeType;\n\n // Detect free variable `global` from Node.js or Browserified code and use it as `root`.\n var freeGlobal = freeExports && hasFreeModule && typeof global == 'object' && global;\n if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Used to check objects for own properties.\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n /*--------------------------------------------------------------------------*/\n\n // Generates a string based on the given code point.\n // Based on https://mths.be/fromcodepoint by @mathias.\n function fromCodePoint() {\n var codePoint = Number(arguments[0]);\n\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xFFFF) {\n // BMP code point\n return String.fromCharCode(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n var highSurrogate = (codePoint >> 10) + 0xD800;\n var lowSurrogate = (codePoint % 0x400) + 0xDC00;\n return String.fromCharCode(highSurrogate, lowSurrogate);\n }\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Ensures that nodes have the correct types.\n var assertTypeRegexMap = {};\n function assertType(type, expected) {\n if (expected.indexOf('|') == -1) {\n if (type == expected) {\n return;\n }\n\n throw Error('Invalid node type: ' + type + '; expected type: ' + expected);\n }\n\n expected = hasOwnProperty.call(assertTypeRegexMap, expected)\n ? assertTypeRegexMap[expected]\n : (assertTypeRegexMap[expected] = RegExp('^(?:' + expected + ')$'));\n\n if (expected.test(type)) {\n return;\n }\n\n throw Error('Invalid node type: ' + type + '; expected types: ' + expected);\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Generates a regular expression string based on an AST.\n function generate(node) {\n var type = node.type;\n\n if (hasOwnProperty.call(generators, type)) {\n return generators[type](node);\n }\n\n throw Error('Invalid node type: ' + type);\n }\n\n /*--------------------------------------------------------------------------*/\n\n function generateAlternative(node) {\n assertType(node.type, 'alternative');\n\n var terms = node.body,\n i = -1,\n length = terms.length,\n result = '';\n\n while (++i < length) {\n result += generateTerm(terms[i]);\n }\n\n return result;\n }\n\n function generateAnchor(node) {\n assertType(node.type, 'anchor');\n\n switch (node.kind) {\n case 'start':\n return '^';\n case 'end':\n return '$';\n case 'boundary':\n return '\\\\b';\n case 'not-boundary':\n return '\\\\B';\n default:\n throw Error('Invalid assertion');\n }\n }\n\n function generateAtom(node) {\n assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value');\n\n return generate(node);\n }\n\n function generateCharacterClass(node) {\n assertType(node.type, 'characterClass');\n\n var classRanges = node.body,\n i = -1,\n length = classRanges.length,\n result = '';\n\n if (node.negative) {\n result += '^';\n }\n\n while (++i < length) {\n result += generateClassAtom(classRanges[i]);\n }\n\n return '[' + result + ']';\n }\n\n function generateCharacterClassEscape(node) {\n assertType(node.type, 'characterClassEscape');\n\n return '\\\\' + node.value;\n }\n\n function generateUnicodePropertyEscape(node) {\n assertType(node.type, 'unicodePropertyEscape');\n\n return '\\\\' + (node.negative ? 'P' : 'p') + '{' + node.value + '}';\n }\n\n function generateCharacterClassRange(node) {\n assertType(node.type, 'characterClassRange');\n\n var min = node.min,\n max = node.max;\n\n if (min.type == 'characterClassRange' || max.type == 'characterClassRange') {\n throw Error('Invalid character class range');\n }\n\n return generateClassAtom(min) + '-' + generateClassAtom(max);\n }\n\n function generateClassAtom(node) {\n assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value');\n\n return generate(node);\n }\n\n function generateDisjunction(node) {\n assertType(node.type, 'disjunction');\n\n var body = node.body,\n i = -1,\n length = body.length,\n result = '';\n\n while (++i < length) {\n if (i != 0) {\n result += '|';\n }\n result += generate(body[i]);\n }\n\n return result;\n }\n\n function generateDot(node) {\n assertType(node.type, 'dot');\n\n return '.';\n }\n\n function generateGroup(node) {\n assertType(node.type, 'group');\n\n var result = '';\n\n switch (node.behavior) {\n case 'normal':\n if (node.name) {\n result += '?<' + generateIdentifier(node.name) + '>';\n }\n break;\n case 'ignore':\n result += '?:';\n break;\n case 'lookahead':\n result += '?=';\n break;\n case 'negativeLookahead':\n result += '?!';\n break;\n case 'lookbehind':\n result += '?<=';\n break;\n case 'negativeLookbehind':\n result += '?';\n }\n\n throw new Error('Unknown reference type');\n }\n\n function generateTerm(node) {\n assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|unicodePropertyEscape|value');\n\n return generate(node);\n }\n\n function generateValue(node) {\n assertType(node.type, 'value');\n\n var kind = node.kind,\n codePoint = node.codePoint;\n\n if (typeof codePoint != 'number') {\n throw new Error('Invalid code point: ' + codePoint);\n }\n\n switch (kind) {\n case 'controlLetter':\n return '\\\\c' + fromCodePoint(codePoint + 64);\n case 'hexadecimalEscape':\n return '\\\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2);\n case 'identifier':\n return '\\\\' + fromCodePoint(codePoint);\n case 'null':\n return '\\\\' + codePoint;\n case 'octal':\n return '\\\\' + codePoint.toString(8);\n case 'singleEscape':\n switch (codePoint) {\n case 0x0008:\n return '\\\\b';\n case 0x0009:\n return '\\\\t';\n case 0x000A:\n return '\\\\n';\n case 0x000B:\n return '\\\\v';\n case 0x000C:\n return '\\\\f';\n case 0x000D:\n return '\\\\r';\n default:\n throw Error('Invalid code point: ' + codePoint);\n }\n case 'symbol':\n return fromCodePoint(codePoint);\n case 'unicodeEscape':\n return '\\\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4);\n case 'unicodeCodePointEscape':\n return '\\\\u{' + codePoint.toString(16).toUpperCase() + '}';\n default:\n throw Error('Unsupported node kind: ' + kind);\n }\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Used to generate strings for each node type.\n var generators = {\n 'alternative': generateAlternative,\n 'anchor': generateAnchor,\n 'characterClass': generateCharacterClass,\n 'characterClassEscape': generateCharacterClassEscape,\n 'characterClassRange': generateCharacterClassRange,\n 'unicodePropertyEscape': generateUnicodePropertyEscape,\n 'disjunction': generateDisjunction,\n 'dot': generateDot,\n 'group': generateGroup,\n 'quantifier': generateQuantifier,\n 'reference': generateReference,\n 'value': generateValue\n };\n\n /*--------------------------------------------------------------------------*/\n\n // Export regjsgen.\n var regjsgen = {\n 'generate': generate\n };\n\n // Some AMD build optimizers, like r.js, check for condition patterns like the following:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Define as an anonymous module so it can be aliased through path mapping.\n define(function() {\n return regjsgen;\n });\n\n root.regjsgen = regjsgen;\n }\n // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\n else if (freeExports && hasFreeModule) {\n // Export for CommonJS support.\n freeExports.generate = generate;\n }\n else {\n // Export to the global object.\n root.regjsgen = regjsgen;\n }\n}.call(this));\n","// regjsparser\n//\n// ==================================================================\n//\n// See ECMA-262 Standard: 15.10.1\n//\n// NOTE: The ECMA-262 standard uses the term \"Assertion\" for /^/. Here the\n// term \"Anchor\" is used.\n//\n// Pattern ::\n// Disjunction\n//\n// Disjunction ::\n// Alternative\n// Alternative | Disjunction\n//\n// Alternative ::\n// [empty]\n// Alternative Term\n//\n// Term ::\n// Anchor\n// Atom\n// Atom Quantifier\n//\n// Anchor ::\n// ^\n// $\n// \\ b\n// \\ B\n// ( ? = Disjunction )\n// ( ? ! Disjunction )\n// ( ? < = Disjunction )\n// ( ? < ! Disjunction )\n//\n// Quantifier ::\n// QuantifierPrefix\n// QuantifierPrefix ?\n//\n// QuantifierPrefix ::\n// *\n// +\n// ?\n// { DecimalDigits }\n// { DecimalDigits , }\n// { DecimalDigits , DecimalDigits }\n//\n// Atom ::\n// PatternCharacter\n// .\n// \\ AtomEscape\n// CharacterClass\n// ( GroupSpecifier Disjunction )\n// ( ? : Disjunction )\n//\n// PatternCharacter ::\n// SourceCharacter but not any of: ^ $ \\ . * + ? ( ) [ ] { } |\n//\n// AtomEscape ::\n// DecimalEscape\n// CharacterEscape\n// CharacterClassEscape\n// k GroupName\n//\n// CharacterEscape[U] ::\n// ControlEscape\n// c ControlLetter\n// HexEscapeSequence\n// RegExpUnicodeEscapeSequence[?U] (ES6)\n// IdentityEscape[?U]\n//\n// ControlEscape ::\n// one of f n r t v\n// ControlLetter ::\n// one of\n// a b c d e f g h i j k l m n o p q r s t u v w x y z\n// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\n//\n// IdentityEscape ::\n// SourceCharacter but not c\n//\n// DecimalEscape ::\n// DecimalIntegerLiteral [lookahead ∉ DecimalDigit]\n//\n// CharacterClassEscape ::\n// one of d D s S w W\n//\n// CharacterClass ::\n// [ [lookahead ∉ {^}] ClassRanges ]\n// [ ^ ClassRanges ]\n//\n// ClassRanges ::\n// [empty]\n// NonemptyClassRanges\n//\n// NonemptyClassRanges ::\n// ClassAtom\n// ClassAtom NonemptyClassRangesNoDash\n// ClassAtom - ClassAtom ClassRanges\n//\n// NonemptyClassRangesNoDash ::\n// ClassAtom\n// ClassAtomNoDash NonemptyClassRangesNoDash\n// ClassAtomNoDash - ClassAtom ClassRanges\n//\n// ClassAtom ::\n// -\n// ClassAtomNoDash\n//\n// ClassAtomNoDash ::\n// SourceCharacter but not one of \\ or ] or -\n// \\ ClassEscape\n//\n// ClassEscape ::\n// DecimalEscape\n// b\n// CharacterEscape\n// CharacterClassEscape\n//\n// GroupSpecifier ::\n// [empty]\n// ? GroupName\n//\n// GroupName ::\n// < RegExpIdentifierName >\n//\n// RegExpIdentifierName ::\n// RegExpIdentifierStart\n// RegExpIdentifierName RegExpIdentifierContinue\n//\n// RegExpIdentifierStart ::\n// UnicodeIDStart\n// $\n// _\n// \\ RegExpUnicodeEscapeSequence\n//\n// RegExpIdentifierContinue ::\n// UnicodeIDContinue\n// $\n// _\n// \\ RegExpUnicodeEscapeSequence\n// \n// \n\n(function() {\n\n var fromCodePoint = String.fromCodePoint || (function() {\n // Implementation taken from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint\n\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n\n return function fromCodePoint() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return '';\n }\n var result = '';\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n if (codePoint <= 0xFFFF) { // BMP code point\n codeUnits.push(codePoint);\n } else { // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xD800;\n lowSurrogate = (codePoint % 0x400) + 0xDC00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n }());\n\n function parse(str, flags, features) {\n if (!features) {\n features = {};\n }\n function addRaw(node) {\n node.raw = str.substring(node.range[0], node.range[1]);\n return node;\n }\n\n function updateRawStart(node, start) {\n node.range[0] = start;\n return addRaw(node);\n }\n\n function createAnchor(kind, rawLength) {\n return addRaw({\n type: 'anchor',\n kind: kind,\n range: [\n pos - rawLength,\n pos\n ]\n });\n }\n\n function createValue(kind, codePoint, from, to) {\n return addRaw({\n type: 'value',\n kind: kind,\n codePoint: codePoint,\n range: [from, to]\n });\n }\n\n function createEscaped(kind, codePoint, value, fromOffset) {\n fromOffset = fromOffset || 0;\n return createValue(kind, codePoint, pos - (value.length + fromOffset), pos);\n }\n\n function createCharacter(matches) {\n var _char = matches[0];\n var first = _char.charCodeAt(0);\n if (hasUnicodeFlag) {\n var second;\n if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) {\n second = lookahead().charCodeAt(0);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n pos++;\n return createValue(\n 'symbol',\n (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000,\n pos - 2, pos);\n }\n }\n }\n return createValue('symbol', first, pos - 1, pos);\n }\n\n function createDisjunction(alternatives, from, to) {\n return addRaw({\n type: 'disjunction',\n body: alternatives,\n range: [\n from,\n to\n ]\n });\n }\n\n function createDot() {\n return addRaw({\n type: 'dot',\n range: [\n pos - 1,\n pos\n ]\n });\n }\n\n function createCharacterClassEscape(value) {\n return addRaw({\n type: 'characterClassEscape',\n value: value,\n range: [\n pos - 2,\n pos\n ]\n });\n }\n\n function createReference(matchIndex) {\n return addRaw({\n type: 'reference',\n matchIndex: parseInt(matchIndex, 10),\n range: [\n pos - 1 - matchIndex.length,\n pos\n ]\n });\n }\n\n function createNamedReference(name) {\n return addRaw({\n type: 'reference',\n name: name,\n range: [\n name.range[0] - 3,\n pos\n ]\n });\n }\n\n function createGroup(behavior, disjunction, from, to) {\n return addRaw({\n type: 'group',\n behavior: behavior,\n body: disjunction,\n range: [\n from,\n to\n ]\n });\n }\n\n function createQuantifier(min, max, from, to) {\n if (to == null) {\n from = pos - 1;\n to = pos;\n }\n\n return addRaw({\n type: 'quantifier',\n min: min,\n max: max,\n greedy: true,\n body: null, // set later on\n range: [\n from,\n to\n ]\n });\n }\n\n function createAlternative(terms, from, to) {\n return addRaw({\n type: 'alternative',\n body: terms,\n range: [\n from,\n to\n ]\n });\n }\n\n function createCharacterClass(classRanges, negative, from, to) {\n return addRaw({\n type: 'characterClass',\n body: classRanges,\n negative: negative,\n range: [\n from,\n to\n ]\n });\n }\n\n function createClassRange(min, max, from, to) {\n // See 15.10.2.15:\n if (min.codePoint > max.codePoint) {\n bail('invalid range in character class', min.raw + '-' + max.raw, from, to);\n }\n\n return addRaw({\n type: 'characterClassRange',\n min: min,\n max: max,\n range: [\n from,\n to\n ]\n });\n }\n\n function flattenBody(body) {\n if (body.type === 'alternative') {\n return body.body;\n } else {\n return [body];\n }\n }\n\n function isEmpty(obj) {\n return obj.type === 'empty';\n }\n\n function incr(amount) {\n amount = (amount || 1);\n var res = str.substring(pos, pos + amount);\n pos += (amount || 1);\n return res;\n }\n\n function skip(value) {\n if (!match(value)) {\n bail('character', value);\n }\n }\n\n function match(value) {\n if (str.indexOf(value, pos) === pos) {\n return incr(value.length);\n }\n }\n\n function lookahead() {\n return str[pos];\n }\n\n function current(value) {\n return str.indexOf(value, pos) === pos;\n }\n\n function next(value) {\n return str[pos + 1] === value;\n }\n\n function matchReg(regExp) {\n var subStr = str.substring(pos);\n var res = subStr.match(regExp);\n if (res) {\n res.range = [];\n res.range[0] = pos;\n incr(res[0].length);\n res.range[1] = pos;\n }\n return res;\n }\n\n function parseDisjunction() {\n // Disjunction ::\n // Alternative\n // Alternative | Disjunction\n var res = [], from = pos;\n res.push(parseAlternative());\n\n while (match('|')) {\n res.push(parseAlternative());\n }\n\n if (res.length === 1) {\n return res[0];\n }\n\n return createDisjunction(res, from, pos);\n }\n\n function parseAlternative() {\n var res = [], from = pos;\n var term;\n\n // Alternative ::\n // [empty]\n // Alternative Term\n while (term = parseTerm()) {\n res.push(term);\n }\n\n if (res.length === 1) {\n return res[0];\n }\n\n return createAlternative(res, from, pos);\n }\n\n function parseTerm() {\n // Term ::\n // Anchor\n // Atom\n // Atom Quantifier\n\n if (pos >= str.length || current('|') || current(')')) {\n return null; /* Means: The term is empty */\n }\n\n var anchor = parseAnchor();\n\n if (anchor) {\n return anchor;\n }\n\n var atom = parseAtom();\n if (!atom) {\n bail('Expected atom');\n }\n var quantifier = parseQuantifier() || false;\n if (quantifier) {\n quantifier.body = flattenBody(atom);\n // The quantifier contains the atom. Therefore, the beginning of the\n // quantifier range is given by the beginning of the atom.\n updateRawStart(quantifier, atom.range[0]);\n return quantifier;\n }\n return atom;\n }\n\n function parseGroup(matchA, typeA, matchB, typeB) {\n var type = null, from = pos;\n\n if (match(matchA)) {\n type = typeA;\n } else if (match(matchB)) {\n type = typeB;\n } else {\n return false;\n }\n\n return finishGroup(type, from);\n }\n\n function finishGroup(type, from) {\n var body = parseDisjunction();\n if (!body) {\n bail('Expected disjunction');\n }\n skip(')');\n var group = createGroup(type, flattenBody(body), from, pos);\n\n if (type == 'normal') {\n // Keep track of the number of closed groups. This is required for\n // parseDecimalEscape(). In case the string is parsed a second time the\n // value already holds the total count and no incrementation is required.\n if (firstIteration) {\n closedCaptureCounter++;\n }\n }\n return group;\n }\n\n function parseAnchor() {\n // Anchor ::\n // ^\n // $\n // \\ b\n // \\ B\n // ( ? = Disjunction )\n // ( ? ! Disjunction )\n var res, from = pos;\n\n if (match('^')) {\n return createAnchor('start', 1 /* rawLength */);\n } else if (match('$')) {\n return createAnchor('end', 1 /* rawLength */);\n } else if (match('\\\\b')) {\n return createAnchor('boundary', 2 /* rawLength */);\n } else if (match('\\\\B')) {\n return createAnchor('not-boundary', 2 /* rawLength */);\n } else {\n return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead');\n }\n }\n\n function parseQuantifier() {\n // Quantifier ::\n // QuantifierPrefix\n // QuantifierPrefix ?\n //\n // QuantifierPrefix ::\n // *\n // +\n // ?\n // { DecimalDigits }\n // { DecimalDigits , }\n // { DecimalDigits , DecimalDigits }\n\n var res, from = pos;\n var quantifier;\n var min, max;\n\n if (match('*')) {\n quantifier = createQuantifier(0);\n }\n else if (match('+')) {\n quantifier = createQuantifier(1);\n }\n else if (match('?')) {\n quantifier = createQuantifier(0, 1);\n }\n else if (res = matchReg(/^\\{([0-9]+)\\}/)) {\n min = parseInt(res[1], 10);\n quantifier = createQuantifier(min, min, res.range[0], res.range[1]);\n }\n else if (res = matchReg(/^\\{([0-9]+),\\}/)) {\n min = parseInt(res[1], 10);\n quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]);\n }\n else if (res = matchReg(/^\\{([0-9]+),([0-9]+)\\}/)) {\n min = parseInt(res[1], 10);\n max = parseInt(res[2], 10);\n if (min > max) {\n bail('numbers out of order in {} quantifier', '', from, pos);\n }\n quantifier = createQuantifier(min, max, res.range[0], res.range[1]);\n }\n\n if (quantifier) {\n if (match('?')) {\n quantifier.greedy = false;\n quantifier.range[1] += 1;\n }\n }\n\n return quantifier;\n }\n\n function parseAtom() {\n // Atom ::\n // PatternCharacter\n // .\n // \\ AtomEscape\n // CharacterClass\n // ( GroupSpecifier Disjunction )\n // ( ? : Disjunction )\n\n var res;\n\n // jviereck: allow ']', '}' here as well to be compatible with browser's\n // implementations: ']'.match(/]/);\n // if (res = matchReg(/^[^^$\\\\.*+?()[\\]{}|]/)) {\n if (res = matchReg(/^[^^$\\\\.*+?(){[|]/)) {\n // PatternCharacter\n return createCharacter(res);\n }\n else if (match('.')) {\n // .\n return createDot();\n }\n else if (match('\\\\')) {\n // \\ AtomEscape\n res = parseAtomEscape();\n if (!res) {\n if (!hasUnicodeFlag && lookahead() == 'c') {\n // B.1.4 ExtendedAtom\n // \\[lookahead = c]\n return createValue('symbol', 92, pos - 1, pos);\n }\n bail('atomEscape');\n }\n return res;\n }\n else if (res = parseCharacterClass()) {\n return res;\n }\n else if (features.lookbehind && (res = parseGroup('(?<=', 'lookbehind', '(?\");\n var group = finishGroup(\"normal\", name.range[0] - 3);\n group.name = name;\n return group;\n }\n else {\n // ( Disjunction )\n // ( ? : Disjunction )\n return parseGroup('(?:', 'ignore', '(', 'normal');\n }\n }\n\n function parseUnicodeSurrogatePairEscape(firstEscape) {\n if (hasUnicodeFlag) {\n var first, second;\n if (firstEscape.kind == 'unicodeEscape' &&\n (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF &&\n current('\\\\') && next('u') ) {\n var prevPos = pos;\n pos++;\n var secondEscape = parseClassEscape();\n if (secondEscape.kind == 'unicodeEscape' &&\n (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n firstEscape.range[1] = secondEscape.range[1];\n firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n firstEscape.type = 'value';\n firstEscape.kind = 'unicodeCodePointEscape';\n addRaw(firstEscape);\n }\n else {\n pos = prevPos;\n }\n }\n }\n return firstEscape;\n }\n\n function parseClassEscape() {\n return parseAtomEscape(true);\n }\n\n function parseAtomEscape(insideCharacterClass) {\n // AtomEscape ::\n // DecimalEscape\n // CharacterEscape\n // CharacterClassEscape\n // k GroupName\n\n var res, from = pos;\n\n res = parseDecimalEscape() || parseNamedReference();\n if (res) {\n return res;\n }\n\n // For ClassEscape\n if (insideCharacterClass) {\n if (match('b')) {\n // 15.10.2.19\n // The production ClassEscape :: b evaluates by returning the\n // CharSet containing the one character (Unicode value 0008).\n return createEscaped('singleEscape', 0x0008, '\\\\b');\n } else if (match('B')) {\n bail('\\\\B not possible inside of CharacterClass', '', from);\n } else if (!hasUnicodeFlag && (res = matchReg(/^c([0-9])/))) {\n // B.1.4\n // c ClassControlLetter\n return createEscaped('controlLetter', res[1] + 16, res[1], 2);\n }\n }\n\n res = parseCharacterEscape();\n\n return res;\n }\n\n\n function parseDecimalEscape() {\n // DecimalEscape ::\n // DecimalIntegerLiteral [lookahead ∉ DecimalDigit]\n // CharacterClassEscape :: one of d D s S w W\n\n var res, match;\n\n if (res = matchReg(/^(?!0)\\d+/)) {\n match = res[0];\n var refIdx = parseInt(res[0], 10);\n if (refIdx <= closedCaptureCounter) {\n // If the number is smaller than the normal-groups found so\n // far, then it is a reference...\n return createReference(res[0]);\n } else {\n // ... otherwise it needs to be interpreted as a octal (if the\n // number is in an octal format). If it is NOT octal format,\n // then the slash is ignored and the number is matched later\n // as normal characters.\n\n // Recall the negative decision to decide if the input must be parsed\n // a second time with the total normal-groups.\n backrefDenied.push(refIdx);\n\n // Reset the position again, as maybe only parts of the previous\n // matched numbers are actual octal numbers. E.g. in '019' only\n // the '01' should be matched.\n incr(-res[0].length);\n if (res = matchReg(/^[0-7]{1,3}/)) {\n return createEscaped('octal', parseInt(res[0], 8), res[0], 1);\n } else {\n // If we end up here, we have a case like /\\91/. Then the\n // first slash is to be ignored and the 9 & 1 to be treated\n // like ordinary characters. Create a character for the\n // first number only here - other number-characters\n // (if available) will be matched later.\n res = createCharacter(matchReg(/^[89]/));\n return updateRawStart(res, res.range[0] - 1);\n }\n }\n }\n // Only allow octal numbers in the following. All matched numbers start\n // with a zero (if the do not, the previous if-branch is executed).\n // If the number is not octal format and starts with zero (e.g. `091`)\n // then only the zeros `0` is treated here and the `91` are ordinary\n // characters.\n // Example:\n // /\\091/.exec('\\091')[0].length === 3\n else if (res = matchReg(/^[0-7]{1,3}/)) {\n match = res[0];\n if (/^0{1,3}$/.test(match)) {\n // If they are all zeros, then only take the first one.\n return createEscaped('null', 0x0000, '0', match.length + 1);\n } else {\n return createEscaped('octal', parseInt(match, 8), match, 1);\n }\n } else if (res = matchReg(/^[dDsSwW]/)) {\n return createCharacterClassEscape(res[0]);\n }\n return false;\n }\n\n function parseNamedReference() {\n if (features.namedGroups && matchReg(/^k<(?=.*?>)/)) {\n var name = parseIdentifier();\n skip('>');\n return createNamedReference(name);\n }\n }\n\n function parseRegExpUnicodeEscapeSequence() {\n var res;\n if (res = matchReg(/^u([0-9a-fA-F]{4})/)) {\n // UnicodeEscapeSequence\n return parseUnicodeSurrogatePairEscape(\n createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2)\n );\n } else if (hasUnicodeFlag && (res = matchReg(/^u\\{([0-9a-fA-F]+)\\}/))) {\n // RegExpUnicodeEscapeSequence (ES6 Unicode code point escape)\n return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4);\n }\n }\n\n function parseCharacterEscape() {\n // CharacterEscape ::\n // ControlEscape\n // c ControlLetter\n // HexEscapeSequence\n // UnicodeEscapeSequence\n // IdentityEscape\n\n var res;\n var from = pos;\n if (res = matchReg(/^[fnrtv]/)) {\n // ControlEscape\n var codePoint = 0;\n switch (res[0]) {\n case 't': codePoint = 0x009; break;\n case 'n': codePoint = 0x00A; break;\n case 'v': codePoint = 0x00B; break;\n case 'f': codePoint = 0x00C; break;\n case 'r': codePoint = 0x00D; break;\n }\n return createEscaped('singleEscape', codePoint, '\\\\' + res[0]);\n } else if (res = matchReg(/^c([a-zA-Z])/)) {\n // c ControlLetter\n return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2);\n } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) {\n // HexEscapeSequence\n return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2);\n } else if (res = parseRegExpUnicodeEscapeSequence()) {\n if (!res || res.codePoint > 0x10FFFF) {\n bail('Invalid escape sequence', null, from, pos);\n }\n return res;\n } else if (features.unicodePropertyEscape && hasUnicodeFlag && (res = matchReg(/^([pP])\\{([^\\}]+)\\}/))) {\n // https://github.com/jviereck/regjsparser/issues/77\n return addRaw({\n type: 'unicodePropertyEscape',\n negative: res[1] === 'P',\n value: res[2],\n range: [res.range[0] - 1, res.range[1]],\n raw: res[0]\n });\n } else {\n // IdentityEscape\n return parseIdentityEscape();\n }\n }\n\n function parseIdentifierAtom(check) {\n var ch = lookahead();\n var from = pos;\n if (ch === '\\\\') {\n incr();\n var esc = parseRegExpUnicodeEscapeSequence();\n if (!esc || !check(esc.codePoint)) {\n bail('Invalid escape sequence', null, from, pos);\n }\n return fromCodePoint(esc.codePoint);\n }\n var code = ch.charCodeAt(0);\n if (code >= 0xD800 && code <= 0xDBFF) {\n ch += str[pos + 1];\n var second = ch.charCodeAt(1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n code = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n if (!check(code)) return;\n incr();\n if (code > 0xFFFF) incr();\n return ch;\n }\n\n function parseIdentifier() {\n // RegExpIdentifierName ::\n // RegExpIdentifierStart\n // RegExpIdentifierName RegExpIdentifierContinue\n //\n // RegExpIdentifierStart ::\n // UnicodeIDStart\n // $\n // _\n // \\ RegExpUnicodeEscapeSequence\n //\n // RegExpIdentifierContinue ::\n // UnicodeIDContinue\n // $\n // _\n // \\ RegExpUnicodeEscapeSequence\n // \n // \n\n var start = pos;\n var res = parseIdentifierAtom(isIdentifierStart);\n if (!res) {\n bail('Invalid identifier');\n }\n\n var ch;\n while (ch = parseIdentifierAtom(isIdentifierPart)) {\n res += ch;\n }\n\n return addRaw({\n type: 'identifier',\n value: res,\n range: [start, pos]\n });\n }\n\n function isIdentifierStart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierStart = /[\\$A-Z_a-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\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\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEF\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7B9\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF1A]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDE9D\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFF1]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/;\n\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n ((ch >= 0x80) && NonAsciiIdentifierStart.test(fromCodePoint(ch)));\n }\n\n // Taken from the Esprima parser.\n function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }\n\n function parseIdentityEscape() {\n // IdentityEscape ::\n // SourceCharacter but not c\n\n var tmp;\n\n if (lookahead() !== 'c') {\n tmp = incr();\n return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1);\n }\n\n return null;\n }\n\n function parseCharacterClass() {\n // CharacterClass ::\n // [ [lookahead ∉ {^}] ClassRanges ]\n // [ ^ ClassRanges ]\n\n var res, from = pos;\n if (res = matchReg(/^\\[\\^/)) {\n res = parseClassRanges();\n skip(']');\n return createCharacterClass(res, true, from, pos);\n } else if (match('[')) {\n res = parseClassRanges();\n skip(']');\n return createCharacterClass(res, false, from, pos);\n }\n\n return null;\n }\n\n function parseClassRanges() {\n // ClassRanges ::\n // [empty]\n // NonemptyClassRanges\n\n var res;\n if (current(']')) {\n // Empty array means nothing insinde of the ClassRange.\n return [];\n } else {\n res = parseNonemptyClassRanges();\n if (!res) {\n bail('nonEmptyClassRanges');\n }\n return res;\n }\n }\n\n function parseHelperClassRanges(atom) {\n var from, to, res;\n if (current('-') && !next(']')) {\n // ClassAtom - ClassAtom ClassRanges\n skip('-');\n\n res = parseClassAtom();\n if (!res) {\n bail('classAtom');\n }\n to = pos;\n var classRanges = parseClassRanges();\n if (!classRanges) {\n bail('classRanges');\n }\n from = atom.range[0];\n if (classRanges.type === 'empty') {\n return [createClassRange(atom, res, from, to)];\n }\n return [createClassRange(atom, res, from, to)].concat(classRanges);\n }\n\n res = parseNonemptyClassRangesNoDash();\n if (!res) {\n bail('nonEmptyClassRangesNoDash');\n }\n\n return [atom].concat(res);\n }\n\n function parseNonemptyClassRanges() {\n // NonemptyClassRanges ::\n // ClassAtom\n // ClassAtom NonemptyClassRangesNoDash\n // ClassAtom - ClassAtom ClassRanges\n\n var atom = parseClassAtom();\n if (!atom) {\n bail('classAtom');\n }\n\n if (current(']')) {\n // ClassAtom\n return [atom];\n }\n\n // ClassAtom NonemptyClassRangesNoDash\n // ClassAtom - ClassAtom ClassRanges\n return parseHelperClassRanges(atom);\n }\n\n function parseNonemptyClassRangesNoDash() {\n // NonemptyClassRangesNoDash ::\n // ClassAtom\n // ClassAtomNoDash NonemptyClassRangesNoDash\n // ClassAtomNoDash - ClassAtom ClassRanges\n\n var res = parseClassAtom();\n if (!res) {\n bail('classAtom');\n }\n if (current(']')) {\n // ClassAtom\n return res;\n }\n\n // ClassAtomNoDash NonemptyClassRangesNoDash\n // ClassAtomNoDash - ClassAtom ClassRanges\n return parseHelperClassRanges(res);\n }\n\n function parseClassAtom() {\n // ClassAtom ::\n // -\n // ClassAtomNoDash\n if (match('-')) {\n return createCharacter('-');\n } else {\n return parseClassAtomNoDash();\n }\n }\n\n function parseClassAtomNoDash() {\n // ClassAtomNoDash ::\n // SourceCharacter but not one of \\ or ] or -\n // \\ ClassEscape\n\n var res;\n if (res = matchReg(/^[^\\\\\\]-]/)) {\n return createCharacter(res[0]);\n } else if (match('\\\\')) {\n res = parseClassEscape();\n if (!res) {\n bail('classEscape');\n }\n\n return parseUnicodeSurrogatePairEscape(res);\n }\n }\n\n function bail(message, details, from, to) {\n from = from == null ? pos : from;\n to = to == null ? from : to;\n\n var contextStart = Math.max(0, from - 10);\n var contextEnd = Math.min(to + 10, str.length);\n\n // Output a bit of context and a line pointing to where our error is.\n //\n // We are assuming that there are no actual newlines in the content as this is a regular expression.\n var context = ' ' + str.substring(contextStart, contextEnd);\n var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^';\n\n throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\\n' + context + '\\n' + pointer);\n }\n\n var backrefDenied = [];\n var closedCaptureCounter = 0;\n var firstIteration = true;\n var hasUnicodeFlag = (flags || \"\").indexOf(\"u\") !== -1;\n var pos = 0;\n\n // Convert the input to a string and treat the empty string special.\n str = String(str);\n if (str === '') {\n str = '(?:)';\n }\n\n var result = parseDisjunction();\n\n if (result.range[1] !== str.length) {\n bail('Could not parse entire input - got stuck', '', result.range[1]);\n }\n\n // The spec requires to interpret the `\\2` in `/\\2()()/` as backreference.\n // As the parser collects the number of capture groups as the string is\n // parsed it is impossible to make these decisions at the point when the\n // `\\2` is handled. In case the local decision turns out to be wrong after\n // the parsing has finished, the input string is parsed a second time with\n // the total number of capture groups set.\n //\n // SEE: https://github.com/jviereck/regjsparser/issues/70\n for (var i = 0; i < backrefDenied.length; i++) {\n if (backrefDenied[i] <= closedCaptureCounter) {\n // Parse the input a second time.\n pos = 0;\n firstIteration = false;\n return parseDisjunction();\n }\n }\n\n return result;\n }\n\n var regjsparser = {\n parse: parse\n };\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = regjsparser;\n } else {\n window.regjsparser = regjsparser;\n }\n\n}());\n","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n","/** @license React v0.11.3\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';Object.defineProperty(exports,\"__esModule\",{value:!0});var d=null,f=!1,h=3,k=-1,l=-1,m=!1,n=!1;function p(){if(!m){var a=d.expirationTime;n?q():n=!0;r(t,a)}}\nfunction u(){var a=d,b=d.next;if(d===b)d=null;else{var c=d.previous;d=c.next=b;b.previous=c}a.next=a.previous=null;c=a.callback;b=a.expirationTime;a=a.priorityLevel;var e=h,Q=l;h=a;l=b;try{var g=c()}finally{h=e,l=Q}if(\"function\"===typeof g)if(g={callback:g,priorityLevel:a,expirationTime:b,next:null,previous:null},null===d)d=g.next=g.previous=g;else{c=null;a=d;do{if(a.expirationTime>=b){c=a;break}a=a.next}while(a!==d);null===c?c=d:c===d&&(d=g,p());b=c.previous;b.next=c.previous=g;g.next=c;g.previous=\nb}}function v(){if(-1===k&&null!==d&&1===d.priorityLevel){m=!0;try{do u();while(null!==d&&1===d.priorityLevel)}finally{m=!1,null!==d?p():n=!1}}}function t(a){m=!0;var b=f;f=a;try{if(a)for(;null!==d;){var c=exports.unstable_now();if(d.expirationTime<=c){do u();while(null!==d&&d.expirationTime<=c)}else break}else if(null!==d){do u();while(null!==d&&!w())}}finally{m=!1,f=b,null!==d?p():n=!1,v()}}\nvar x=Date,y=\"function\"===typeof setTimeout?setTimeout:void 0,z=\"function\"===typeof clearTimeout?clearTimeout:void 0,A=\"function\"===typeof requestAnimationFrame?requestAnimationFrame:void 0,B=\"function\"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0,C,D;function E(a){C=A(function(b){z(D);a(b)});D=y(function(){B(C);a(exports.unstable_now())},100)}\nif(\"object\"===typeof performance&&\"function\"===typeof performance.now){var F=performance;exports.unstable_now=function(){return F.now()}}else exports.unstable_now=function(){return x.now()};var r,q,w,G=null;\"undefined\"!==typeof window?G=window:\"undefined\"!==typeof global&&(G=global);\nif(G&&G._schedMock){var H=G._schedMock;r=H[0];q=H[1];w=H[2];exports.unstable_now=H[3]}else if(\"undefined\"===typeof window||\"function\"!==typeof MessageChannel){var I=null,J=function(a){if(null!==I)try{I(a)}finally{I=null}};r=function(a){null!==I?setTimeout(r,0,a):(I=a,setTimeout(J,0,!1))};q=function(){I=null};w=function(){return!1}}else{\"undefined\"!==typeof console&&(\"function\"!==typeof A&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\"),\n\"function\"!==typeof B&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\"));var K=null,L=!1,M=-1,N=!1,O=!1,P=0,R=33,S=33;w=function(){return P<=exports.unstable_now()};var T=new MessageChannel,U=T.port2;T.port1.onmessage=function(){L=!1;var a=K,b=M;K=null;M=-1;var c=exports.unstable_now(),e=!1;if(0>=P-c)if(-1!==b&&b<=c)e=!0;else{N||(N=!0,E(V));K=a;M=b;return}if(null!==a){O=!0;try{a(e)}finally{O=!1}}};\nvar V=function(a){if(null!==K){E(V);var b=a-P+S;bb&&(b=8),S=bb?U.postMessage(void 0):N||(N=!0,E(V))};q=function(){K=null;L=!1;M=-1}}exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;\nexports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=h,e=k;h=a;k=exports.unstable_now();try{return b()}finally{h=c,k=e,v()}};\nexports.unstable_scheduleCallback=function(a,b){var c=-1!==k?k:exports.unstable_now();if(\"object\"===typeof b&&null!==b&&\"number\"===typeof b.timeout)b=c+b.timeout;else switch(h){case 1:b=c+-1;break;case 2:b=c+250;break;case 5:b=c+1073741823;break;case 4:b=c+1E4;break;default:b=c+5E3}a={callback:a,priorityLevel:h,expirationTime:b,next:null,previous:null};if(null===d)d=a.next=a.previous=a,p();else{c=null;var e=d;do{if(e.expirationTime>b){c=e;break}e=e.next}while(e!==d);null===c?c=d:c===d&&(d=a,p());\nb=c.previous;b.next=c.previous=a;a.next=c;a.previous=b}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)d=null;else{a===d&&(d=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=h;return function(){var c=h,e=k;h=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{h=c,k=e,v()}}};exports.unstable_getCurrentPriorityLevel=function(){return h};\nexports.unstable_shouldYield=function(){return!f&&(null!==d&&d.expirationTime 1) {\n // Make a copy so as not to interfere with a current dispatchEvent.\n this._listeners[eventType] = arr.slice(0, idx).concat(arr.slice(idx + 1));\n } else {\n delete this._listeners[eventType];\n }\n return;\n }\n};\n\nEventTarget.prototype.dispatchEvent = function() {\n var event = arguments[0];\n var t = event.type;\n // equivalent of Array.prototype.slice.call(arguments, 0);\n var args = arguments.length === 1 ? [event] : Array.apply(null, arguments);\n // TODO: This doesn't match the real behavior; per spec, onfoo get\n // their place in line from the /first/ time they're set from\n // non-null. Although WebKit bumps it to the end every time it's\n // set.\n if (this['on' + t]) {\n this['on' + t].apply(this, args);\n }\n if (t in this._listeners) {\n // Grab a reference to the listeners list. removeEventListener may alter the list.\n var listeners = this._listeners[t];\n for (var i = 0; i < listeners.length; i++) {\n listeners[i].apply(this, args);\n }\n }\n};\n\nmodule.exports = EventTarget;\n","'use strict';\n\nvar inherits = require('inherits')\n , Event = require('./event')\n ;\n\nfunction TransportMessageEvent(data) {\n Event.call(this);\n this.initEvent('message', false, false);\n this.data = data;\n}\n\ninherits(TransportMessageEvent, Event);\n\nmodule.exports = TransportMessageEvent;\n","'use strict';\n\nvar JSON3 = require('json3')\n , iframeUtils = require('./utils/iframe')\n ;\n\nfunction FacadeJS(transport) {\n this._transport = transport;\n transport.on('message', this._transportMessage.bind(this));\n transport.on('close', this._transportClose.bind(this));\n}\n\nFacadeJS.prototype._transportClose = function(code, reason) {\n iframeUtils.postMessage('c', JSON3.stringify([code, reason]));\n};\nFacadeJS.prototype._transportMessage = function(frame) {\n iframeUtils.postMessage('t', frame);\n};\nFacadeJS.prototype._send = function(data) {\n this._transport.send(data);\n};\nFacadeJS.prototype._close = function() {\n this._transport.close();\n this._transport.removeAllListeners();\n};\n\nmodule.exports = FacadeJS;\n","'use strict';\n\nvar urlUtils = require('./utils/url')\n , eventUtils = require('./utils/event')\n , JSON3 = require('json3')\n , FacadeJS = require('./facade')\n , InfoIframeReceiver = require('./info-iframe-receiver')\n , iframeUtils = require('./utils/iframe')\n , loc = require('./location')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:iframe-bootstrap');\n}\n\nmodule.exports = function(SockJS, availableTransports) {\n var transportMap = {};\n availableTransports.forEach(function(at) {\n if (at.facadeTransport) {\n transportMap[at.facadeTransport.transportName] = at.facadeTransport;\n }\n });\n\n // hard-coded for the info iframe\n // TODO see if we can make this more dynamic\n transportMap[InfoIframeReceiver.transportName] = InfoIframeReceiver;\n var parentOrigin;\n\n /* eslint-disable camelcase */\n SockJS.bootstrap_iframe = function() {\n /* eslint-enable camelcase */\n var facade;\n iframeUtils.currentWindowId = loc.hash.slice(1);\n var onMessage = function(e) {\n if (e.source !== parent) {\n return;\n }\n if (typeof parentOrigin === 'undefined') {\n parentOrigin = e.origin;\n }\n if (e.origin !== parentOrigin) {\n return;\n }\n\n var iframeMessage;\n try {\n iframeMessage = JSON3.parse(e.data);\n } catch (ignored) {\n debug('bad json', e.data);\n return;\n }\n\n if (iframeMessage.windowId !== iframeUtils.currentWindowId) {\n return;\n }\n switch (iframeMessage.type) {\n case 's':\n var p;\n try {\n p = JSON3.parse(iframeMessage.data);\n } catch (ignored) {\n debug('bad json', iframeMessage.data);\n break;\n }\n var version = p[0];\n var transport = p[1];\n var transUrl = p[2];\n var baseUrl = p[3];\n debug(version, transport, transUrl, baseUrl);\n // change this to semver logic\n if (version !== SockJS.version) {\n throw new Error('Incompatible SockJS! Main site uses:' +\n ' \"' + version + '\", the iframe:' +\n ' \"' + SockJS.version + '\".');\n }\n\n if (!urlUtils.isOriginEqual(transUrl, loc.href) ||\n !urlUtils.isOriginEqual(baseUrl, loc.href)) {\n throw new Error('Can\\'t connect to different domain from within an ' +\n 'iframe. (' + loc.href + ', ' + transUrl + ', ' + baseUrl + ')');\n }\n facade = new FacadeJS(new transportMap[transport](transUrl, baseUrl));\n break;\n case 'm':\n facade._send(iframeMessage.data);\n break;\n case 'c':\n if (facade) {\n facade._close();\n }\n facade = null;\n break;\n }\n };\n\n eventUtils.attachEvent('message', onMessage);\n\n // Start\n iframeUtils.postMessage('s');\n };\n};\n","'use strict';\n\nvar EventEmitter = require('events').EventEmitter\n , inherits = require('inherits')\n , JSON3 = require('json3')\n , objectUtils = require('./utils/object')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:info-ajax');\n}\n\nfunction InfoAjax(url, AjaxObject) {\n EventEmitter.call(this);\n\n var self = this;\n var t0 = +new Date();\n this.xo = new AjaxObject('GET', url);\n\n this.xo.once('finish', function(status, text) {\n var info, rtt;\n if (status === 200) {\n rtt = (+new Date()) - t0;\n if (text) {\n try {\n info = JSON3.parse(text);\n } catch (e) {\n debug('bad json', text);\n }\n }\n\n if (!objectUtils.isObject(info)) {\n info = {};\n }\n }\n self.emit('finish', info, rtt);\n self.removeAllListeners();\n });\n}\n\ninherits(InfoAjax, EventEmitter);\n\nInfoAjax.prototype.close = function() {\n this.removeAllListeners();\n this.xo.close();\n};\n\nmodule.exports = InfoAjax;\n","'use strict';\n\nvar inherits = require('inherits')\n , EventEmitter = require('events').EventEmitter\n , JSON3 = require('json3')\n , XHRLocalObject = require('./transport/sender/xhr-local')\n , InfoAjax = require('./info-ajax')\n ;\n\nfunction InfoReceiverIframe(transUrl) {\n var self = this;\n EventEmitter.call(this);\n\n this.ir = new InfoAjax(transUrl, XHRLocalObject);\n this.ir.once('finish', function(info, rtt) {\n self.ir = null;\n self.emit('message', JSON3.stringify([info, rtt]));\n });\n}\n\ninherits(InfoReceiverIframe, EventEmitter);\n\nInfoReceiverIframe.transportName = 'iframe-info-receiver';\n\nInfoReceiverIframe.prototype.close = function() {\n if (this.ir) {\n this.ir.close();\n this.ir = null;\n }\n this.removeAllListeners();\n};\n\nmodule.exports = InfoReceiverIframe;\n","'use strict';\n\nvar EventEmitter = require('events').EventEmitter\n , inherits = require('inherits')\n , JSON3 = require('json3')\n , utils = require('./utils/event')\n , IframeTransport = require('./transport/iframe')\n , InfoReceiverIframe = require('./info-iframe-receiver')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:info-iframe');\n}\n\nfunction InfoIframe(baseUrl, url) {\n var self = this;\n EventEmitter.call(this);\n\n var go = function() {\n var ifr = self.ifr = new IframeTransport(InfoReceiverIframe.transportName, url, baseUrl);\n\n ifr.once('message', function(msg) {\n if (msg) {\n var d;\n try {\n d = JSON3.parse(msg);\n } catch (e) {\n debug('bad json', msg);\n self.emit('finish');\n self.close();\n return;\n }\n\n var info = d[0], rtt = d[1];\n self.emit('finish', info, rtt);\n }\n self.close();\n });\n\n ifr.once('close', function() {\n self.emit('finish');\n self.close();\n });\n };\n\n // TODO this seems the same as the 'needBody' from transports\n if (!global.document.body) {\n utils.attachEvent('load', go);\n } else {\n go();\n }\n}\n\ninherits(InfoIframe, EventEmitter);\n\nInfoIframe.enabled = function() {\n return IframeTransport.enabled();\n};\n\nInfoIframe.prototype.close = function() {\n if (this.ifr) {\n this.ifr.close();\n }\n this.removeAllListeners();\n this.ifr = null;\n};\n\nmodule.exports = InfoIframe;\n","'use strict';\n\nvar EventEmitter = require('events').EventEmitter\n , inherits = require('inherits')\n , urlUtils = require('./utils/url')\n , XDR = require('./transport/sender/xdr')\n , XHRCors = require('./transport/sender/xhr-cors')\n , XHRLocal = require('./transport/sender/xhr-local')\n , XHRFake = require('./transport/sender/xhr-fake')\n , InfoIframe = require('./info-iframe')\n , InfoAjax = require('./info-ajax')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:info-receiver');\n}\n\nfunction InfoReceiver(baseUrl, urlInfo) {\n debug(baseUrl);\n var self = this;\n EventEmitter.call(this);\n\n setTimeout(function() {\n self.doXhr(baseUrl, urlInfo);\n }, 0);\n}\n\ninherits(InfoReceiver, EventEmitter);\n\n// TODO this is currently ignoring the list of available transports and the whitelist\n\nInfoReceiver._getReceiver = function(baseUrl, url, urlInfo) {\n // determine method of CORS support (if needed)\n if (urlInfo.sameOrigin) {\n return new InfoAjax(url, XHRLocal);\n }\n if (XHRCors.enabled) {\n return new InfoAjax(url, XHRCors);\n }\n if (XDR.enabled && urlInfo.sameScheme) {\n return new InfoAjax(url, XDR);\n }\n if (InfoIframe.enabled()) {\n return new InfoIframe(baseUrl, url);\n }\n return new InfoAjax(url, XHRFake);\n};\n\nInfoReceiver.prototype.doXhr = function(baseUrl, urlInfo) {\n var self = this\n , url = urlUtils.addPath(baseUrl, '/info')\n ;\n debug('doXhr', url);\n\n this.xo = InfoReceiver._getReceiver(baseUrl, url, urlInfo);\n\n this.timeoutRef = setTimeout(function() {\n debug('timeout');\n self._cleanup(false);\n self.emit('finish');\n }, InfoReceiver.timeout);\n\n this.xo.once('finish', function(info, rtt) {\n debug('finish', info, rtt);\n self._cleanup(true);\n self.emit('finish', info, rtt);\n });\n};\n\nInfoReceiver.prototype._cleanup = function(wasClean) {\n debug('_cleanup');\n clearTimeout(this.timeoutRef);\n this.timeoutRef = null;\n if (!wasClean && this.xo) {\n this.xo.close();\n }\n this.xo = null;\n};\n\nInfoReceiver.prototype.close = function() {\n debug('close');\n this.removeAllListeners();\n this._cleanup(false);\n};\n\nInfoReceiver.timeout = 8000;\n\nmodule.exports = InfoReceiver;\n","'use strict';\n\nmodule.exports = global.location || {\n origin: 'http://localhost:80'\n, protocol: 'http:'\n, host: 'localhost'\n, port: 80\n, href: 'http://localhost/'\n, hash: ''\n};\n","'use strict';\n\nrequire('./shims');\n\nvar URL = require('url-parse')\n , inherits = require('inherits')\n , JSON3 = require('json3')\n , random = require('./utils/random')\n , escape = require('./utils/escape')\n , urlUtils = require('./utils/url')\n , eventUtils = require('./utils/event')\n , transport = require('./utils/transport')\n , objectUtils = require('./utils/object')\n , browser = require('./utils/browser')\n , log = require('./utils/log')\n , Event = require('./event/event')\n , EventTarget = require('./event/eventtarget')\n , loc = require('./location')\n , CloseEvent = require('./event/close')\n , TransportMessageEvent = require('./event/trans-message')\n , InfoReceiver = require('./info-receiver')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:main');\n}\n\nvar transports;\n\n// follow constructor steps defined at http://dev.w3.org/html5/websockets/#the-websocket-interface\nfunction SockJS(url, protocols, options) {\n if (!(this instanceof SockJS)) {\n return new SockJS(url, protocols, options);\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'SockJS: 1 argument required, but only 0 present\");\n }\n EventTarget.call(this);\n\n this.readyState = SockJS.CONNECTING;\n this.extensions = '';\n this.protocol = '';\n\n // non-standard extension\n options = options || {};\n if (options.protocols_whitelist) {\n log.warn(\"'protocols_whitelist' is DEPRECATED. Use 'transports' instead.\");\n }\n this._transportsWhitelist = options.transports;\n this._transportOptions = options.transportOptions || {};\n\n var sessionId = options.sessionId || 8;\n if (typeof sessionId === 'function') {\n this._generateSessionId = sessionId;\n } else if (typeof sessionId === 'number') {\n this._generateSessionId = function() {\n return random.string(sessionId);\n };\n } else {\n throw new TypeError('If sessionId is used in the options, it needs to be a number or a function.');\n }\n\n this._server = options.server || random.numberString(1000);\n\n // Step 1 of WS spec - parse and validate the url. Issue #8\n var parsedUrl = new URL(url);\n if (!parsedUrl.host || !parsedUrl.protocol) {\n throw new SyntaxError(\"The URL '\" + url + \"' is invalid\");\n } else if (parsedUrl.hash) {\n throw new SyntaxError('The URL must not contain a fragment');\n } else if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {\n throw new SyntaxError(\"The URL's scheme must be either 'http:' or 'https:'. '\" + parsedUrl.protocol + \"' is not allowed.\");\n }\n\n var secure = parsedUrl.protocol === 'https:';\n // Step 2 - don't allow secure origin with an insecure protocol\n if (loc.protocol === 'https:' && !secure) {\n throw new Error('SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS');\n }\n\n // Step 3 - check port access - no need here\n // Step 4 - parse protocols argument\n if (!protocols) {\n protocols = [];\n } else if (!Array.isArray(protocols)) {\n protocols = [protocols];\n }\n\n // Step 5 - check protocols argument\n var sortedProtocols = protocols.sort();\n sortedProtocols.forEach(function(proto, i) {\n if (!proto) {\n throw new SyntaxError(\"The protocols entry '\" + proto + \"' is invalid.\");\n }\n if (i < (sortedProtocols.length - 1) && proto === sortedProtocols[i + 1]) {\n throw new SyntaxError(\"The protocols entry '\" + proto + \"' is duplicated.\");\n }\n });\n\n // Step 6 - convert origin\n var o = urlUtils.getOrigin(loc.href);\n this._origin = o ? o.toLowerCase() : null;\n\n // remove the trailing slash\n parsedUrl.set('pathname', parsedUrl.pathname.replace(/\\/+$/, ''));\n\n // store the sanitized url\n this.url = parsedUrl.href;\n debug('using url', this.url);\n\n // Step 7 - start connection in background\n // obtain server info\n // http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#section-26\n this._urlInfo = {\n nullOrigin: !browser.hasDomain()\n , sameOrigin: urlUtils.isOriginEqual(this.url, loc.href)\n , sameScheme: urlUtils.isSchemeEqual(this.url, loc.href)\n };\n\n this._ir = new InfoReceiver(this.url, this._urlInfo);\n this._ir.once('finish', this._receiveInfo.bind(this));\n}\n\ninherits(SockJS, EventTarget);\n\nfunction userSetCode(code) {\n return code === 1000 || (code >= 3000 && code <= 4999);\n}\n\nSockJS.prototype.close = function(code, reason) {\n // Step 1\n if (code && !userSetCode(code)) {\n throw new Error('InvalidAccessError: Invalid code');\n }\n // Step 2.4 states the max is 123 bytes, but we are just checking length\n if (reason && reason.length > 123) {\n throw new SyntaxError('reason argument has an invalid length');\n }\n\n // Step 3.1\n if (this.readyState === SockJS.CLOSING || this.readyState === SockJS.CLOSED) {\n return;\n }\n\n // TODO look at docs to determine how to set this\n var wasClean = true;\n this._close(code || 1000, reason || 'Normal closure', wasClean);\n};\n\nSockJS.prototype.send = function(data) {\n // #13 - convert anything non-string to string\n // TODO this currently turns objects into [object Object]\n if (typeof data !== 'string') {\n data = '' + data;\n }\n if (this.readyState === SockJS.CONNECTING) {\n throw new Error('InvalidStateError: The connection has not been established yet');\n }\n if (this.readyState !== SockJS.OPEN) {\n return;\n }\n this._transport.send(escape.quote(data));\n};\n\nSockJS.version = require('./version');\n\nSockJS.CONNECTING = 0;\nSockJS.OPEN = 1;\nSockJS.CLOSING = 2;\nSockJS.CLOSED = 3;\n\nSockJS.prototype._receiveInfo = function(info, rtt) {\n debug('_receiveInfo', rtt);\n this._ir = null;\n if (!info) {\n this._close(1002, 'Cannot connect to server');\n return;\n }\n\n // establish a round-trip timeout (RTO) based on the\n // round-trip time (RTT)\n this._rto = this.countRTO(rtt);\n // allow server to override url used for the actual transport\n this._transUrl = info.base_url ? info.base_url : this.url;\n info = objectUtils.extend(info, this._urlInfo);\n debug('info', info);\n // determine list of desired and supported transports\n var enabledTransports = transports.filterToEnabled(this._transportsWhitelist, info);\n this._transports = enabledTransports.main;\n debug(this._transports.length + ' enabled transports');\n\n this._connect();\n};\n\nSockJS.prototype._connect = function() {\n for (var Transport = this._transports.shift(); Transport; Transport = this._transports.shift()) {\n debug('attempt', Transport.transportName);\n if (Transport.needBody) {\n if (!global.document.body ||\n (typeof global.document.readyState !== 'undefined' &&\n global.document.readyState !== 'complete' &&\n global.document.readyState !== 'interactive')) {\n debug('waiting for body');\n this._transports.unshift(Transport);\n eventUtils.attachEvent('load', this._connect.bind(this));\n return;\n }\n }\n\n // calculate timeout based on RTO and round trips. Default to 5s\n var timeoutMs = (this._rto * Transport.roundTrips) || 5000;\n this._transportTimeoutId = setTimeout(this._transportTimeout.bind(this), timeoutMs);\n debug('using timeout', timeoutMs);\n\n var transportUrl = urlUtils.addPath(this._transUrl, '/' + this._server + '/' + this._generateSessionId());\n var options = this._transportOptions[Transport.transportName];\n debug('transport url', transportUrl);\n var transportObj = new Transport(transportUrl, this._transUrl, options);\n transportObj.on('message', this._transportMessage.bind(this));\n transportObj.once('close', this._transportClose.bind(this));\n transportObj.transportName = Transport.transportName;\n this._transport = transportObj;\n\n return;\n }\n this._close(2000, 'All transports failed', false);\n};\n\nSockJS.prototype._transportTimeout = function() {\n debug('_transportTimeout');\n if (this.readyState === SockJS.CONNECTING) {\n if (this._transport) {\n this._transport.close();\n }\n\n this._transportClose(2007, 'Transport timed out');\n }\n};\n\nSockJS.prototype._transportMessage = function(msg) {\n debug('_transportMessage', msg);\n var self = this\n , type = msg.slice(0, 1)\n , content = msg.slice(1)\n , payload\n ;\n\n // first check for messages that don't need a payload\n switch (type) {\n case 'o':\n this._open();\n return;\n case 'h':\n this.dispatchEvent(new Event('heartbeat'));\n debug('heartbeat', this.transport);\n return;\n }\n\n if (content) {\n try {\n payload = JSON3.parse(content);\n } catch (e) {\n debug('bad json', content);\n }\n }\n\n if (typeof payload === 'undefined') {\n debug('empty payload', content);\n return;\n }\n\n switch (type) {\n case 'a':\n if (Array.isArray(payload)) {\n payload.forEach(function(p) {\n debug('message', self.transport, p);\n self.dispatchEvent(new TransportMessageEvent(p));\n });\n }\n break;\n case 'm':\n debug('message', this.transport, payload);\n this.dispatchEvent(new TransportMessageEvent(payload));\n break;\n case 'c':\n if (Array.isArray(payload) && payload.length === 2) {\n this._close(payload[0], payload[1], true);\n }\n break;\n }\n};\n\nSockJS.prototype._transportClose = function(code, reason) {\n debug('_transportClose', this.transport, code, reason);\n if (this._transport) {\n this._transport.removeAllListeners();\n this._transport = null;\n this.transport = null;\n }\n\n if (!userSetCode(code) && code !== 2000 && this.readyState === SockJS.CONNECTING) {\n this._connect();\n return;\n }\n\n this._close(code, reason);\n};\n\nSockJS.prototype._open = function() {\n debug('_open', this._transport.transportName, this.readyState);\n if (this.readyState === SockJS.CONNECTING) {\n if (this._transportTimeoutId) {\n clearTimeout(this._transportTimeoutId);\n this._transportTimeoutId = null;\n }\n this.readyState = SockJS.OPEN;\n this.transport = this._transport.transportName;\n this.dispatchEvent(new Event('open'));\n debug('connected', this.transport);\n } else {\n // The server might have been restarted, and lost track of our\n // connection.\n this._close(1006, 'Server lost session');\n }\n};\n\nSockJS.prototype._close = function(code, reason, wasClean) {\n debug('_close', this.transport, code, reason, wasClean, this.readyState);\n var forceFail = false;\n\n if (this._ir) {\n forceFail = true;\n this._ir.close();\n this._ir = null;\n }\n if (this._transport) {\n this._transport.close();\n this._transport = null;\n this.transport = null;\n }\n\n if (this.readyState === SockJS.CLOSED) {\n throw new Error('InvalidStateError: SockJS has already been closed');\n }\n\n this.readyState = SockJS.CLOSING;\n setTimeout(function() {\n this.readyState = SockJS.CLOSED;\n\n if (forceFail) {\n this.dispatchEvent(new Event('error'));\n }\n\n var e = new CloseEvent('close');\n e.wasClean = wasClean || false;\n e.code = code || 1000;\n e.reason = reason;\n\n this.dispatchEvent(e);\n this.onmessage = this.onclose = this.onerror = null;\n debug('disconnected');\n }.bind(this), 0);\n};\n\n// See: http://www.erg.abdn.ac.uk/~gerrit/dccp/notes/ccid2/rto_estimator/\n// and RFC 2988.\nSockJS.prototype.countRTO = function(rtt) {\n // In a local environment, when using IE8/9 and the `jsonp-polling`\n // transport the time needed to establish a connection (the time that pass\n // from the opening of the transport to the call of `_dispatchOpen`) is\n // around 200msec (the lower bound used in the article above) and this\n // causes spurious timeouts. For this reason we calculate a value slightly\n // larger than that used in the article.\n if (rtt > 100) {\n return 4 * rtt; // rto > 400msec\n }\n return 300 + rtt; // 300msec < rto <= 400msec\n};\n\nmodule.exports = function(availableTransports) {\n transports = transport(availableTransports);\n require('./iframe-bootstrap')(SockJS, availableTransports);\n return SockJS;\n};\n","/* eslint-disable */\n/* jscs: disable */\n'use strict';\n\n// pulled specific shims from https://github.com/es-shims/es5-shim\n\nvar ArrayPrototype = Array.prototype;\nvar ObjectPrototype = Object.prototype;\nvar FunctionPrototype = Function.prototype;\nvar StringPrototype = String.prototype;\nvar array_slice = ArrayPrototype.slice;\n\nvar _toString = ObjectPrototype.toString;\nvar isFunction = function (val) {\n return ObjectPrototype.toString.call(val) === '[object Function]';\n};\nvar isArray = function isArray(obj) {\n return _toString.call(obj) === '[object Array]';\n};\nvar isString = function isString(obj) {\n return _toString.call(obj) === '[object String]';\n};\n\nvar supportsDescriptors = Object.defineProperty && (function () {\n try {\n Object.defineProperty({}, 'x', {});\n return true;\n } catch (e) { /* this is ES3 */\n return false;\n }\n}());\n\n// Define configurable, writable and non-enumerable props\n// if they don't exist.\nvar defineProperty;\nif (supportsDescriptors) {\n defineProperty = function (object, name, method, forceAssign) {\n if (!forceAssign && (name in object)) { return; }\n Object.defineProperty(object, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: method\n });\n };\n} else {\n defineProperty = function (object, name, method, forceAssign) {\n if (!forceAssign && (name in object)) { return; }\n object[name] = method;\n };\n}\nvar defineProperties = function (object, map, forceAssign) {\n for (var name in map) {\n if (ObjectPrototype.hasOwnProperty.call(map, name)) {\n defineProperty(object, name, map[name], forceAssign);\n }\n }\n};\n\nvar toObject = function (o) {\n if (o == null) { // this matches both null and undefined\n throw new TypeError(\"can't convert \" + o + ' to object');\n }\n return Object(o);\n};\n\n//\n// Util\n// ======\n//\n\n// ES5 9.4\n// http://es5.github.com/#x9.4\n// http://jsperf.com/to-integer\n\nfunction toInteger(num) {\n var n = +num;\n if (n !== n) { // isNaN\n n = 0;\n } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {\n n = (n > 0 || -1) * Math.floor(Math.abs(n));\n }\n return n;\n}\n\nfunction ToUint32(x) {\n return x >>> 0;\n}\n\n//\n// Function\n// ========\n//\n\n// ES-5 15.3.4.5\n// http://es5.github.com/#x15.3.4.5\n\nfunction Empty() {}\n\ndefineProperties(FunctionPrototype, {\n bind: function bind(that) { // .length is 1\n // 1. Let Target be the this value.\n var target = this;\n // 2. If IsCallable(Target) is false, throw a TypeError exception.\n if (!isFunction(target)) {\n throw new TypeError('Function.prototype.bind called on incompatible ' + target);\n }\n // 3. Let A be a new (possibly empty) internal list of all of the\n // argument values provided after thisArg (arg1, arg2 etc), in order.\n // XXX slicedArgs will stand in for \"A\" if used\n var args = array_slice.call(arguments, 1); // for normal call\n // 4. Let F be a new native ECMAScript object.\n // 11. Set the [[Prototype]] internal property of F to the standard\n // built-in Function prototype object as specified in 15.3.3.1.\n // 12. Set the [[Call]] internal property of F as described in\n // 15.3.4.5.1.\n // 13. Set the [[Construct]] internal property of F as described in\n // 15.3.4.5.2.\n // 14. Set the [[HasInstance]] internal property of F as described in\n // 15.3.4.5.3.\n var binder = function () {\n\n if (this instanceof bound) {\n // 15.3.4.5.2 [[Construct]]\n // When the [[Construct]] internal method of a function object,\n // F that was created using the bind function is called with a\n // list of arguments ExtraArgs, the following steps are taken:\n // 1. Let target be the value of F's [[TargetFunction]]\n // internal property.\n // 2. If target has no [[Construct]] internal method, a\n // TypeError exception is thrown.\n // 3. Let boundArgs be the value of F's [[BoundArgs]] internal\n // property.\n // 4. Let args be a new list containing the same values as the\n // list boundArgs in the same order followed by the same\n // values as the list ExtraArgs in the same order.\n // 5. Return the result of calling the [[Construct]] internal\n // method of target providing args as the arguments.\n\n var result = target.apply(\n this,\n args.concat(array_slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n\n } else {\n // 15.3.4.5.1 [[Call]]\n // When the [[Call]] internal method of a function object, F,\n // which was created using the bind function is called with a\n // this value and a list of arguments ExtraArgs, the following\n // steps are taken:\n // 1. Let boundArgs be the value of F's [[BoundArgs]] internal\n // property.\n // 2. Let boundThis be the value of F's [[BoundThis]] internal\n // property.\n // 3. Let target be the value of F's [[TargetFunction]] internal\n // property.\n // 4. Let args be a new list containing the same values as the\n // list boundArgs in the same order followed by the same\n // values as the list ExtraArgs in the same order.\n // 5. Return the result of calling the [[Call]] internal method\n // of target providing boundThis as the this value and\n // providing args as the arguments.\n\n // equiv: target.call(this, ...boundArgs, ...args)\n return target.apply(\n that,\n args.concat(array_slice.call(arguments))\n );\n\n }\n\n };\n\n // 15. If the [[Class]] internal property of Target is \"Function\", then\n // a. Let L be the length property of Target minus the length of A.\n // b. Set the length own property of F to either 0 or L, whichever is\n // larger.\n // 16. Else set the length own property of F to 0.\n\n var boundLength = Math.max(0, target.length - args.length);\n\n // 17. Set the attributes of the length own property of F to the values\n // specified in 15.3.5.1.\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n // XXX Build a dynamic function with desired amount of arguments is the only\n // way to set the length property of a function.\n // In environments where Content Security Policies enabled (Chrome extensions,\n // for ex.) all use of eval or Function costructor throws an exception.\n // However in all of these environments Function.prototype.bind exists\n // and so this code will never be executed.\n var bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this, arguments); }')(binder);\n\n if (target.prototype) {\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n // Clean up dangling references.\n Empty.prototype = null;\n }\n\n // TODO\n // 18. Set the [[Extensible]] internal property of F to true.\n\n // TODO\n // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).\n // 20. Call the [[DefineOwnProperty]] internal method of F with\n // arguments \"caller\", PropertyDescriptor {[[Get]]: thrower, [[Set]]:\n // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and\n // false.\n // 21. Call the [[DefineOwnProperty]] internal method of F with\n // arguments \"arguments\", PropertyDescriptor {[[Get]]: thrower,\n // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},\n // and false.\n\n // TODO\n // NOTE Function objects created using Function.prototype.bind do not\n // have a prototype property or the [[Code]], [[FormalParameters]], and\n // [[Scope]] internal properties.\n // XXX can't delete prototype in pure-js.\n\n // 22. Return F.\n return bound;\n }\n});\n\n//\n// Array\n// =====\n//\n\n// ES5 15.4.3.2\n// http://es5.github.com/#x15.4.3.2\n// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray\ndefineProperties(Array, { isArray: isArray });\n\n\nvar boxedString = Object('a');\nvar splitString = boxedString[0] !== 'a' || !(0 in boxedString);\n\nvar properlyBoxesContext = function properlyBoxed(method) {\n // Check node 0.6.21 bug where third parameter is not boxed\n var properlyBoxesNonStrict = true;\n var properlyBoxesStrict = true;\n if (method) {\n method.call('foo', function (_, __, context) {\n if (typeof context !== 'object') { properlyBoxesNonStrict = false; }\n });\n\n method.call([1], function () {\n 'use strict';\n properlyBoxesStrict = typeof this === 'string';\n }, 'x');\n }\n return !!method && properlyBoxesNonStrict && properlyBoxesStrict;\n};\n\ndefineProperties(ArrayPrototype, {\n forEach: function forEach(fun /*, thisp*/) {\n var object = toObject(this),\n self = splitString && isString(this) ? this.split('') : object,\n thisp = arguments[1],\n i = -1,\n length = self.length >>> 0;\n\n // If no callback function or if callback is not a callable function\n if (!isFunction(fun)) {\n throw new TypeError(); // TODO message\n }\n\n while (++i < length) {\n if (i in self) {\n // Invoke the callback function with call, passing arguments:\n // context, property value, property key, thisArg object\n // context\n fun.call(thisp, self[i], i, object);\n }\n }\n }\n}, !properlyBoxesContext(ArrayPrototype.forEach));\n\n// ES5 15.4.4.14\n// http://es5.github.com/#x15.4.4.14\n// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf\nvar hasFirefox2IndexOfBug = Array.prototype.indexOf && [0, 1].indexOf(1, 2) !== -1;\ndefineProperties(ArrayPrototype, {\n indexOf: function indexOf(sought /*, fromIndex */ ) {\n var self = splitString && isString(this) ? this.split('') : toObject(this),\n length = self.length >>> 0;\n\n if (!length) {\n return -1;\n }\n\n var i = 0;\n if (arguments.length > 1) {\n i = toInteger(arguments[1]);\n }\n\n // handle negative indices\n i = i >= 0 ? i : Math.max(0, length + i);\n for (; i < length; i++) {\n if (i in self && self[i] === sought) {\n return i;\n }\n }\n return -1;\n }\n}, hasFirefox2IndexOfBug);\n\n//\n// String\n// ======\n//\n\n// ES5 15.5.4.14\n// http://es5.github.com/#x15.5.4.14\n\n// [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]\n// Many browsers do not split properly with regular expressions or they\n// do not perform the split correctly under obscure conditions.\n// See http://blog.stevenlevithan.com/archives/cross-browser-split\n// I've tested in many browsers and this seems to cover the deviant ones:\n// 'ab'.split(/(?:ab)*/) should be [\"\", \"\"], not [\"\"]\n// '.'.split(/(.?)(.?)/) should be [\"\", \".\", \"\", \"\"], not [\"\", \"\"]\n// 'tesst'.split(/(s)*/) should be [\"t\", undefined, \"e\", \"s\", \"t\"], not\n// [undefined, \"t\", undefined, \"e\", ...]\n// ''.split(/.?/) should be [], not [\"\"]\n// '.'.split(/()()/) should be [\".\"], not [\"\", \"\", \".\"]\n\nvar string_split = StringPrototype.split;\nif (\n 'ab'.split(/(?:ab)*/).length !== 2 ||\n '.'.split(/(.?)(.?)/).length !== 4 ||\n 'tesst'.split(/(s)*/)[1] === 't' ||\n 'test'.split(/(?:)/, -1).length !== 4 ||\n ''.split(/.?/).length ||\n '.'.split(/()()/).length > 1\n) {\n (function () {\n var compliantExecNpcg = /()??/.exec('')[1] === void 0; // NPCG: nonparticipating capturing group\n\n StringPrototype.split = function (separator, limit) {\n var string = this;\n if (separator === void 0 && limit === 0) {\n return [];\n }\n\n // If `separator` is not a regex, use native split\n if (_toString.call(separator) !== '[object RegExp]') {\n return string_split.call(this, separator, limit);\n }\n\n var output = [],\n flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.extended ? 'x' : '') + // Proposed for ES6\n (separator.sticky ? 'y' : ''), // Firefox 3+\n lastLastIndex = 0,\n // Make `global` and avoid `lastIndex` issues by working with a copy\n separator2, match, lastIndex, lastLength;\n separator = new RegExp(separator.source, flags + 'g');\n string += ''; // Type-convert\n if (!compliantExecNpcg) {\n // Doesn't need flags gy, but they don't hurt\n separator2 = new RegExp('^' + separator.source + '$(?!\\\\s)', flags);\n }\n /* Values for `limit`, per the spec:\n * If undefined: 4294967295 // Math.pow(2, 32) - 1\n * If 0, Infinity, or NaN: 0\n * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;\n * If negative number: 4294967296 - Math.floor(Math.abs(limit))\n * If other: Type-convert, then use the above rules\n */\n limit = limit === void 0 ?\n -1 >>> 0 : // Math.pow(2, 32) - 1\n ToUint32(limit);\n while (match = separator.exec(string)) {\n // `separator.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0].length;\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for\n // nonparticipating capturing groups\n if (!compliantExecNpcg && match.length > 1) {\n match[0].replace(separator2, function () {\n for (var i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === void 0) {\n match[i] = void 0;\n }\n }\n });\n }\n if (match.length > 1 && match.index < string.length) {\n ArrayPrototype.push.apply(output, match.slice(1));\n }\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= limit) {\n break;\n }\n }\n if (separator.lastIndex === match.index) {\n separator.lastIndex++; // Avoid an infinite loop\n }\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !separator.test('')) {\n output.push('');\n }\n } else {\n output.push(string.slice(lastLastIndex));\n }\n return output.length > limit ? output.slice(0, limit) : output;\n };\n }());\n\n// [bugfix, chrome]\n// If separator is undefined, then the result array contains just one String,\n// which is the this value (converted to a String). If limit is not undefined,\n// then the output array is truncated so that it contains no more than limit\n// elements.\n// \"0\".split(undefined, 0) -> []\n} else if ('0'.split(void 0, 0).length) {\n StringPrototype.split = function split(separator, limit) {\n if (separator === void 0 && limit === 0) { return []; }\n return string_split.call(this, separator, limit);\n };\n}\n\n// ECMA-262, 3rd B.2.3\n// Not an ECMAScript standard, although ECMAScript 3rd Edition has a\n// non-normative section suggesting uniform semantics and it should be\n// normalized across all browsers\n// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE\nvar string_substr = StringPrototype.substr;\nvar hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';\ndefineProperties(StringPrototype, {\n substr: function substr(start, length) {\n return string_substr.call(\n this,\n start < 0 ? ((start = this.length + start) < 0 ? 0 : start) : start,\n length\n );\n }\n}, hasNegativeSubstrBug);\n","'use strict';\n\nmodule.exports = [\n // streaming transports\n require('./transport/websocket')\n, require('./transport/xhr-streaming')\n, require('./transport/xdr-streaming')\n, require('./transport/eventsource')\n, require('./transport/lib/iframe-wrap')(require('./transport/eventsource'))\n\n // polling transports\n, require('./transport/htmlfile')\n, require('./transport/lib/iframe-wrap')(require('./transport/htmlfile'))\n, require('./transport/xhr-polling')\n, require('./transport/xdr-polling')\n, require('./transport/lib/iframe-wrap')(require('./transport/xhr-polling'))\n, require('./transport/jsonp-polling')\n];\n","'use strict';\n\nvar EventEmitter = require('events').EventEmitter\n , inherits = require('inherits')\n , utils = require('../../utils/event')\n , urlUtils = require('../../utils/url')\n , XHR = global.XMLHttpRequest\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:browser:xhr');\n}\n\nfunction AbstractXHRObject(method, url, payload, opts) {\n debug(method, url);\n var self = this;\n EventEmitter.call(this);\n\n setTimeout(function () {\n self._start(method, url, payload, opts);\n }, 0);\n}\n\ninherits(AbstractXHRObject, EventEmitter);\n\nAbstractXHRObject.prototype._start = function(method, url, payload, opts) {\n var self = this;\n\n try {\n this.xhr = new XHR();\n } catch (x) {\n // intentionally empty\n }\n\n if (!this.xhr) {\n debug('no xhr');\n this.emit('finish', 0, 'no xhr support');\n this._cleanup();\n return;\n }\n\n // several browsers cache POSTs\n url = urlUtils.addQuery(url, 't=' + (+new Date()));\n\n // Explorer tends to keep connection open, even after the\n // tab gets closed: http://bugs.jquery.com/ticket/5280\n this.unloadRef = utils.unloadAdd(function() {\n debug('unload cleanup');\n self._cleanup(true);\n });\n try {\n this.xhr.open(method, url, true);\n if (this.timeout && 'timeout' in this.xhr) {\n this.xhr.timeout = this.timeout;\n this.xhr.ontimeout = function() {\n debug('xhr timeout');\n self.emit('finish', 0, '');\n self._cleanup(false);\n };\n }\n } catch (e) {\n debug('exception', e);\n // IE raises an exception on wrong port.\n this.emit('finish', 0, '');\n this._cleanup(false);\n return;\n }\n\n if ((!opts || !opts.noCredentials) && AbstractXHRObject.supportsCORS) {\n debug('withCredentials');\n // Mozilla docs says https://developer.mozilla.org/en/XMLHttpRequest :\n // \"This never affects same-site requests.\"\n\n this.xhr.withCredentials = true;\n }\n if (opts && opts.headers) {\n for (var key in opts.headers) {\n this.xhr.setRequestHeader(key, opts.headers[key]);\n }\n }\n\n this.xhr.onreadystatechange = function() {\n if (self.xhr) {\n var x = self.xhr;\n var text, status;\n debug('readyState', x.readyState);\n switch (x.readyState) {\n case 3:\n // IE doesn't like peeking into responseText or status\n // on Microsoft.XMLHTTP and readystate=3\n try {\n status = x.status;\n text = x.responseText;\n } catch (e) {\n // intentionally empty\n }\n debug('status', status);\n // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450\n if (status === 1223) {\n status = 204;\n }\n\n // IE does return readystate == 3 for 404 answers.\n if (status === 200 && text && text.length > 0) {\n debug('chunk');\n self.emit('chunk', status, text);\n }\n break;\n case 4:\n status = x.status;\n debug('status', status);\n // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450\n if (status === 1223) {\n status = 204;\n }\n // IE returns this for a bad port\n // http://msdn.microsoft.com/en-us/library/windows/desktop/aa383770(v=vs.85).aspx\n if (status === 12005 || status === 12029) {\n status = 0;\n }\n\n debug('finish', status, x.responseText);\n self.emit('finish', status, x.responseText);\n self._cleanup(false);\n break;\n }\n }\n };\n\n try {\n self.xhr.send(payload);\n } catch (e) {\n self.emit('finish', 0, '');\n self._cleanup(false);\n }\n};\n\nAbstractXHRObject.prototype._cleanup = function(abort) {\n debug('cleanup');\n if (!this.xhr) {\n return;\n }\n this.removeAllListeners();\n utils.unloadDel(this.unloadRef);\n\n // IE needs this field to be a function\n this.xhr.onreadystatechange = function() {};\n if (this.xhr.ontimeout) {\n this.xhr.ontimeout = null;\n }\n\n if (abort) {\n try {\n this.xhr.abort();\n } catch (x) {\n // intentionally empty\n }\n }\n this.unloadRef = this.xhr = null;\n};\n\nAbstractXHRObject.prototype.close = function() {\n debug('close');\n this._cleanup(true);\n};\n\nAbstractXHRObject.enabled = !!XHR;\n// override XMLHttpRequest for IE6/7\n// obfuscate to avoid firewalls\nvar axo = ['Active'].concat('Object').join('X');\nif (!AbstractXHRObject.enabled && (axo in global)) {\n debug('overriding xmlhttprequest');\n XHR = function() {\n try {\n return new global[axo]('Microsoft.XMLHTTP');\n } catch (e) {\n return null;\n }\n };\n AbstractXHRObject.enabled = !!new XHR();\n}\n\nvar cors = false;\ntry {\n cors = 'withCredentials' in new XHR();\n} catch (ignored) {\n // intentionally empty\n}\n\nAbstractXHRObject.supportsCORS = cors;\n\nmodule.exports = AbstractXHRObject;\n","module.exports = global.EventSource;\n","'use strict';\n\nvar Driver = global.WebSocket || global.MozWebSocket;\nif (Driver) {\n\tmodule.exports = function WebSocketBrowserDriver(url) {\n\t\treturn new Driver(url);\n\t};\n} else {\n\tmodule.exports = undefined;\n}\n","'use strict';\n\nvar inherits = require('inherits')\n , AjaxBasedTransport = require('./lib/ajax-based')\n , EventSourceReceiver = require('./receiver/eventsource')\n , XHRCorsObject = require('./sender/xhr-cors')\n , EventSourceDriver = require('eventsource')\n ;\n\nfunction EventSourceTransport(transUrl) {\n if (!EventSourceTransport.enabled()) {\n throw new Error('Transport created when disabled');\n }\n\n AjaxBasedTransport.call(this, transUrl, '/eventsource', EventSourceReceiver, XHRCorsObject);\n}\n\ninherits(EventSourceTransport, AjaxBasedTransport);\n\nEventSourceTransport.enabled = function() {\n return !!EventSourceDriver;\n};\n\nEventSourceTransport.transportName = 'eventsource';\nEventSourceTransport.roundTrips = 2;\n\nmodule.exports = EventSourceTransport;\n","'use strict';\n\nvar inherits = require('inherits')\n , HtmlfileReceiver = require('./receiver/htmlfile')\n , XHRLocalObject = require('./sender/xhr-local')\n , AjaxBasedTransport = require('./lib/ajax-based')\n ;\n\nfunction HtmlFileTransport(transUrl) {\n if (!HtmlfileReceiver.enabled) {\n throw new Error('Transport created when disabled');\n }\n AjaxBasedTransport.call(this, transUrl, '/htmlfile', HtmlfileReceiver, XHRLocalObject);\n}\n\ninherits(HtmlFileTransport, AjaxBasedTransport);\n\nHtmlFileTransport.enabled = function(info) {\n return HtmlfileReceiver.enabled && info.sameOrigin;\n};\n\nHtmlFileTransport.transportName = 'htmlfile';\nHtmlFileTransport.roundTrips = 2;\n\nmodule.exports = HtmlFileTransport;\n","'use strict';\n\n// Few cool transports do work only for same-origin. In order to make\n// them work cross-domain we shall use iframe, served from the\n// remote domain. New browsers have capabilities to communicate with\n// cross domain iframe using postMessage(). In IE it was implemented\n// from IE 8+, but of course, IE got some details wrong:\n// http://msdn.microsoft.com/en-us/library/cc197015(v=VS.85).aspx\n// http://stevesouders.com/misc/test-postmessage.php\n\nvar inherits = require('inherits')\n , JSON3 = require('json3')\n , EventEmitter = require('events').EventEmitter\n , version = require('../version')\n , urlUtils = require('../utils/url')\n , iframeUtils = require('../utils/iframe')\n , eventUtils = require('../utils/event')\n , random = require('../utils/random')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:transport:iframe');\n}\n\nfunction IframeTransport(transport, transUrl, baseUrl) {\n if (!IframeTransport.enabled()) {\n throw new Error('Transport created when disabled');\n }\n EventEmitter.call(this);\n\n var self = this;\n this.origin = urlUtils.getOrigin(baseUrl);\n this.baseUrl = baseUrl;\n this.transUrl = transUrl;\n this.transport = transport;\n this.windowId = random.string(8);\n\n var iframeUrl = urlUtils.addPath(baseUrl, '/iframe.html') + '#' + this.windowId;\n debug(transport, transUrl, iframeUrl);\n\n this.iframeObj = iframeUtils.createIframe(iframeUrl, function(r) {\n debug('err callback');\n self.emit('close', 1006, 'Unable to load an iframe (' + r + ')');\n self.close();\n });\n\n this.onmessageCallback = this._message.bind(this);\n eventUtils.attachEvent('message', this.onmessageCallback);\n}\n\ninherits(IframeTransport, EventEmitter);\n\nIframeTransport.prototype.close = function() {\n debug('close');\n this.removeAllListeners();\n if (this.iframeObj) {\n eventUtils.detachEvent('message', this.onmessageCallback);\n try {\n // When the iframe is not loaded, IE raises an exception\n // on 'contentWindow'.\n this.postMessage('c');\n } catch (x) {\n // intentionally empty\n }\n this.iframeObj.cleanup();\n this.iframeObj = null;\n this.onmessageCallback = this.iframeObj = null;\n }\n};\n\nIframeTransport.prototype._message = function(e) {\n debug('message', e.data);\n if (!urlUtils.isOriginEqual(e.origin, this.origin)) {\n debug('not same origin', e.origin, this.origin);\n return;\n }\n\n var iframeMessage;\n try {\n iframeMessage = JSON3.parse(e.data);\n } catch (ignored) {\n debug('bad json', e.data);\n return;\n }\n\n if (iframeMessage.windowId !== this.windowId) {\n debug('mismatched window id', iframeMessage.windowId, this.windowId);\n return;\n }\n\n switch (iframeMessage.type) {\n case 's':\n this.iframeObj.loaded();\n // window global dependency\n this.postMessage('s', JSON3.stringify([\n version\n , this.transport\n , this.transUrl\n , this.baseUrl\n ]));\n break;\n case 't':\n this.emit('message', iframeMessage.data);\n break;\n case 'c':\n var cdata;\n try {\n cdata = JSON3.parse(iframeMessage.data);\n } catch (ignored) {\n debug('bad json', iframeMessage.data);\n return;\n }\n this.emit('close', cdata[0], cdata[1]);\n this.close();\n break;\n }\n};\n\nIframeTransport.prototype.postMessage = function(type, data) {\n debug('postMessage', type, data);\n this.iframeObj.post(JSON3.stringify({\n windowId: this.windowId\n , type: type\n , data: data || ''\n }), this.origin);\n};\n\nIframeTransport.prototype.send = function(message) {\n debug('send', message);\n this.postMessage('m', message);\n};\n\nIframeTransport.enabled = function() {\n return iframeUtils.iframeEnabled;\n};\n\nIframeTransport.transportName = 'iframe';\nIframeTransport.roundTrips = 2;\n\nmodule.exports = IframeTransport;\n","'use strict';\n\n// The simplest and most robust transport, using the well-know cross\n// domain hack - JSONP. This transport is quite inefficient - one\n// message could use up to one http request. But at least it works almost\n// everywhere.\n// Known limitations:\n// o you will get a spinning cursor\n// o for Konqueror a dumb timer is needed to detect errors\n\nvar inherits = require('inherits')\n , SenderReceiver = require('./lib/sender-receiver')\n , JsonpReceiver = require('./receiver/jsonp')\n , jsonpSender = require('./sender/jsonp')\n ;\n\nfunction JsonPTransport(transUrl) {\n if (!JsonPTransport.enabled()) {\n throw new Error('Transport created when disabled');\n }\n SenderReceiver.call(this, transUrl, '/jsonp', jsonpSender, JsonpReceiver);\n}\n\ninherits(JsonPTransport, SenderReceiver);\n\nJsonPTransport.enabled = function() {\n return !!global.document;\n};\n\nJsonPTransport.transportName = 'jsonp-polling';\nJsonPTransport.roundTrips = 1;\nJsonPTransport.needBody = true;\n\nmodule.exports = JsonPTransport;\n","'use strict';\n\nvar inherits = require('inherits')\n , urlUtils = require('../../utils/url')\n , SenderReceiver = require('./sender-receiver')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:ajax-based');\n}\n\nfunction createAjaxSender(AjaxObject) {\n return function(url, payload, callback) {\n debug('create ajax sender', url, payload);\n var opt = {};\n if (typeof payload === 'string') {\n opt.headers = {'Content-type': 'text/plain'};\n }\n var ajaxUrl = urlUtils.addPath(url, '/xhr_send');\n var xo = new AjaxObject('POST', ajaxUrl, payload, opt);\n xo.once('finish', function(status) {\n debug('finish', status);\n xo = null;\n\n if (status !== 200 && status !== 204) {\n return callback(new Error('http status ' + status));\n }\n callback();\n });\n return function() {\n debug('abort');\n xo.close();\n xo = null;\n\n var err = new Error('Aborted');\n err.code = 1000;\n callback(err);\n };\n };\n}\n\nfunction AjaxBasedTransport(transUrl, urlSuffix, Receiver, AjaxObject) {\n SenderReceiver.call(this, transUrl, urlSuffix, createAjaxSender(AjaxObject), Receiver, AjaxObject);\n}\n\ninherits(AjaxBasedTransport, SenderReceiver);\n\nmodule.exports = AjaxBasedTransport;\n","'use strict';\n\nvar inherits = require('inherits')\n , EventEmitter = require('events').EventEmitter\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:buffered-sender');\n}\n\nfunction BufferedSender(url, sender) {\n debug(url);\n EventEmitter.call(this);\n this.sendBuffer = [];\n this.sender = sender;\n this.url = url;\n}\n\ninherits(BufferedSender, EventEmitter);\n\nBufferedSender.prototype.send = function(message) {\n debug('send', message);\n this.sendBuffer.push(message);\n if (!this.sendStop) {\n this.sendSchedule();\n }\n};\n\n// For polling transports in a situation when in the message callback,\n// new message is being send. If the sending connection was started\n// before receiving one, it is possible to saturate the network and\n// timeout due to the lack of receiving socket. To avoid that we delay\n// sending messages by some small time, in order to let receiving\n// connection be started beforehand. This is only a halfmeasure and\n// does not fix the big problem, but it does make the tests go more\n// stable on slow networks.\nBufferedSender.prototype.sendScheduleWait = function() {\n debug('sendScheduleWait');\n var self = this;\n var tref;\n this.sendStop = function() {\n debug('sendStop');\n self.sendStop = null;\n clearTimeout(tref);\n };\n tref = setTimeout(function() {\n debug('timeout');\n self.sendStop = null;\n self.sendSchedule();\n }, 25);\n};\n\nBufferedSender.prototype.sendSchedule = function() {\n debug('sendSchedule', this.sendBuffer.length);\n var self = this;\n if (this.sendBuffer.length > 0) {\n var payload = '[' + this.sendBuffer.join(',') + ']';\n this.sendStop = this.sender(this.url, payload, function(err) {\n self.sendStop = null;\n if (err) {\n debug('error', err);\n self.emit('close', err.code || 1006, 'Sending error: ' + err);\n self.close();\n } else {\n self.sendScheduleWait();\n }\n });\n this.sendBuffer = [];\n }\n};\n\nBufferedSender.prototype._cleanup = function() {\n debug('_cleanup');\n this.removeAllListeners();\n};\n\nBufferedSender.prototype.close = function() {\n debug('close');\n this._cleanup();\n if (this.sendStop) {\n this.sendStop();\n this.sendStop = null;\n }\n};\n\nmodule.exports = BufferedSender;\n","'use strict';\n\nvar inherits = require('inherits')\n , IframeTransport = require('../iframe')\n , objectUtils = require('../../utils/object')\n ;\n\nmodule.exports = function(transport) {\n\n function IframeWrapTransport(transUrl, baseUrl) {\n IframeTransport.call(this, transport.transportName, transUrl, baseUrl);\n }\n\n inherits(IframeWrapTransport, IframeTransport);\n\n IframeWrapTransport.enabled = function(url, info) {\n if (!global.document) {\n return false;\n }\n\n var iframeInfo = objectUtils.extend({}, info);\n iframeInfo.sameOrigin = true;\n return transport.enabled(iframeInfo) && IframeTransport.enabled();\n };\n\n IframeWrapTransport.transportName = 'iframe-' + transport.transportName;\n IframeWrapTransport.needBody = true;\n IframeWrapTransport.roundTrips = IframeTransport.roundTrips + transport.roundTrips - 1; // html, javascript (2) + transport - no CORS (1)\n\n IframeWrapTransport.facadeTransport = transport;\n\n return IframeWrapTransport;\n};\n","'use strict';\n\nvar inherits = require('inherits')\n , EventEmitter = require('events').EventEmitter\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:polling');\n}\n\nfunction Polling(Receiver, receiveUrl, AjaxObject) {\n debug(receiveUrl);\n EventEmitter.call(this);\n this.Receiver = Receiver;\n this.receiveUrl = receiveUrl;\n this.AjaxObject = AjaxObject;\n this._scheduleReceiver();\n}\n\ninherits(Polling, EventEmitter);\n\nPolling.prototype._scheduleReceiver = function() {\n debug('_scheduleReceiver');\n var self = this;\n var poll = this.poll = new this.Receiver(this.receiveUrl, this.AjaxObject);\n\n poll.on('message', function(msg) {\n debug('message', msg);\n self.emit('message', msg);\n });\n\n poll.once('close', function(code, reason) {\n debug('close', code, reason, self.pollIsClosing);\n self.poll = poll = null;\n\n if (!self.pollIsClosing) {\n if (reason === 'network') {\n self._scheduleReceiver();\n } else {\n self.emit('close', code || 1006, reason);\n self.removeAllListeners();\n }\n }\n });\n};\n\nPolling.prototype.abort = function() {\n debug('abort');\n this.removeAllListeners();\n this.pollIsClosing = true;\n if (this.poll) {\n this.poll.abort();\n }\n};\n\nmodule.exports = Polling;\n","'use strict';\n\nvar inherits = require('inherits')\n , urlUtils = require('../../utils/url')\n , BufferedSender = require('./buffered-sender')\n , Polling = require('./polling')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:sender-receiver');\n}\n\nfunction SenderReceiver(transUrl, urlSuffix, senderFunc, Receiver, AjaxObject) {\n var pollUrl = urlUtils.addPath(transUrl, urlSuffix);\n debug(pollUrl);\n var self = this;\n BufferedSender.call(this, transUrl, senderFunc);\n\n this.poll = new Polling(Receiver, pollUrl, AjaxObject);\n this.poll.on('message', function(msg) {\n debug('poll message', msg);\n self.emit('message', msg);\n });\n this.poll.once('close', function(code, reason) {\n debug('poll close', code, reason);\n self.poll = null;\n self.emit('close', code, reason);\n self.close();\n });\n}\n\ninherits(SenderReceiver, BufferedSender);\n\nSenderReceiver.prototype.close = function() {\n BufferedSender.prototype.close.call(this);\n debug('close');\n this.removeAllListeners();\n if (this.poll) {\n this.poll.abort();\n this.poll = null;\n }\n};\n\nmodule.exports = SenderReceiver;\n","'use strict';\n\nvar inherits = require('inherits')\n , EventEmitter = require('events').EventEmitter\n , EventSourceDriver = require('eventsource')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:receiver:eventsource');\n}\n\nfunction EventSourceReceiver(url) {\n debug(url);\n EventEmitter.call(this);\n\n var self = this;\n var es = this.es = new EventSourceDriver(url);\n es.onmessage = function(e) {\n debug('message', e.data);\n self.emit('message', decodeURI(e.data));\n };\n es.onerror = function(e) {\n debug('error', es.readyState, e);\n // ES on reconnection has readyState = 0 or 1.\n // on network error it's CLOSED = 2\n var reason = (es.readyState !== 2 ? 'network' : 'permanent');\n self._cleanup();\n self._close(reason);\n };\n}\n\ninherits(EventSourceReceiver, EventEmitter);\n\nEventSourceReceiver.prototype.abort = function() {\n debug('abort');\n this._cleanup();\n this._close('user');\n};\n\nEventSourceReceiver.prototype._cleanup = function() {\n debug('cleanup');\n var es = this.es;\n if (es) {\n es.onmessage = es.onerror = null;\n es.close();\n this.es = null;\n }\n};\n\nEventSourceReceiver.prototype._close = function(reason) {\n debug('close', reason);\n var self = this;\n // Safari and chrome < 15 crash if we close window before\n // waiting for ES cleanup. See:\n // https://code.google.com/p/chromium/issues/detail?id=89155\n setTimeout(function() {\n self.emit('close', null, reason);\n self.removeAllListeners();\n }, 200);\n};\n\nmodule.exports = EventSourceReceiver;\n","'use strict';\n\nvar inherits = require('inherits')\n , iframeUtils = require('../../utils/iframe')\n , urlUtils = require('../../utils/url')\n , EventEmitter = require('events').EventEmitter\n , random = require('../../utils/random')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:receiver:htmlfile');\n}\n\nfunction HtmlfileReceiver(url) {\n debug(url);\n EventEmitter.call(this);\n var self = this;\n iframeUtils.polluteGlobalNamespace();\n\n this.id = 'a' + random.string(6);\n url = urlUtils.addQuery(url, 'c=' + decodeURIComponent(iframeUtils.WPrefix + '.' + this.id));\n\n debug('using htmlfile', HtmlfileReceiver.htmlfileEnabled);\n var constructFunc = HtmlfileReceiver.htmlfileEnabled ?\n iframeUtils.createHtmlfile : iframeUtils.createIframe;\n\n global[iframeUtils.WPrefix][this.id] = {\n start: function() {\n debug('start');\n self.iframeObj.loaded();\n }\n , message: function(data) {\n debug('message', data);\n self.emit('message', data);\n }\n , stop: function() {\n debug('stop');\n self._cleanup();\n self._close('network');\n }\n };\n this.iframeObj = constructFunc(url, function() {\n debug('callback');\n self._cleanup();\n self._close('permanent');\n });\n}\n\ninherits(HtmlfileReceiver, EventEmitter);\n\nHtmlfileReceiver.prototype.abort = function() {\n debug('abort');\n this._cleanup();\n this._close('user');\n};\n\nHtmlfileReceiver.prototype._cleanup = function() {\n debug('_cleanup');\n if (this.iframeObj) {\n this.iframeObj.cleanup();\n this.iframeObj = null;\n }\n delete global[iframeUtils.WPrefix][this.id];\n};\n\nHtmlfileReceiver.prototype._close = function(reason) {\n debug('_close', reason);\n this.emit('close', null, reason);\n this.removeAllListeners();\n};\n\nHtmlfileReceiver.htmlfileEnabled = false;\n\n// obfuscate to avoid firewalls\nvar axo = ['Active'].concat('Object').join('X');\nif (axo in global) {\n try {\n HtmlfileReceiver.htmlfileEnabled = !!new global[axo]('htmlfile');\n } catch (x) {\n // intentionally empty\n }\n}\n\nHtmlfileReceiver.enabled = HtmlfileReceiver.htmlfileEnabled || iframeUtils.iframeEnabled;\n\nmodule.exports = HtmlfileReceiver;\n","'use strict';\n\nvar utils = require('../../utils/iframe')\n , random = require('../../utils/random')\n , browser = require('../../utils/browser')\n , urlUtils = require('../../utils/url')\n , inherits = require('inherits')\n , EventEmitter = require('events').EventEmitter\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:receiver:jsonp');\n}\n\nfunction JsonpReceiver(url) {\n debug(url);\n var self = this;\n EventEmitter.call(this);\n\n utils.polluteGlobalNamespace();\n\n this.id = 'a' + random.string(6);\n var urlWithId = urlUtils.addQuery(url, 'c=' + encodeURIComponent(utils.WPrefix + '.' + this.id));\n\n global[utils.WPrefix][this.id] = this._callback.bind(this);\n this._createScript(urlWithId);\n\n // Fallback mostly for Konqueror - stupid timer, 35 seconds shall be plenty.\n this.timeoutId = setTimeout(function() {\n debug('timeout');\n self._abort(new Error('JSONP script loaded abnormally (timeout)'));\n }, JsonpReceiver.timeout);\n}\n\ninherits(JsonpReceiver, EventEmitter);\n\nJsonpReceiver.prototype.abort = function() {\n debug('abort');\n if (global[utils.WPrefix][this.id]) {\n var err = new Error('JSONP user aborted read');\n err.code = 1000;\n this._abort(err);\n }\n};\n\nJsonpReceiver.timeout = 35000;\nJsonpReceiver.scriptErrorTimeout = 1000;\n\nJsonpReceiver.prototype._callback = function(data) {\n debug('_callback', data);\n this._cleanup();\n\n if (this.aborting) {\n return;\n }\n\n if (data) {\n debug('message', data);\n this.emit('message', data);\n }\n this.emit('close', null, 'network');\n this.removeAllListeners();\n};\n\nJsonpReceiver.prototype._abort = function(err) {\n debug('_abort', err);\n this._cleanup();\n this.aborting = true;\n this.emit('close', err.code, err.message);\n this.removeAllListeners();\n};\n\nJsonpReceiver.prototype._cleanup = function() {\n debug('_cleanup');\n clearTimeout(this.timeoutId);\n if (this.script2) {\n this.script2.parentNode.removeChild(this.script2);\n this.script2 = null;\n }\n if (this.script) {\n var script = this.script;\n // Unfortunately, you can't really abort script loading of\n // the script.\n script.parentNode.removeChild(script);\n script.onreadystatechange = script.onerror =\n script.onload = script.onclick = null;\n this.script = null;\n }\n delete global[utils.WPrefix][this.id];\n};\n\nJsonpReceiver.prototype._scriptError = function() {\n debug('_scriptError');\n var self = this;\n if (this.errorTimer) {\n return;\n }\n\n this.errorTimer = setTimeout(function() {\n if (!self.loadedOkay) {\n self._abort(new Error('JSONP script loaded abnormally (onerror)'));\n }\n }, JsonpReceiver.scriptErrorTimeout);\n};\n\nJsonpReceiver.prototype._createScript = function(url) {\n debug('_createScript', url);\n var self = this;\n var script = this.script = global.document.createElement('script');\n var script2; // Opera synchronous load trick.\n\n script.id = 'a' + random.string(8);\n script.src = url;\n script.type = 'text/javascript';\n script.charset = 'UTF-8';\n script.onerror = this._scriptError.bind(this);\n script.onload = function() {\n debug('onload');\n self._abort(new Error('JSONP script loaded abnormally (onload)'));\n };\n\n // IE9 fires 'error' event after onreadystatechange or before, in random order.\n // Use loadedOkay to determine if actually errored\n script.onreadystatechange = function() {\n debug('onreadystatechange', script.readyState);\n if (/loaded|closed/.test(script.readyState)) {\n if (script && script.htmlFor && script.onclick) {\n self.loadedOkay = true;\n try {\n // In IE, actually execute the script.\n script.onclick();\n } catch (x) {\n // intentionally empty\n }\n }\n if (script) {\n self._abort(new Error('JSONP script loaded abnormally (onreadystatechange)'));\n }\n }\n };\n // IE: event/htmlFor/onclick trick.\n // One can't rely on proper order for onreadystatechange. In order to\n // make sure, set a 'htmlFor' and 'event' properties, so that\n // script code will be installed as 'onclick' handler for the\n // script object. Later, onreadystatechange, manually execute this\n // code. FF and Chrome doesn't work with 'event' and 'htmlFor'\n // set. For reference see:\n // http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html\n // Also, read on that about script ordering:\n // http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order\n if (typeof script.async === 'undefined' && global.document.attachEvent) {\n // According to mozilla docs, in recent browsers script.async defaults\n // to 'true', so we may use it to detect a good browser:\n // https://developer.mozilla.org/en/HTML/Element/script\n if (!browser.isOpera()) {\n // Naively assume we're in IE\n try {\n script.htmlFor = script.id;\n script.event = 'onclick';\n } catch (x) {\n // intentionally empty\n }\n script.async = true;\n } else {\n // Opera, second sync script hack\n script2 = this.script2 = global.document.createElement('script');\n script2.text = \"try{var a = document.getElementById('\" + script.id + \"'); if(a)a.onerror();}catch(x){};\";\n script.async = script2.async = false;\n }\n }\n if (typeof script.async !== 'undefined') {\n script.async = true;\n }\n\n var head = global.document.getElementsByTagName('head')[0];\n head.insertBefore(script, head.firstChild);\n if (script2) {\n head.insertBefore(script2, head.firstChild);\n }\n};\n\nmodule.exports = JsonpReceiver;\n","'use strict';\n\nvar inherits = require('inherits')\n , EventEmitter = require('events').EventEmitter\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:receiver:xhr');\n}\n\nfunction XhrReceiver(url, AjaxObject) {\n debug(url);\n EventEmitter.call(this);\n var self = this;\n\n this.bufferPosition = 0;\n\n this.xo = new AjaxObject('POST', url, null);\n this.xo.on('chunk', this._chunkHandler.bind(this));\n this.xo.once('finish', function(status, text) {\n debug('finish', status, text);\n self._chunkHandler(status, text);\n self.xo = null;\n var reason = status === 200 ? 'network' : 'permanent';\n debug('close', reason);\n self.emit('close', null, reason);\n self._cleanup();\n });\n}\n\ninherits(XhrReceiver, EventEmitter);\n\nXhrReceiver.prototype._chunkHandler = function(status, text) {\n debug('_chunkHandler', status);\n if (status !== 200 || !text) {\n return;\n }\n\n for (var idx = -1; ; this.bufferPosition += idx + 1) {\n var buf = text.slice(this.bufferPosition);\n idx = buf.indexOf('\\n');\n if (idx === -1) {\n break;\n }\n var msg = buf.slice(0, idx);\n if (msg) {\n debug('message', msg);\n this.emit('message', msg);\n }\n }\n};\n\nXhrReceiver.prototype._cleanup = function() {\n debug('_cleanup');\n this.removeAllListeners();\n};\n\nXhrReceiver.prototype.abort = function() {\n debug('abort');\n if (this.xo) {\n this.xo.close();\n debug('close');\n this.emit('close', null, 'user');\n this.xo = null;\n }\n this._cleanup();\n};\n\nmodule.exports = XhrReceiver;\n","'use strict';\n\nvar random = require('../../utils/random')\n , urlUtils = require('../../utils/url')\n ;\n\nvar debug = function() {};\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:sender:jsonp');\n}\n\nvar form, area;\n\nfunction createIframe(id) {\n debug('createIframe', id);\n try {\n // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n return global.document.createElement('