diff --git a/.eslintrc b/.eslintrc index 67f3d60..bd8d29f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,14 +1,3 @@ -eslintConfig: - root: true - -ecmaFeatures: - modules: true - jsx: true - arrowFunctions: true - blockBindings: true - classes: true - defaultParams: true - env: amd: true browser: true @@ -17,11 +6,10 @@ env: node: true jasmine: true mocha: true - parserOptions: sourceType: module - -# http://eslint.org/docs/rules/ + ecmaFeatures: + jsx: true rules: # Possible Errors comma-dangle: [0, never] diff --git a/.gitignore b/.gitignore index ae695bb..89f9dc1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,42 +1,11 @@ -#### joe made this: https://goel.io/joe - #####=== JetBrains ===##### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm - -*.iml - -## Directory-based project format: .idea/ -# if you remove the above rule, at least ignore the following: - -# User-specific stuff: -# .idea/workspace.xml -# .idea/tasks.xml -# .idea/dictionaries - -# Sensitive or high-churn files: -# .idea/dataSources.ids -# .idea/dataSources.xml -# .idea/sqlDataSources.xml -# .idea/dynamic.xml -# .idea/uiDesigner.xml - -# Gradle: -# .idea/gradle.xml -# .idea/libraries - -# Mongo Explorer plugin: -# .idea/mongoSettings.xml ## File-based project format: *.ipr *.iws ## Plugin-specific files: - -# IntelliJ -out/ - # mpeltonen/sbt-idea plugin .idea_modules/ @@ -56,7 +25,6 @@ crashlytics-build.properties # Icon must end with two \r Icon - # Thumbnails ._* @@ -72,7 +40,6 @@ Temporary Items .apdisk #####=== Node ===##### - # Logs logs *.log @@ -85,9 +52,6 @@ pids # Directory for instrumented libs generated by jscoverage/JSCover lib-cov -# Coverage directory used by tools like istanbul -coverage - # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt @@ -127,16 +91,10 @@ deeploy.json* # Frontend dependencies **/js/vendor/ **/frontend/vendor/ +**/frontend/js/lib/deep-framework.js # Tests resources -GitDiffWalker.js -S3CoverageSynchronizer.js -CoverageComparator.js -CoverageManager.js -GitHubMsgPublisher.js -_vars.sh -/package.json -**/.sass-cache/ +coverage.lcov **/coverage/ **/coverages/ diff --git a/.recink.yml b/.recink.yml new file mode 100644 index 0000000..5bc07b3 --- /dev/null +++ b/.recink.yml @@ -0,0 +1,60 @@ +--- +$: + preprocess: + '$.coverage.compare.storage.options.1.region': 'eval' + '$.coverage.compare.storage.options.1.accessKeyId': 'eval' + '$.coverage.compare.storage.options.1.secretAccessKey': 'eval' + '$.cache.options.1.region': 'eval' + '$.cache.options.1.accessKeyId': 'eval' + '$.cache.options.1.secretAccessKey': 'eval' + '$.codeclimate.token': 'eval' + cache: + driver: 's3' + options: + - 's3://travis-metadata/cache/MitocGroup/deep-microservices-benchmarking' + - + region: 'process.env.AWS_DEFAULT_REGION' + accessKeyId: 'process.env.AWS_ACCESS_KEY_ID' + secretAccessKey: 'process.env.AWS_SECRET_ACCESS_KEY' + npm: + scripts: [] + emit: + pattern: + - /.+\.js$/i + ignore: + - /^(.*\/)?backend(\/?$)?/i + - /^(.*\/)?frontend(\/?$)?/i + - /^(.*\/)?node_modules(\/?$)?/i + test: + mocha: + options: + check-leaks: true + retries: 2 + pattern: + - /.+\.spec\.js$/i + ignore: ~ + coverage: + pattern: + - /.+\.js$/i + ignore: + - /.+\.spec\.js$/i + reporters: + text-summary: ~ + lcovonly: + file: ./coverage.lcov + compare: + negative-delta: 1 + storage: + driver: 's3' + options: + - 's3://travis-metadata/coverage/MitocGroup/deep-microservices-benchmarking' + - + region: 'process.env.AWS_DEFAULT_REGION' + accessKeyId: 'process.env.AWS_ACCESS_KEY_ID' + secretAccessKey: 'process.env.AWS_SECRET_ACCESS_KEY' + codeclimate: + token: 'process.env.CODECLIMATE_REPO_TOKEN' + +### Add other modules here... +test-microservice: + root: src/deep-benchmarking diff --git a/.travis.yml b/.travis.yml index 47e734c..7d4aa23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,52 +1,35 @@ language: node_js -sudo: required -node_js: - - '6.10' - - '7.8' +dist: trusty +git: + depth: 1 cache: edge: true directories: - - $(npm root -g) - node_modules - - deep_modules - - $(npm config get prefix)/bin + - "$(npm root -g)" + - "$(npm config get prefix)/bin" branches: only: - master - - dev - stage - test -before_install: - - cp bin/test/package.json . -after_success: - - npm run coverage -after_script: - - npm run remove-coverage + - dev env: global: - - MAJOR_VERSIONS=master - - DEEP_NO_INTERACTION=1 - - E2E_TESTING=none - - secure: - NAdPvpG4O8G0UL5Mc8CWmWLmpZxqquNu+k61GR4ozC7x+HL85vcc8mOu8fmNeO2SbPH+8yovi9sxvMZZBI2sC+K23u44OrcDG3oTjLGvg+uKYlXtwKCRly/jUOXAzEehJupptm4HFb56APDRYX63pNXaXOOSEccqHNa5/MspQflj3cggGyOJ1bj71PH/eQmPOJDOQZkDDNDnfZq19dHWCEeNnAKpXpk4R9DYBhej3cXpfae+puNnjUUr1DYk6st3OsHw/lcc9OKZPRBNOGCWA7gLHCNGmX1bUtfGAZhzrjhsW8woT33/NZqPr7ICLHzpsTuCmNXx0SUKo6Ogiw+Nf4JEG06sJv9iaQD+cK0hD2zeMgs4Oaa9XE1bWYL7VuxjpMzDzJMSvBhYupQ+0UexrEMg9ze2YbDO0B2E4bx1M/33ztaoqOzqy6GCMwj7JWNO3dgKQJvM+9c6VtU8TofBNqB+ROVSFJCFGrO7qOrFGwyo3bVHyzYe7gPOzH2fmfFRdVpEbr0nLwaSB1YvqTjbu+RG7LdgVk5UoiPM7kZOYTGsWIws+hrtSVo6UPZxdWUGirvGewpV8Q7BzduK4urQ6UjDiFqfz4Cx+c1I+fxUW7ZieHhsEsziKU7M9cTQQ5fmELH3HlJDyWd6ME/NQXNHae0K/IpdsFoT+FC25Iu+Cww= - - secure: - WG1ANBRgNx/tKZ18L8+/jT17HoWssqLcC0fasMpVE/mt9LDHSKsa2si2YdrHuawnQPKb1y7XBgdwXznwoizpj8Nii4EJZDTj1rLNHRAxyLvsp4USbwHjp0pHm8KJh58wp+12ySUVCQynZothOR/SRz7zDSy1E/eMqFTUIZBrXY4yB1NqHJZVes2XbwFZo3PLwXDb713q7NZ5eTyLWWwDdCj9t35B8ZVfDNehoni65tY+4IeicfjoaBqm2zHrm58jnWygM5Q3ZV7jNU7Y1aemm9zOU+K46mhIJfStO9mTsyoIG57vR+r5FsM11DVknI8Nl9uWFUicSTgGag3Gfj7zJc43HPLyRfzSAXjN2Np5VCukoh736P/HNDwqqaBaNxhubkoWXu2YDH2G0FAXwnJ79CwpF/LfIFZyQsWhlEDJeGW/Yb0rmTxkXQc2EO6RflM5bfAB4vkUbl2UUc07l7nQ2re5g++YopRYnO1Up57CsIXXnYze6kFLV3h0HX60CYPH/VCN3br06x5ZxIw05RRO3GP6ZiTJGBZk8SmNBus/rAogImXrodtxPyvdf25gS3NobY50UjaKHOKZjBMtCavqzRzloXe8xwF0TYhvhh1A0+a3+5ibLEnsAYbCWMawz5htY1f+SkqfQiL2Z3CLR1KXi9M0tU+euSLzcOhr1R/ZwI0= - - secure: - dctYM6vGxR9HiYRDJymcLykmMEU4SiU9N4hvWUuJXCvNJ0uSZNTplEdeLR9Mryb9MctomfqijxupSf1zsM25tqeyRtkZgmAG0NkLkvSNbKHIKEgOvkovtXoDPYFjDTF/XiAmEiwjwEZzdOg53UvvPL5L2jaxfIdM+Yrcl0hnh1y1ORqMvgshyhgt6JJ2DI+3ZgdKF6n+DbqdTqf0mMm7zh8lVkKkMK6/If8eFlJ65IYMOrcd5/hL78p8bgKpqfQWYP5du/9V5Gnzb+1+2GhsRJwC+2ueDgAZZBQ+8NklUEFQKjZ4EaGZaa95mgXZOTi69dFvviVePlykQpA3xJjlCKqQTnAfIv+9HRhyVyDqLWa8J/sMD3yX5cSz21FP4+3cR2cZsbOipFik2O7ekpcTMJ5zwI0OI6VdJ8SeiqIxv2Sh3TZF2FG2eH1UdIFUxSmRC6QpPQYpAKkkmMFeNeCDRvmA/5uFabLH0NK0WuJGovbJ4nus5o/3OQd8VkRSp9cBruaqBoMc/ukKujoo+yGX2j6lz/vIAv82wCkUbnrH5I+m7eeUIvrAkWV3hE0Y3tiWm/envZpVsTLRNyE2wtgtsqFRVkCQTvZ0uGEGlSS0skNAI//OHcIyQRW+uoO1oS1gbQzSYt3YZ5iQIJ2DMhO1WY8Rv+CMtsLmFShuRqg6t7M= - - secure: - n6vGISUVXMa9Ij75sw4qgOKQEAftUAF2wh9onpBfz4//glCayDbnh5ACm6dAOsCtGEK1pnADu1fwjDLMQZt/gg0GyRcfyqIKCN4DxrxTdjX+wEZdM/y9xcUmDZdUPveWqz3Wp1vmFQLYg6XlC5XPhHC1kRHpfson9CcpQAl7mBqzFmmNTjrbaroMfc4m5X/cpbW9/eRYuroFXNJ8yJqouPK9djDuA4VdZlDeDVSNkwiGfea7Q724jUwWlCEQ8GjEs3n6IHF3tQFcM7EcJmVEmLlS+YOAjd3rqFMAPqB9SxRqV5jbDyQE9nfW5lMSbjHNrSGrsouFixpR9oAGBbexIby62iRD7sKxFGqhcSGrl3p4Zhx4QM3yunAC9cqv2DYtu0DcvZjRLqNrmRCIhHrEgyEBJFetjKY34X4PhiXWcs7aK8fUiOLdkZuLtSeVnH3nL4Pym1QOTUi/S/J7Ty+O3Vc2ddR2J090OM8CUrDrI3m3cdS5dM6lf/vGWAsVrcjpj86iiCAS70Y9XniSE4Usvxt6bSvSK/XM2ZAJeWgdDO5TtRuqZzCVylX4Ifo2hRjkzPhMSC7AqpVFHZo4Fno6WsSfgObrbjIyx453EdTBPAXMsWsMEP0zo/af21jHfn75WyU9KriWHVIsErYj0hyh2/vkoNvR+jrbo17T0/ppLYo= - - secure: - f8z9bPehA4WYWULitZoWl1YDiH5kkovn8a2EEvpvZwc5v9ZlixR0VFHks/kz13SVPegan0rx4vL9htGT6OHMKpN9pwjLipNmhYeFaVBfQIFTe5Iif1YsoVGsWsMp71vfs115JYMn6ys3kOy4qAtr8YxUTVVZAb9C2ShcoOaKA8lQzPVSjyIdUnYCpecm94OhTf7P6K6UV3+WmHphDpACOkh/p7/A3zg5IBMM72zPOuBpb3pjqgzMFQu2Egeg3wCIVy3jfBvnB0wnmQHvh8dWXTYmMef3wxl1jl3gYGAqcbHxjhYNvtGLBsWSaCOXSA+ozl2nXFFvn+sfXDIi5klrwI5KADaMC8HkAS31UPeTU8CgZx1GVTUojDGGlE/bX9yzQ9Gmsdd02fK0+5xRl2S2feClR9W+y1J8MXJGPXhSz9izvN0Fdw8WU0wsFMQbrV+Enn6Z5jCYDqMIHCChTM+nQY9Ty10ntardBzlMaAXnA4jHZzi9qpuE9GiJvlpIr+tX8QKqWYzG6gKFtZhfRnUyl/ZdDraxVI8i5wkHjbKAXRfc/sBThebMM6MbV7r72TQRyIf4WDXiOQ1LgvXvex4f8v+aAmVB82on4iCxPJEYG4sBtOKVhKHVrcxVq3vbUFH8HbmHfD5Kg1vacVmhMS2C3m1hmVcvgbtmiYcbm8drHhA= - - secure: - CbJxEnWNRgGCPlZmRgh3qp582f61MUUmQowHOgMwAzVMe4oc3U7SJJtACGlZJXw0mehyycBau7hJhSbdGemcxYywUwng69YgKwN0Y0VIQNKBiWtpXGaTyCNzD5HzOH6fThLuXTgEEK1vkJWZajHJMoLQImtywr3u43Nqlf2rJkF+Pu6QjDjDhUwpHmqNS2ZxYJcw9RRht8WskskqmDVwC/QnA7LaIVa5FWxWvMwkj0wWILDAuSzHLLvD5PKkzmHtGjyLW1P9EbHi9qYAIats5M7VTLLERT4ZqF23HYS8D/qeNMjKry3lXifh0Y9krNHgJeRlserDYR6NpFPXNSWgjhtZcJmlzydIG5dAe+XORMV1m16Bk1bdxdoTbEI72pAaSlfUvfhiQm2rIteg/RZ3S3zJzowVx0LzaruJrtcNhEsszCsZqTxN2OLqSdw3cJ7We0MN88RIEbai+XyVd9y/fQGwUUaHRwx9hfHCZRuk1+3fNC09qEFjHMlfHpKoyTOssLW4rt8hHG4bC+IwwcEAF8c7EnRBTPS/JxNsS/3/bel0g1WcxCbeGN7CvXqGknNHXME0iZHdvQgSPs6Ea8fMbyzGewcCO87dh1PQKouHBFh3fBHJb4v7FB3snnH1poGR+ZM9R+Eg40HAWfsGgKqRlk81KoxuI79DEZCZe0VSE6w= - - secure: - pLoiDL36oJhc957vIM6IpFWceH+gQfBfEecKL8kddV58TWtb81+/6/uX3NNKRO6IVDtQ0qy6BjV4Y20UIiaXyHO3vVA4i/KsXT8wyd9v2/uOXY2knFGw2feZIyftFmbJ7Iw2TmwnsVZiIe5uEiXwaop62Mgb1vlsAWI/FKyiVzbIi719bhtNKkCiL1pPSA0jdX3Cd7nffsVD7PYyj7TrW8/LNaT2regKuaXV9LcUPJo7DockTrdG+fysaxHg0y6wJqi0oA70qyCH6jYaP3sG75Pvte8pCaLzhFR43ffhMsr1uoEXdxth8KkGc2tSw9nojPusNUVXJ0UlGUM0pSA4Zk+arrft8PkapXD8Jy/muKapLbHamDVBCK34hzxKeRtL4Tl2t8TCCxu6zuaTdHWvI+81lNmAklSjF5Rp55dZq2qFmyigg3g6Dele6D1qi9iIyaX1mbl0WAHNItQMU+gWP1cVX8O/+1/BDCCtMq3+JQYy0wsaZY+NTQJYzGR7P9sYeB8cqMmjlvjie2Ju9QJ7WC5fjc8CjW0/oarW9V5LaOJDfN/0UT8cayAfB9TwPTUgWgy1TXNju5RyOpfQSHjJA//FWQkOTqZ2k+2dZol5sCeX4nqkHlORAmZea7sjyfJGQlCTePC3ntE3qlitcTDpIFvmgrdXNiYyQFHk5FJjAWs= - - secure: - RAILR82mY2uP43UaQIWIaK0vhmHtsgoVOarSlSh+bigOi6Jaarzj7bc2pgUFHsEZnsWROSMdpTAnjIjA5Y238c0FFhc/jgBqoSQVqkoApFDjArVQAaGssWxOVJPqmA5JHtthS+Bngjvg4QHbANKGKId/suOhRKmi7NpCt7MxinIl5FoyHC23W4D6Zkjc9lSAZ2HPnY+qd0P8CYex+4Wg7alSSh/Ff0qdl1HJya38y6DIcpmqFMCu+i7ZG/OsqYN5G2+dEFCsuJIURm2Alj8TJcLBBR4YDtE42TTH4nwaSm3L6S6DJq388R9vRQHiZOeugRfAFej87YDC0sfd+LAqFaf5Xp/tPeE/XtgsB24qfc3r+fvW9BF0tpNa0D8LuY9FvxbsnHEYVqDxuXucLCcRKTHPfdKUSa/X3uFY+GYXId7XrYcTvI24DqEQaOxIWdSvRfkFQA9ChZKWo1fUvp6z47a5gdHOPVd1G2BQ/w8Jv/EzrIpJHXh2RXcZreZePkXuc7BaIMNGR/PJxHeSvaa+zMSzAtwlIz74Qx3pKIl79fQkQs4FOUeyjNxQRTR9P58CgXZcpjte2yWt0vvlkaKQqCzDoWjhDwQfwLogOdakIsrzNVp48V6jXkjMbHXW2oNOQBvBDS/rCRghSO3uStRoZIFRtxgC2Z0wyz7OyfCxRFg= - matrix: - - TEST_SUITE=backend - - TEST_SUITE=frontend -notifications: - slack: - secure: - V82TJsFHbmVgD34fqV0HBreCnP7Iyj4X2HIAfN3ZdEHSv6Ct744eNrp1heze8wlE9a9zPZzA6AeX+JswnjXh5jOZfpBwQiiBTQNX3NFmQTp5z+PYT1xasL0EAAS5YWwPD0naLFl/5vR8WjWWgB+m4DmQVcTO+NcUnHuBNHOPz/1Ou/um2sJ+7m9BHYOX6j+ZPZ43n2gXKB2sKWs+O4chxwmOOavTf2/uf047B+BPATwdU7IrEMzJOOOLUxS/OdCvcs/9QEVQIhYX+6A2zAwRTwO1JIuvWsatU0Gd8KIddS5v604aGGYlJ+7vZ8pA9eDpRESBW+uHVymbrpvN6z6Nyna8wJ8YM2dm/Z20mBACq9y3PJ9KQDrwWO9e7QpSKLDTCosDV7c7yRc6F3yeUtXXO4c/bD+IAIgmUWtPEFKS+4G/ZOHTDNRm9jSfUAXDtFhkrPvCH+Ozm+DYpUhhHKxC9SoabcM/4i4dHkii8PpsXWz6/ZXEWyOxIdoUeI1cVDWQRBJ6D2hisBUIu+3FyW2ITgrCOnAWm2wXvX2z3R6qjAbcmCRREkR3UVy5wx7KidN3Ytj9sZdsuA7JH0I+TalHZM6zZU29rBe3pl80yCHNA4ePSAJkx5zBOFOZ2cdlsroipuxi6+4NCHWkznl2rNv9CIXZR9nCtCca8LgphC9ueDs= + # CODECLIMATE_REPO_TOKEN=[secure] + - secure: "fRdlX4tG3L7ZI1DOnbMuwYXRCUL10wgQkhXhbuxEr93M7n0SLF7PlFMizAUffpwRqGR2U0SG+MQlVa04+15aHBM591DVcb9IqXGQpVsyJvgvMq9m2uAyxw+/+KdNpI/G8UvRi/9poL1DDYvUgMeDmA4c1narClPTUZjv14ExCHBBZruw8AGvDwH58HSFSGiSYMz6E7jBkFddTq974EMRxiCKG7+tdrk5d5To6FP3N5MbhQs2Mb3JZZHyoyKsMnQMue59Elpqsp1iaIUVbeSAqexArMWspAhx0VjXNO9aOVaK3zcCU7X45sBWvTUdj3jDGfxzDq4YlBDyGUWIweb8pz64PsPC8MVl9ocphkk4iVKi941nFcdVDHAFoS2rMVriIUo4OgtbxfE5G//EVb3cJTDkLXdyZ4uIZ0t1KCQeIeAAh4j2VrfQjgQTGYoTXcd31Ge+BM2VNl2QIWHmkPrgCVf4JZBDRd9tFhTxwYBMHWrpMDT8JYetrRMrI50hiv/CWQHxwAuBE0dW8csEU9WPMgFm+TZy/qNes3BpXb+KjiVfvsW3+Ag9LgQwdzgr0/s5RI9wMPh5lwDOImeXr1ZpF/2mA1I/ThLGN2wwTr4ArpC7kDE79RtrhQarCqWYmVrEdxJMfuEWL61lrKbSc4Qxg5snWamKkq/n0qQ9s5HXK2U=" + # AWS_DEFAULT_REGION=[secure] + - secure: "dnoGWOYOCrjSkRvTbBHql+7NLkcp/SpGguzCh2U4Ztw+WmtkJ3JhFUSOIkg3XvY2sHtjzNiuyAY0LSDiAYPzNAkgJteEho8rXx38gvXe3cE2BcZhEBJbsypmVO30svtj3+4DXosTqPJ1fGmno+k2EOsz6OL4qbykx0kfvOdcE6Lri0XIWhWu/PYPdhJZ+3KV9lIEo0G1ubvPMnnPuhbs0Gs0VqqtGa1zkDXElzZ8Xr0ufe+CkHrHshSZVjgWpcR7Dra1Dwjag0n+K/Gzbt34Vy7W5VYeuXpDXUA2HrYWUiWeS6KrNF8wf8z6dqdPGpiZzn5UXEfDy/etC6ReSSqduCP8mpYp7w4Grd/tn/AFJC80TvNx1Hf6fvMxySNrjA8fvXmTTJHfG+SgGwHQy3fuKMOQrd+LgwXLEIpU2y8ZhqAGHkHp7/OffPgRFTbVShcW/7X5Ppp+mP6CcAipYpMS9wOGnzcWKEOgv8xZN2+Mv3rv7TWIboASZJL6mzddiQlnh2ge+YUZheTie430UWVbIYvXCf9yIp9aQj96d3kTrqdbkEaWxL/DhFR8slEyUOTKATUsY3vqHmP6d/j+qP3ruRvQk1pCY18iar+cdQ1CuemW35UbvajFu7BB25xT5pmpWBfk0txeosNvednRFGp7oDQnGqXICsxGzo5E6Ekjfbs=" + # AWS_ACCESS_KEY_ID=[secure] + - secure: "gYOqmcsRzk9zPSMHSbyYLHmbpjp7K26nZcYKQxxyVSlnOrG9y439uUrh6Djz+NF8nIQZ5J27Cb1JUo8sGhTRRVSBtsWkdNzB1gVhHLPLjw/hkRws3zJ1gNy6CIwiaDLFjbG1AuteQrjjlmO5i9Tp0jjjSKqUeyjedxbpu4I+Cr6m1/f92MpBYNhF98Nxy2ot69vdAKLUea49SkOEV5ORNDG8SWvEfGPF5Ql1MwWA4LIUiupRZK9nlOIbu8nl0xshwnKCB4eiCSteR+JOJshlgB5Vp0OX7pl7T0U779bU3Mxmicx3NzF+sTSW1ICaCg60E4Iuy8zz3wDP3Jx8hKbr9WJVFt0lkgyGa+aR7dKw8HGj74rVX+Zy8D4IOqoQeElKhqYSiG0N/vyqYLRmu1mj5RK/SXosxtPRsDRxSC8SP+QK7RrwGfTnDAnGOm9hZI5e4oUMLsAII2cfX6d52Qa2fv6gQNYqnVsuGbQEMcIusWmGozLbaoFUJUJVfbqCr/fiVGHnhbkwlzEMKP3ND+CnqotOB5+ZCn0E26iUHEBWnB4OmgVk+kuOmGyASmwuaBkjZFvF/QDmw5+MJsUtFJLZ306XBrOXCV0p7Zto/HN9ihI5plkjoF4Yzyei/VzT2ol7m5y1+ihGUEB02zTpH3DUghD6KnEEc6etT3etzs+6Vt8=" + # AWS_SECRET_ACCESS_KEY=[secure] + - secure: "HlYhmAuLhcIOxxB5uBaeN59YBX9Mi4LT/OErIHoXv08B9vTWCDf0H5A6YVTZziNfmXqF0994hGbBj0/pOFp0XrWFoCMm3UW5nmzIgjVmrAGxdckNiqbxwVTo9IZi+4FNZSaEXXIUJehO760AcIk8bQ8xD7iDRWBBWn+ps3kG2mJlQ6R42/zA06ShmPz1hepl4KRJ6/ZqY+NFR0JyZqdFE4AiWN/znBSqI3xAFnQhZFs4HTpxgvVv0Ccu0/aLLsnX/GGtAtm0iaUYT/3w58D55tVQINXPP7lGFZ152mvkEbImRERlG7IDwH83ESANCdtyK3ev8px3BpMvvIQtYYPX0SMW83XvJ0hUtaeawrsdADANxAg2KwW8cJKeMNe8tDHxzKTXixjah3tw1776rOe6yDZqV+vS5o+KXP8JyP0tBO+CRg2XG0AeLpH2F5+buLnnG9l2W5oRdMxs2Pyzja5ARilrmPvu8PUDf1BOPzL5I62PETs0cuC2uGP6d19zrhZVbX/IjfADKqWRveM42IyzTsBLmzogT+62ft6HbcBwlc8atwEzP+RIqDS3MgiQW5zakwJtOmf8TQ0eAWeOUDaBE4SoNS6LSbZWzfdg2lwYmaAVrU040XIsRaYIaQrpYKn/X1fSwAD1V/ukOgicyN13lC5VVY9ivkjw8JeFi5BFzIw=" + +stage: "Run Unit Tests :clipboard:" +node_js: + - 6 + - 8 +before_install: + - bash bin/travis-init.sh +script: + - recink run unit -c recink-codeclimate -c recink-snyk diff --git a/README.md b/README.md index 1ce9aec..7bc2aab 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ deep-microservices-benchmarking =============================== [![Build Status](https://travis-ci.org/MitocGroup/deep-microservices-benchmarking.svg?branch=master)](https://travis-ci.org/MitocGroup/deep-microservices-benchmarking) -[![Test Coverage](https://codeclimate.com/repos/579230941b5f1a4f910012b9/badges/56076cd4e0183ecdbf45/coverage.svg)](https://codeclimate.com/repos/579230941b5f1a4f910012b9/coverage) +[![Test Coverage](https://codeclimate.com/github/MitocGroup/deep-microservices-benchmarking/badges/coverage.svg?maxAge=0)](https://codeclimate.com/github/MitocGroup/deep-microservices-benchmarking) deep-microservices-benchmarking is a microservice designed to help benchmark web applications built on top of [DEEP Framework](https://github.com/MitocGroup/deep-framework). It could be used either diff --git a/bin/test/_head.sh b/bin/test/_head.sh deleted file mode 100755 index 2ddf39d..0000000 --- a/bin/test/_head.sh +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -##################################### -### Initializing global variables ### -##################################### -__SCRIPT_PATH=$(cd $(dirname $0); pwd -P) -__SRC_PATH="${__SCRIPT_PATH}/../../src/" -__COVERAGE_PATH="${__SCRIPT_PATH}/../coverages/local/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}/summary-report" -__VARS_FILE_PATH="${__SCRIPT_PATH}/_vars.sh" -__NONE="none" -__BACKEND="backend" -__FRONTEND="frontend" -__IS_CONCURRENT_SCRIPT=${__NONE} -__E2E_WITH_PUBLIC_REPO="public" -__E2E_WITH_PRIVATE_REPO="private" -__TRAVIS_NODE_MAJOR_VERSION="${TRAVIS_NODE_VERSION:0:1}" -__UPPER_CASE_TRAVIS_BRANCH=`echo "$TRAVIS_BRANCH" | tr '[:lower:]' '[:upper:]'` -__CODECLIMATE_TOKEN_NAME="CODECLIMATE_REPO_TOKEN_${__UPPER_CASE_TRAVIS_BRANCH}" - -###################################################### -### Import the initialized vars with changed stuff ### -###################################################### -if [ "$TRAVIS" == "true" ] && [ -e "$__VARS_FILE_PATH" ]; then - source "$__VARS_FILE_PATH" -fi - -############################################################################# -### Checks if all environment variables available for validating coverage ### -### Arguments: ### -### None ### -### Returns: ### -### 0 or 1 ### -############################################################################# -IS_ENV_VARS_AVAILABLE () { - if [ -z $GITHUB_OAUTH_TOKEN ] || \ - [ -z $AWS_ACCESS_KEY_ID ] || [ -z AWS_SECRET_ACCESS_KEY ] || \ - [ -z $AWS_DEFAULT_REGION ] || [ -z $AWS_S3_BUCKET ]; \ - then - echo 0; - return; - fi - - echo 1; -} - -################################################################# -### Checks if codeclimate token available for specific branch ### -### Arguments: ### -### None ### -### Returns: ### -### 0 or 1 ### -################################################################# -IS_CODECLIMATE_TOKEN_AVAILABLE () { - - if [ -z `printenv $__CODECLIMATE_TOKEN_NAME` ]; then - echo 0; - - return; - fi - - echo 1; -} - - - -####################################################################################### -### Executes frontend/backend commands for subpaths with/without parallelizing mode ### -### Arguments: ### -### DIR ### -### BACKEND_CMD ### -### FRONTEND_CMD ### -### IS_CONCURRENT_SCRIPT ### -### Returns: ### -### None ### -####################################################################################### -subpath_run_cmd () { - local DIR - local BACKEND_CMD - local FRONTEND_CMD - local SEARCH_VALUE - local REPLACE_VALUE - local PATH_TO_COVERAGE_FILE - - DIR=$(cd $1 && pwd -P) - - TEST_FRONTEND_PATH="tests/frontend/" - TEST_BACKEND_PATH="tests/backend/" - - BACKEND_CMD=$2 - - ########################################################## - ### set __BACKEND_MODULES[] which need to install/test ### - ########################################################## - if [ -z "$BACKEND_MICROAPP_PATHS" ]; then - i=0; - for subpath in $DIR/*/$TEST_BACKEND_PATH - do - __BACKEND_MODULES[i]=$subpath - i=$((i+1)) - done - - else - EXPR=(${BACKEND_MICROAPP_PATHS//,/ }) - - for i in "${!EXPR[@]}" - do - __BACKEND_MODULES[i]=$DIR/${EXPR[i]}/$TEST_BACKEND_PATH - done - fi - - ########################################################### - ### set __FRONTEND_MODULES[] which need to install/test ### - ########################################################### - if [ -z "$FRONTEND_MICROAPP_PATHS" ]; then - i=0; - for subpath in $DIR/*/$TEST_FRONTEND_PATH - do - __FRONTEND_MODULES[i]=$subpath - i=$((i+1)) - done - - else - EXPR=(${FRONTEND_MICROAPP_PATHS//,/ }) - - for i in "${!EXPR[@]}" - do - __FRONTEND_MODULES[i]=$DIR/${EXPR[i]}/$TEST_FRONTEND_PATH - done - fi - - ############################## - ### Set paralellizing mode ### - ############################## - if [ -z "${4}" ]; then - echo "PARALLELIZING DISABLED" - __IS_CONCURRENT_SCRIPT=${__NONE} - else - __IS_CONCURRENT_SCRIPT=$4 - echo "PARALLELIZING ENABLED FOR: ${__IS_CONCURRENT_SCRIPT}" - fi - - ########################################################### - ### Set command for frontend if didn't pass as agrument ### - ########################################################### - if [ -z "${3}" ]; then - FRONTEND_CMD="${BACKEND_CMD}" - else - FRONTEND_CMD="${3}" - fi - - ################################################## - ### run always for frontend to gather coverage ### - ################################################## - for subpath in "${__FRONTEND_MODULES[@]}" - do - echo "[Running command for frontend] $subpath" - if [ -d ${subpath} ]; then - cd ${subpath} && eval_or_exit "${FRONTEND_CMD}" - - #################################################################################################### - ### replace ./frontend to absolute file path to fix karma issue after combining coverage reports ### - #################################################################################################### - if [ "${FRONTEND_CMD}" == "npm run test" ]; then - SEARCH_VALUE='\.\/frontend\/' - subpath=${subpath/tests\/frontend/frontend} - - ####################################################### - ### Escape path for sed using bash find and replace ### - ####################################################### - REPLACE_VALUE="${subpath//\//\\/}" - - export PATH_TO_TEST_TDF_FILE="$(find ./coverage -name 'coverage-final.json')" - sed "s/${SEARCH_VALUE}/${REPLACE_VALUE}/g" "${PATH_TO_TEST_TDF_FILE}" > ./coverage/report.json - fi - fi - done - - ############################# - ### run tests for backend ### - ############################# - if [ "$__IS_CONCURRENT_SCRIPT" == "$__NONE" ] || [ "$__IS_CONCURRENT_SCRIPT" == "$__BACKEND" ]; then - - for subpath in "${__BACKEND_MODULES[@]}" - do - echo "[Running command for backend] $subpath" - if [ -d ${subpath} ]; then - cd ${subpath} && eval_or_exit "${BACKEND_CMD}" - fi - done - fi -} - -######################################## -### Executes command and show result ### -### Arguments: ### -### CMD ### -### Returns: ### -### 0 or 1 ### -######################################## -eval_or_exit() { - local RET_CODE - - echo $1 - eval "$1" - RET_CODE=$? - - if [ ${RET_CODE} == 0 ]; then - echo "[SUCCEED] $1" - else - echo "[FAILED] $1" - exit 1 - fi -} - -##################################################################################### -### Checks if deep-package-magager has latest version otherwise reinstall deepify ### -### Arguments: ### -### None ### -### Returns: ### -### None ### -##################################################################################### -CHECK_DEEP_PACKAGE_MANAGER() { - local CURRENT_DPM_VERSION - local LATEST_DPM_VERSION - - LATEST_DPM_VERSION=`npm show deep-package-manager version` - CURRENT_DPM_VERSION=`npm list -g --depth=3 | grep deep-package-manager | cut -d"@" -f 2` - - if [ "${LATEST_DPM_VERSION}" != "${CURRENT_DPM_VERSION}" ]; then - echo "Reinstall deepify due to deep-package-manager updates" - `npm install -g deepify` - fi -} diff --git a/bin/test/_vars.sh b/bin/test/_vars.sh deleted file mode 100644 index 27bd6f9..0000000 --- a/bin/test/_vars.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -FRONTEND_MICROAPP_PATHS="none" -BACKEND_MICROAPP_PATHS="none" -BACKEND_MICROAPP_IDENTIFIERS="none" -CI_FULL="false" -IS_SKIP_TESTS="true" diff --git a/bin/test/coverage.sh b/bin/test/coverage.sh deleted file mode 100755 index c6411c8..0000000 --- a/bin/test/coverage.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -source $(dirname $0)/_head.sh - -if [ -z "${1}" ]; then - __IS_CONCURRENT_SCRIPT=${__NONE}; -else - __IS_CONCURRENT_SCRIPT=${1} -fi - -if [ $(IS_ENV_VARS_AVAILABLE) == "1" ] && [ "${IS_SKIP_TESTS}" == "false" ] && \ - ([ "$__IS_CONCURRENT_SCRIPT" == "$__NONE" ] || [ "$__IS_CONCURRENT_SCRIPT" == "$__BACKEND" ]); then - - ################################################################ - ### Update paths to have src/* file in coverage report ### - ### https://github.com/codacy/node-codacy-coverage/issues/26 ### - ################################################################ - SEARCH_VALUE=$(pwd -P)"/" - REPLACE_VALUE="" - - sed -e "s@${SEARCH_VALUE}@${REPLACE_VALUE}@g" ${__COVERAGE_PATH}"/lcov.info" > ${__COVERAGE_PATH}"/coverage.info" - - - - if [ $(IS_CODECLIMATE_TOKEN_AVAILABLE) == "1" ]; then - - ############################################################ - ### Upload Coverage info to Codeclimate in token exists ### - ############################################################ - CODECLIMATE_REPO_TOKEN=`printenv $__CODECLIMATE_TOKEN_NAME` codeclimate-test-reporter < ${__COVERAGE_PATH}"/coverage.info" - else - echo "Doesn't exists env variable ${__CODECLIMATE_TOKEN_NAME}" - fi - - ##################################################################### - ### Log top 20 file paths to be able see paths format from travis ### - ##################################################################### - head -n 20 ${__COVERAGE_PATH}"/coverage.info" -fi diff --git a/bin/test/install.sh b/bin/test/install.sh deleted file mode 100755 index f8bd9f4..0000000 --- a/bin/test/install.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -source $(dirname $0)/_head.sh - -######################## -### Install NPM deps ### -######################## -__CMD="npm install" - -subpath_run_cmd "${__SRC_PATH}" "$__CMD" "$__CMD" "${1}" - -if [ -z "${1}" ]; then - __IS_CONCURRENT_SCRIPT=${__NONE}; -else - __IS_CONCURRENT_SCRIPT=${1} -fi - -##################################### -### Add logging for imported vars ### -##################################### -if [ "$TRAVIS" == "true" ] && [ -e "${__VARS_FILE_PATH}" ]; then - head -n 20 "${__VARS_FILE_PATH}" -fi - -if [ "$__IS_CONCURRENT_SCRIPT" == "$__NONE" ] || [ "$__IS_CONCURRENT_SCRIPT" == "$__BACKEND" ]; then - - ################################################## - ### install frontend deps where e2e is enabled ### - ################################################## - if [ "$__IS_CONCURRENT_SCRIPT" != "$__NONE" ] && \ - ( ([ "${__E2E_WITH_PUBLIC_REPO}" == "${E2E_TESTING}" ]) || \ - ([ "${__E2E_WITH_PRIVATE_REPO}" == "${E2E_TESTING}" ] && [ "${CI_FULL}" == "true" ]) ); then - subpath_run_cmd "${__SRC_PATH}" "$__CMD" "$__CMD" "$__FRONTEND" - fi - - echo "Start initializing backend" - - ########################################################################### - ### Check if deeploy.example.json exists, otherwise exit with error msg ### - ########################################################################### - if [ ! -f ${__SRC_PATH}deeploy.example.json ]; then - echo "File deeploy.example.json doesn't exist. Please create it and repeat" - exit 1 - fi - - cp ${__SRC_PATH}deeploy.example.json ${__SRC_PATH}deeploy.json - - if [ "${TRAVIS}" == "true" ] && [ "$BACKEND_MICROAPP_IDENTIFIERS" == "none" ] && \ - ([ "${FRONTEND_MICROAPP_PATHS}" == "$__NONE" ] || [ "${__E2E_WITH_PUBLIC_REPO}" != "${E2E_TESTING}" ]); then - - ########################################################################### - ### Skip initializing backend if no changes in backend or running in CI ### - ########################################################################### - echo "Skipping initializing backend, becuase no changes in backend" - elif ( ([ "${BACKEND_MICROAPP_PATHS}" != "$__NONE" ] || [ "${FRONTEND_MICROAPP_PATHS}" != "$__NONE" ]) && \ - ([ "${__E2E_WITH_PUBLIC_REPO}" == "${E2E_TESTING}" ] || ([ "${__E2E_WITH_PRIVATE_REPO}" == "${E2E_TESTING}" ] && \ - [ "${CI_FULL}" == "true" ]))); then - - ################################################################# - ### Fully initializing backend for e2e test or forced locally ### - ########################################################## - echo "Fully initializing backend" - - cd ${__SRC_PATH} && deepify install && deepify compile dev "${__SRC_PATH}" - else - - ################################################################ - ### Partially initializing backend for specified identifiers ### - ################################################################ - echo "Partially initializing backend: ${BACKEND_MICROAPP_PATHS}" - cd ${__SRC_PATH} && deepify install && deepify compile dev -m "${BACKEND_MICROAPP_PATHS}" - fi - -fi diff --git a/bin/test/node-scripts/CoverageComparator.es6 b/bin/test/node-scripts/CoverageComparator.es6 deleted file mode 100644 index 2007df5..0000000 --- a/bin/test/node-scripts/CoverageComparator.es6 +++ /dev/null @@ -1,271 +0,0 @@ -/** - * Created by vcernomschi on 6/20/16. - */ - -'use strict'; -import combine from 'istanbul-combine'; -import fs from 'fs'; -import fsExtra from 'fs-extra'; -import path from 'path'; -import nodeDir from 'node-dir'; -import S3CoverageSynchronizer from './S3CoverageSynchronizer'; -import GitHubMsgPublisher from './GitHubMsgPublisher'; - -export default class CoverageComparator { - - /** - * @param {String} pathToAccess - * @returns {boolean} - */ - static accessSync(pathToAccess) { - try { - fs.accessSync(pathToAccess, fs.F_OK | fs.R_OK | fs.W_OK); - return true; - } catch (exception) { - return false; - } - } - - /** - * @returns {String} - * @constructor - */ - static get LOCAL_COVERAGE_FULL_PATH() { - return path.join(__dirname, `../../../${CoverageComparator.LOCAL_COVERAGE_SUMMARY_DIR}/coverage-summary.json`); - } - - /** - * @returns {String} - * @constructor - */ - static get S3_COVERAGE_FULL_PATH() { - return path.join(__dirname, `../../../${CoverageComparator.S3_COVERAGE_SUMMARY_DIR}/coverage-summary.json`); - } - - /** - * @returns {String} - * @constructor - */ - static get REPORT_PREFIX() { - return `${process.env['TRAVIS_REPO_SLUG']}/${process.env['TRAVIS_BRANCH']}/`; - } - - /** - * @returns {String} - * @constructor - */ - static get LOCAL_COVERAGE_DIR() { - return `bin/coverages/local/${CoverageComparator.REPORT_PREFIX}`; - } - - /** - * @returns {String} - * @constructor - */ - static get S3_COVERAGE_DIR() { - return `bin/coverages/aws/${CoverageComparator.REPORT_PREFIX}`; - } - - /** - * @returns {String} - * @constructor - */ - static get LOCAL_COVERAGE_PATTERN() { - return `${CoverageComparator.LOCAL_COVERAGE_DIR}**/coverage.json`; - } - - /** - * @returns {String} - * @constructor - */ - static get S3_COVERAGE_PATTERN() { - return `${CoverageComparator.S3_COVERAGE_DIR}**/coverage.json`; - } - - /** - * @returns {String} - * @constructor - */ - static get LOCAL_COVERAGE_SUMMARY_DIR() { - return `${CoverageComparator.LOCAL_COVERAGE_DIR}summary-report`; - } - - /** - * @returns {String} - * @constructor - */ - static get S3_COVERAGE_SUMMARY_DIR() { - return `${CoverageComparator.S3_COVERAGE_DIR}summary-report`; - } - - /** - * @returns {String} - * @constructor - */ - static get LOCAL_COVERAGES_PATH() { - return path.join(__dirname, '../../coverages/local'); - } - - /** - * @returns {String} - * @constructor - */ - static get S3_COVERAGES_PATH() { - return path.join(__dirname, '../../coverages/aws'); - } - - /** - * @returns {String} - * @constructor - */ - static get GIT_REPO_NAME() { - return process.env['TRAVIS_REPO_SLUG'].replace(/.*\/(.*)/i, '$1'); - } - - /** - * @param {String} coverageDir - output directory for combined report(s) - * @param {String} pattern - pattern to find json reports to be combined - * @returns {Object} - */ - static getOptions(coverageDir, pattern) { - - return { - dir: coverageDir, - pattern: pattern, - reporters: { - lcovonly: {}, - 'json-summary': {}, - }, - base: '../../../', - }; - } - - /** - * Synchronous method to combine coverage reports - * @param {String} coverageDir - output directory for combined report(s) - * @param {String} pattern - pattern to find json reports to be combined - * @returns {Number} - */ - static combineSync(coverageDir, pattern) { - - combine.sync(CoverageComparator.getOptions(coverageDir, pattern)); - - let result = (CoverageComparator.accessSync(CoverageComparator.LOCAL_COVERAGE_FULL_PATH)) ? - JSON.parse(fs.readFileSync(CoverageComparator.LOCAL_COVERAGE_FULL_PATH, 'utf8')).total.lines.pct : - 0; - - return result; - } - - /** - * Return frontend coverage report folder if exists or current directory - * @param {String} srcPath - * @returns {String} - */ - static getCoverageDirectory(srcPath) { - - if (CoverageComparator.accessSync(srcPath)) { - return fs.readdirSync(srcPath).filter((file) => { - return CoverageComparator.accessSync(path.join(srcPath, file, 'coverage-final.json')); - })[0]; - } - - return './'; - } - - /** - * @param {Function} callback - */ - static gatherReports(callback) { - - CoverageComparator.getMicroAppPaths((error, microAppPathsArray) => { - - if (error) { - console.log(error); - throw error; - } - - for (let microAppPath of microAppPathsArray) { - - let backendCoveragePath = path.join(microAppPath, 'tests/backend/coverage/coverage.json'); - let frontendCoverageDir = CoverageComparator.getCoverageDirectory( - path.join(microAppPath, 'tests/frontend/coverage/') - ); - let frontendCoveragePath = path.join( - microAppPath, - `tests/frontend/coverage/${frontendCoverageDir}/coverage-final.json` - ); - let microAppName = microAppPath.replace(/.+\/src\/(.+)\//i, '$1'); - - if (CoverageComparator.accessSync(backendCoveragePath)) { - let backendDestPath = path.join( - CoverageComparator.LOCAL_COVERAGES_PATH, - process.env['TRAVIS_REPO_SLUG'], - process.env['TRAVIS_BRANCH'], - microAppName, - 'backend/coverage.json' - ); - fsExtra.ensureFileSync(backendDestPath); - fsExtra.copySync(backendCoveragePath, backendDestPath, { - clobber: true, - }); - } - - if (frontendCoverageDir !== './' && CoverageComparator.accessSync(frontendCoveragePath)) { - - let frontendDestPath = path.join( - CoverageComparator.LOCAL_COVERAGES_PATH, - process.env['TRAVIS_REPO_SLUG'], - process.env['TRAVIS_BRANCH'], - microAppName, - 'frontend/coverage.json' - ); - - fsExtra.ensureFileSync(frontendDestPath); - fsExtra.copySync(frontendCoveragePath, frontendDestPath, { - clobber: true, - }); - } - } - - callback(null, null); - }) - } - - /** - * @param {Function} callback - */ - static getMicroAppPaths(callback) { - - let sourcePath = path.join(__dirname, '../../../src/'); - let microAppBackendPaths = []; - - if (CoverageComparator.accessSync(sourcePath)) { - - // match only filenames resources.json - nodeDir.readFiles(sourcePath, { - match: /resources\.json$/, - exclude: /^\./, - excludeDir: ['frontend', 'node_modules', 'docs', 'data', 'tests'], - }, (err, content, next) => { - if (err) { - callback(err, null); - } - - next(); - }, - (err, files) => { - if (err) { - callback(err, null); - } - - microAppBackendPaths = files.map((file) => { - return file.replace(/backend\/resources.json/i, ''); - }); - - callback(null, microAppBackendPaths); - } - ); - } - } -} diff --git a/bin/test/node-scripts/CoverageComparator.js b/bin/test/node-scripts/CoverageComparator.js deleted file mode 100644 index e7bff79..0000000 --- a/bin/test/node-scripts/CoverageComparator.js +++ /dev/null @@ -1,346 +0,0 @@ -/** - * Created by vcernomschi on 6/20/16. - */ - -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _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; }; }(); - -var _istanbulCombine = require('istanbul-combine'); - -var _istanbulCombine2 = _interopRequireDefault(_istanbulCombine); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _fsExtra = require('fs-extra'); - -var _fsExtra2 = _interopRequireDefault(_fsExtra); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var _nodeDir = require('node-dir'); - -var _nodeDir2 = _interopRequireDefault(_nodeDir); - -var _S3CoverageSynchronizer = require('./S3CoverageSynchronizer'); - -var _S3CoverageSynchronizer2 = _interopRequireDefault(_S3CoverageSynchronizer); - -var _GitHubMsgPublisher = require('./GitHubMsgPublisher'); - -var _GitHubMsgPublisher2 = _interopRequireDefault(_GitHubMsgPublisher); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -let CoverageComparator = function () { - function CoverageComparator() { - _classCallCheck(this, CoverageComparator); - } - - _createClass(CoverageComparator, null, [{ - key: 'accessSync', - - - /** - * @param {String} pathToAccess - * @returns {boolean} - */ - value: function accessSync(pathToAccess) { - try { - _fs2.default.accessSync(pathToAccess, _fs2.default.F_OK | _fs2.default.R_OK | _fs2.default.W_OK); - return true; - } catch (exception) { - return false; - } - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'getOptions', - - - /** - * @param {String} coverageDir - output directory for combined report(s) - * @param {String} pattern - pattern to find json reports to be combined - * @returns {Object} - */ - value: function getOptions(coverageDir, pattern) { - - return { - dir: coverageDir, - pattern: pattern, - reporters: { - lcovonly: {}, - 'json-summary': {} - }, - base: '../../../' - }; - } - - /** - * Synchronous method to combine coverage reports - * @param {String} coverageDir - output directory for combined report(s) - * @param {String} pattern - pattern to find json reports to be combined - * @returns {Number} - */ - - }, { - key: 'combineSync', - value: function combineSync(coverageDir, pattern) { - - _istanbulCombine2.default.sync(CoverageComparator.getOptions(coverageDir, pattern)); - - let result = CoverageComparator.accessSync(CoverageComparator.LOCAL_COVERAGE_FULL_PATH) ? JSON.parse(_fs2.default.readFileSync(CoverageComparator.LOCAL_COVERAGE_FULL_PATH, 'utf8')).total.lines.pct : 0; - - return result; - } - - /** - * Return frontend coverage report folder if exists or current directory - * @param {String} srcPath - * @returns {String} - */ - - }, { - key: 'getCoverageDirectory', - value: function getCoverageDirectory(srcPath) { - - if (CoverageComparator.accessSync(srcPath)) { - return _fs2.default.readdirSync(srcPath).filter(file => { - return CoverageComparator.accessSync(_path2.default.join(srcPath, file, 'coverage-final.json')); - })[0]; - } - - return './'; - } - - /** - * @param {Function} callback - */ - - }, { - key: 'gatherReports', - value: function gatherReports(callback) { - - CoverageComparator.getMicroAppPaths((error, microAppPathsArray) => { - - if (error) { - console.log(error); - throw error; - } - - for (let microAppPath of microAppPathsArray) { - - let backendCoveragePath = _path2.default.join(microAppPath, 'tests/backend/coverage/coverage.json'); - let frontendCoverageDir = CoverageComparator.getCoverageDirectory(_path2.default.join(microAppPath, 'tests/frontend/coverage/')); - let frontendCoveragePath = _path2.default.join(microAppPath, `tests/frontend/coverage/${ frontendCoverageDir }/coverage-final.json`); - let microAppName = microAppPath.replace(/.+\/src\/(.+)\//i, '$1'); - - if (CoverageComparator.accessSync(backendCoveragePath)) { - let backendDestPath = _path2.default.join(CoverageComparator.LOCAL_COVERAGES_PATH, process.env['TRAVIS_REPO_SLUG'], process.env['TRAVIS_BRANCH'], microAppName, 'backend/coverage.json'); - _fsExtra2.default.ensureFileSync(backendDestPath); - _fsExtra2.default.copySync(backendCoveragePath, backendDestPath, { - clobber: true - }); - } - - if (frontendCoverageDir !== './' && CoverageComparator.accessSync(frontendCoveragePath)) { - - let frontendDestPath = _path2.default.join(CoverageComparator.LOCAL_COVERAGES_PATH, process.env['TRAVIS_REPO_SLUG'], process.env['TRAVIS_BRANCH'], microAppName, 'frontend/coverage.json'); - - _fsExtra2.default.ensureFileSync(frontendDestPath); - _fsExtra2.default.copySync(frontendCoveragePath, frontendDestPath, { - clobber: true - }); - } - } - - callback(null, null); - }); - } - - /** - * @param {Function} callback - */ - - }, { - key: 'getMicroAppPaths', - value: function getMicroAppPaths(callback) { - - let sourcePath = _path2.default.join(__dirname, '../../../src/'); - let microAppBackendPaths = []; - - if (CoverageComparator.accessSync(sourcePath)) { - - // match only filenames resources.json - _nodeDir2.default.readFiles(sourcePath, { - match: /resources\.json$/, - exclude: /^\./, - excludeDir: ['frontend', 'node_modules', 'docs', 'data', 'tests'] - }, (err, content, next) => { - if (err) { - callback(err, null); - } - - next(); - }, (err, files) => { - if (err) { - callback(err, null); - } - - microAppBackendPaths = files.map(file => { - return file.replace(/backend\/resources.json/i, ''); - }); - - callback(null, microAppBackendPaths); - }); - } - } - }, { - key: 'LOCAL_COVERAGE_FULL_PATH', - get: function get() { - return _path2.default.join(__dirname, `../../../${ CoverageComparator.LOCAL_COVERAGE_SUMMARY_DIR }/coverage-summary.json`); - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'S3_COVERAGE_FULL_PATH', - get: function get() { - return _path2.default.join(__dirname, `../../../${ CoverageComparator.S3_COVERAGE_SUMMARY_DIR }/coverage-summary.json`); - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'REPORT_PREFIX', - get: function get() { - return `${ process.env['TRAVIS_REPO_SLUG'] }/${ process.env['TRAVIS_BRANCH'] }/`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'LOCAL_COVERAGE_DIR', - get: function get() { - return `bin/coverages/local/${ CoverageComparator.REPORT_PREFIX }`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'S3_COVERAGE_DIR', - get: function get() { - return `bin/coverages/aws/${ CoverageComparator.REPORT_PREFIX }`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'LOCAL_COVERAGE_PATTERN', - get: function get() { - return `${ CoverageComparator.LOCAL_COVERAGE_DIR }**/coverage.json`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'S3_COVERAGE_PATTERN', - get: function get() { - return `${ CoverageComparator.S3_COVERAGE_DIR }**/coverage.json`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'LOCAL_COVERAGE_SUMMARY_DIR', - get: function get() { - return `${ CoverageComparator.LOCAL_COVERAGE_DIR }summary-report`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'S3_COVERAGE_SUMMARY_DIR', - get: function get() { - return `${ CoverageComparator.S3_COVERAGE_DIR }summary-report`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'LOCAL_COVERAGES_PATH', - get: function get() { - return _path2.default.join(__dirname, '../../coverages/local'); - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'S3_COVERAGES_PATH', - get: function get() { - return _path2.default.join(__dirname, '../../coverages/aws'); - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'GIT_REPO_NAME', - get: function get() { - return process.env['TRAVIS_REPO_SLUG'].replace(/.*\/(.*)/i, '$1'); - } - }]); - - return CoverageComparator; -}(); - -exports.default = CoverageComparator; -module.exports = exports['default']; - diff --git a/bin/test/node-scripts/CoverageManager.es6 b/bin/test/node-scripts/CoverageManager.es6 deleted file mode 100644 index a0c209f..0000000 --- a/bin/test/node-scripts/CoverageManager.es6 +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Created by vcernomschi on 6/20/16. - */ - -'use strict'; -import combine from 'istanbul-combine'; -import fs from 'fs'; -import fsExtra from 'fs-extra'; -import S3CoverageSynchronizer from './S3CoverageSynchronizer'; -import GitHubMsgPublisher from './GitHubMsgPublisher'; -import CoverageComparator from './CoverageComparator'; - -let s3CoverageSync = new S3CoverageSynchronizer(); - -s3CoverageSync.init((err, data) => { - s3CoverageSync.downloadReportsFromS3( - S3CoverageSynchronizer.BUCKET_NAME, - S3CoverageSynchronizer.REPORT_PREFIX, - S3CoverageSynchronizer.S3_REPORTS_PATH, - () => { - - //copy s3 reports to local - if (CoverageComparator.accessSync(S3CoverageSynchronizer.S3_REPORTS_PATH)) { - fsExtra.copySync(S3CoverageSynchronizer.S3_REPORTS_PATH, S3CoverageSynchronizer.LOCAL_REPORTS_PATH); - } - - CoverageComparator.gatherReports((error, data) => { - if (error) { - console.log(error); - throw error; - } - - //combine/override local coverage - let localSumPercent = CoverageComparator.combineSync( - CoverageComparator.LOCAL_COVERAGE_SUMMARY_DIR, CoverageComparator.LOCAL_COVERAGE_PATTERN - ); - - let s3SumPercent = (CoverageComparator.accessSync(CoverageComparator.S3_COVERAGE_FULL_PATH)) ? - JSON.parse(fs.readFileSync(CoverageComparator.S3_COVERAGE_FULL_PATH, 'utf8')).total.lines.pct : - 0; - - let gitHubMsgPublisher = new GitHubMsgPublisher(); - - //add comments when applicable - gitHubMsgPublisher.addComment(s3SumPercent, localSumPercent, (err) => { - if (err) { - console.log(err); - return; - } - }); - - //uploading coverage in s3 when !PR - if (!GitHubMsgPublisher.isPullRequest) { - s3CoverageSync.syncReportsToS3( - S3CoverageSynchronizer.LOCAL_REPORTS_PATH, - S3CoverageSynchronizer.BUCKET_NAME, - S3CoverageSynchronizer.REPORT_PREFIX, - () => { - } - ); - } - }); - } - ); - } -); diff --git a/bin/test/node-scripts/CoverageManager.js b/bin/test/node-scripts/CoverageManager.js deleted file mode 100644 index 9418037..0000000 --- a/bin/test/node-scripts/CoverageManager.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Created by vcernomschi on 6/20/16. - */ - -'use strict'; - -var _istanbulCombine = require('istanbul-combine'); - -var _istanbulCombine2 = _interopRequireDefault(_istanbulCombine); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _fsExtra = require('fs-extra'); - -var _fsExtra2 = _interopRequireDefault(_fsExtra); - -var _S3CoverageSynchronizer = require('./S3CoverageSynchronizer'); - -var _S3CoverageSynchronizer2 = _interopRequireDefault(_S3CoverageSynchronizer); - -var _GitHubMsgPublisher = require('./GitHubMsgPublisher'); - -var _GitHubMsgPublisher2 = _interopRequireDefault(_GitHubMsgPublisher); - -var _CoverageComparator = require('./CoverageComparator'); - -var _CoverageComparator2 = _interopRequireDefault(_CoverageComparator); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -let s3CoverageSync = new _S3CoverageSynchronizer2.default(); - -s3CoverageSync.init((err, data) => { - s3CoverageSync.downloadReportsFromS3(_S3CoverageSynchronizer2.default.BUCKET_NAME, _S3CoverageSynchronizer2.default.REPORT_PREFIX, _S3CoverageSynchronizer2.default.S3_REPORTS_PATH, () => { - - //copy s3 reports to local - if (_CoverageComparator2.default.accessSync(_S3CoverageSynchronizer2.default.S3_REPORTS_PATH)) { - _fsExtra2.default.copySync(_S3CoverageSynchronizer2.default.S3_REPORTS_PATH, _S3CoverageSynchronizer2.default.LOCAL_REPORTS_PATH); - } - - _CoverageComparator2.default.gatherReports((error, data) => { - if (error) { - console.log(error); - throw error; - } - - //combine/override local coverage - let localSumPercent = _CoverageComparator2.default.combineSync(_CoverageComparator2.default.LOCAL_COVERAGE_SUMMARY_DIR, _CoverageComparator2.default.LOCAL_COVERAGE_PATTERN); - - let s3SumPercent = _CoverageComparator2.default.accessSync(_CoverageComparator2.default.S3_COVERAGE_FULL_PATH) ? JSON.parse(_fs2.default.readFileSync(_CoverageComparator2.default.S3_COVERAGE_FULL_PATH, 'utf8')).total.lines.pct : 0; - - let gitHubMsgPublisher = new _GitHubMsgPublisher2.default(); - - //add comments when applicable - gitHubMsgPublisher.addComment(s3SumPercent, localSumPercent, err => { - if (err) { - console.log(err); - return; - } - }); - - //uploading coverage in s3 when !PR - if (!_GitHubMsgPublisher2.default.isPullRequest) { - s3CoverageSync.syncReportsToS3(_S3CoverageSynchronizer2.default.LOCAL_REPORTS_PATH, _S3CoverageSynchronizer2.default.BUCKET_NAME, _S3CoverageSynchronizer2.default.REPORT_PREFIX, () => {}); - } - }); - }); -}); - diff --git a/bin/test/node-scripts/GitDiffWalker.es6 b/bin/test/node-scripts/GitDiffWalker.es6 deleted file mode 100644 index 7942203..0000000 --- a/bin/test/node-scripts/GitDiffWalker.es6 +++ /dev/null @@ -1,653 +0,0 @@ -/** - * Created by vcernomschi on 5/16/16. - */ - -'use strict' - -import path from 'path'; -import fs from 'fs'; -import os from 'os'; -import fsExtra from 'fs-extra'; -import syncExec from 'sync-exec'; -import AWS from 'aws-sdk'; -import S3CoverageSynchronizer from './S3CoverageSynchronizer'; -import GitHubMsgPublisher from './GitHubMsgPublisher'; -import CoverageComparator from './CoverageComparator'; - -/** - * - */ -export class GitDiffWalker { - - /** - * @returns {String} - * @constructor - */ - static get TARGET_BRANCH() { - console.log('TRAVIS_BRANCH: ', process.env['TRAVIS_BRANCH']) - return process.env['TRAVIS_BRANCH']; - } - - /** - * @returns {String} - * @constructor - */ - static get CMD() { - return (process.env['PR_MERGE'] === 'true') ? - 'git diff --name-only @~..@' : - `git diff --name-only ${GitDiffWalker.TARGET_BRANCH}`; - } - - /** - * @returns {String} - * @constructor - */ - static get NONE() { - return 'none'; - } - - /** - * @returns {String} - * @constructor - */ - static get FULL_CI_RUN() { - return '[ci full]'; - } - - /** - * @returns {String} - * @constructor - */ - static get SRC() { - return 'src'; - } - - /** - * @returns {String} - * @constructor - */ - static get FRONTEND_MICROAPP_PATHS() { - return 'FRONTEND_MICROAPP_PATHS'; - } - - /** - * @returns {String} - * @constructor - */ - static get BACKEND_MICROAPP_PATHS() { - return 'BACKEND_MICROAPP_PATHS'; - } - - /** - * @returns {String} - * @constructor - */ - static get BACKEND_MICROAPP_IDENTIFIERS() { - return 'BACKEND_MICROAPP_IDENTIFIERS'; - } - - /** - * @returns {String} - * @constructor - */ - static get CI_FULL() { - return 'CI_FULL'; - } - - /** - * @returns {String} - * @constructor - */ - static get IS_SKIP_TESTS() { - return 'IS_SKIP_TESTS'; - } - - /** - * @returns {String} - * @constructor - */ - static get DEEPKG_JSON() { - return 'deepkg.json'; - } - - /** - * @returns {String} - * @constructor - */ - static get CWD() { - return path.join(__dirname, '../../..'); - } - - /** - * @returns {String} - * @constructor - */ - static get VARS_SHELL_PATH() { - return path.join(__dirname, '../_vars.sh'); - } - - static removeDuplicates() { - let result = []; - - for (let i = 0; i < arguments.length; i++) { - - let _argument = arguments[i].toString().split(','); - - for (let j = 0; j < _argument.length; j++) { - if (result.indexOf(_argument[j]) === -1) { - result.push(_argument[j]); - } - } - } - - return result.join(','); - } - - /** - * @returns {String} - * @constructor - */ - static get TEST_PATHS_TPL() { - let content = []; - - content.push('#!\/bin\/bash'); - content.push(''); - content.push(`${GitDiffWalker.FRONTEND_MICROAPP_PATHS}="{frontendMicroAppPaths}"`); - content.push(`${GitDiffWalker.BACKEND_MICROAPP_PATHS}="{backendMicroAppPaths}"`); - content.push(`${GitDiffWalker.BACKEND_MICROAPP_IDENTIFIERS}="{backendMicroAppIdentifiers}"`); - content.push(`${GitDiffWalker.CI_FULL}="{ciFull}"`); - content.push(`${GitDiffWalker.IS_SKIP_TESTS}="{isSkipTests}"`); - content.push(''); - - return content.join(os.EOL); - } - - /** - * @returns {String} - */ - static get commitMessage() { - return process.env['TRAVIS_COMMIT_MESSAGE']; - } - - /** - * @returns {String} - */ - static getAllChangedFiles() { - - console.log(`Run command: ${GitDiffWalker.CMD} for cwd: ${GitDiffWalker.CWD}`); - - let result = syncExec(GitDiffWalker.CMD, { - cwd: GitDiffWalker.CWD, - }); - - console.log('Changed files: ', result.stdout.toString().trim()); - - return (parseInt(result.status) !== 0) ? - `Command '${GitDiffWalker.CMD}' failed in '${GitDiffWalker.CWD}' with exit code ${result.status}` : - result.stdout.toString().trim(); - } - - getAllMicroAppPath(srcPath) { - - if (!CoverageComparator.accessSync(srcPath)) { - return []; - } - - return fs.readdirSync(srcPath).filter(function (file) { - return GitDiffWalker.getFullPath(fs.statSync(path.join(srcPath, file)).isDirectory()); - }); - } - - /** - * - */ - constructor() { - this._files = GitDiffWalker.getAllChangedFiles().split('\n'); - - this._allMicroAppPaths = this.getAllMicroAppPaths(path.join(__dirname, '../../..', GitDiffWalker.SRC)); - this._allMicroAppIdentifiers = this.getAllMicroAppIdentifiers(); - - this.getBackendMicroAppPaths(); - this.getBackendTestMicroAppPaths(); - this.getBackendCodeMicroAppPaths(); - this.getFrontendMicroAppPaths(); - } - - - /** - * @returns {String[]} - */ - get files() { - return this._files; - } - - /** - * @returns {String[]} - */ - getFullPath(name) { - return path.join(__dirname, '../../..', GitDiffWalker.SRC, name); - } - - /** - * @param srcpath - * @returns {String[]} - */ - getAllMicroAppPaths(srcPath) { - - if (!CoverageComparator.accessSync(srcPath)) { - return []; - } - - return fs.readdirSync(srcPath).filter((file) => { - return fs.statSync(path.join(srcPath, file)).isDirectory(); - }); - } - - /** - * Get changed microapplication identifiers from deepkg.json where were changed code or backend tests - * @returns {String[]} - */ - getAllMicroAppIdentifiers() { - let indentifiers = []; - - for (let microAppPath of this._allMicroAppPaths) { - - let microAppFullPath = this.getFullPath(microAppPath); - - if (!CoverageComparator.accessSync(microAppFullPath)) { - continue; - } - - let content = fsExtra.readJsonSync( - path.join(microAppFullPath, GitDiffWalker.DEEPKG_JSON), {throws: false} - ); - - indentifiers.push(content.identifier); - } - - return indentifiers; - } - - /** - * @returns {boolean} - */ - get isSkipTests() { - let re = /^(?!src\/).+|(.+\/docs\/.+)/i; - - for (let file of this.files) { - - if (!re.test(file)) { - return false; - } - } - - return true; - } - - /** - * Check is full CI without for PR and !PR when coverage exists in S3 - * @returns {boolean} - */ - static get isFullCIRunSync() { - return ((typeof process.env['MAJOR_VERSIONS'] !== 'undefined' && - process.env['MAJOR_VERSIONS'].indexOf(GitDiffWalker.TARGET_BRANCH) > -1) || - (typeof GitDiffWalker.commitMessage !== 'undefined' && - GitDiffWalker.commitMessage.indexOf(GitDiffWalker.FULL_CI_RUN) > -1)); - } - - /** - * Returns as first argument in callback boolean result if is full ci - * @param {Function} callback - */ - isFullCIRun(callback) { - if (GitHubMsgPublisher.isPullRequest) { - callback(GitDiffWalker.isFullCIRunSync); - } else { - let params = { - Bucket: S3CoverageSynchronizer.BUCKET_NAME, - Key: `${S3CoverageSynchronizer.REPORT_PREFIX}summary-report/coverage-summary.json`, - }; - - let s3 = new AWS.S3({}); - - s3.headObject(params, function (err) { - if (err) { - callback(true); - } else { - callback(GitDiffWalker.isFullCIRunSync); - } - }); - } - - } - - /** - * @returns {boolean} - */ - get isFrontedCodeChanged() { - let testsRe = /^src\/(.+)\/tests\/frontend\/.+$/i; - let re = /^src\/(.+)\/frontend\/.+$/i; - - for (let file of this.files) { - - if (!testsRe.test(file) && re.test(file)) { - return true; - } - } - - return false; - } - - /** - * @returns {boolean} - */ - get isFrontendTestsChanged() { - let re = /^src\/(.+)\/tests\/frontend\/.+$/i; - - for (let file of this.files) { - - if (re.test(file)) { - return true; - } - } - - return false; - } - - /** - * @returns {boolean} - */ - get isBackendTestsChanged() { - let re = /^src\/(.+)\/tests\/backend\/.+$/i; - - for (let file of this.files) { - - if (re.test(file)) { - return true; - } - } - - return false; - } - - /** - * @returns {boolean} - */ - get isBackendCodeChanged() { - let testsRe = /^src\/(.+)\/tests\/backend\/.+$/i; - let re = /^src\/(.+)\/(backend|data)\/.+$/i; - - for (let file of this.files) { - - if (!testsRe.test(file) && re.test(file)) { - return true; - } - } - - return false; - } - - /** - * Get changed microapplication paths where were changed frontend - * @returns {String[]} - */ - getFrontendMicroAppPaths() { - let re = /^src\/(.+)\/frontend\/.+$/i; - let paths = []; - - for (let file of this.files) { - - if (re.test(file)) { - - let fullPath = this.getFullPath(file.replace(re, '$1').replace(/(\/|\\).+/, '')); - - if (paths.indexOf(fullPath) === -1) { - paths.push(fullPath); - } - } - } - - this._frontendMicroAppPaths = paths; - - return paths; - } - - /** - * Get changed microapplication paths where were changed frontend - * @returns {String[]} - */ - getFrontendMicroAppNames() { - let names = []; - - for (let file of this._frontendMicroAppPaths) { - - names.push(file.substring(file.lastIndexOf(path.sep) + 1)); - } - - this._frontendMicroAppNames = names; - - return names; - } - - /** - * Get changed microapplication paths where were changed backend code or backend tests - * @returns {String[]} - */ - getBackendMicroAppPaths() { - let re = /^src\/(.+)\/(backend|data)\/.+$/i; - let paths = []; - - for (let file of this.files) { - - if (re.test(file)) { - - let fullPath = this.getFullPath(file.replace(re, '$1').replace(/(\/|\\).+/, '')); - - if (paths.indexOf(fullPath) === -1) { - paths.push(fullPath); - } - } - } - - this._backendMicroAppPaths = paths; - - return paths; - } - - /** - * Get changed microapplication paths where were changed only backend tests - * @returns {String[]} - */ - getBackendTestMicroAppPaths() { - let re = /^src\/(.+)\/tests\/backend\/.+$/i; - let paths = []; - - for (let file of this.files) { - - if (re.test(file)) { - - let fullPath = this.getFullPath(file.replace(re, '$1').replace(/(\/|\\).+/, '')); - - if (paths.indexOf(fullPath) === -1) { - paths.push(fullPath); - } - } - } - - this._backendTestMicroAppPaths = paths; - - return paths; - } - - /** - * Get changed microapplication paths where were changed only backend code - * @returns {String[]} - */ - getBackendCodeMicroAppPaths() { - let testsRe = /^src\/(.+)\/tests\/backend\/.+$/i; - let re = /^src\/(.+)\/(backend|data)\/.+$/i; - - let paths = []; - - for (let file of this.files) { - - if (!testsRe.test(file) && re.test(file)) { - let fullPath = this.getFullPath(file.replace(re, '$1').replace(/(\/|\\).+/, '')); - - if (paths.indexOf(fullPath) === -1) { - paths.push(fullPath); - } - } - } - - this._backendCodeMicroAppPaths = paths; - - return paths; - } - - /** - * Get changed microapplication identifiers from deepkg.json where were changed code or backend tests - * @returns {String[]} - */ - getBackendMicroAppIdentifiers() { - let indentifiers = []; - let microAppPaths = this._backendMicroAppPaths; - - for (let microAppPath of microAppPaths) { - - let microAppFullPath = this.getFullPath(microAppPath); - - if (!CoverageComparator.accessSync(microAppFullPath)) { - continue; - } - - let content = fsExtra.readJsonSync( - path.join(microAppFullPath, GitDiffWalker.DEEPKG_JSON), {throws: false} - ); - - indentifiers.push(content.identifier); - } - - this._backendMicroAppIdentifiers = indentifiers; - - return indentifiers; - } - - /** - * Get changed microapplication names where were changed backend code or backend tests - * @returns {String[]} - */ - getBackendMicroAppNames() { - let names = []; - - for (let file of this._backendMicroAppPaths) { - - names.push(file.substring(file.lastIndexOf(path.sep) + 1)); - } - - this._backendMicroAppNames = names; - - return names; - } - - /** - * Get changed microapplication names where were changed backend code - * @returns {String[]} - */ - getBackendCodeMicroAppNames() { - let names = []; - - for (let file of this._backendCodeMicroAppPaths) { - - names.push(file.substring(file.lastIndexOf(path.sep) + 1)); - } - - this._backendCodeMicroAppNames = names; - - return names; - } - - /** - * Get changed microapplication names where were changed backend tests - * @returns {String[]} - */ - getBackendTestMicroAppNames() { - let names = []; - - for (let file of this._backendTestMicroAppPaths) { - - names.push(file.substring(file.lastIndexOf(path.sep) + 1)); - } - - this._backendTestMicroAppNames = names; - - return names; - } - - setTestPaths() { - - let backendMicroAppPaths = GitDiffWalker.NONE; - let frontendMicroAppPaths = GitDiffWalker.NONE; - let backendMicroAppIdentifiers = GitDiffWalker.NONE; - - if (this.isFrontedCodeChanged || this.isFrontendTestsChanged) { - frontendMicroAppPaths = this.getFrontendMicroAppNames(); - } - - if (this.isBackendTestsChanged || this.isBackendCodeChanged) { - backendMicroAppPaths = this.getBackendMicroAppNames(); - - //changes backend code and frontend, need to remove duplicates - if (this.isBackendCodeChanged && typeof this._frontendMicroAppNames !== 'undefined' && - this._frontendMicroAppNames.length > 0) { - frontendMicroAppPaths = GitDiffWalker.removeDuplicates( - this.getFrontendMicroAppNames(), this.getBackendCodeMicroAppNames() - ); - } else if (this.isBackendCodeChanged) { - frontendMicroAppPaths = this.getBackendCodeMicroAppNames(); - } - - backendMicroAppIdentifiers = this.getBackendMicroAppIdentifiers(); - } - - this.isFullCIRun((isFullCIRun) => { - - if (isFullCIRun) { - frontendMicroAppPaths = backendMicroAppPaths = this._allMicroAppPaths; - backendMicroAppIdentifiers = this._allMicroAppIdentifiers; - } - - let varsContent = GitDiffWalker.TEST_PATHS_TPL - .replace(/\{frontendMicroAppPaths\}/g, frontendMicroAppPaths) - .replace(/\{backendMicroAppPaths\}/g, backendMicroAppPaths) - .replace(/\{backendMicroAppIdentifiers\}/g, backendMicroAppIdentifiers) - .replace(/\{ciFull\}/g, isFullCIRun) - .replace(/\{isSkipTests\}/g, `${this.isSkipTests && !isFullCIRun}`); - - fsExtra.writeFileSync(GitDiffWalker.VARS_SHELL_PATH, varsContent, 'utf8'); - - console.log("TRAVIS_COMMIT_MESSAGE: ", GitDiffWalker.commitMessage); - console.log(`isFullCIRun: ${isFullCIRun}`); - console.log(`isSkipTests: ${this.isSkipTests && !isFullCIRun}`); - console.log(`isFrontedCodeChanged: ${this.isFrontedCodeChanged}`); - console.log(`isFrontendTestsChanged: ${this.isFrontendTestsChanged}`); - console.log(`isBackendCodeChanged: ${this.isBackendCodeChanged}`); - console.log(`isBackendTestsChanged: ${this.isBackendTestsChanged}`); - - console.log(`frontend paths: ${this.getFrontendMicroAppPaths()}`); - console.log(`frontend names: ${this.getFrontendMicroAppNames()}`); - - console.log(`backend all paths: ${this.getBackendMicroAppPaths()}`); - console.log(`backend tests paths: ${this.getBackendTestMicroAppPaths()}`); - console.log(`backend code paths: ${this.getBackendCodeMicroAppPaths()}`); - console.log(`backend identifiers: ${this.getBackendMicroAppIdentifiers()}`); - console.log(`backend all names: ${this.getBackendMicroAppNames()}`); - console.log(`backend tests names: ${this.getBackendTestMicroAppNames()}`); - console.log(`backend code names: ${this.getBackendCodeMicroAppNames()}`); - - }); - } -} - -let walker = new GitDiffWalker(); -walker.setTestPaths(); diff --git a/bin/test/node-scripts/GitDiffWalker.js b/bin/test/node-scripts/GitDiffWalker.js deleted file mode 100644 index 98dd345..0000000 --- a/bin/test/node-scripts/GitDiffWalker.js +++ /dev/null @@ -1,789 +0,0 @@ -/** - * Created by vcernomschi on 5/16/16. - */ - -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.GitDiffWalker = undefined; - -var _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; }; }(); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _os = require('os'); - -var _os2 = _interopRequireDefault(_os); - -var _fsExtra = require('fs-extra'); - -var _fsExtra2 = _interopRequireDefault(_fsExtra); - -var _syncExec = require('sync-exec'); - -var _syncExec2 = _interopRequireDefault(_syncExec); - -var _awsSdk = require('aws-sdk'); - -var _awsSdk2 = _interopRequireDefault(_awsSdk); - -var _S3CoverageSynchronizer = require('./S3CoverageSynchronizer'); - -var _S3CoverageSynchronizer2 = _interopRequireDefault(_S3CoverageSynchronizer); - -var _GitHubMsgPublisher = require('./GitHubMsgPublisher'); - -var _GitHubMsgPublisher2 = _interopRequireDefault(_GitHubMsgPublisher); - -var _CoverageComparator = require('./CoverageComparator'); - -var _CoverageComparator2 = _interopRequireDefault(_CoverageComparator); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * - */ -let GitDiffWalker = exports.GitDiffWalker = function () { - _createClass(GitDiffWalker, [{ - key: 'getAllMicroAppPath', - value: function getAllMicroAppPath(srcPath) { - - if (!_CoverageComparator2.default.accessSync(srcPath)) { - return []; - } - - return _fs2.default.readdirSync(srcPath).filter(function (file) { - return GitDiffWalker.getFullPath(_fs2.default.statSync(_path2.default.join(srcPath, file)).isDirectory()); - }); - } - - /** - * - */ - - }], [{ - key: 'removeDuplicates', - value: function removeDuplicates() { - let result = []; - - for (let i = 0; i < arguments.length; i++) { - - let _argument = arguments[i].toString().split(','); - - for (let j = 0; j < _argument.length; j++) { - if (result.indexOf(_argument[j]) === -1) { - result.push(_argument[j]); - } - } - } - - return result.join(','); - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'getAllChangedFiles', - - - /** - * @returns {String} - */ - value: function getAllChangedFiles() { - - console.log(`Run command: ${ GitDiffWalker.CMD } for cwd: ${ GitDiffWalker.CWD }`); - - let result = (0, _syncExec2.default)(GitDiffWalker.CMD, { - cwd: GitDiffWalker.CWD - }); - - console.log('Changed files: ', result.stdout.toString().trim()); - - return parseInt(result.status) !== 0 ? `Command '${ GitDiffWalker.CMD }' failed in '${ GitDiffWalker.CWD }' with exit code ${ result.status }` : result.stdout.toString().trim(); - } - }, { - key: 'TARGET_BRANCH', - - - /** - * @returns {String} - * @constructor - */ - get: function get() { - console.log('TRAVIS_BRANCH: ', process.env['TRAVIS_BRANCH']); - return process.env['TRAVIS_BRANCH']; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'CMD', - get: function get() { - return process.env['PR_MERGE'] === 'true' ? 'git diff --name-only @~..@' : `git diff --name-only ${ GitDiffWalker.TARGET_BRANCH }`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'NONE', - get: function get() { - return 'none'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'FULL_CI_RUN', - get: function get() { - return '[ci full]'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'SRC', - get: function get() { - return 'src'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'FRONTEND_MICROAPP_PATHS', - get: function get() { - return 'FRONTEND_MICROAPP_PATHS'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'BACKEND_MICROAPP_PATHS', - get: function get() { - return 'BACKEND_MICROAPP_PATHS'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'BACKEND_MICROAPP_IDENTIFIERS', - get: function get() { - return 'BACKEND_MICROAPP_IDENTIFIERS'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'CI_FULL', - get: function get() { - return 'CI_FULL'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'IS_SKIP_TESTS', - get: function get() { - return 'IS_SKIP_TESTS'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'DEEPKG_JSON', - get: function get() { - return 'deepkg.json'; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'CWD', - get: function get() { - return _path2.default.join(__dirname, '../../..'); - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'VARS_SHELL_PATH', - get: function get() { - return _path2.default.join(__dirname, '../_vars.sh'); - } - }, { - key: 'TEST_PATHS_TPL', - get: function get() { - let content = []; - - content.push('#!\/bin\/bash'); - content.push(''); - content.push(`${ GitDiffWalker.FRONTEND_MICROAPP_PATHS }="{frontendMicroAppPaths}"`); - content.push(`${ GitDiffWalker.BACKEND_MICROAPP_PATHS }="{backendMicroAppPaths}"`); - content.push(`${ GitDiffWalker.BACKEND_MICROAPP_IDENTIFIERS }="{backendMicroAppIdentifiers}"`); - content.push(`${ GitDiffWalker.CI_FULL }="{ciFull}"`); - content.push(`${ GitDiffWalker.IS_SKIP_TESTS }="{isSkipTests}"`); - content.push(''); - - return content.join(_os2.default.EOL); - } - - /** - * @returns {String} - */ - - }, { - key: 'commitMessage', - get: function get() { - return process.env['TRAVIS_COMMIT_MESSAGE']; - } - }]); - - function GitDiffWalker() { - _classCallCheck(this, GitDiffWalker); - - this._files = GitDiffWalker.getAllChangedFiles().split('\n'); - - this._allMicroAppPaths = this.getAllMicroAppPaths(_path2.default.join(__dirname, '../../..', GitDiffWalker.SRC)); - this._allMicroAppIdentifiers = this.getAllMicroAppIdentifiers(); - - this.getBackendMicroAppPaths(); - this.getBackendTestMicroAppPaths(); - this.getBackendCodeMicroAppPaths(); - this.getFrontendMicroAppPaths(); - } - - /** - * @returns {String[]} - */ - - - _createClass(GitDiffWalker, [{ - key: 'getFullPath', - - - /** - * @returns {String[]} - */ - value: function getFullPath(name) { - return _path2.default.join(__dirname, '../../..', GitDiffWalker.SRC, name); - } - - /** - * @param srcpath - * @returns {String[]} - */ - - }, { - key: 'getAllMicroAppPaths', - value: function getAllMicroAppPaths(srcPath) { - - if (!_CoverageComparator2.default.accessSync(srcPath)) { - return []; - } - - return _fs2.default.readdirSync(srcPath).filter(file => { - return _fs2.default.statSync(_path2.default.join(srcPath, file)).isDirectory(); - }); - } - - /** - * Get changed microapplication identifiers from deepkg.json where were changed code or backend tests - * @returns {String[]} - */ - - }, { - key: 'getAllMicroAppIdentifiers', - value: function getAllMicroAppIdentifiers() { - let indentifiers = []; - - for (let microAppPath of this._allMicroAppPaths) { - - let microAppFullPath = this.getFullPath(microAppPath); - - if (!_CoverageComparator2.default.accessSync(microAppFullPath)) { - continue; - } - - let content = _fsExtra2.default.readJsonSync(_path2.default.join(microAppFullPath, GitDiffWalker.DEEPKG_JSON), { throws: false }); - - indentifiers.push(content.identifier); - } - - return indentifiers; - } - - /** - * @returns {boolean} - */ - - }, { - key: 'isFullCIRun', - - - /** - * Returns as first argument in callback boolean result if is full ci - * @param {Function} callback - */ - value: function isFullCIRun(callback) { - if (_GitHubMsgPublisher2.default.isPullRequest) { - callback(GitDiffWalker.isFullCIRunSync); - } else { - let params = { - Bucket: _S3CoverageSynchronizer2.default.BUCKET_NAME, - Key: `${ _S3CoverageSynchronizer2.default.REPORT_PREFIX }summary-report/coverage-summary.json` - }; - - let s3 = new _awsSdk2.default.S3({}); - - s3.headObject(params, function (err) { - if (err) { - callback(true); - } else { - callback(GitDiffWalker.isFullCIRunSync); - } - }); - } - } - - /** - * @returns {boolean} - */ - - }, { - key: 'getFrontendMicroAppPaths', - - - /** - * Get changed microapplication paths where were changed frontend - * @returns {String[]} - */ - value: function getFrontendMicroAppPaths() { - let re = /^src\/(.+)\/frontend\/.+$/i; - let paths = []; - - for (let file of this.files) { - - if (re.test(file)) { - - let fullPath = this.getFullPath(file.replace(re, '$1').replace(/(\/|\\).+/, '')); - - if (paths.indexOf(fullPath) === -1) { - paths.push(fullPath); - } - } - } - - this._frontendMicroAppPaths = paths; - - return paths; - } - - /** - * Get changed microapplication paths where were changed frontend - * @returns {String[]} - */ - - }, { - key: 'getFrontendMicroAppNames', - value: function getFrontendMicroAppNames() { - let names = []; - - for (let file of this._frontendMicroAppPaths) { - - names.push(file.substring(file.lastIndexOf(_path2.default.sep) + 1)); - } - - this._frontendMicroAppNames = names; - - return names; - } - - /** - * Get changed microapplication paths where were changed backend code or backend tests - * @returns {String[]} - */ - - }, { - key: 'getBackendMicroAppPaths', - value: function getBackendMicroAppPaths() { - let re = /^src\/(.+)\/(backend|data)\/.+$/i; - let paths = []; - - for (let file of this.files) { - - if (re.test(file)) { - - let fullPath = this.getFullPath(file.replace(re, '$1').replace(/(\/|\\).+/, '')); - - if (paths.indexOf(fullPath) === -1) { - paths.push(fullPath); - } - } - } - - this._backendMicroAppPaths = paths; - - return paths; - } - - /** - * Get changed microapplication paths where were changed only backend tests - * @returns {String[]} - */ - - }, { - key: 'getBackendTestMicroAppPaths', - value: function getBackendTestMicroAppPaths() { - let re = /^src\/(.+)\/tests\/backend\/.+$/i; - let paths = []; - - for (let file of this.files) { - - if (re.test(file)) { - - let fullPath = this.getFullPath(file.replace(re, '$1').replace(/(\/|\\).+/, '')); - - if (paths.indexOf(fullPath) === -1) { - paths.push(fullPath); - } - } - } - - this._backendTestMicroAppPaths = paths; - - return paths; - } - - /** - * Get changed microapplication paths where were changed only backend code - * @returns {String[]} - */ - - }, { - key: 'getBackendCodeMicroAppPaths', - value: function getBackendCodeMicroAppPaths() { - let testsRe = /^src\/(.+)\/tests\/backend\/.+$/i; - let re = /^src\/(.+)\/(backend|data)\/.+$/i; - - let paths = []; - - for (let file of this.files) { - - if (!testsRe.test(file) && re.test(file)) { - let fullPath = this.getFullPath(file.replace(re, '$1').replace(/(\/|\\).+/, '')); - - if (paths.indexOf(fullPath) === -1) { - paths.push(fullPath); - } - } - } - - this._backendCodeMicroAppPaths = paths; - - return paths; - } - - /** - * Get changed microapplication identifiers from deepkg.json where were changed code or backend tests - * @returns {String[]} - */ - - }, { - key: 'getBackendMicroAppIdentifiers', - value: function getBackendMicroAppIdentifiers() { - let indentifiers = []; - let microAppPaths = this._backendMicroAppPaths; - - for (let microAppPath of microAppPaths) { - - let microAppFullPath = this.getFullPath(microAppPath); - - if (!_CoverageComparator2.default.accessSync(microAppFullPath)) { - continue; - } - - let content = _fsExtra2.default.readJsonSync(_path2.default.join(microAppFullPath, GitDiffWalker.DEEPKG_JSON), { throws: false }); - - indentifiers.push(content.identifier); - } - - this._backendMicroAppIdentifiers = indentifiers; - - return indentifiers; - } - - /** - * Get changed microapplication names where were changed backend code or backend tests - * @returns {String[]} - */ - - }, { - key: 'getBackendMicroAppNames', - value: function getBackendMicroAppNames() { - let names = []; - - for (let file of this._backendMicroAppPaths) { - - names.push(file.substring(file.lastIndexOf(_path2.default.sep) + 1)); - } - - this._backendMicroAppNames = names; - - return names; - } - - /** - * Get changed microapplication names where were changed backend code - * @returns {String[]} - */ - - }, { - key: 'getBackendCodeMicroAppNames', - value: function getBackendCodeMicroAppNames() { - let names = []; - - for (let file of this._backendCodeMicroAppPaths) { - - names.push(file.substring(file.lastIndexOf(_path2.default.sep) + 1)); - } - - this._backendCodeMicroAppNames = names; - - return names; - } - - /** - * Get changed microapplication names where were changed backend tests - * @returns {String[]} - */ - - }, { - key: 'getBackendTestMicroAppNames', - value: function getBackendTestMicroAppNames() { - let names = []; - - for (let file of this._backendTestMicroAppPaths) { - - names.push(file.substring(file.lastIndexOf(_path2.default.sep) + 1)); - } - - this._backendTestMicroAppNames = names; - - return names; - } - }, { - key: 'setTestPaths', - value: function setTestPaths() { - - let backendMicroAppPaths = GitDiffWalker.NONE; - let frontendMicroAppPaths = GitDiffWalker.NONE; - let backendMicroAppIdentifiers = GitDiffWalker.NONE; - - if (this.isFrontedCodeChanged || this.isFrontendTestsChanged) { - frontendMicroAppPaths = this.getFrontendMicroAppNames(); - } - - if (this.isBackendTestsChanged || this.isBackendCodeChanged) { - backendMicroAppPaths = this.getBackendMicroAppNames(); - - //changes backend code and frontend, need to remove duplicates - if (this.isBackendCodeChanged && typeof this._frontendMicroAppNames !== 'undefined' && this._frontendMicroAppNames.length > 0) { - frontendMicroAppPaths = GitDiffWalker.removeDuplicates(this.getFrontendMicroAppNames(), this.getBackendCodeMicroAppNames()); - } else if (this.isBackendCodeChanged) { - frontendMicroAppPaths = this.getBackendCodeMicroAppNames(); - } - - backendMicroAppIdentifiers = this.getBackendMicroAppIdentifiers(); - } - - this.isFullCIRun(isFullCIRun => { - - if (isFullCIRun) { - frontendMicroAppPaths = backendMicroAppPaths = this._allMicroAppPaths; - backendMicroAppIdentifiers = this._allMicroAppIdentifiers; - } - - let varsContent = GitDiffWalker.TEST_PATHS_TPL.replace(/\{frontendMicroAppPaths\}/g, frontendMicroAppPaths).replace(/\{backendMicroAppPaths\}/g, backendMicroAppPaths).replace(/\{backendMicroAppIdentifiers\}/g, backendMicroAppIdentifiers).replace(/\{ciFull\}/g, isFullCIRun).replace(/\{isSkipTests\}/g, `${ this.isSkipTests && !isFullCIRun }`); - - _fsExtra2.default.writeFileSync(GitDiffWalker.VARS_SHELL_PATH, varsContent, 'utf8'); - - console.log("TRAVIS_COMMIT_MESSAGE: ", GitDiffWalker.commitMessage); - console.log(`isFullCIRun: ${ isFullCIRun }`); - console.log(`isSkipTests: ${ this.isSkipTests && !isFullCIRun }`); - console.log(`isFrontedCodeChanged: ${ this.isFrontedCodeChanged }`); - console.log(`isFrontendTestsChanged: ${ this.isFrontendTestsChanged }`); - console.log(`isBackendCodeChanged: ${ this.isBackendCodeChanged }`); - console.log(`isBackendTestsChanged: ${ this.isBackendTestsChanged }`); - - console.log(`frontend paths: ${ this.getFrontendMicroAppPaths() }`); - console.log(`frontend names: ${ this.getFrontendMicroAppNames() }`); - - console.log(`backend all paths: ${ this.getBackendMicroAppPaths() }`); - console.log(`backend tests paths: ${ this.getBackendTestMicroAppPaths() }`); - console.log(`backend code paths: ${ this.getBackendCodeMicroAppPaths() }`); - console.log(`backend identifiers: ${ this.getBackendMicroAppIdentifiers() }`); - console.log(`backend all names: ${ this.getBackendMicroAppNames() }`); - console.log(`backend tests names: ${ this.getBackendTestMicroAppNames() }`); - console.log(`backend code names: ${ this.getBackendCodeMicroAppNames() }`); - }); - } - }, { - key: 'files', - get: function get() { - return this._files; - } - }, { - key: 'isSkipTests', - get: function get() { - let re = /^(?!src\/).+|(.+\/docs\/.+)/i; - - for (let file of this.files) { - - if (!re.test(file)) { - return false; - } - } - - return true; - } - - /** - * Check is full CI without for PR and !PR when coverage exists in S3 - * @returns {boolean} - */ - - }, { - key: 'isFrontedCodeChanged', - get: function get() { - let testsRe = /^src\/(.+)\/tests\/frontend\/.+$/i; - let re = /^src\/(.+)\/frontend\/.+$/i; - - for (let file of this.files) { - - if (!testsRe.test(file) && re.test(file)) { - return true; - } - } - - return false; - } - - /** - * @returns {boolean} - */ - - }, { - key: 'isFrontendTestsChanged', - get: function get() { - let re = /^src\/(.+)\/tests\/frontend\/.+$/i; - - for (let file of this.files) { - - if (re.test(file)) { - return true; - } - } - - return false; - } - - /** - * @returns {boolean} - */ - - }, { - key: 'isBackendTestsChanged', - get: function get() { - let re = /^src\/(.+)\/tests\/backend\/.+$/i; - - for (let file of this.files) { - - if (re.test(file)) { - return true; - } - } - - return false; - } - - /** - * @returns {boolean} - */ - - }, { - key: 'isBackendCodeChanged', - get: function get() { - let testsRe = /^src\/(.+)\/tests\/backend\/.+$/i; - let re = /^src\/(.+)\/(backend|data)\/.+$/i; - - for (let file of this.files) { - - if (!testsRe.test(file) && re.test(file)) { - return true; - } - } - - return false; - } - }], [{ - key: 'isFullCIRunSync', - get: function get() { - return typeof process.env['MAJOR_VERSIONS'] !== 'undefined' && process.env['MAJOR_VERSIONS'].indexOf(GitDiffWalker.TARGET_BRANCH) > -1 || typeof GitDiffWalker.commitMessage !== 'undefined' && GitDiffWalker.commitMessage.indexOf(GitDiffWalker.FULL_CI_RUN) > -1; - } - }]); - - return GitDiffWalker; -}(); - -let walker = new GitDiffWalker(); -walker.setTestPaths(); - diff --git a/bin/test/node-scripts/GitHubMsgPublisher.es6 b/bin/test/node-scripts/GitHubMsgPublisher.es6 deleted file mode 100644 index 1b331b7..0000000 --- a/bin/test/node-scripts/GitHubMsgPublisher.es6 +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Created by vcernomschi on 6/17/16. - */ - -'use strict'; - -import GitHubApi from 'github'; - -export default class GitHubMsgPublisher { - - /** - * @returns {string} - * @constructor - */ - static get isPullRequest() { - let pullRequest = process.env['TRAVIS_PULL_REQUEST']; - - return (pullRequest !== 'false' || !isNaN(pullRequest)); - } - - /** - * @returns {string} - * @constructor - */ - static get gitPRNumber() { - return process.env['TRAVIS_PULL_REQUEST']; - } - - /** - * @returns {string} - * @constructor - */ - static get gitPrUrl() { - return `https://api.github.com/repos/${GitHubMsgPublisher.gitUser}/${GitHubMsgPublisher.gitRepoName}/pulls/${GitHubMsgPublisher.gitPRNumber}`; - } - - /** - * @returns {string} - * @constructor - */ - static get gitUser() { - return process.env['TRAVIS_REPO_SLUG'].replace(/(.*)\/.*/i, '$1'); - } - - /** - * @returns {string} - * @constructor - */ - static get gitRepoName() { - return process.env['TRAVIS_REPO_SLUG'].replace(/.*\/(.*)/i, '$1'); - } - - constructor() { - this.github = new GitHubApi({ - debug: false, - protocol: 'https', - host: 'api.github.com', - timeout: 5000, - headers: { - 'user-agent': 'Code-Coverage-GitHub-App' - }, - followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow ability to disable follow-redirects - includePreview: true // default: false; includes accept headers to allow use of stuff under preview period - }); - - this.github.authenticate({ - type: 'oauth', - token: process.env['GITHUB_OAUTH_TOKEN'], - }); - } - - /** - * Add comments for PR or fails if coverage - * @param {Number} s3SumPercent - s3 summary coverage percent - * @param {Number} localSumPercent - local summary coverage percent - * @param {Function} callback - */ - addComment(s3SumPercent, localSumPercent, callback) { - let commentMsg; - - //failed if coverage decreased more that 1 % - let isFailed = ((localSumPercent + 1) < s3SumPercent); - let failMsg = 'Failed due to decreasing coverage'; - - //no need to add comments for !PR - if (!GitHubMsgPublisher.isPullRequest) { - callback(null, null); - return; - } - - if (isFailed) { - commentMsg = `:x: coverage decreased from ${s3SumPercent}% to ${localSumPercent}%`; - } else if (localSumPercent === s3SumPercent) { - commentMsg = `:white_check_mark: coverage remained the same at ${localSumPercent}%`; - } else if (-1 < (localSumPercent - s3SumPercent) && (localSumPercent - s3SumPercent) < 0) { - commentMsg = `:warning: coverage decreased less than 1% from ${s3SumPercent}% to ${localSumPercent}%`; - } else { - commentMsg = `:white_check_mark: coverage increased from ${s3SumPercent}% to ${localSumPercent}%`; - } - - this.github.issues.getComments({ - user: GitHubMsgPublisher.gitUser, - repo: GitHubMsgPublisher.gitRepoName, - number: GitHubMsgPublisher.gitPRNumber, - }, (err, issues) => { - let isCommentAdded = false; - - if (err) { - console.log(err); - callback(err, null); - return; - } - - for (let issue of issues) { - if (issue.hasOwnProperty('body') && issue.body === commentMsg) { - isCommentAdded = true; - console.log('Comment has already been added: ', commentMsg); - - if (isFailed) { - console.log(failMsg); - process.exit(1) - } - } - } - - if (!isCommentAdded) { - this.github.issues.createComment({ - user: GitHubMsgPublisher.gitUser, - repo: GitHubMsgPublisher.gitRepoName, - number: GitHubMsgPublisher.gitPRNumber, - body: commentMsg, - }, (err, res) => { - if (err) { - console.log(err); - callback(err, null); - return; - } - - callback(null, res); - - if (isFailed) { - console.log(failMsg); - process.exit(1) - } - }); - } - } - ); - } -} diff --git a/bin/test/node-scripts/GitHubMsgPublisher.js b/bin/test/node-scripts/GitHubMsgPublisher.js deleted file mode 100644 index b63cc50..0000000 --- a/bin/test/node-scripts/GitHubMsgPublisher.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * Created by vcernomschi on 6/17/16. - */ - -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _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; }; }(); - -var _github = require('github'); - -var _github2 = _interopRequireDefault(_github); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -let GitHubMsgPublisher = function () { - _createClass(GitHubMsgPublisher, null, [{ - key: 'isPullRequest', - - - /** - * @returns {string} - * @constructor - */ - get: function get() { - let pullRequest = process.env['TRAVIS_PULL_REQUEST']; - - return pullRequest !== 'false' || !isNaN(pullRequest); - } - - /** - * @returns {string} - * @constructor - */ - - }, { - key: 'gitPRNumber', - get: function get() { - return process.env['TRAVIS_PULL_REQUEST']; - } - - /** - * @returns {string} - * @constructor - */ - - }, { - key: 'gitPrUrl', - get: function get() { - return `https://api.github.com/repos/${ GitHubMsgPublisher.gitUser }/${ GitHubMsgPublisher.gitRepoName }/pulls/${ GitHubMsgPublisher.gitPRNumber }`; - } - - /** - * @returns {string} - * @constructor - */ - - }, { - key: 'gitUser', - get: function get() { - return process.env['TRAVIS_REPO_SLUG'].replace(/(.*)\/.*/i, '$1'); - } - - /** - * @returns {string} - * @constructor - */ - - }, { - key: 'gitRepoName', - get: function get() { - return process.env['TRAVIS_REPO_SLUG'].replace(/.*\/(.*)/i, '$1'); - } - }]); - - function GitHubMsgPublisher() { - _classCallCheck(this, GitHubMsgPublisher); - - this.github = new _github2.default({ - debug: false, - protocol: 'https', - host: 'api.github.com', - timeout: 5000, - headers: { - 'user-agent': 'Code-Coverage-GitHub-App' - }, - followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow ability to disable follow-redirects - includePreview: true // default: false; includes accept headers to allow use of stuff under preview period - }); - - this.github.authenticate({ - type: 'oauth', - token: process.env['GITHUB_OAUTH_TOKEN'] - }); - } - - /** - * Add comments for PR or fails if coverage - * @param {Number} s3SumPercent - s3 summary coverage percent - * @param {Number} localSumPercent - local summary coverage percent - * @param {Function} callback - */ - - - _createClass(GitHubMsgPublisher, [{ - key: 'addComment', - value: function addComment(s3SumPercent, localSumPercent, callback) { - let commentMsg; - - //failed if coverage decreased more that 1 % - let isFailed = localSumPercent + 1 < s3SumPercent; - let failMsg = 'Failed due to decreasing coverage'; - - //no need to add comments for !PR - if (!GitHubMsgPublisher.isPullRequest) { - callback(null, null); - return; - } - - if (isFailed) { - commentMsg = `:x: coverage decreased from ${ s3SumPercent }% to ${ localSumPercent }%`; - } else if (localSumPercent === s3SumPercent) { - commentMsg = `:white_check_mark: coverage remained the same at ${ localSumPercent }%`; - } else if (-1 < localSumPercent - s3SumPercent && localSumPercent - s3SumPercent < 0) { - commentMsg = `:warning: coverage decreased less than 1% from ${ s3SumPercent }% to ${ localSumPercent }%`; - } else { - commentMsg = `:white_check_mark: coverage increased from ${ s3SumPercent }% to ${ localSumPercent }%`; - } - - this.github.issues.getComments({ - user: GitHubMsgPublisher.gitUser, - repo: GitHubMsgPublisher.gitRepoName, - number: GitHubMsgPublisher.gitPRNumber - }, (err, issues) => { - let isCommentAdded = false; - - if (err) { - console.log(err); - callback(err, null); - return; - } - - for (let issue of issues) { - if (issue.hasOwnProperty('body') && issue.body === commentMsg) { - isCommentAdded = true; - console.log('Comment has already been added: ', commentMsg); - - if (isFailed) { - console.log(failMsg); - process.exit(1); - } - } - } - - if (!isCommentAdded) { - this.github.issues.createComment({ - user: GitHubMsgPublisher.gitUser, - repo: GitHubMsgPublisher.gitRepoName, - number: GitHubMsgPublisher.gitPRNumber, - body: commentMsg - }, (err, res) => { - if (err) { - console.log(err); - callback(err, null); - return; - } - - callback(null, res); - - if (isFailed) { - console.log(failMsg); - process.exit(1); - } - }); - } - }); - } - }]); - - return GitHubMsgPublisher; -}(); - -exports.default = GitHubMsgPublisher; -module.exports = exports['default']; - diff --git a/bin/test/node-scripts/S3CoverageSynchronizer.es6 b/bin/test/node-scripts/S3CoverageSynchronizer.es6 deleted file mode 100644 index 4708dc7..0000000 --- a/bin/test/node-scripts/S3CoverageSynchronizer.es6 +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Created by vcernomschi on 6/20/16. - */ - -'use strict'; -import AWS from 'aws-sdk'; -import s3 from 's3'; -import path from 'path'; - -export default class S3CoverageSynchronizer { - - /** - * @returns {String} - * @constructor - */ - static get GIT_REPO_NAME() { - return process.env['TRAVIS_REPO_SLUG']; - } - - /** - * @returns {String} - * @constructor - */ - static get GIT_BRANCH() { - return process.env['TRAVIS_BRANCH']; - } - - /** - * @returns {String} - * @constructor - */ - static get BUCKET_NAME() { - return process.env.AWS_S3_BUCKET; - } - - /** - * @returns {String} - * @constructor - */ - static get REPORT_PREFIX() { - return `${S3CoverageSynchronizer.GIT_REPO_NAME}/${S3CoverageSynchronizer.GIT_BRANCH}/`; - } - - /** - * @returns {String} - * @constructor - */ - static get LOCAL_REPORTS_PATH() { - return path.join(__dirname, `../../coverages/local/${S3CoverageSynchronizer.REPORT_PREFIX}`); - } - - /** - * @returns {String} - * @constructor - */ - static get S3_REPORTS_PATH() { - return path.join(__dirname, `../../coverages/aws/${S3CoverageSynchronizer.REPORT_PREFIX}`); - } - - constructor() { - this._awsS3 = new AWS.S3({ - region: process.env.AWS_DEFAULT_REGION, - }); - - this._client = s3.createClient({ - s3Client: this._awsS3, - }); - } - - /** - * @returns {Object} - */ - get client() { - return this._client; - } - - /** - * @returns {Object} - */ - get awsS3() { - return this._awsS3; - } - - /** - * Create bucket if it doesn't exists - * @param {Function} callback - */ - init(callback) { - - let params = { - Bucket: S3CoverageSynchronizer.BUCKET_NAME, - }; - - this.awsS3.headBucket(params, (err, metadata) => { - - if (err && err.code === 'NotFound') { - - this.awsS3.createBucket(params, (err, response) => { - - if (err) { - console.log(err) - callback(err, null); - } - - callback(null, response); - - }); - } - callback(null, metadata); - }); - } - - /** - * Download reports from s3 to destination directory on local file system - * @param {String} fromBucket - s3 bucket name - * @param {String} fromPrefix - s3 prefix - * @param {String} destPath - destination directory on local file system to sync to - * @param {Function} callback - */ - downloadReportsFromS3(fromBucket, fromPrefix, destPath, callback) { - - let params = { - localDir: destPath, - deleteRemoved: true, - s3Params: { - Bucket: fromBucket, - Prefix: fromPrefix, - }, - }; - - let downloader = this.client.downloadDir(params); - downloader.on('error', function (err) { - console.error('unable to download:', err); - callback(err, null); - }); - downloader.on('progress', () => { - }); - downloader.on('end', () => { - console.log('done downloading to'); - callback(null); - }); - } - - /** - * Syncs reports from directory on local file system to s3 - * @param {String} sourcePath - source directory on local file system to sync from - * @param {String} destBucket - destination s3 bucket name - * @param {String} destPrefix - destination prefix - * @param {Function} callback - */ - syncReportsToS3(sourcePath, destBucket, destPrefix, callback) { - - let params = { - localDir: sourcePath, - deleteRemoved: true, - s3Params: { - Bucket: destBucket, - Prefix: destPrefix, - }, - }; - - let uploader = this.client.uploadDir(params); - uploader.on('error', function (err) { - console.error('unable to sync:', err); - callback(err, null); - }); - uploader.on('progress', () => { - }); - uploader.on('end', () => { - console.log('done sync'); - callback(null, null); - }); - } - - /** - * Removes reports from s3 - * @param {String} bucketName - s3 bucket name - * @param {String} prefix - s3 prefix - * @param {Function} callback - */ - deleteReportsFromS3(bucketName, prefix, callback) { - - let params = { - Bucket: bucketName, - Prefix: prefix, - }; - - let remover = this.client.deleteDir(params); - remover.on('error', function (err) { - console.error('unable to sync:', err); - callback(err, null); - }); - remover.on('progress', () => { - }); - remover.on('end', () => { - console.log('done removing'); - callback(null, null); - }); - } -} diff --git a/bin/test/node-scripts/S3CoverageSynchronizer.js b/bin/test/node-scripts/S3CoverageSynchronizer.js deleted file mode 100644 index eba11ce..0000000 --- a/bin/test/node-scripts/S3CoverageSynchronizer.js +++ /dev/null @@ -1,262 +0,0 @@ -/** - * Created by vcernomschi on 6/20/16. - */ - -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _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; }; }(); - -var _awsSdk = require('aws-sdk'); - -var _awsSdk2 = _interopRequireDefault(_awsSdk); - -var _s = require('s3'); - -var _s2 = _interopRequireDefault(_s); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -let S3CoverageSynchronizer = function () { - _createClass(S3CoverageSynchronizer, null, [{ - key: 'GIT_REPO_NAME', - - - /** - * @returns {String} - * @constructor - */ - get: function get() { - return process.env['TRAVIS_REPO_SLUG']; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'GIT_BRANCH', - get: function get() { - return process.env['TRAVIS_BRANCH']; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'BUCKET_NAME', - get: function get() { - return process.env.AWS_S3_BUCKET; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'REPORT_PREFIX', - get: function get() { - return `${ S3CoverageSynchronizer.GIT_REPO_NAME }/${ S3CoverageSynchronizer.GIT_BRANCH }/`; - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'LOCAL_REPORTS_PATH', - get: function get() { - return _path2.default.join(__dirname, `../../coverages/local/${ S3CoverageSynchronizer.REPORT_PREFIX }`); - } - - /** - * @returns {String} - * @constructor - */ - - }, { - key: 'S3_REPORTS_PATH', - get: function get() { - return _path2.default.join(__dirname, `../../coverages/aws/${ S3CoverageSynchronizer.REPORT_PREFIX }`); - } - }]); - - function S3CoverageSynchronizer() { - _classCallCheck(this, S3CoverageSynchronizer); - - this._awsS3 = new _awsSdk2.default.S3({ - region: process.env.AWS_DEFAULT_REGION - }); - - this._client = _s2.default.createClient({ - s3Client: this._awsS3 - }); - } - - /** - * @returns {Object} - */ - - - _createClass(S3CoverageSynchronizer, [{ - key: 'init', - - - /** - * Create bucket if it doesn't exists - * @param {Function} callback - */ - value: function init(callback) { - - let params = { - Bucket: S3CoverageSynchronizer.BUCKET_NAME - }; - - this.awsS3.headBucket(params, (err, metadata) => { - - if (err && err.code === 'NotFound') { - - this.awsS3.createBucket(params, (err, response) => { - - if (err) { - console.log(err); - callback(err, null); - } - - callback(null, response); - }); - } - callback(null, metadata); - }); - } - - /** - * Download reports from s3 to destination directory on local file system - * @param {String} fromBucket - s3 bucket name - * @param {String} fromPrefix - s3 prefix - * @param {String} destPath - destination directory on local file system to sync to - * @param {Function} callback - */ - - }, { - key: 'downloadReportsFromS3', - value: function downloadReportsFromS3(fromBucket, fromPrefix, destPath, callback) { - - let params = { - localDir: destPath, - deleteRemoved: true, - s3Params: { - Bucket: fromBucket, - Prefix: fromPrefix - } - }; - - let downloader = this.client.downloadDir(params); - downloader.on('error', function (err) { - console.error('unable to download:', err); - callback(err, null); - }); - downloader.on('progress', () => {}); - downloader.on('end', () => { - console.log('done downloading to'); - callback(null); - }); - } - - /** - * Syncs reports from directory on local file system to s3 - * @param {String} sourcePath - source directory on local file system to sync from - * @param {String} destBucket - destination s3 bucket name - * @param {String} destPrefix - destination prefix - * @param {Function} callback - */ - - }, { - key: 'syncReportsToS3', - value: function syncReportsToS3(sourcePath, destBucket, destPrefix, callback) { - - let params = { - localDir: sourcePath, - deleteRemoved: true, - s3Params: { - Bucket: destBucket, - Prefix: destPrefix - } - }; - - let uploader = this.client.uploadDir(params); - uploader.on('error', function (err) { - console.error('unable to sync:', err); - callback(err, null); - }); - uploader.on('progress', () => {}); - uploader.on('end', () => { - console.log('done sync'); - callback(null, null); - }); - } - - /** - * Removes reports from s3 - * @param {String} bucketName - s3 bucket name - * @param {String} prefix - s3 prefix - * @param {Function} callback - */ - - }, { - key: 'deleteReportsFromS3', - value: function deleteReportsFromS3(bucketName, prefix, callback) { - - let params = { - Bucket: bucketName, - Prefix: prefix - }; - - let remover = this.client.deleteDir(params); - remover.on('error', function (err) { - console.error('unable to sync:', err); - callback(err, null); - }); - remover.on('progress', () => {}); - remover.on('end', () => { - console.log('done removing'); - callback(null, null); - }); - } - }, { - key: 'client', - get: function get() { - return this._client; - } - - /** - * @returns {Object} - */ - - }, { - key: 'awsS3', - get: function get() { - return this._awsS3; - } - }]); - - return S3CoverageSynchronizer; -}(); - -exports.default = S3CoverageSynchronizer; -module.exports = exports['default']; - diff --git a/bin/test/package.json b/bin/test/package.json deleted file mode 100644 index c3333d5..0000000 --- a/bin/test/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "deep-microservices-skeleton", - "version": "0.0.1", - "description": "This microservice is built on top of [DEEP Framework](https://github.com/MitocGroup/deep-framework). It could be used either as a standalone application or as a dependency in other deep-microservices.", - "author": { - "name": "Mitoc Group", - "email": "hello@mitocgroup.com", - "website": "https://www.mitocgroup.com" - }, - "contributors": [ - { - "name": "DEEP Dev Team", - "email": "hello@deep.mg", - "website": "https://www.deep.mg" - } - ], - "scripts": { - "preinstall": "bin/test/preinstall.sh", - "install": "bin/test/install.sh ${TEST_SUITE}", - "pretest": "bin/test/pretest.sh", - "test": "bin/test/test.sh ${TEST_SUITE}", - "posttest": "bin/test/posttest.sh && npm run prepare-coverage", - "prepare-coverage": "bin/test/prepare-coverage.sh ${TEST_SUITE}", - "coverage": "bin/test/coverage.sh ${TEST_SUITE}", - "remove-coverage": "bin/test/remove-coverage.sh", - "build": "npm run build:styles && npm run build:modules", - "build:modules": "jspm bundle app/angular/index lib/modules_bundle.min.js --minify --skip-source-maps --inject", - "build:modules:sfx": "jspm bundle-sfx app/angular/index lib/modules_bundle.sfx.min.js --minify" - }, - "dependencies": { - }, - "devDependencies": { - }, - "repository": { - "type": "git", - "url": "https://github.com/MitocGroup/deep-microservices-skeleton.git" - }, - "license": "MIT" -} \ No newline at end of file diff --git a/bin/test/phantomjs.sh b/bin/test/phantomjs.sh deleted file mode 100644 index 2bbe6fc..0000000 --- a/bin/test/phantomjs.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -source $(dirname $0)/_head.sh - -############################################################################################ -### Fix for issue: https://github.com/Medium/phantomjs/issues/430#issuecomment-174038299 ### -############################################################################################ -echo "TRAVIS_NODE_VERSION: ${TRAVIS_NODE_VERSION}" - -npm list -g phantomjs@2.1.7 --depth=0 || npm install -g phantomjs@2.1.7 diff --git a/bin/test/posttest.sh b/bin/test/posttest.sh deleted file mode 100755 index 0551409..0000000 --- a/bin/test/posttest.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -source $(dirname $0)/_head.sh - -###################################### -### Start protractor tests for e2e ### -###################################### -if [ "${TEST_SUITE}" == "$__BACKEND" ] && \ - ([ "${BACKEND_MICROAPP_PATHS}" != "$__NONE" ] || [ "${FRONTEND_MICROAPP_PATHS}" != "$__NONE" ]) && \ - ([ "${__E2E_WITH_PUBLIC_REPO}" = "${E2E_TESTING}" ] || ([ "${__E2E_WITH_PRIVATE_REPO}" = "${E2E_TESTING}" ] && \ - [ "${CI_FULL}" == "true" ] )) && \ - [ "${__TRAVIS_NODE_MAJOR_VERSION}" -ge "7" ]; then - - - __PROTRACTOR_CONFIG_PATH=$(find ${__SRC_PATH} -name protractor.config.js -type f -maxdepth 4) - __DIRNAME_TO_CONFIG="$(dirname "$__PROTRACTOR_CONFIG_PATH")"; - __ABS_PATH="$( cd "$__DIRNAME_TO_CONFIG" && pwd )" - - ########################################################################### - ### Check if protractor.config.js exists, otherwise exit with error msg ### - ########################################################################### - if [ ! -f "${__ABS_PATH}/protractor.config.js" ]; then - echo "Protractor config [protractor.config.js] doesn't exist. Please create it and repeat" - exit 1 - fi - - echo "Running E2E tests with protractor config: ${__PROTRACTOR_CONFIG_PATH}" - - protractor-flake --node-bin node --max-attempts=3 -- ${__PROTRACTOR_CONFIG_PATH} -else - echo "Skipping E2E tests..." -fi diff --git a/bin/test/preinstall.sh b/bin/test/preinstall.sh deleted file mode 100755 index dcbb5ea..0000000 --- a/bin/test/preinstall.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -source $(dirname $0)/_head.sh - -#################################################### -### Install dependencies globally if don't exist ### -#################################################### -(npm list -g babel-cli --depth=0 || npm install -g babel-cli) &&\ -(npm list -g babel-polyfill --depth=0 || npm install -g babel-polyfill) &&\ -(npm list -g babel-preset-es2015 --depth=0 || npm install -g babel-preset-es2015) &&\ -( (npm list -g deepify@$(npm show deepify version) --depth=0 || npm install -g deepify) && CHECK_DEEP_PACKAGE_MANAGER) &&\ -(npm list -g jspm --depth=0 || npm install -g jspm@0.16.15) &&\ -(npm list -g browserify --depth=0 || npm install -g browserify@11.2.x) &&\ -(npm list -g jscs --depth=0 || npm install -g jscs@2.1.x) &&\ -(npm list -g mocha@2.5.x --depth=0 || npm install -g mocha@2.5.x) &&\ -(npm list -g chai --depth=0 || npm install -g chai@3.3.x) &&\ -(npm list -g jasmine-core --depth=0 || npm install -g jasmine-core@2.3.x) &&\ -(npm list -g istanbul@^1.0.0-alpha --depth=0 || npm install -g istanbul@^1.0.0-alpha) &&\ -(npm list -g istanbul-combine --depth=0 || npm install -g istanbul-combine@0.3.x) &&\ -(npm list -g karma@0.13.x --depth=0 || npm install -g karma@0.13.x) &&\ -(npm list -g karma-jspm --depth=0 || npm install -g karma-jspm@2.0.x) &&\ -(npm list -g karma-jasmine@0.3.x --depth=0 || npm install -g karma-jasmine@0.3.x) &&\ -(npm list -g karma-babel-preprocessor --depth=0 || npm install -g karma-babel-preprocessor@5.2.x) &&\ -(npm list -g karma-coverage@1.0.x --depth=0 || npm install -g karma-coverage@1.0.x) &&\ -(npm list -g karma-verbose-reporter --depth=0 || npm install -g karma-verbose-reporter@0.0.x) &&\ -(npm list -g karma-phantomjs-launcher --depth=0 || npm install -g karma-phantomjs-launcher@0.2.x) &&\ -(npm list -g karma-ng-html2js-preprocessor --depth=0 || npm install -g karma-ng-html2js-preprocessor@0.2.x) &&\ -(npm list -g codeclimate-test-reporter --depth=0 || npm install -g codeclimate-test-reporter) &&\ - -################################################### -### Install dependencies locally if don't exist ### -################################################### -(if [ ! -d "node_modules/codelyzer" ]; then npm install codelyzer; fi) &&\ -(if [ ! -d "node_modules/tslint-eslint-rules" ]; then npm install tslint-eslint-rules; fi) &&\ -(if [ ! -d "node_modules/isparta" ]; then npm install isparta@3.1.x; fi) &&\ -(if [ ! -d "node_modules/sync-exec" ]; then npm install sync-exec@^0.6.x; fi) &&\ -(if [ ! -d "node_modules/fs-extra" ]; then npm install fs-extra@0.x.x; fi) &&\ -(if [ ! -d "node_modules/github" ]; then npm install github@3.1.0; fi) &&\ -(if [ ! -d "node_modules/aws-sdk" ]; then npm install aws-sdk; fi) &&\ -(if [ ! -d "node_modules/s3" ]; then npm install s3; fi) &&\ -(if [ ! -d "node_modules/node-dir" ]; then npm install node-dir; fi) &&\ -(if [ ! -d "node_modules/istanbul-combine" ]; then npm link istanbul-combine; fi) - -############################################################################# -### Configure jspm and git if we are in CI ### -### for JSPM: https://gist.github.com/topheman/25241e48a1b4f91ec6d4 ### -### for NPM: https://github.com/npm/npm/issues/5257#issuecomment-60441477 ### -############################################################################# -if [ -z $TRAVIS_BUILD_NUMBER ]; then - echo "Running locally - no need to jspm config" -else - echo "Running in CI - configuring jspm registries" - jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN - git config --local url.https://github.com/.insteadOf git://github.com/ - - ########################## - ### Configure git user ### - ########################## - if [ -z $GITHUB_OAUTH_TOKEN ]; then - echo "No GitHub token" - else - deepify registry config github --set "devs-deep:${GITHUB_OAUTH_TOKEN}" - fi - -fi - -################################################################## -### Installing dependencies for E2E tests stuff written in ES6 ### -################################################################## -if [ "${__E2E_WITH_PUBLIC_REPO}" = "${E2E_TESTING}" ] || [ "${__E2E_WITH_PRIVATE_REPO}" = "${E2E_TESTING}" ]; then - bash `dirname $0`/protractor.sh - - ####################################################### - ### Install module to be able to rerun failed tests ### - ####################################################### - (npm list -g protractor-flake --depth=0 || npm install -g protractor-flake) &&\ - - ############################################################### - ### Install locally, protractor doesn't find babel globally ### - ############################################################### - (if [ ! -d "node_modules/babel-register" ]; then npm install babel-register; fi) &&\ - (if [ ! -d "node_modules/babel-cli" ]; then npm link babel-cli; fi) &&\ - (if [ ! -d "node_modules/babel-preset-es2015" ]; then npm link babel-preset-es2015; fi) &&\ - (if [ ! -d "node_modules/babel-plugin-add-module-exports" ]; then npm install babel-plugin-add-module-exports; fi) &&\ - (if [ ! -d "node_modules/jasmine2-custom-message" ]; then npm install jasmine2-custom-message@0.8.x; fi) &&\ - (if [ ! -d "node_modules/jasmine-utils" ]; then npm install jasmine-utils@0.2.x; fi) -fi - -########################################################## -### Install skeleton dependecies if we are in skeleton ### -########################################################## -if [ $(git config --get remote.origin.url) == "https://github.com/MitocGroup/deep-microservices-skeleton" ]; then - sh $(dirname $0)/../tools/skeleton-install.sh -fi - -################################################### -### Install Phantomjs for frontend unit testing ### -################################################### -bash `dirname $0`/phantomjs.sh - -if [ "$TRAVIS" == "true" ]; then - ########################################################################################## - ### Resolving detached HEAD error by attaching HEAD to the `TRAVIS_FROM_BRANCH` branch ### - ########################################################################################## - - IFS=$'\n' TRAVIS_COMMIT_MESSAGES=($(git log -2 --pretty=%s)) - - export TRAVIS_COMMIT_MESSAGE=${TRAVIS_COMMIT_MESSAGES[1]} - - ########################### - ### Case for merging PR ### - ########################### - if [ -n "$(git show-ref refs/heads/${TRAVIS_BRANCH})" ]; then - export PR_MERGE=true - echo "branch ${TRAVIS_BRANCH} exists!" - else - TRAVIS_FROM_BRANCH="travis_from_branch" - git branch $TRAVIS_FROM_BRANCH - git checkout $TRAVIS_FROM_BRANCH - git fetch origin $TRAVIS_BRANCH - git checkout -qf FETCH_HEAD - git branch $TRAVIS_BRANCH - git checkout $TRAVIS_BRANCH - git checkout $TRAVIS_FROM_BRANCH - fi - -else - export TRAVIS_COMMIT_MESSAGE=$(git log -1 --pretty=%s) -fi - -############################################################################################# -### Copy package.json again - fixes issue when .gitignore doesn't contain "/package.json" ### -############################################################################################# -cp bin/test/package.json . - -############################################################################################ -### Transpile from ES6 to ES5 by using deepify and execute to retrieve the changed stuff ### -############################################################################################ -deepify compile es6 $(dirname $0)/node-scripts/GitDiffWalker.es6 --source > $(dirname $0)/node-scripts/GitDiffWalker.js -deepify compile es6 $(dirname $0)/node-scripts/S3CoverageSynchronizer.es6 --source > $(dirname $0)/node-scripts/S3CoverageSynchronizer.js -deepify compile es6 $(dirname $0)/node-scripts/CoverageComparator.es6 --source > $(dirname $0)/node-scripts/CoverageComparator.js -deepify compile es6 $(dirname $0)/node-scripts/GitHubMsgPublisher.es6 --source > $(dirname $0)/node-scripts/GitHubMsgPublisher.js -deepify compile es6 $(dirname $0)/node-scripts/CoverageManager.es6 --source > $(dirname $0)/node-scripts/CoverageManager.js - -node $(dirname $0)/node-scripts/GitDiffWalker.js diff --git a/bin/test/prepare-coverage.sh b/bin/test/prepare-coverage.sh deleted file mode 100755 index 3b93df5..0000000 --- a/bin/test/prepare-coverage.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 23/06/2015 -# - -source $(dirname $0)/_head.sh - -if [ -z "${1}" ]; then - __IS_CONCURRENT_SCRIPT=${__NONE}; -else - __IS_CONCURRENT_SCRIPT=${1} -fi - -if [ $(IS_ENV_VARS_AVAILABLE) == "1" ] && [ "${IS_SKIP_TESTS}" == "false" ] && \ - ([ "$__IS_CONCURRENT_SCRIPT" == "$__NONE" ] || [ "$__IS_CONCURRENT_SCRIPT" == "$__BACKEND" ]); then - - ########################################################################################################## - ### Merge coverage results, compare with s3 report, add comments and update report in s3 if applicable ### - ########################################################################################################## - node $(dirname $0)/node-scripts/CoverageManager.js -fi diff --git a/bin/test/pretest.sh b/bin/test/pretest.sh deleted file mode 100755 index 9542dc3..0000000 --- a/bin/test/pretest.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -source $(dirname $0)/_head.sh - -############################################ -### Gets HTTP status code for passed URL ### -### Arguments: ### -### URL ### -### Returns: ### -### HTTP_STATUS_CODE ### -############################################ -checkStatus () { - curl -sL -w "%{http_code}\\n" "$1" -o /dev/null -} - -##################################################################### -### Checks local server availability with 3s timeout during 3000s ### -### Arguments: ### -### None ### -### Returns: ### -### 0 or 1 ### -##################################################################### -isLocalServerUp () { - NEXT_WAIT_INDEX=0 - CHECK_STATUS_TIMEOUT=3 - DEEPIFY_TIMEOUT=3000 - CURRENT_TIMEOUT=0 - - while true; do - STATUS=$(checkStatus "http://localhost:8000/") - - CURRENT_TIMEOUT=$((NEXT_WAIT_INDEX * $CHECK_STATUS_TIMEOUT)) - echo "$STATUS" - - if [ $STATUS == "200" ]; then - echo "STATUS OK" - break - elif [ $CURRENT_TIMEOUT -lt $DEEPIFY_TIMEOUT ]; then - NEXT_WAIT_INDEX=$((NEXT_WAIT_INDEX + 1)) - echo "Sleeping $CURRENT_TIMEOUT" - sleep $CHECK_STATUS_TIMEOUT - else - echo "TIMEOUT EXPIRED: $CURRENT_TIMEOUT" - exit 1 - fi - - done - - exit 0 -} - -########################################################## -### launch local server and check if it up and running ### -########################################################## -if [ "${TEST_SUITE}" != "frontend" ] &&\ - ([ "${BACKEND_MICROAPP_PATHS}" != "$__NONE" ] || [ "${FRONTEND_MICROAPP_PATHS}" != "$__NONE" ]) &&\ - [ "${__E2E_WITH_PUBLIC_REPO}" = "${E2E_TESTING}" ]; then - deepify server ${__SRC_PATH} -s & sleep 15 & isLocalServerUp -else - echo "Skipping launching deepify server" -fi diff --git a/bin/test/protractor.sh b/bin/test/protractor.sh deleted file mode 100644 index b7171cb..0000000 --- a/bin/test/protractor.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -source $(dirname $0)/_head.sh - -############################################################ -### Initial protractor && support backward compatibility ### -############################################################ -echo "TRAVIS_NODE_VERSION: ${TRAVIS_NODE_VERSION}" - -if [ "${__TRAVIS_NODE_MAJOR_VERSION}" = "0" ]; then - npm list -g protractor@2.0.x --depth=0 || npm install -g protractor@2.0.x -else - npm list -g protractor@3.0.x --depth=0 || npm install -g protractor@3.0.x -fi diff --git a/bin/test/remove-coverage.sh b/bin/test/remove-coverage.sh deleted file mode 100755 index d17f05e..0000000 --- a/bin/test/remove-coverage.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 23/06/2015 -# - -source $(dirname $0)/_head.sh - -############################################# -### Cleanup! Remove all generated reports ### -############################################# -__CMD='rm -rf ./coverage' -subpath_run_cmd ${__SRC_PATH} "$__CMD" - -##################################### -### Remove final report if exists ### -##################################### -(if [ -d ${__COVERAGE_PATH} ]; then rm -rf ${__COVERAGE_PATH}; fi) diff --git a/bin/test/test.sh b/bin/test/test.sh deleted file mode 100755 index d8db4c1..0000000 --- a/bin/test/test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# -# Created by vcernomschi on 10/06/2015 -# - -source $(dirname $0)/_head.sh - -###################### -### Run unit tests ### -###################### -__CMD="npm run test" - -if [ -z "${1}" ]; then - __IS_CONCURRENT_SCRIPT=${__NONE}; -else - __IS_CONCURRENT_SCRIPT=${1} -fi - -subpath_run_cmd "${__SRC_PATH}" "${__CMD}" "${__CMD}" "$__IS_CONCURRENT_SCRIPT" "${1}" diff --git a/bin/travis-init.sh b/bin/travis-init.sh new file mode 100644 index 0000000..782074e --- /dev/null +++ b/bin/travis-init.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Install global packages +NPM_BIN=`which npm` +GLOBAL_DEPS=( + deepify + recink + recink-snyk + recink-pagespeed + recink-codeclimate +); + +for DEP in ${GLOBAL_DEPS[@]}; do + if [ ! -d "$(${NPM_BIN} root -g)/${DEP}" ]; then + echo "Installing missing ${DEP}" + ${NPM_BIN} install -g ${DEP} || (echo "Failed to install ${DEP}" && exit 1) + fi +done diff --git a/src/deep-benchmarking/docs/index.md b/src/deep-benchmarking/docs/index.md deleted file mode 100755 index 8db02a8..0000000 --- a/src/deep-benchmarking/docs/index.md +++ /dev/null @@ -1,4 +0,0 @@ -Deep Benchmarking MicroService -============================== - -TBU \ No newline at end of file diff --git a/src/deep-benchmarking/hook.init.js b/src/deep-benchmarking/hook.init.js new file mode 100644 index 0000000..3e450e5 --- /dev/null +++ b/src/deep-benchmarking/hook.init.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function(callback) { + callback(); +}; diff --git a/src/deep-benchmarking/package.json b/src/deep-benchmarking/package.json new file mode 100644 index 0000000..d79e028 --- /dev/null +++ b/src/deep-benchmarking/package.json @@ -0,0 +1,9 @@ +{ + "name": "deep-benchmarking", + "version": "0.0.1", + "author": "MitocGroup team", + "license": "MIT", + "devDependencies": { + "chai": "^4.1.2" + } +} diff --git a/src/deep-benchmarking/tests/backend/.babelrc b/src/deep-benchmarking/tests/backend/.babelrc deleted file mode 100644 index 02f08fb..0000000 --- a/src/deep-benchmarking/tests/backend/.babelrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "presets": [ - "es2015" - ] -} \ No newline at end of file diff --git a/src/deep-benchmarking/tests/backend/.istanbul.yml b/src/deep-benchmarking/tests/backend/.istanbul.yml deleted file mode 100644 index 3bf63e4..0000000 --- a/src/deep-benchmarking/tests/backend/.istanbul.yml +++ /dev/null @@ -1,4 +0,0 @@ -instrumentation: - root: ./../../backend/src - extensions: - - .js \ No newline at end of file diff --git a/src/deep-benchmarking/tests/backend/node-bin/install.sh b/src/deep-benchmarking/tests/backend/node-bin/install.sh deleted file mode 100755 index e9be129..0000000 --- a/src/deep-benchmarking/tests/backend/node-bin/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -npm link chai &&\ -npm link aws-sdk &&\ -npm link node-dir &&\ -npm link deepify &&\ -npm link babel-preset-es2015 &&\ - -############################################ -#TODO: TEMPORARY FIX FOR NODE MORE THAN v5 # -############################################ -(npm list -g deep-framework --depth=0 || npm install deep-framework -g babel-cli) &&\ -npm link deep-framework \ No newline at end of file diff --git a/src/deep-benchmarking/tests/backend/node-bin/posttest.sh b/src/deep-benchmarking/tests/backend/node-bin/posttest.sh deleted file mode 100755 index e228a6a..0000000 --- a/src/deep-benchmarking/tests/backend/node-bin/posttest.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -################################################ -### Update paths to have backend in coverage ### -################################################ -SEARCH_VALUE=".js" -REPLACE_VALUE=".es6" - -sed -e "s@${SEARCH_VALUE}@${REPLACE_VALUE}@g" ./coverage/coverage.raw.json > ./coverage/coverage.json - -(if [ -f "./coverage/coverage.raw.json" ]; then rm ./coverage/coverage.raw.json; fi) diff --git a/src/deep-benchmarking/tests/backend/node-bin/preinstall.sh b/src/deep-benchmarking/tests/backend/node-bin/preinstall.sh deleted file mode 100755 index 72bc3cb..0000000 --- a/src/deep-benchmarking/tests/backend/node-bin/preinstall.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ -e "./node_modules/deepify" ] && rm -f "./node_modules/deepify"; - -[ -e "./node_modules/deep-framework" ] && rm -f "./node_modules/deep-framework"; - -exit 0 diff --git a/src/deep-benchmarking/tests/backend/node-bin/test.sh b/src/deep-benchmarking/tests/backend/node-bin/test.sh deleted file mode 100755 index 3ccf71b..0000000 --- a/src/deep-benchmarking/tests/backend/node-bin/test.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -RUN_TESTS() { - babel-node $(npm root -g)/istanbul/lib/cli.js cover `which _mocha` -- 'test/**/*.spec.js' \ - --reporter spec --ui tdd --recursive --timeout 180s -} - -if [ "$OSTYPE" != "msys" ] && [ "$OSTYPE" != "win32" ] && [ "$OSTYPE" != "win64" ] && [ -d 'test' ] && [ -d 'node_modules' ]; then - - ######################################################################### - ### Run with babel-node to support ES6 tests and have coverage in ES6 ### - ######################################################################### - RUN_TESTS -elif [ "$OSTYPE" == "win32" ] || [ "$OSTYPE" == "win64" ]; then - - ################################################# - ### Skip running on Windows from command line ### - ################################################# - echo "You should have installed and configured http://git-scm.com/ and run all bash command by using git-bash.exe" -elif [ -d 'test' ] && [ -d 'node_modules' ]; then - - ######################################### - ### Running from git-bash on Windows ### - ######################################### - echo "Running from git-bash with gathering coverage" - RUN_TESTS -else - - ################################################## - ### Skip running if `lib` folder doesn't exist ### - ################################################## - echo "Skipping testing..." -fi diff --git a/src/deep-benchmarking/tests/backend/package.json b/src/deep-benchmarking/tests/backend/package.json deleted file mode 100644 index 982a4ef..0000000 --- a/src/deep-benchmarking/tests/backend/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "deep-benchmarking-backend-test", - "version": "0.0.1", - "description": "Description of deep-benchmarking-backend-test", - "scripts": { - "preinstall": "bash node-bin/preinstall.sh", - "install": "bash node-bin/install.sh", - "test": "bash node-bin/test.sh", - "posttest": "bash node-bin/posttest.sh" - }, - "dependencies": {}, - "devDependencies": {}, - "repository": { - "type": "git", - "url": "https://github.com/MitocGroup/deep-microservices-skeleton.git" - }, - "private": true, - "license": "MIT" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/unused-code/bootstrap.spec.js b/src/deep-benchmarking/tests/backend/test/case/unused-code/bootstrap.spec.js deleted file mode 100644 index 8c74bee..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/unused-code/bootstrap.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import chai from 'chai'; -import bootstrap from '../../../../../backend/src/case/unused-code/bootstrap'; - -suite('Bootstraps', () => { - test(' bootstrap exists in unused-code module', () => { - chai.expect(bootstrap).to.be.an('object'); - }); -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/unused-code/functional.spec.js b/src/deep-benchmarking/tests/backend/test/case/unused-code/functional.spec.js deleted file mode 100644 index 1d8a735..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/unused-code/functional.spec.js +++ /dev/null @@ -1,109 +0,0 @@ -/*jshint evil:true */ - -'use strict'; - -import chai from 'chai'; -import dir from 'node-dir'; -import path from 'path'; -import {Exec} from '../../../node_modules/deepify/lib.compiled/Helpers/Exec'; - -suite('Functional tests', () => { - - let inputEventsArray = []; - let inputEventsFilesArray = []; - let expectedResultsArray = []; - let expectedResultsFilesArray = []; - let i = 0; - - suiteSetup((done) => { - - const TEST_ASSERTS_DIR = './test-asserts'; - let dirPath = path.join(__dirname, TEST_ASSERTS_DIR); - - dir.readFiles(dirPath, { - match: /result.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - expectedResultsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - expectedResultsFilesArray = files; - }); - - dir.readFiles(dirPath, { - match: /payload.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - inputEventsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - inputEventsFilesArray = files; - done(); - }); - }); - - test('Check relevant of data', () => { - for (i = 0; i < inputEventsFilesArray.length; i++) { - chai.expect(inputEventsFilesArray[i].replace('payload.json', '')).to.equal( - expectedResultsFilesArray[i].replace('result.json', '') - ); - } - }); - - test('Check lambdas', () => { - - for (i = 0; i < inputEventsArray.length; i++) { - let eventStr = '\'' + inputEventsArray[i].replace(/(\r\n|\n|\r)/gm, '') + '\''; - let cmd = `deepify lambda ../../../../../backend/src/case/unused-code -e=${eventStr} -p`; - let runLambdaCmd = new Exec(cmd); - - runLambdaCmd.cwd = __dirname; - - let lambdaResult = runLambdaCmd.runSync(); - let expectedResult = JSON.parse(expectedResultsArray[i]); - let actualResult = (lambdaResult.failed) ? - JSON.parse(lambdaResult.error) - : ( typeof JSON.parse(lambdaResult.result) === 'string') ? - JSON.parse(JSON.parse(lambdaResult.result)) - : JSON.parse(lambdaResult.result); - - if (expectedResult._ignore) { - - var ignoreKeys = (result, ignoreKeysArray) => { - - for(let ignoreKey of ignoreKeysArray) { - eval(`delete result.${ignoreKey}`); - } - - return result; - }; - - ignoreKeys(actualResult, expectedResult._ignore); - - delete expectedResult._ignore; - } - - chai.expect(actualResult).to.eql(expectedResult, `for payload from: ${inputEventsFilesArray[i]}`); - } - - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/unused-code/handler.spec.js b/src/deep-benchmarking/tests/backend/test/case/unused-code/handler.spec.js deleted file mode 100644 index 07bd3e7..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/unused-code/handler.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -// THIS TEST WAS GENERATED AUTOMATICALLY ON Thu Jun 23 2016 22:22:48 GMT-0400 (EDT) - -'use strict'; - -import chai from 'chai'; -import Handler from '../../../../../backend/src/case/unused-code/Handler'; -import Kernel from '../../../node_modules/deep-framework/node_modules/deep-kernel'; -import KernelFactory from '../../common/KernelFactory'; - -// @todo: Add more advanced tests -suite('Handlers', () => { - let handler, kernelInstance; - - test('Class Handler exists in unused-code module', () => { - chai.expect(Handler).to.be.an('function'); - }); - - test('Load Kernel by using Kernel.load()', (done) => { - let callback = (backendKernel) => { - kernelInstance = backendKernel; - - chai.assert.instanceOf( - backendKernel, Kernel, 'backendKernel is an instance of Kernel' - ); - - // complete the async - done(); - }; - - KernelFactory.create(callback); - }); - - test('Check Handler constructor', () => { - handler = new Handler(kernelInstance); - - chai.expect(handler).to.be.an.instanceof(Handler); - }); - - test('Check handle method exists', () => { - chai.expect(handler.handle).to.be.an('function'); - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts-sample/test1.payload.json b/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts-sample/test1.payload.json deleted file mode 100644 index 861ebb8..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts-sample/test1.payload.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "InputKey": "Input Value" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts-sample/test1.result.json b/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts-sample/test1.result.json deleted file mode 100644 index 6b66cee..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts-sample/test1.result.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ResultKey": "ResultValue" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts/.gitignore b/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts/.gitignore deleted file mode 100644 index 357dd5b..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/unused-code/test-asserts/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen - diff --git a/src/deep-benchmarking/tests/backend/test/case/used-code/bootstrap.spec.js b/src/deep-benchmarking/tests/backend/test/case/used-code/bootstrap.spec.js deleted file mode 100644 index 24f84b4..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/used-code/bootstrap.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import chai from 'chai'; -import bootstrap from '../../../../../backend/src/case/used-code/bootstrap'; - -suite('Bootstraps', () => { - test(' bootstrap exists in used-code module', () => { - chai.expect(bootstrap).to.be.an('object'); - }); -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/used-code/functional.spec.js b/src/deep-benchmarking/tests/backend/test/case/used-code/functional.spec.js deleted file mode 100644 index d4e49ca..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/used-code/functional.spec.js +++ /dev/null @@ -1,109 +0,0 @@ -/*jshint evil:true */ - -'use strict'; - -import chai from 'chai'; -import dir from 'node-dir'; -import path from 'path'; -import {Exec} from '../../../node_modules/deepify/lib.compiled/Helpers/Exec'; - -suite('Functional tests', () => { - - let inputEventsArray = []; - let inputEventsFilesArray = []; - let expectedResultsArray = []; - let expectedResultsFilesArray = []; - let i = 0; - - suiteSetup((done) => { - - const TEST_ASSERTS_DIR = './test-asserts'; - let dirPath = path.join(__dirname, TEST_ASSERTS_DIR); - - dir.readFiles(dirPath, { - match: /result.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - expectedResultsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - expectedResultsFilesArray = files; - }); - - dir.readFiles(dirPath, { - match: /payload.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - inputEventsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - inputEventsFilesArray = files; - done(); - }); - }); - - test('Check relevant of data', () => { - for (i = 0; i < inputEventsFilesArray.length; i++) { - chai.expect(inputEventsFilesArray[i].replace('payload.json', '')).to.equal( - expectedResultsFilesArray[i].replace('result.json', '') - ); - } - }); - - test('Check lambdas', () => { - - for (i = 0; i < inputEventsArray.length; i++) { - let eventStr = '\'' + inputEventsArray[i].replace(/(\r\n|\n|\r)/gm, '') + '\''; - let cmd = `deepify lambda ../../../../../backend/src/case/used-code -e=${eventStr} -p`; - let runLambdaCmd = new Exec(cmd); - - runLambdaCmd.cwd = __dirname; - - let lambdaResult = runLambdaCmd.runSync(); - let expectedResult = JSON.parse(expectedResultsArray[i]); - let actualResult = (lambdaResult.failed) ? - JSON.parse(lambdaResult.error) - : ( typeof JSON.parse(lambdaResult.result) === 'string') ? - JSON.parse(JSON.parse(lambdaResult.result)) - : JSON.parse(lambdaResult.result); - - if (expectedResult._ignore) { - - var ignoreKeys = (result, ignoreKeysArray) => { - - for(let ignoreKey of ignoreKeysArray) { - eval(`delete result.${ignoreKey}`); - } - - return result; - }; - - ignoreKeys(actualResult, expectedResult._ignore); - - delete expectedResult._ignore; - } - - chai.expect(actualResult).to.eql(expectedResult, `for payload from: ${inputEventsFilesArray[i]}`); - } - - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/used-code/handler.spec.js b/src/deep-benchmarking/tests/backend/test/case/used-code/handler.spec.js deleted file mode 100644 index 8bb7599..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/used-code/handler.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -// THIS TEST WAS GENERATED AUTOMATICALLY ON Thu Jun 23 2016 22:22:48 GMT-0400 (EDT) - -'use strict'; - -import chai from 'chai'; -import Handler from '../../../../../backend/src/case/used-code/Handler'; -import Kernel from '../../../node_modules/deep-framework/node_modules/deep-kernel'; -import KernelFactory from '../../common/KernelFactory'; - -// @todo: Add more advanced tests -suite('Handlers', () => { - let handler, kernelInstance; - - test('Class Handler exists in used-code module', () => { - chai.expect(Handler).to.be.an('function'); - }); - - test('Load Kernel by using Kernel.load()', (done) => { - let callback = (backendKernel) => { - kernelInstance = backendKernel; - - chai.assert.instanceOf( - backendKernel, Kernel, 'backendKernel is an instance of Kernel' - ); - - // complete the async - done(); - }; - - KernelFactory.create(callback); - }); - - test('Check Handler constructor', () => { - handler = new Handler(kernelInstance); - - chai.expect(handler).to.be.an.instanceof(Handler); - }); - - test('Check handle method exists', () => { - chai.expect(handler.handle).to.be.an('function'); - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts-sample/test1.payload.json b/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts-sample/test1.payload.json deleted file mode 100644 index 861ebb8..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts-sample/test1.payload.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "InputKey": "Input Value" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts-sample/test1.result.json b/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts-sample/test1.result.json deleted file mode 100644 index 6b66cee..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts-sample/test1.result.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ResultKey": "ResultValue" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts/.gitignore b/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts/.gitignore deleted file mode 100644 index 357dd5b..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/used-code/test-asserts/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen - diff --git a/src/deep-benchmarking/tests/backend/test/case/with-babel/bootstrap.spec.js b/src/deep-benchmarking/tests/backend/test/case/with-babel/bootstrap.spec.js deleted file mode 100644 index 3fe8555..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-babel/bootstrap.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import chai from 'chai'; -import bootstrap from '../../../../../backend/src/case/with-babel/bootstrap'; - -suite('Bootstraps', () => { - test(' bootstrap exists in with-babel module', () => { - chai.expect(bootstrap).to.be.an('object'); - }); -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/with-babel/functional.spec.js b/src/deep-benchmarking/tests/backend/test/case/with-babel/functional.spec.js deleted file mode 100644 index 3615f32..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-babel/functional.spec.js +++ /dev/null @@ -1,109 +0,0 @@ -/*jshint evil:true */ - -'use strict'; - -import chai from 'chai'; -import dir from 'node-dir'; -import path from 'path'; -import {Exec} from '../../../node_modules/deepify/lib.compiled/Helpers/Exec'; - -suite('Functional tests', () => { - - let inputEventsArray = []; - let inputEventsFilesArray = []; - let expectedResultsArray = []; - let expectedResultsFilesArray = []; - let i = 0; - - suiteSetup((done) => { - - const TEST_ASSERTS_DIR = './test-asserts'; - let dirPath = path.join(__dirname, TEST_ASSERTS_DIR); - - dir.readFiles(dirPath, { - match: /result.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - expectedResultsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - expectedResultsFilesArray = files; - }); - - dir.readFiles(dirPath, { - match: /payload.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - inputEventsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - inputEventsFilesArray = files; - done(); - }); - }); - - test('Check relevant of data', () => { - for (i = 0; i < inputEventsFilesArray.length; i++) { - chai.expect(inputEventsFilesArray[i].replace('payload.json', '')).to.equal( - expectedResultsFilesArray[i].replace('result.json', '') - ); - } - }); - - test('Check lambdas', () => { - - for (i = 0; i < inputEventsArray.length; i++) { - let eventStr = '\'' + inputEventsArray[i].replace(/(\r\n|\n|\r)/gm, '') + '\''; - let cmd = `deepify lambda ../../../../../backend/src/case/with-babel -e=${eventStr} -p`; - let runLambdaCmd = new Exec(cmd); - - runLambdaCmd.cwd = __dirname; - - let lambdaResult = runLambdaCmd.runSync(); - let expectedResult = JSON.parse(expectedResultsArray[i]); - let actualResult = (lambdaResult.failed) ? - JSON.parse(lambdaResult.error) - : ( typeof JSON.parse(lambdaResult.result) === 'string') ? - JSON.parse(JSON.parse(lambdaResult.result)) - : JSON.parse(lambdaResult.result); - - if (expectedResult._ignore) { - - var ignoreKeys = (result, ignoreKeysArray) => { - - for(let ignoreKey of ignoreKeysArray) { - eval(`delete result.${ignoreKey}`); - } - - return result; - }; - - ignoreKeys(actualResult, expectedResult._ignore); - - delete expectedResult._ignore; - } - - chai.expect(actualResult).to.eql(expectedResult, `for payload from: ${inputEventsFilesArray[i]}`); - } - - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/with-babel/handler.spec.js b/src/deep-benchmarking/tests/backend/test/case/with-babel/handler.spec.js deleted file mode 100644 index c36d963..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-babel/handler.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -// THIS TEST WAS GENERATED AUTOMATICALLY ON Thu Jun 23 2016 22:22:48 GMT-0400 (EDT) - -'use strict'; - -import chai from 'chai'; -import Handler from '../../../../../backend/src/case/with-babel/Handler'; -import Kernel from '../../../node_modules/deep-framework/node_modules/deep-kernel'; -import KernelFactory from '../../common/KernelFactory'; - -// @todo: Add more advanced tests -suite('Handlers', () => { - let handler, kernelInstance; - - test('Class Handler exists in with-babel module', () => { - chai.expect(Handler).to.be.an('function'); - }); - - test('Load Kernel by using Kernel.load()', (done) => { - let callback = (backendKernel) => { - kernelInstance = backendKernel; - - chai.assert.instanceOf( - backendKernel, Kernel, 'backendKernel is an instance of Kernel' - ); - - // complete the async - done(); - }; - - KernelFactory.create(callback); - }); - - test('Check Handler constructor', () => { - handler = new Handler(kernelInstance); - - chai.expect(handler).to.be.an.instanceof(Handler); - }); - - test('Check handle method exists', () => { - chai.expect(handler.handle).to.be.an('function'); - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts-sample/test1.payload.json b/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts-sample/test1.payload.json deleted file mode 100644 index 861ebb8..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts-sample/test1.payload.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "InputKey": "Input Value" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts-sample/test1.result.json b/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts-sample/test1.result.json deleted file mode 100644 index 6b66cee..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts-sample/test1.result.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ResultKey": "ResultValue" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts/.gitignore b/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts/.gitignore deleted file mode 100644 index 357dd5b..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-babel/test-asserts/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen - diff --git a/src/deep-benchmarking/tests/backend/test/case/with-framework/bootstrap.spec.js b/src/deep-benchmarking/tests/backend/test/case/with-framework/bootstrap.spec.js deleted file mode 100644 index c5e1ff4..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-framework/bootstrap.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import chai from 'chai'; -import bootstrap from '../../../../../backend/src/case/with-framework/bootstrap'; - -suite('Bootstraps', () => { - test(' bootstrap exists in with-framework module', () => { - chai.expect(bootstrap).to.be.an('object'); - }); -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/with-framework/functional.spec.js b/src/deep-benchmarking/tests/backend/test/case/with-framework/functional.spec.js deleted file mode 100644 index b640f46..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-framework/functional.spec.js +++ /dev/null @@ -1,109 +0,0 @@ -/*jshint evil:true */ - -'use strict'; - -import chai from 'chai'; -import dir from 'node-dir'; -import path from 'path'; -import {Exec} from '../../../node_modules/deepify/lib.compiled/Helpers/Exec'; - -suite('Functional tests', () => { - - let inputEventsArray = []; - let inputEventsFilesArray = []; - let expectedResultsArray = []; - let expectedResultsFilesArray = []; - let i = 0; - - suiteSetup((done) => { - - const TEST_ASSERTS_DIR = './test-asserts'; - let dirPath = path.join(__dirname, TEST_ASSERTS_DIR); - - dir.readFiles(dirPath, { - match: /result.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - expectedResultsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - expectedResultsFilesArray = files; - }); - - dir.readFiles(dirPath, { - match: /payload.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - inputEventsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - inputEventsFilesArray = files; - done(); - }); - }); - - test('Check relevant of data', () => { - for (i = 0; i < inputEventsFilesArray.length; i++) { - chai.expect(inputEventsFilesArray[i].replace('payload.json', '')).to.equal( - expectedResultsFilesArray[i].replace('result.json', '') - ); - } - }); - - test('Check lambdas', () => { - - for (i = 0; i < inputEventsArray.length; i++) { - let eventStr = '\'' + inputEventsArray[i].replace(/(\r\n|\n|\r)/gm, '') + '\''; - let cmd = `deepify lambda ../../../../../backend/src/case/with-framework -e=${eventStr} -p`; - let runLambdaCmd = new Exec(cmd); - - runLambdaCmd.cwd = __dirname; - - let lambdaResult = runLambdaCmd.runSync(); - let expectedResult = JSON.parse(expectedResultsArray[i]); - let actualResult = (lambdaResult.failed) ? - JSON.parse(lambdaResult.error) - : ( typeof JSON.parse(lambdaResult.result) === 'string') ? - JSON.parse(JSON.parse(lambdaResult.result)) - : JSON.parse(lambdaResult.result); - - if (expectedResult._ignore) { - - var ignoreKeys = (result, ignoreKeysArray) => { - - for(let ignoreKey of ignoreKeysArray) { - eval(`delete result.${ignoreKey}`); - } - - return result; - }; - - ignoreKeys(actualResult, expectedResult._ignore); - - delete expectedResult._ignore; - } - - chai.expect(actualResult).to.eql(expectedResult, `for payload from: ${inputEventsFilesArray[i]}`); - } - - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/with-framework/handler.spec.js b/src/deep-benchmarking/tests/backend/test/case/with-framework/handler.spec.js deleted file mode 100644 index 307e7de..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-framework/handler.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -// THIS TEST WAS GENERATED AUTOMATICALLY ON Thu Jun 23 2016 22:22:48 GMT-0400 (EDT) - -'use strict'; - -import chai from 'chai'; -import Handler from '../../../../../backend/src/case/with-framework/Handler'; -import Kernel from '../../../node_modules/deep-framework/node_modules/deep-kernel'; -import KernelFactory from '../../common/KernelFactory'; - -// @todo: Add more advanced tests -suite('Handlers', () => { - let handler, kernelInstance; - - test('Class Handler exists in with-framework module', () => { - chai.expect(Handler).to.be.an('function'); - }); - - test('Load Kernel by using Kernel.load()', (done) => { - let callback = (backendKernel) => { - kernelInstance = backendKernel; - - chai.assert.instanceOf( - backendKernel, Kernel, 'backendKernel is an instance of Kernel' - ); - - // complete the async - done(); - }; - - KernelFactory.create(callback); - }); - - test('Check Handler constructor', () => { - handler = new Handler(kernelInstance); - - chai.expect(handler).to.be.an.instanceof(Handler); - }); - - test('Check handle method exists', () => { - chai.expect(handler.handle).to.be.an('function'); - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts-sample/test1.payload.json b/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts-sample/test1.payload.json deleted file mode 100644 index 861ebb8..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts-sample/test1.payload.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "InputKey": "Input Value" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts-sample/test1.result.json b/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts-sample/test1.result.json deleted file mode 100644 index 6b66cee..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts-sample/test1.result.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ResultKey": "ResultValue" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts/.gitignore b/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts/.gitignore deleted file mode 100644 index 357dd5b..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/with-framework/test-asserts/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen - diff --git a/src/deep-benchmarking/tests/backend/test/case/without-babel/bootstrap.spec.js b/src/deep-benchmarking/tests/backend/test/case/without-babel/bootstrap.spec.js deleted file mode 100644 index 15b5229..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-babel/bootstrap.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import chai from 'chai'; -import bootstrap from '../../../../../backend/src/case/without-babel/bootstrap'; - -suite('Bootstraps', () => { - test(' bootstrap exists in without-babel module', () => { - chai.expect(bootstrap).to.be.an('object'); - }); -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/without-babel/functional.spec.js b/src/deep-benchmarking/tests/backend/test/case/without-babel/functional.spec.js deleted file mode 100644 index fea74d4..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-babel/functional.spec.js +++ /dev/null @@ -1,109 +0,0 @@ -/*jshint evil:true */ - -'use strict'; - -import chai from 'chai'; -import dir from 'node-dir'; -import path from 'path'; -import {Exec} from '../../../node_modules/deepify/lib.compiled/Helpers/Exec'; - -suite('Functional tests', () => { - - let inputEventsArray = []; - let inputEventsFilesArray = []; - let expectedResultsArray = []; - let expectedResultsFilesArray = []; - let i = 0; - - suiteSetup((done) => { - - const TEST_ASSERTS_DIR = './test-asserts'; - let dirPath = path.join(__dirname, TEST_ASSERTS_DIR); - - dir.readFiles(dirPath, { - match: /result.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - expectedResultsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - expectedResultsFilesArray = files; - }); - - dir.readFiles(dirPath, { - match: /payload.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - inputEventsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - inputEventsFilesArray = files; - done(); - }); - }); - - test('Check relevant of data', () => { - for (i = 0; i < inputEventsFilesArray.length; i++) { - chai.expect(inputEventsFilesArray[i].replace('payload.json', '')).to.equal( - expectedResultsFilesArray[i].replace('result.json', '') - ); - } - }); - - test('Check lambdas', () => { - - for (i = 0; i < inputEventsArray.length; i++) { - let eventStr = '\'' + inputEventsArray[i].replace(/(\r\n|\n|\r)/gm, '') + '\''; - let cmd = `deepify lambda ../../../../../backend/src/case/without-babel -e=${eventStr} -p`; - let runLambdaCmd = new Exec(cmd); - - runLambdaCmd.cwd = __dirname; - - let lambdaResult = runLambdaCmd.runSync(); - let expectedResult = JSON.parse(expectedResultsArray[i]); - let actualResult = (lambdaResult.failed) ? - JSON.parse(lambdaResult.error) - : ( typeof JSON.parse(lambdaResult.result) === 'string') ? - JSON.parse(JSON.parse(lambdaResult.result)) - : JSON.parse(lambdaResult.result); - - if (expectedResult._ignore) { - - var ignoreKeys = (result, ignoreKeysArray) => { - - for(let ignoreKey of ignoreKeysArray) { - eval(`delete result.${ignoreKey}`); - } - - return result; - }; - - ignoreKeys(actualResult, expectedResult._ignore); - - delete expectedResult._ignore; - } - - chai.expect(actualResult).to.eql(expectedResult, `for payload from: ${inputEventsFilesArray[i]}`); - } - - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/without-babel/handler.spec.js b/src/deep-benchmarking/tests/backend/test/case/without-babel/handler.spec.js deleted file mode 100644 index 44af546..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-babel/handler.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -// THIS TEST WAS GENERATED AUTOMATICALLY ON Thu Jun 23 2016 22:22:48 GMT-0400 (EDT) - -'use strict'; - -import chai from 'chai'; -import Handler from '../../../../../backend/src/case/without-babel/Handler'; -import Kernel from '../../../node_modules/deep-framework/node_modules/deep-kernel'; -import KernelFactory from '../../common/KernelFactory'; - -// @todo: Add more advanced tests -suite('Handlers', () => { - let handler, kernelInstance; - - test('Class Handler exists in without-babel module', () => { - chai.expect(Handler).to.be.an('function'); - }); - - test('Load Kernel by using Kernel.load()', (done) => { - let callback = (backendKernel) => { - kernelInstance = backendKernel; - - chai.assert.instanceOf( - backendKernel, Kernel, 'backendKernel is an instance of Kernel' - ); - - // complete the async - done(); - }; - - KernelFactory.create(callback); - }); - - test('Check Handler constructor', () => { - handler = new Handler(kernelInstance); - - chai.expect(handler).to.be.an.instanceof(Handler); - }); - - test('Check handle method exists', () => { - chai.expect(handler.handle).to.be.an('function'); - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts-sample/test1.payload.json b/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts-sample/test1.payload.json deleted file mode 100644 index 861ebb8..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts-sample/test1.payload.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "InputKey": "Input Value" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts-sample/test1.result.json b/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts-sample/test1.result.json deleted file mode 100644 index 6b66cee..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts-sample/test1.result.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ResultKey": "ResultValue" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts/.gitignore b/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts/.gitignore deleted file mode 100644 index 357dd5b..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-babel/test-asserts/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen - diff --git a/src/deep-benchmarking/tests/backend/test/case/without-framework/bootstrap.spec.js b/src/deep-benchmarking/tests/backend/test/case/without-framework/bootstrap.spec.js deleted file mode 100644 index 41932d7..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-framework/bootstrap.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import chai from 'chai'; -import bootstrap from '../../../../../backend/src/case/without-framework/bootstrap'; - -suite('Bootstraps', () => { - test(' bootstrap exists in without-framework module', () => { - chai.expect(bootstrap).to.be.an('object'); - }); -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/without-framework/functional.spec.js b/src/deep-benchmarking/tests/backend/test/case/without-framework/functional.spec.js deleted file mode 100644 index b269045..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-framework/functional.spec.js +++ /dev/null @@ -1,109 +0,0 @@ -/*jshint evil:true */ - -'use strict'; - -import chai from 'chai'; -import dir from 'node-dir'; -import path from 'path'; -import {Exec} from '../../../node_modules/deepify/lib.compiled/Helpers/Exec'; - -suite('Functional tests', () => { - - let inputEventsArray = []; - let inputEventsFilesArray = []; - let expectedResultsArray = []; - let expectedResultsFilesArray = []; - let i = 0; - - suiteSetup((done) => { - - const TEST_ASSERTS_DIR = './test-asserts'; - let dirPath = path.join(__dirname, TEST_ASSERTS_DIR); - - dir.readFiles(dirPath, { - match: /result.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - expectedResultsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - expectedResultsFilesArray = files; - }); - - dir.readFiles(dirPath, { - match: /payload.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - inputEventsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - inputEventsFilesArray = files; - done(); - }); - }); - - test('Check relevant of data', () => { - for (i = 0; i < inputEventsFilesArray.length; i++) { - chai.expect(inputEventsFilesArray[i].replace('payload.json', '')).to.equal( - expectedResultsFilesArray[i].replace('result.json', '') - ); - } - }); - - test('Check lambdas', () => { - - for (i = 0; i < inputEventsArray.length; i++) { - let eventStr = '\'' + inputEventsArray[i].replace(/(\r\n|\n|\r)/gm, '') + '\''; - let cmd = `deepify lambda ../../../../../backend/src/case/without-framework -e=${eventStr} -p`; - let runLambdaCmd = new Exec(cmd); - - runLambdaCmd.cwd = __dirname; - - let lambdaResult = runLambdaCmd.runSync(); - let expectedResult = JSON.parse(expectedResultsArray[i]); - let actualResult = (lambdaResult.failed) ? - JSON.parse(lambdaResult.error) - : ( typeof JSON.parse(lambdaResult.result) === 'string') ? - JSON.parse(JSON.parse(lambdaResult.result)) - : JSON.parse(lambdaResult.result); - - if (expectedResult._ignore) { - - var ignoreKeys = (result, ignoreKeysArray) => { - - for(let ignoreKey of ignoreKeysArray) { - eval(`delete result.${ignoreKey}`); - } - - return result; - }; - - ignoreKeys(actualResult, expectedResult._ignore); - - delete expectedResult._ignore; - } - - chai.expect(actualResult).to.eql(expectedResult, `for payload from: ${inputEventsFilesArray[i]}`); - } - - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/without-framework/handler.spec.js b/src/deep-benchmarking/tests/backend/test/case/without-framework/handler.spec.js deleted file mode 100644 index a5d1b0e..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-framework/handler.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -// THIS TEST WAS GENERATED AUTOMATICALLY ON Thu Jun 23 2016 22:22:48 GMT-0400 (EDT) - -'use strict'; - -import chai from 'chai'; -import Handler from '../../../../../backend/src/case/without-framework/Handler'; -import Kernel from '../../../node_modules/deep-framework/node_modules/deep-kernel'; -import KernelFactory from '../../common/KernelFactory'; - -// @todo: Add more advanced tests -suite('Handlers', () => { - let handler, kernelInstance; - - test('Class Handler exists in without-framework module', () => { - chai.expect(Handler).to.be.an('function'); - }); - - test('Load Kernel by using Kernel.load()', (done) => { - let callback = (backendKernel) => { - kernelInstance = backendKernel; - - chai.assert.instanceOf( - backendKernel, Kernel, 'backendKernel is an instance of Kernel' - ); - - // complete the async - done(); - }; - - KernelFactory.create(callback); - }); - - test('Check Handler constructor', () => { - handler = new Handler(kernelInstance); - - chai.expect(handler).to.be.an.instanceof(Handler); - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts-sample/test1.payload.json b/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts-sample/test1.payload.json deleted file mode 100644 index 861ebb8..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts-sample/test1.payload.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "InputKey": "Input Value" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts-sample/test1.result.json b/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts-sample/test1.result.json deleted file mode 100644 index 6b66cee..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts-sample/test1.result.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ResultKey": "ResultValue" -} diff --git a/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts/.gitignore b/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts/.gitignore deleted file mode 100644 index 357dd5b..0000000 --- a/src/deep-benchmarking/tests/backend/test/case/without-framework/test-asserts/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen - diff --git a/src/deep-benchmarking/tests/backend/test/common/KernelFactory.js b/src/deep-benchmarking/tests/backend/test/common/KernelFactory.js deleted file mode 100644 index fd6d5ba..0000000 --- a/src/deep-benchmarking/tests/backend/test/common/KernelFactory.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -import backendConfig from './backend-cfg-json'; -import Kernel from '../../node_modules/deep-framework/node_modules/deep-kernel'; -import Validation from '../../node_modules/deep-framework/node_modules/deep-validation'; -import Resource from '../../node_modules/deep-framework/node_modules/deep-resource'; -import Security from '../../node_modules/deep-framework/node_modules/deep-security'; -import Cache from '../../node_modules/deep-framework/node_modules/deep-cache'; -import DB from '../../node_modules/deep-framework/node_modules/deep-db'; -import FS from '../../node_modules/deep-framework/node_modules/deep-fs'; -import Log from '../../node_modules/deep-framework/node_modules/deep-log'; - -export default { - /** - * @param {Object} services - * @param {Function} callback - */ - create: function (callback) { - let services = { - Validation: Validation, - Security: Security, - Resource: Resource, - Cache: Cache, - FS: FS, - DB: DB, - Log: Log, - }; - - let backendInstance = new Kernel(services, Kernel.BACKEND_CONTEXT); - - return backendInstance.load(backendConfig, (backendKernel) => { - callback(backendKernel); - }); - }, -}; diff --git a/src/deep-benchmarking/tests/backend/test/common/backend-cfg-json.js b/src/deep-benchmarking/tests/backend/test/common/backend-cfg-json.js deleted file mode 100644 index 164b20d..0000000 --- a/src/deep-benchmarking/tests/backend/test/common/backend-cfg-json.js +++ /dev/null @@ -1,215 +0,0 @@ -export default { - 'env': 'dev', - 'deployId': 'a44dd54d', - 'awsRegion': 'us-west-2', - 'models': [ - { - 'name': { - 'Name': 'string' - } - } - ], - 'identityPoolId': 'us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xx0123456789', - 'identityProviders': '', - 'microservices': { - 'deep-hello-world': { - 'isRoot': false, - 'parameters': {}, - 'resources': { - 'say-hello': { - 'create-msg': { - 'type': 'lambda', - 'methods': [ - 'POST' - ], - 'forceUserIdentity': true, - 'validationSchema': 'name-data', - 'apiCache': { - 'enabled': false, - 'ttl': -1 - }, - 'region': 'us-west-2', - 'scope': 'public', - 'source': { - 'api': '/deep-hello-world/say-hello/create-msg', - 'original': 'arn:aws:lambda:::function:deep-hello-world-say-hello-create-msg', - '_localPath': './src/deep-hello-world/backend/src/say-hello/create-msg/bootstrap.js' - } - }, - 'create-fs': { - 'type': 'lambda', - 'methods': [ - 'POST' - ], - 'forceUserIdentity': true, - 'validationSchema': 'name-data', - 'apiCache': { - 'enabled': false, - 'ttl': -1 - }, - 'region': 'us-west-2', - 'scope': 'public', - 'source': { - 'api': '/deep-hello-world/say-hello/create-fs', - 'original': 'arn:aws:lambda:::function:deep-hello-world-say-hello-create-fs', - '_localPath': './src/deep-hello-world/backend/src/say-hello/create-fs/bootstrap.js' - } - }, - 'create-db': { - 'type': 'lambda', - 'methods': [ - 'POST' - ], - 'forceUserIdentity': true, - 'validationSchema': 'name-data', - 'apiCache': { - 'enabled': false, - 'ttl': -1 - }, - 'region': 'us-west-2', - 'scope': 'public', - 'source': { - 'api': '/deep-hello-world/say-hello/create-db', - 'original': 'arn:aws:lambda:::function:deep-hello-world-say-hello-create-db', - '_localPath': './src/deep-hello-world/backend/src/say-hello/create-db/bootstrap.js' - } - } - } - } - }, - 'deep-root-vanilla': { - 'isRoot': true, - 'parameters': {}, - 'resources': { - 'async-config': { - 'dump': { - 'type': 'lambda', - 'methods': [ - 'GET' - ], - 'forceUserIdentity': false, - 'apiCache': { - 'enabled': false, - 'ttl': -1 - }, - 'region': 'us-west-2', - 'scope': 'private', - 'source': { - 'api': null, - 'original': 'arn:aws:lambda:::function:deep-root-vanilla-async-config-dump', - '_localPath': './src/deep-root-vanilla/backend/src/async-config/dump/bootstrap.js' - } - } - }, - 'scheduler': { - 'rule': { - 'type': 'lambda', - 'methods': [ - 'GET' - ], - 'forceUserIdentity': false, - 'apiCache': { - 'enabled': false, - 'ttl': -1 - }, - 'region': 'us-west-2', - 'scope': 'private', - 'source': { - 'api': null, - 'original': 'arn:aws:lambda:::function:deep-root-vanilla-scheduler-rule', - '_localPath': './src/deep-root-vanilla/backend/src/scheduler/rule/bootstrap.js' - } - } - }, - 'ddb-eventual-consistency': { - 'listen-queues': { - 'type': 'lambda', - 'methods': [ - 'GET' - ], - 'forceUserIdentity': false, - 'apiCache': { - 'enabled': false, - 'ttl': -1 - }, - 'region': 'us-west-2', - 'scope': 'private', - 'source': { - 'api': null, - 'original': 'arn:aws:lambda:::function:deep-root-vanilla-ddb-eventual-consistency-listen-queues', - '_localPath': './src/deep-root-vanilla/backend/src/ddb-eventual-consistency/listen-queues/bootstrap.js' - } - }, - 'pool-queue': { - 'type': 'lambda', - 'methods': [ - 'GET' - ], - 'forceUserIdentity': false, - 'apiCache': { - 'enabled': false, - 'ttl': -1 - }, - 'region': 'us-west-2', - 'scope': 'private', - 'source': { - 'api': null, - 'original': 'arn:aws:lambda:::function:deep-root-vanilla-ddb-eventual-consistency-pool-queue', - '_localPath': './src/deep-root-vanilla/backend/src/ddb-eventual-consistency/pool-queue/bootstrap.js' - } - } - } - } - } - }, - 'globals': { - 'favicon': '@deep-root-vanilla:img/favicon.ico', - 'pageLoader': { - 'src': '@deep-root-vanilla:img/loader.gif', - 'alt': 'Loading...' - }, - 'engine': { - 'ngRewrite': '/' - } - }, - 'searchDomains': {}, - 'validationSchemas': [ - 'name-data' - ], - 'modelsSettings': [ - { - 'name': { - 'readCapacity': 1, - 'writeCapacity': 1, - 'maxReadCapacity': 10000, - 'maxWriteCapacity': 10000 - } - } - ], - 'forceUserIdentity': false, - 'microserviceIdentifier': 'deep-hello-world', - 'awsAccountId': 123456789123, - 'apiVersion': 'v1', - 'appIdentifier': 'gfhfgdhfghgjgh7687687fghgfhgf', - 'timestamp': 1465996738254, - 'buckets': { - 'temp': { - 'name': 'fdgfd56765gfhjgj768768ghjjhgjhg898-temp' - }, - 'public': { - 'name': 'fdgfd56765gfhjgj768768ghjjhgjhg898-public' - }, - 'private': { - 'name': 'fdgfd56765gfhjgj768768ghjjhgjhg898-private' - }, - 'shared': { - 'name': 'fdgfd56765gfhjgj768768ghjjhgjhg898-shared' - } - }, - 'tablesNames': { - 'name': 'DeepDevName4a7dbaed' - }, - 'cacheDsn': '', - 'name': 'deep-hello-world-say-hello-create-db', - 'path': './src/deep-hello-world/backend/src/say-hello/create-db/bootstrap.js' -}; \ No newline at end of file diff --git a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/bootstrap.spec.js b/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/bootstrap.spec.js deleted file mode 100644 index f647ac4..0000000 --- a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/bootstrap.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import chai from 'chai'; -import bootstrap from '../../../../../backend/src/lambda/size-retrieve/bootstrap'; - -suite('Bootstraps', () => { - test(' bootstrap exists in lambda-size module', () => { - chai.expect(bootstrap).to.be.an('object'); - }); -}); diff --git a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/functional.spec.js b/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/functional.spec.js deleted file mode 100644 index c23f125..0000000 --- a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/functional.spec.js +++ /dev/null @@ -1,109 +0,0 @@ -/*jshint evil:true */ - -'use strict'; - -import chai from 'chai'; -import dir from 'node-dir'; -import path from 'path'; -import {Exec} from '../../../node_modules/deepify/lib.compiled/Helpers/Exec'; - -suite('Functional tests', () => { - - let inputEventsArray = []; - let inputEventsFilesArray = []; - let expectedResultsArray = []; - let expectedResultsFilesArray = []; - let i = 0; - - suiteSetup((done) => { - - const TEST_ASSERTS_DIR = './test-asserts'; - let dirPath = path.join(__dirname, TEST_ASSERTS_DIR); - - dir.readFiles(dirPath, { - match: /result.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - expectedResultsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - expectedResultsFilesArray = files; - }); - - dir.readFiles(dirPath, { - match: /payload.json$/, - exclude: /^\./, - }, (err, content, next) => { - if (err) { - throw err; - } - - inputEventsArray.push(content); - next(); - }, - (err, files) => { - if (err) { - throw err; - } - - inputEventsFilesArray = files; - done(); - }); - }); - - test('Check relevant of data', () => { - for (i = 0; i < inputEventsFilesArray.length; i++) { - chai.expect(inputEventsFilesArray[i].replace('payload.json', '')).to.equal( - expectedResultsFilesArray[i].replace('result.json', '') - ); - } - }); - - test('Check lambdas', () => { - - for (i = 0; i < inputEventsArray.length; i++) { - let eventStr = '\'' + inputEventsArray[i].replace(/(\r\n|\n|\r)/gm, '') + '\''; - let cmd = `deepify lambda ../../../../../backend/src/lambda/size-retrieve -e=${eventStr} -p`; - let runLambdaCmd = new Exec(cmd); - - runLambdaCmd.cwd = __dirname; - - let lambdaResult = runLambdaCmd.runSync(); - let expectedResult = JSON.parse(expectedResultsArray[i]); - let actualResult = (lambdaResult.failed) ? - JSON.parse(lambdaResult.error) - : ( typeof JSON.parse(lambdaResult.result) === 'string') ? - JSON.parse(JSON.parse(lambdaResult.result)) - : JSON.parse(lambdaResult.result); - - if (expectedResult._ignore) { - - var ignoreKeys = (result, ignoreKeysArray) => { - - for(let ignoreKey of ignoreKeysArray) { - eval(`delete result.${ignoreKey}`); - } - - return result; - }; - - ignoreKeys(actualResult, expectedResult._ignore); - - delete expectedResult._ignore; - } - - chai.expect(actualResult).to.eql(expectedResult, `for payload from: ${inputEventsFilesArray[i]}`); - } - - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/handler.spec.js b/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/handler.spec.js deleted file mode 100644 index 9620cf6..0000000 --- a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/handler.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -// THIS TEST WAS GENERATED AUTOMATICALLY ON Thu Jun 23 2016 22:22:48 GMT-0400 (EDT) - -'use strict'; - -import chai from 'chai'; -import Handler from '../../../../../backend/src/lambda/size-retrieve/Handler'; -import Kernel from '../../../node_modules/deep-framework/node_modules/deep-kernel'; -import KernelFactory from '../../common/KernelFactory'; - -// @todo: Add more advanced tests -suite('Handlers', () => { - let handler, kernelInstance; - - test('Class Handler exists in lambda-size module', () => { - chai.expect(Handler).to.be.an('function'); - }); - - test('Load Kernel by using Kernel.load()', (done) => { - let callback = (backendKernel) => { - kernelInstance = backendKernel; - - chai.assert.instanceOf( - backendKernel, Kernel, 'backendKernel is an instance of Kernel' - ); - - // complete the async - done(); - }; - - KernelFactory.create(callback); - }); - - test('Check Handler constructor', () => { - handler = new Handler(kernelInstance); - - chai.expect(handler).to.be.an.instanceof(Handler); - }); - - test('Check handle method exists', () => { - chai.expect(handler.handle).to.be.an('function'); - }); - -}); diff --git a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts-sample/test1.payload.json b/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts-sample/test1.payload.json deleted file mode 100644 index 861ebb8..0000000 --- a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts-sample/test1.payload.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "InputKey": "Input Value" -} diff --git a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts-sample/test1.result.json b/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts-sample/test1.result.json deleted file mode 100644 index 6b66cee..0000000 --- a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts-sample/test1.result.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ResultKey": "ResultValue" -} diff --git a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts/.gitignore b/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts/.gitignore deleted file mode 100644 index 357dd5b..0000000 --- a/src/deep-benchmarking/tests/backend/test/lambda/size-retrieve/test-asserts/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen - diff --git a/src/deep-benchmarking/tests/frontend/angular/controllers/DeepBenchmarkingMainController.spec.js b/src/deep-benchmarking/tests/frontend/angular/controllers/DeepBenchmarkingMainController.spec.js deleted file mode 100644 index 32b8ed4..0000000 --- a/src/deep-benchmarking/tests/frontend/angular/controllers/DeepBenchmarkingMainController.spec.js +++ /dev/null @@ -1,70 +0,0 @@ -// THIS TEST WAS GENERATED AUTOMATICALLY ON 07/22/2016 15:50:15 - -'use strict'; - -import moduleName from '../../../../frontend/js/app/angular/name'; - -// @todo: Add more advanced tests -describe('Controllers', () => { - - let scope, rootScope; - let $controller; - let controller; - - beforeEach(() => { - - // Load modules - module('ui.router'); - angular.mock.module(moduleName); - - // store references to scope, rootScope - // so they are available to all tests in this describe block - // - // $controller service that is responsible for instantiating controllers - // $rootScope ngMock’s service to allow getting an instance of angular’s core and create child scopes via its $new - // - // The underscores are a convenience trick to inject a service under a different name - // so that we can locally assign a local variable of the same name as the service. - inject((_$controller_, $rootScope) => { - - $controller = _$controller_; - rootScope = $rootScope; - scope = $rootScope.$new(); - - //how to set model testedModelValue value for controller - //scope.testedModelValue = null; - }); - }); - - /** - * Sets ready for testing - * @returns {HTMLDivElement} - */ - function instantiateController() { - scope.$digest(); - - controller = $controller('DeepBenchmarkingMainController', { - $scope: scope, - $rootScope: rootScope, - }); - - scope.$digest(); - } - - //@todo - should be added controller's use cases by using "controller" - describe('DeepBenchmarkingMainController', () => { - it('Check DeepBenchmarkingMainController constructor', () => { - let error = null; - - try { - instantiateController(); - } catch (exception) { - error = exception; - } - - if (!error) { - expect(typeof controller).toEqual('object'); - } - }); - }); -}); diff --git a/src/deep-benchmarking/tests/frontend/angular/health-checks/health.check.spec.js b/src/deep-benchmarking/tests/frontend/angular/health-checks/health.check.spec.js deleted file mode 100644 index 9c319ee..0000000 --- a/src/deep-benchmarking/tests/frontend/angular/health-checks/health.check.spec.js +++ /dev/null @@ -1,30 +0,0 @@ -/* global angular */ - -'use strict'; - -import moduleName from '../../../../frontend/js/app/angular/name'; - -describe('Health checks', () => { - it('Should load angular library', () => { - expect(typeof angular).toBe('object'); - }); - - it('Should load angular version 1.4.0', () => { - expect(angular.version.full).toBe('1.4.0'); - }); - - it('Should load angular ui router', () => { - expect(angular.module('ui.router').name).toBe('ui.router'); - }); - - it('Should load ngMock', () => { - expect(typeof angular.mock.module).toBe('function'); - expect(typeof inject).toBe('function'); - expect(typeof dump).toBe('function'); - }); - - it('Module name is [deepBenchmarking]', () => { - expect(moduleName).toBe('deepBenchmarking'); - }); - -}); diff --git a/src/deep-benchmarking/tests/frontend/config.karma.js b/src/deep-benchmarking/tests/frontend/config.karma.js deleted file mode 100644 index 2982afd..0000000 --- a/src/deep-benchmarking/tests/frontend/config.karma.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -// Karma configuration -module.exports = function(config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '../..', - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['jspm', 'jasmine'], - - // list of files / patterns to load in the browser - files: [ - 'tests/frontend/vendor/github/angular/bower-angular@1.4.0/angular.js', - 'tests/frontend/vendor/github/angular/bower-angular-mocks@1.4.4/angular-mocks.js', - 'tests/frontend/vendor/github/angular-ui/ui-router@0.2.15/angular-ui-router.js', - - //https://github.com/angular-ui/bootstrap/issues/1936 - 'tests/frontend/vendor/github/angular-ui/bootstrap-bower@0.12.1/ui-bootstrap-tpls.js', - 'tests/frontend/vendor/system.js', - 'tests/frontend/lib/DeepFramework.js', - 'tests/frontend/mock/lib/DeepFramework.js', - {pattern: 'tests/frontend/mock/data/*.json', watched: true, served: true, included: false}, - - //include the directory where directive templates are stored. - '**/views/directives/*.html', - ], - - // jspm configuration - jspm: { - config: 'tests/frontend/config.test.js', - packages: 'tests/frontend/vendor/', - useBundles: false, - paths: { - 'github:*': 'tests/frontend/vendor/github/*.js', - 'npm:*': 'tests/frontend/vendor/npm/*.js', - }, - loadFiles: [ - 'tests/frontend/angular/**/*.spec.js', - 'frontend/js/app/angular/index.js', - ], - serveFiles: [ - 'frontend/**/*.js', - ], - }, - - proxies: { - }, - - client: { - captureConsole: true, - }, - - // list of files to exclude - exclude: [ - ], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - 'frontend/js/app/angular/**/*.js': ['coverage'], - 'tests/frontend/angular/**/*.spec.js': ['babel'], - '**/views/directives/*.html': 'ng-html2js', - }, - - babelPreprocessor: { - options: { - sourceMap: 'inline', - modules: 'system', - }, - }, - - ngHtml2JsPreprocessor: { - moduleName: 'templates', - }, - - plugins: [ - 'karma-babel-preprocessor', - 'karma-jasmine', - 'karma-coverage', - 'karma-jspm', - 'karma-phantomjs-launcher', - 'karma-verbose-reporter', - 'karma-ng-html2js-preprocessor', - ], - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - //verbose - //progress - reporters: ['verbose', 'coverage'], - - coverageReporter: { - // configure the reporter to use isparta for JavaScript coverage - // Only on { "karma-coverage": "douglasduteil/karma-coverage#next" } - instrumenters: { isparta: require('isparta') }, - instrumenter: { - '**/*.js': 'isparta', - }, - reporters: [ - { - type: 'json', - dir: 'tests/frontend/coverage/', - }, - { - type: 'lcov', - dir: 'tests/frontend/coverage/', - }, - ], - }, - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_DEBUG, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - browserNoActivityTimeout: 30000, - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['PhantomJS'], - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: true, - - }); -}; diff --git a/src/deep-benchmarking/tests/frontend/config.test.js b/src/deep-benchmarking/tests/frontend/config.test.js deleted file mode 100644 index bbc531e..0000000 --- a/src/deep-benchmarking/tests/frontend/config.test.js +++ /dev/null @@ -1,97 +0,0 @@ -System.config({ - defaultJSExtensions: true, - transpiler: "babel", - babelOptions: { - "optional": [ - "runtime", - "optimisation.modules.system" - ] - }, - paths: { - "github:*": "frontend/vendor/github/*", - "npm:*": "frontend/vendor/npm/*" - }, - - map: { - "angular": "github:angular/bower-angular@1.4.0", - "angular-cookies": "npm:angular-cookies@1.5.7", - "angular-mocks": "github:angular/bower-angular-mocks@1.4.4", - "angular-ui-router": "github:angular-ui/ui-router@0.2.15", - "angular-ui/bootstrap-bower": "github:angular-ui/bootstrap-bower@0.12.1", - "babel": "npm:babel-core@5.8.38", - "babel-runtime": "npm:babel-runtime@5.8.38", - "core-js": "npm:core-js@1.2.6", - "css": "github:systemjs/plugin-css@0.1.13", - "es5-shim": "github:es-shims/es5-shim@4.4.0", - "es6-shim": "github:es-shims/es6-shim@0.34.0", - "jquery": "npm:jquery@2.2.4", - "github:angular-ui/bootstrap-bower@0.12.1": { - "angular": "github:angular/bower-angular@1.2.30" - }, - "github:angular-ui/ui-router@0.2.15": { - "angular": "github:angular/bower-angular@1.4.0" - }, - "github:angular/bower-angular-mocks@1.4.4": { - "angular": "github:angular/bower-angular@1.4.0" - }, - "github:jspm/nodelibs-assert@0.1.0": { - "assert": "npm:assert@1.4.1" - }, - "github:jspm/nodelibs-buffer@0.1.0": { - "buffer": "npm:buffer@3.6.0" - }, - "github:jspm/nodelibs-path@0.1.0": { - "path-browserify": "npm:path-browserify@0.0.0" - }, - "github:jspm/nodelibs-process@0.1.2": { - "process": "npm:process@0.11.5" - }, - "github:jspm/nodelibs-util@0.1.0": { - "util": "npm:util@0.10.3" - }, - "github:jspm/nodelibs-vm@0.1.0": { - "vm-browserify": "npm:vm-browserify@0.0.4" - }, - "npm:assert@1.4.1": { - "assert": "github:jspm/nodelibs-assert@0.1.0", - "buffer": "github:jspm/nodelibs-buffer@0.1.0", - "process": "github:jspm/nodelibs-process@0.1.2", - "util": "npm:util@0.10.3" - }, - "npm:babel-runtime@5.8.38": { - "process": "github:jspm/nodelibs-process@0.1.2" - }, - "npm:buffer@3.6.0": { - "base64-js": "npm:base64-js@0.0.8", - "child_process": "github:jspm/nodelibs-child_process@0.1.0", - "fs": "github:jspm/nodelibs-fs@0.1.2", - "ieee754": "npm:ieee754@1.1.6", - "isarray": "npm:isarray@1.0.0", - "process": "github:jspm/nodelibs-process@0.1.2" - }, - "npm:core-js@1.2.6": { - "fs": "github:jspm/nodelibs-fs@0.1.2", - "path": "github:jspm/nodelibs-path@0.1.0", - "process": "github:jspm/nodelibs-process@0.1.2", - "systemjs-json": "github:systemjs/plugin-json@0.1.2" - }, - "npm:inherits@2.0.1": { - "util": "github:jspm/nodelibs-util@0.1.0" - }, - "npm:path-browserify@0.0.0": { - "process": "github:jspm/nodelibs-process@0.1.2" - }, - "npm:process@0.11.5": { - "assert": "github:jspm/nodelibs-assert@0.1.0", - "fs": "github:jspm/nodelibs-fs@0.1.2", - "vm": "github:jspm/nodelibs-vm@0.1.0" - }, - "npm:util@0.10.3": { - "inherits": "npm:inherits@2.0.1", - "process": "github:jspm/nodelibs-process@0.1.2" - }, - "npm:vm-browserify@0.0.4": { - "indexof": "npm:indexof@0.0.1" - } - } -}); diff --git a/src/deep-benchmarking/tests/frontend/lib/DeepFramework.js b/src/deep-benchmarking/tests/frontend/lib/DeepFramework.js deleted file mode 100644 index 0a917ae..0000000 --- a/src/deep-benchmarking/tests/frontend/lib/DeepFramework.js +++ /dev/null @@ -1,171 +0,0 @@ -require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}return new(_bind.apply(DriverPrototype,[null].concat(args)))}}]);return Cache}(_mitocgroupDeepKernel2["default"].ContainerAware);exports.Cache=Cache}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-cache/lib.compiled/Cache.js","/node_modules/@mitocgroup/deep-cache/lib.compiled")},{"./Driver/AbstractDriver":4,"./Driver/InMemoryDriver":10,"./Driver/LocalStorageDriver":11,"./Driver/RedisDriver":12,"./Exception/Exception":13,"@mitocgroup/deep-kernel":"@mitocgroup/deep-kernel",_process:1069,buffer:919}],4:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}return new(_bind.apply(prototype,[null].concat(args)))}},{key:"createCollection",value:function createCollection(prototype){prototype=Factory._assurePrototype(prototype);return new _Collection.Collection(prototype)}},{key:"_assurePrototype",value:function _assurePrototype(prototype){if(typeof prototype==="string"){prototype=Factory[prototype.toUpperCase()]}return prototype}},{key:"POLICY",get:function get(){return _Policy.Policy}},{key:"RESOURCE",get:function get(){return _Resource.Resource}},{key:"ACTION",get:function get(){return _Action.Action}},{key:"STATEMENT",get:function get(){return _Statement.Statement}}]);return Factory}();exports.Factory=Factory}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/lib.compiled/AWS/IAM/Factory.js","/node_modules/@mitocgroup/deep-core/lib.compiled/AWS/IAM")},{"./Action":14,"./Collection":15,"./Policy":19,"./Resource":20,"./Statement":21,_process:1069,buffer:919}],19:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0?this._action.extract():_Policy.Policy.ANY;var resources=this._resource.count()>0?this._resource.extract():null;var statement={Effect:this._effect,Action:actions};if(null!==resources){statement["Resource"]=resources}if(null!==this._condition&&this._condition instanceof Object){statement.Condition=this._condition}if(null!==this._principal){statement.Principal=this._principal}if(this._notAction.count()>0){statement.NotAction=this._notAction.extract()}if(this._notResource.count()>0){statement.NotResource=this._notResource.extract()}return statement}},{key:"effect",set:function set(effect){if([Statement.ALLOW,Statement.DENY].indexOf(effect)===-1){throw new _ExceptionInvalidArgumentException.InvalidArgumentException(effect,"[Statement.ALLOW, Statement.DENY]")}this._condition=effect},get:function get(){return this._condition}},{key:"condition",set:function set(condition){this._condition=condition},get:function get(){return this._condition}},{key:"principal",set:function set(principal){this._principal=principal},get:function get(){return this._principal}},{key:"notResource",get:function get(){return this._notResource}},{key:"resource",get:function get(){return this._resource}},{key:"notAction",get:function get(){return this._notAction}},{key:"action",get:function get(){return this._action}}],[{key:"ALLOW",get:function get(){return"Allow"}},{key:"DENY",get:function get(){return"Deny"}}]);return Statement}(_Extractable2.Extractable);exports.Statement=Statement}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/lib.compiled/AWS/IAM/Statement.js","/node_modules/@mitocgroup/deep-core/lib.compiled/AWS/IAM")},{"../../Exception/InvalidArgumentException":30,"./Action":14,"./Collection":15,"./Extractable":17,"./Policy":19,"./Resource":20,_process:1069,buffer:919}],22:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){throw new _ExceptionMethodsNotImplementedException.MethodsNotImplementedException(notImplementedMethods)}};exports.Interface=Interface}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/lib.compiled/OOP/Interface.js","/node_modules/@mitocgroup/deep-core/lib.compiled/OOP")},{"../Exception/InvalidArgumentException":30,"../Exception/MethodsNotImplementedException":31,_process:1069,buffer:919}],34:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var used=[],exports=module.exports={};exports.version="3.2.0";exports.AssertionError=require("assertion-error");var util=require("./chai/utils");exports.use=function(fn){if(!~used.indexOf(fn)){fn(this,util);used.push(fn)}return this};exports.util=util;var config=require("./chai/config");exports.config=config;var assertion=require("./chai/assertion");exports.use(assertion);var core=require("./chai/core/assertions");exports.use(core);var expect=require("./chai/interface/expect");exports.use(expect);var should=require("./chai/interface/should");exports.use(should);var assert=require("./chai/interface/assert");exports.use(assert)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib")},{"./chai/assertion":35,"./chai/config":36,"./chai/core/assertions":37,"./chai/interface/assert":38,"./chai/interface/expect":39,"./chai/interface/should":40,"./chai/utils":53,_process:1069,"assertion-error":61,buffer:919}],35:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var config=require("./config");module.exports=function(_chai,util){var AssertionError=_chai.AssertionError,flag=util.flag;_chai.Assertion=Assertion;function Assertion(obj,msg,stack){flag(this,"ssfi",stack||arguments.callee);flag(this,"object",obj);flag(this,"message",msg)}Object.defineProperty(Assertion,"includeStack",{get:function(){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");return config.includeStack},set:function(value){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");config.includeStack=value}});Object.defineProperty(Assertion,"showDiff",{get:function(){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");return config.showDiff},set:function(value){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");config.showDiff=value}});Assertion.addProperty=function(name,fn){util.addProperty(this.prototype,name,fn)};Assertion.addMethod=function(name,fn){util.addMethod(this.prototype,name,fn)};Assertion.addChainableMethod=function(name,fn,chainingBehavior){util.addChainableMethod(this.prototype,name,fn,chainingBehavior)};Assertion.overwriteProperty=function(name,fn){util.overwriteProperty(this.prototype,name,fn)};Assertion.overwriteMethod=function(name,fn){util.overwriteMethod(this.prototype,name,fn)};Assertion.overwriteChainableMethod=function(name,fn,chainingBehavior){util.overwriteChainableMethod(this.prototype,name,fn,chainingBehavior)};Assertion.prototype.assert=function(expr,msg,negateMsg,expected,_actual,showDiff){var ok=util.test(this,arguments);if(true!==showDiff)showDiff=false;if(true!==config.showDiff)showDiff=false;if(!ok){var msg=util.getMessage(this,arguments),actual=util.getActual(this,arguments);throw new AssertionError(msg,{actual:actual,expected:expected,showDiff:showDiff},config.includeStack?this.assert:flag(this,"ssfi"))}};Object.defineProperty(Assertion.prototype,"_obj",{get:function(){return flag(this,"object")},set:function(val){flag(this,"object",val)}})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/assertion.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai")},{"./config":36,_process:1069,buffer:919}],36:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports={includeStack:false,showDiff:true,truncateThreshold:40}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/config.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai")},{_process:1069,buffer:919}],37:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(chai,_){var Assertion=chai.Assertion,toString=Object.prototype.toString,flag=_.flag;["to","be","been","is","and","has","have","with","that","which","at","of","same"].forEach(function(chain){Assertion.addProperty(chain,function(){return this})});Assertion.addProperty("not",function(){flag(this,"negate",true)});Assertion.addProperty("deep",function(){flag(this,"deep",true)});Assertion.addProperty("any",function(){flag(this,"any",true);flag(this,"all",false)});Assertion.addProperty("all",function(){flag(this,"all",true);flag(this,"any",false)});function an(type,msg){if(msg)flag(this,"message",msg);type=type.toLowerCase();var obj=flag(this,"object"),article=~["a","e","i","o","u"].indexOf(type.charAt(0))?"an ":"a ";this.assert(type===_.type(obj),"expected #{this} to be "+article+type,"expected #{this} not to be "+article+type)}Assertion.addChainableMethod("an",an);Assertion.addChainableMethod("a",an);function includeChainingBehavior(){flag(this,"contains",true)}function include(val,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");var expected=false;if(_.type(obj)==="array"&&_.type(val)==="object"){for(var i in obj){if(_.eql(obj[i],val)){expected=true;break}}}else if(_.type(val)==="object"){if(!flag(this,"negate")){for(var k in val)new Assertion(obj).property(k,val[k]);return}var subset={};for(var k in val)subset[k]=obj[k];expected=_.eql(subset,val)}else{expected=obj&&~obj.indexOf(val)}this.assert(expected,"expected #{this} to include "+_.inspect(val),"expected #{this} to not include "+_.inspect(val))}Assertion.addChainableMethod("include",include,includeChainingBehavior);Assertion.addChainableMethod("contain",include,includeChainingBehavior);Assertion.addChainableMethod("contains",include,includeChainingBehavior);Assertion.addChainableMethod("includes",include,includeChainingBehavior);Assertion.addProperty("ok",function(){this.assert(flag(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});Assertion.addProperty("true",function(){this.assert(true===flag(this,"object"),"expected #{this} to be true","expected #{this} to be false",this.negate?false:true)});Assertion.addProperty("false",function(){this.assert(false===flag(this,"object"),"expected #{this} to be false","expected #{this} to be true",this.negate?true:false)});Assertion.addProperty("null",function(){this.assert(null===flag(this,"object"),"expected #{this} to be null","expected #{this} not to be null")});Assertion.addProperty("undefined",function(){this.assert(undefined===flag(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")});Assertion.addProperty("NaN",function(){this.assert(isNaN(flag(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});Assertion.addProperty("exist",function(){this.assert(null!=flag(this,"object"),"expected #{this} to exist","expected #{this} to not exist")});Assertion.addProperty("empty",function(){var obj=flag(this,"object"),expected=obj;if(Array.isArray(obj)||"string"===typeof object){expected=obj.length}else if(typeof obj==="object"){expected=Object.keys(obj).length}this.assert(!expected,"expected #{this} to be empty","expected #{this} not to be empty")});function checkArguments(){var obj=flag(this,"object"),type=Object.prototype.toString.call(obj);this.assert("[object Arguments]"===type,"expected #{this} to be arguments but got "+type,"expected #{this} to not be arguments")}Assertion.addProperty("arguments",checkArguments);Assertion.addProperty("Arguments",checkArguments);function assertEqual(val,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"deep")){return this.eql(val)}else{this.assert(val===obj,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",val,this._obj,true)}}Assertion.addMethod("equal",assertEqual);Assertion.addMethod("equals",assertEqual);Assertion.addMethod("eq",assertEqual);function assertEql(obj,msg){if(msg)flag(this,"message",msg);this.assert(_.eql(obj,flag(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",obj,this._obj,true)}Assertion.addMethod("eql",assertEql);Assertion.addMethod("eqls",assertEql);function assertAbove(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"doLength")){new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len>n,"expected #{this} to have a length above #{exp} but got #{act}","expected #{this} to not have a length above #{exp}",n,len)}else{this.assert(obj>n,"expected #{this} to be above "+n,"expected #{this} to be at most "+n)}}Assertion.addMethod("above",assertAbove);Assertion.addMethod("gt",assertAbove);Assertion.addMethod("greaterThan",assertAbove);function assertLeast(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"doLength")){new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len>=n,"expected #{this} to have a length at least #{exp} but got #{act}","expected #{this} to have a length below #{exp}",n,len)}else{this.assert(obj>=n,"expected #{this} to be at least "+n,"expected #{this} to be below "+n)}}Assertion.addMethod("least",assertLeast);Assertion.addMethod("gte",assertLeast);function assertBelow(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"doLength")){new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len=start&&len<=finish,"expected #{this} to have a length within "+range,"expected #{this} to not have a length within "+range)}else{this.assert(obj>=start&&obj<=finish,"expected #{this} to be within "+range,"expected #{this} to not be within "+range)}});function assertInstanceOf(constructor,msg){if(msg)flag(this,"message",msg);var name=_.getName(constructor);this.assert(flag(this,"object")instanceof constructor,"expected #{this} to be an instance of "+name,"expected #{this} to not be an instance of "+name)}Assertion.addMethod("instanceof",assertInstanceOf);Assertion.addMethod("instanceOf",assertInstanceOf);Assertion.addMethod("property",function(name,val,msg){if(msg)flag(this,"message",msg);var isDeep=!!flag(this,"deep"),descriptor=isDeep?"deep property ":"property ",negate=flag(this,"negate"),obj=flag(this,"object"),pathInfo=isDeep?_.getPathInfo(name,obj):null,hasProperty=isDeep?pathInfo.exists:_.hasProperty(name,obj),value=isDeep?pathInfo.value:obj[name];if(negate&&arguments.length>1){if(undefined===value){msg=msg!=null?msg+": ":"";throw new Error(msg+_.inspect(obj)+" has no "+descriptor+_.inspect(name))}}else{this.assert(hasProperty,"expected #{this} to have a "+descriptor+_.inspect(name),"expected #{this} to not have "+descriptor+_.inspect(name))}if(arguments.length>1){this.assert(val===value,"expected #{this} to have a "+descriptor+_.inspect(name)+" of #{exp}, but got #{act}","expected #{this} to not have a "+descriptor+_.inspect(name)+" of #{act}",val,value)}flag(this,"object",value)});function assertOwnProperty(name,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");this.assert(obj.hasOwnProperty(name),"expected #{this} to have own property "+_.inspect(name),"expected #{this} to not have own property "+_.inspect(name))}Assertion.addMethod("ownProperty",assertOwnProperty);Assertion.addMethod("haveOwnProperty",assertOwnProperty);function assertOwnPropertyDescriptor(name,descriptor,msg){if(typeof descriptor==="string"){msg=descriptor;descriptor=null}if(msg)flag(this,"message",msg);var obj=flag(this,"object");var actualDescriptor=Object.getOwnPropertyDescriptor(Object(obj),name);if(actualDescriptor&&descriptor){this.assert(_.eql(descriptor,actualDescriptor),"expected the own property descriptor for "+_.inspect(name)+" on #{this} to match "+_.inspect(descriptor)+", got "+_.inspect(actualDescriptor),"expected the own property descriptor for "+_.inspect(name)+" on #{this} to not match "+_.inspect(descriptor),descriptor,actualDescriptor,true)}else{this.assert(actualDescriptor,"expected #{this} to have an own property descriptor for "+_.inspect(name),"expected #{this} to not have an own property descriptor for "+_.inspect(name))}flag(this,"object",actualDescriptor)}Assertion.addMethod("ownPropertyDescriptor",assertOwnPropertyDescriptor);Assertion.addMethod("haveOwnPropertyDescriptor",assertOwnPropertyDescriptor);function assertLengthChain(){flag(this,"doLength",true)}function assertLength(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len==n,"expected #{this} to have a length of #{exp} but got #{act}","expected #{this} to not have a length of #{act}",n,len)}Assertion.addChainableMethod("length",assertLength,assertLengthChain);Assertion.addMethod("lengthOf",assertLength);function assertMatch(re,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");this.assert(re.exec(obj),"expected #{this} to match "+re,"expected #{this} not to match "+re)}Assertion.addMethod("match",assertMatch);Assertion.addMethod("matches",assertMatch);Assertion.addMethod("string",function(str,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj,msg).is.a("string");this.assert(~obj.indexOf(str),"expected #{this} to contain "+_.inspect(str),"expected #{this} to not contain "+_.inspect(str))});function assertKeys(keys){var obj=flag(this,"object"),str,ok=true,mixedArgsMsg="keys must be given single argument of Array|Object|String, or multiple String arguments";switch(_.type(keys)){case"array":if(arguments.length>1)throw new Error(mixedArgsMsg);break;case"object":if(arguments.length>1)throw new Error(mixedArgsMsg);keys=Object.keys(keys);break;default:keys=Array.prototype.slice.call(arguments)}if(!keys.length)throw new Error("keys required");var actual=Object.keys(obj),expected=keys,len=keys.length,any=flag(this,"any"),all=flag(this,"all");if(!any&&!all){all=true}if(any){var intersection=expected.filter(function(key){return~actual.indexOf(key)});ok=intersection.length>0}if(all){ok=keys.every(function(key){return~actual.indexOf(key)});if(!flag(this,"negate")&&!flag(this,"contains")){ok=ok&&keys.length==actual.length}}if(len>1){keys=keys.map(function(key){return _.inspect(key)});var last=keys.pop();if(all){str=keys.join(", ")+", and "+last}if(any){str=keys.join(", ")+", or "+last}}else{str=_.inspect(keys[0])}str=(len>1?"keys ":"key ")+str;str=(flag(this,"contains")?"contain ":"have ")+str;this.assert(ok,"expected #{this} to "+str,"expected #{this} to not "+str,expected.slice(0).sort(),actual.sort(),true)}Assertion.addMethod("keys",assertKeys);Assertion.addMethod("key",assertKeys);function assertThrows(constructor,errMsg,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj,msg).is.a("function");var thrown=false,desiredError=null,name=null,thrownError=null;if(arguments.length===0){errMsg=null;constructor=null}else if(constructor&&(constructor instanceof RegExp||"string"===typeof constructor)){errMsg=constructor;constructor=null}else if(constructor&&constructor instanceof Error){desiredError=constructor;constructor=null;errMsg=null}else if(typeof constructor==="function"){name=constructor.prototype.name||constructor.name;if(name==="Error"&&constructor!==Error){name=(new constructor).name}}else{constructor=null}try{obj()}catch(err){if(desiredError){this.assert(err===desiredError,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}",desiredError instanceof Error?desiredError.toString():desiredError,err instanceof Error?err.toString():err);flag(this,"object",err);return this}if(constructor){this.assert(err instanceof constructor,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp} but #{act} was thrown",name,err instanceof Error?err.toString():err);if(!errMsg){flag(this,"object",err);return this}}var message="error"===_.type(err)&&"message"in err?err.message:""+err;if(message!=null&&errMsg&&errMsg instanceof RegExp){this.assert(errMsg.exec(message),"expected #{this} to throw error matching #{exp} but got #{act}","expected #{this} to throw error not matching #{exp}",errMsg,message);flag(this,"object",err);return this}else if(message!=null&&errMsg&&"string"===typeof errMsg){this.assert(~message.indexOf(errMsg),"expected #{this} to throw error including #{exp} but got #{act}","expected #{this} to throw error not including #{act}",errMsg,message);flag(this,"object",err);return this}else{thrown=true;thrownError=err}}var actuallyGot="",expectedThrown=name!==null?name:desiredError?"#{exp}":"an error";if(thrown){actuallyGot=" but #{act} was thrown"}this.assert(thrown===true,"expected #{this} to throw "+expectedThrown+actuallyGot,"expected #{this} to not throw "+expectedThrown+actuallyGot,desiredError instanceof Error?desiredError.toString():desiredError,thrownError instanceof Error?thrownError.toString():thrownError);flag(this,"object",thrownError)}Assertion.addMethod("throw",assertThrows);Assertion.addMethod("throws",assertThrows);Assertion.addMethod("Throw",assertThrows);function respondTo(method,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object"),itself=flag(this,"itself"),context="function"===_.type(obj)&&!itself?obj.prototype[method]:obj[method];this.assert("function"===typeof context,"expected #{this} to respond to "+_.inspect(method),"expected #{this} to not respond to "+_.inspect(method))}Assertion.addMethod("respondTo",respondTo);Assertion.addMethod("respondsTo",respondTo);Assertion.addProperty("itself",function(){flag(this,"itself",true)});function satisfy(matcher,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");var result=matcher(obj);this.assert(result,"expected #{this} to satisfy "+_.objDisplay(matcher),"expected #{this} to not satisfy"+_.objDisplay(matcher),this.negate?false:true,result)}Assertion.addMethod("satisfy",satisfy);Assertion.addMethod("satisfies",satisfy);Assertion.addMethod("closeTo",function(expected,delta,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj,msg).is.a("number");if(_.type(expected)!=="number"||_.type(delta)!=="number"){throw new Error("the arguments to closeTo must be numbers")}this.assert(Math.abs(obj-expected)<=delta,"expected #{this} to be close to "+expected+" +/- "+delta,"expected #{this} not to be close to "+expected+" +/- "+delta)});function isSubsetOf(subset,superset,cmp){return subset.every(function(elem){if(!cmp)return superset.indexOf(elem)!==-1;return superset.some(function(elem2){return cmp(elem,elem2)})})}Assertion.addMethod("members",function(subset,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj).to.be.an("array");new Assertion(subset).to.be.an("array");var cmp=flag(this,"deep")?_.eql:undefined;if(flag(this,"contains")){return this.assert(isSubsetOf(subset,obj,cmp),"expected #{this} to be a superset of #{act}","expected #{this} to not be a superset of #{act}",obj,subset)}this.assert(isSubsetOf(obj,subset,cmp)&&isSubsetOf(subset,obj,cmp),"expected #{this} to have the same members as #{act}","expected #{this} to not have the same members as #{act}",obj,subset)});function assertChanges(object,prop,msg){if(msg)flag(this,"message",msg);var fn=flag(this,"object");new Assertion(object,msg).to.have.property(prop);new Assertion(fn).is.a("function");var initial=object[prop];fn();this.assert(initial!==object[prop],"expected ."+prop+" to change","expected ."+prop+" to not change")}Assertion.addChainableMethod("change",assertChanges);Assertion.addChainableMethod("changes",assertChanges);function assertIncreases(object,prop,msg){if(msg)flag(this,"message",msg);var fn=flag(this,"object");new Assertion(object,msg).to.have.property(prop);new Assertion(fn).is.a("function");var initial=object[prop];fn();this.assert(object[prop]-initial>0,"expected ."+prop+" to increase","expected ."+prop+" to not increase")}Assertion.addChainableMethod("increase",assertIncreases);Assertion.addChainableMethod("increases",assertIncreases);function assertDecreases(object,prop,msg){if(msg)flag(this,"message",msg);var fn=flag(this,"object");new Assertion(object,msg).to.have.property(prop);new Assertion(fn).is.a("function");var initial=object[prop];fn();this.assert(object[prop]-initial<0,"expected ."+prop+" to decrease","expected ."+prop+" to not decrease")}Assertion.addChainableMethod("decrease",assertDecreases);Assertion.addChainableMethod("decreases",assertDecreases);Assertion.addProperty("extensible",function(){var obj=flag(this,"object");this.assert(Object.isExtensible(obj),"expected #{this} to be extensible","expected #{this} to not be extensible")});Assertion.addProperty("sealed",function(){var obj=flag(this,"object");this.assert(Object.isSealed(obj),"expected #{this} to be sealed","expected #{this} to not be sealed")});Assertion.addProperty("frozen",function(){var obj=flag(this,"object");this.assert(Object.isFrozen(obj),"expected #{this} to be frozen","expected #{this} to not be frozen")})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/core/assertions.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/core")},{_process:1069,buffer:919}],38:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(chai,util){var Assertion=chai.Assertion,flag=util.flag;var assert=chai.assert=function(express,errmsg){var test=new Assertion(null,null,chai.assert);test.assert(express,errmsg,"[ negation message unavailable ]")};assert.fail=function(actual,expected,message,operator){message=message||"assert.fail()";throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},assert.fail)};assert.isOk=function(val,msg){new Assertion(val,msg).is.ok};assert.isNotOk=function(val,msg){new Assertion(val,msg).is.not.ok};assert.equal=function(act,exp,msg){var test=new Assertion(act,msg,assert.equal);test.assert(exp==flag(test,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",exp,act)};assert.notEqual=function(act,exp,msg){var test=new Assertion(act,msg,assert.notEqual);test.assert(exp!=flag(test,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",exp,act)};assert.strictEqual=function(act,exp,msg){new Assertion(act,msg).to.equal(exp)};assert.notStrictEqual=function(act,exp,msg){new Assertion(act,msg).to.not.equal(exp)};assert.deepEqual=function(act,exp,msg){new Assertion(act,msg).to.eql(exp)};assert.notDeepEqual=function(act,exp,msg){new Assertion(act,msg).to.not.eql(exp)};assert.isAbove=function(val,abv,msg){new Assertion(val,msg).to.be.above(abv)};assert.isBelow=function(val,blw,msg){new Assertion(val,msg).to.be.below(blw)};assert.isTrue=function(val,msg){new Assertion(val,msg).is["true"]};assert.isFalse=function(val,msg){new Assertion(val,msg).is["false"]};assert.isNull=function(val,msg){new Assertion(val,msg).to.equal(null)};assert.isNotNull=function(val,msg){new Assertion(val,msg).to.not.equal(null)};assert.isNaN=function(val,msg){new Assertion(val,msg).to.be.NaN};assert.isNotNaN=function(val,msg){new Assertion(val,msg).not.to.be.NaN};assert.isUndefined=function(val,msg){new Assertion(val,msg).to.equal(undefined)};assert.isDefined=function(val,msg){new Assertion(val,msg).to.not.equal(undefined)};assert.isFunction=function(val,msg){new Assertion(val,msg).to.be.a("function")};assert.isNotFunction=function(val,msg){new Assertion(val,msg).to.not.be.a("function")};assert.isObject=function(val,msg){new Assertion(val,msg).to.be.a("object")};assert.isNotObject=function(val,msg){new Assertion(val,msg).to.not.be.a("object")};assert.isArray=function(val,msg){new Assertion(val,msg).to.be.an("array")};assert.isNotArray=function(val,msg){new Assertion(val,msg).to.not.be.an("array")};assert.isString=function(val,msg){new Assertion(val,msg).to.be.a("string")};assert.isNotString=function(val,msg){new Assertion(val,msg).to.not.be.a("string")};assert.isNumber=function(val,msg){new Assertion(val,msg).to.be.a("number")};assert.isNotNumber=function(val,msg){new Assertion(val,msg).to.not.be.a("number")};assert.isBoolean=function(val,msg){new Assertion(val,msg).to.be.a("boolean")};assert.isNotBoolean=function(val,msg){new Assertion(val,msg).to.not.be.a("boolean")};assert.typeOf=function(val,type,msg){new Assertion(val,msg).to.be.a(type)};assert.notTypeOf=function(val,type,msg){new Assertion(val,msg).to.not.be.a(type)};assert.instanceOf=function(val,type,msg){new Assertion(val,msg).to.be.instanceOf(type)};assert.notInstanceOf=function(val,type,msg){ -new Assertion(val,msg).to.not.be.instanceOf(type)};assert.include=function(exp,inc,msg){new Assertion(exp,msg,assert.include).include(inc)};assert.notInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notInclude).not.include(inc)};assert.match=function(exp,re,msg){new Assertion(exp,msg).to.match(re)};assert.notMatch=function(exp,re,msg){new Assertion(exp,msg).to.not.match(re)};assert.property=function(obj,prop,msg){new Assertion(obj,msg).to.have.property(prop)};assert.notProperty=function(obj,prop,msg){new Assertion(obj,msg).to.not.have.property(prop)};assert.deepProperty=function(obj,prop,msg){new Assertion(obj,msg).to.have.deep.property(prop)};assert.notDeepProperty=function(obj,prop,msg){new Assertion(obj,msg).to.not.have.deep.property(prop)};assert.propertyVal=function(obj,prop,val,msg){new Assertion(obj,msg).to.have.property(prop,val)};assert.propertyNotVal=function(obj,prop,val,msg){new Assertion(obj,msg).to.not.have.property(prop,val)};assert.deepPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg).to.have.deep.property(prop,val)};assert.deepPropertyNotVal=function(obj,prop,val,msg){new Assertion(obj,msg).to.not.have.deep.property(prop,val)};assert.lengthOf=function(exp,len,msg){new Assertion(exp,msg).to.have.length(len)};assert.throws=function(fn,errt,errs,msg){if("string"===typeof errt||errt instanceof RegExp){errs=errt;errt=null}var assertErr=new Assertion(fn,msg).to.throw(errt,errs);return flag(assertErr,"object")};assert.doesNotThrow=function(fn,type,msg){if("string"===typeof type){msg=type;type=null}new Assertion(fn,msg).to.not.Throw(type)};assert.operator=function(val,operator,val2,msg){var ok;switch(operator){case"==":ok=val==val2;break;case"===":ok=val===val2;break;case">":ok=val>val2;break;case">=":ok=val>=val2;break;case"<":ok=val4?args[4]:obj._obj}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/getActual.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{_process:1069,buffer:919}],46:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function getEnumerableProperties(object){var result=[];for(var name in object){result.push(name)}return result}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/getEnumerableProperties.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{_process:1069,buffer:919}],47:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var flag=require("./flag"),getActual=require("./getActual"),inspect=require("./inspect"),objDisplay=require("./objDisplay");module.exports=function(obj,args){var negate=flag(obj,"negate"),val=flag(obj,"object"),expected=args[3],actual=getActual(obj,args),msg=negate?args[2]:args[1],flagMsg=flag(obj,"message");if(typeof msg==="function")msg=msg();msg=msg||"";msg=msg.replace(/#{this}/g,objDisplay(val)).replace(/#{act}/g,objDisplay(actual)).replace(/#{exp}/g,objDisplay(expected));return flagMsg?flagMsg+": "+msg:msg}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/getMessage.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{"./flag":44,"./getActual":45,"./inspect":54,"./objDisplay":55,_process:1069,buffer:919}],48:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(func){if(func.name)return func.name;var match=/^\s?function ([^(]*)\(/.exec(func);return match&&match[1]?match[1]:""}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/getName.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{_process:1069,buffer:919}],49:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var hasProperty=require("./hasProperty");module.exports=function getPathInfo(path,obj){var parsed=parsePath(path),last=parsed[parsed.length-1];var info={parent:parsed.length>1?_getPathValue(parsed,obj,parsed.length-1):obj,name:last.p||last.i,value:_getPathValue(parsed,obj)};info.exists=hasProperty(info.name,info.parent);return info};function parsePath(path){var str=path.replace(/([^\\])\[/g,"$1.["),parts=str.match(/(\\\.|[^.]+?)+/g);return parts.map(function(value){var re=/^\[(\d+)\]$/,mArr=re.exec(value);if(mArr)return{i:parseFloat(mArr[1])};else return{p:value.replace(/\\([.\[\]])/g,"$1")}})}function _getPathValue(parsed,obj,index){var tmp=obj,res;index=index===undefined?parsed.length:index;for(var i=0,l=index;i<",">"+value.innerHTML+"<");container.innerHTML="";return html}}catch(err){}}}var visibleKeys=getEnumerableProperties(value);var keys=ctx.showHidden?getProperties(value):visibleKeys;if(keys.length===0||isError(value)&&(keys.length===1&&keys[0]==="stack"||keys.length===2&&keys[0]==="description"&&keys[1]==="stack")){if(typeof value==="function"){var name=getName(value);var nameSuffix=name?": "+name:"";return ctx.stylize("[Function"+nameSuffix+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toUTCString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(typeof value==="function"){var name=getName(value);var nameSuffix=name?": "+name:"";base=" [Function"+nameSuffix+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){return formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){switch(typeof value){case"undefined":return ctx.stylize("undefined","undefined");case"string":var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string");case"number":if(value===0&&1/value===-Infinity){return ctx.stylize("-0","number")}return ctx.stylize(""+value,"number");case"boolean":return ctx.stylize(""+value,"boolean")}if(value===null){return ctx.stylize("null","null")}}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(typeof name==="undefined"){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)||typeof ar==="object"&&objectToString(ar)==="[object Array]"}function isRegExp(re){return typeof re==="object"&&objectToString(re)==="[object RegExp]"}function isDate(d){return typeof d==="object"&&objectToString(d)==="[object Date]"}function isError(e){return typeof e==="object"&&objectToString(e)==="[object Error]"}function objectToString(o){return Object.prototype.toString.call(o)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/inspect.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{"./getEnumerableProperties":46,"./getName":48,"./getProperties":51,_process:1069,buffer:919}],55:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var inspect=require("./inspect");var config=require("../config");module.exports=function(obj){var str=inspect(obj),type=Object.prototype.toString.call(obj);if(config.truncateThreshold&&str.length>=config.truncateThreshold){if(type==="[object Function]"){return!obj.name||obj.name===""?"[Function]":"[Function: "+obj.name+"]"}else if(type==="[object Array]"){return"[ Array("+obj.length+") ]"}else if(type==="[object Object]"){var keys=Object.keys(obj),kstr=keys.length>2?keys.splice(0,2).join(", ")+", ...":keys.join(", ");return"{ Object ("+kstr+") }"}else{return str}}else{return str}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/objDisplay.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{"../config":36,"./inspect":54,_process:1069,buffer:919}],56:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(ctx,name,method,chainingBehavior){var chainableBehavior=ctx.__methods[name];var _chainingBehavior=chainableBehavior.chainingBehavior;chainableBehavior.chainingBehavior=function(){var result=chainingBehavior(_chainingBehavior).call(this);return result===undefined?this:result};var _method=chainableBehavior.method;chainableBehavior.method=function(){var result=method(_method).apply(this,arguments);return result===undefined?this:result}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{_process:1069,buffer:919}],57:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(ctx,name,method){var _method=ctx[name],_super=function(){return this};if(_method&&"function"===typeof _method)_super=_method;ctx[name]=function(){var result=method(_super).apply(this,arguments);return result===undefined?this:result}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/overwriteMethod.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{_process:1069,buffer:919}],58:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(ctx,name,getter){var _get=Object.getOwnPropertyDescriptor(ctx,name),_super=function(){};if(_get&&"function"===typeof _get.get)_super=_get.get;Object.defineProperty(ctx,name,{get:function(){var result=getter(_super).call(this);return result===undefined?this:result},configurable:true})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/overwriteProperty.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{_process:1069,buffer:919}],59:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var flag=require("./flag");module.exports=function(obj,args){var negate=flag(obj,"negate"),expr=args[0];return negate?!expr:expr}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/test.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{"./flag":44,_process:1069,buffer:919}],60:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(assertion,object,includeAll){var flags=assertion.__flags||(assertion.__flags=Object.create(null));if(!object.__flags){object.__flags=Object.create(null)}includeAll=arguments.length===3?includeAll:true;for(var flag in flags){if(includeAll||flag!=="object"&&flag!=="ssfi"&&flag!="message"){object.__flags[flag]=flags[flag]}}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils/transferFlags.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/lib/chai/utils")},{_process:1069,buffer:919}],61:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){function exclude(){var excludes=[].slice.call(arguments);function excludeProps(res,obj){Object.keys(obj).forEach(function(key){if(!~excludes.indexOf(key))res[key]=obj[key]})}return function extendExclude(){var args=[].slice.call(arguments),i=0,res={};for(;i=0;i--){key=ka[i];if(!deepEqual(a[key],b[key],m)){return false}}return true}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/deep-eql/lib/eql.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/deep-eql/lib")},{_process:1069,buffer:919,"type-detect":64}],64:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=require("./lib/type")}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/deep-eql/node_modules/type-detect/index.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/deep-eql/node_modules/type-detect")},{"./lib/type":65,_process:1069,buffer:919}],65:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var exports=module.exports=getType;var natives={"[object Array]":"array","[object RegExp]":"regexp","[object Function]":"function","[object Arguments]":"arguments","[object Date]":"date"};function getType(obj){var str=Object.prototype.toString.call(obj);if(natives[str])return natives[str];if(obj===null)return"null";if(obj===undefined)return"undefined";if(obj===Object(obj))return"object";return typeof obj}exports.Library=Library;function Library(){this.tests={}}Library.prototype.of=getType;Library.prototype.define=function(type,test){if(arguments.length===1)return this.tests[type];this.tests[type]=test;return this};Library.prototype.test=function(obj,type){if(type===getType(obj))return true;var test=this.tests[type];if(test&&"regexp"===getType(test)){return test.test(obj)}else if(test&&"function"===getType(test)){return test(obj)}else{throw new ReferenceError('Type test "'+type+'" not defined or invalid.')}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/deep-eql/node_modules/type-detect/lib/type.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/deep-eql/node_modules/type-detect/lib")},{_process:1069,buffer:919}],66:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=require("./lib/type")}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/type-detect/index.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/type-detect")},{"./lib/type":67,_process:1069,buffer:919}],67:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var exports=module.exports=getType;var objectTypeRegexp=/^\[object (.*)\]$/;function getType(obj){var type=Object.prototype.toString.call(obj).match(objectTypeRegexp)[1].toLowerCase();if(typeof Promise==="function"&&obj instanceof Promise)return"promise";if(obj===null)return"null";if(obj===undefined)return"undefined";return type}exports.Library=Library;function Library(){if(!(this instanceof Library))return new Library;this.tests={}}Library.prototype.of=getType;Library.prototype.define=function(type,test){if(arguments.length===1)return this.tests[type];this.tests[type]=test;return this};Library.prototype.test=function(obj,type){if(type===getType(obj))return true;var test=this.tests[type];if(test&&"regexp"===getType(test)){return test.test(obj)}else if(test&&"function"===getType(test)){return test(obj)}else{throw new ReferenceError('Type test "'+type+'" not defined or invalid.')}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/type-detect/lib/type.js","/node_modules/@mitocgroup/deep-core/node_modules/chai/node_modules/type-detect/lib")},{_process:1069,buffer:919}],68:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){bytesRead=fs.readSync(fdr,_buff,0,BUF_LENGTH,pos);fs.writeSync(fdw,_buff,0,bytesRead);pos+=bytesRead}if(preserveTimestamps){fs.futimesSync(fdw,stat.atime,stat.mtime)}fs.closeSync(fdr);fs.closeSync(fdw)}module.exports=copyFileSync}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy-sync")},{_process:1069,buffer:919,"graceful-fs":115}],88:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var path=require("path");var copyFileSync=require("./copy-file-sync");var mkdir=require("../mkdirs");function copySync(src,dest,options){if(typeof options==="function"||options instanceof RegExp){options={filter:options}}options=options||{};options.recursive=!!options.recursive;options.clobber="clobber"in options?!!options.clobber:true; -options.preserveTimestamps="preserveTimestamps"in options?!!options.preserveTimestamps:true;options.filter=options.filter||function(){return true};var stats=options.recursive?fs.lstatSync(src):fs.statSync(src);var destFolder=path.dirname(dest);var destFolderExists=fs.existsSync(destFolder);var performCopy=false;if(stats.isFile()){if(options.filter instanceof RegExp)performCopy=options.filter.test(src);else if(typeof options.filter==="function")performCopy=options.filter(src);if(performCopy){if(!destFolderExists)mkdir.mkdirsSync(destFolder);copyFileSync(src,dest,{clobber:options.clobber,preserveTimestamps:options.preserveTimestamps})}}else if(stats.isDirectory()){if(!fs.existsSync(dest))mkdir.mkdirsSync(dest);var contents=fs.readdirSync(src);contents.forEach(function(content){var opts=options;opts.recursive=true;copySync(path.join(src,content),path.join(dest,content),opts)})}else if(options.recursive&&stats.isSymbolicLink()){var srcPath=fs.readlinkSync(src);fs.symlinkSync(srcPath,dest)}}module.exports=copySync}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy-sync/copy-sync.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy-sync")},{"../mkdirs":104,"./copy-file-sync":87,_process:1069,buffer:919,"graceful-fs":115,path:1068}],89:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports={copySync:require("./copy-sync")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy-sync/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy-sync")},{"./copy-sync":88,_process:1069,buffer:919}],90:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var path=require("path");var ncp=require("./ncp");var mkdir=require("../mkdirs");function copy(src,dest,options,callback){if(typeof options==="function"&&!callback){callback=options;options={}}else if(typeof options==="function"||options instanceof RegExp){options={filter:options}}callback=callback||function(){};fs.lstat(src,function(err,stats){if(err)return callback(err);var dir=null;if(stats.isDirectory()){var parts=dest.split(path.sep);parts.pop();dir=parts.join(path.sep)}else{dir=path.dirname(dest)}fs.exists(dir,function(dirExists){if(dirExists)return ncp(src,dest,options,callback);mkdir.mkdirs(dir,function(err){if(err)return callback(err);ncp(src,dest,options,callback)})})})}module.exports=copy}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy/copy.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy")},{"../mkdirs":104,"./ncp":92,_process:1069,buffer:919,"graceful-fs":115,path:1068}],91:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports={copy:require("./copy")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy")},{"./copy":90,_process:1069,buffer:919}],92:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var path=require("path");var utimes=require("../util/utimes");function ncp(source,dest,options,callback){if(!callback){callback=options;options={}}var basePath=process.cwd();var currentPath=path.resolve(basePath,source);var targetPath=path.resolve(basePath,dest);var filter=options.filter;var transform=options.transform;var clobber=options.clobber!==false;var dereference=options.dereference;var preserveTimestamps=options.preserveTimestamps===true;var errs=null;var started=0;var finished=0;var running=0;var limit=options.limit||512;startCopy(currentPath);function startCopy(source){started++;if(filter){if(filter instanceof RegExp){if(!filter.test(source)){return doneOne(true)}}else if(typeof filter==="function"){if(!filter(source)){return doneOne(true)}}}return getStats(source)}function getStats(source){var stat=dereference?fs.stat:fs.lstat;if(running>=limit){return setImmediate(function(){getStats(source)})}running++;stat(source,function(err,stats){if(err)return onError(err);var item={name:source,mode:stats.mode,mtime:stats.mtime,atime:stats.atime,stats:stats};if(stats.isDirectory()){return onDir(item)}else if(stats.isFile()){return onFile(item)}else if(stats.isSymbolicLink()){return onLink(source)}})}function onFile(file){var target=file.name.replace(currentPath,targetPath);isWritable(target,function(writable){if(writable){copyFile(file,target)}else{if(clobber){rmFile(target,function(){copyFile(file,target)})}else{doneOne()}}})}function copyFile(file,target){var readStream=fs.createReadStream(file.name);var writeStream=fs.createWriteStream(target,{mode:file.mode});readStream.on("error",onError);writeStream.on("error",onError);if(transform){transform(readStream,writeStream,file)}else{writeStream.on("open",function(){readStream.pipe(writeStream)})}writeStream.once("finish",function(){fs.chmod(target,file.mode,function(err){if(err)return onError(err);if(preserveTimestamps){utimes.utimesMillis(target,file.atime,file.mtime,function(err){if(err)return onError(err);return doneOne()})}else{doneOne()}})})}function rmFile(file,done){fs.unlink(file,function(err){if(err)return onError(err);return done()})}function onDir(dir){var target=dir.name.replace(currentPath,targetPath);isWritable(target,function(writable){if(writable){return mkDir(dir,target)}copyDir(dir.name)})}function mkDir(dir,target){fs.mkdir(target,dir.mode,function(err){if(err)return onError(err);fs.chmod(target,dir.mode,function(err){if(err)return onError(err);copyDir(dir.name)})})}function copyDir(dir){fs.readdir(dir,function(err,items){if(err)return onError(err);items.forEach(function(item){startCopy(path.join(dir,item))});return doneOne()})}function onLink(link){var target=link.replace(currentPath,targetPath);fs.readlink(link,function(err,resolvedPath){if(err)return onError(err);checkLink(resolvedPath,target)})}function checkLink(resolvedPath,target){if(dereference){resolvedPath=path.resolve(basePath,resolvedPath)}isWritable(target,function(writable){if(writable){return makeLink(resolvedPath,target)}fs.readlink(target,function(err,targetDest){if(err)return onError(err);if(dereference){targetDest=path.resolve(basePath,targetDest)}if(targetDest===resolvedPath){return doneOne()}return rmFile(target,function(){makeLink(resolvedPath,target)})})})}function makeLink(linkPath,target){fs.symlink(linkPath,target,function(err){if(err)return onError(err);return doneOne()})}function isWritable(path,done){fs.lstat(path,function(err){if(err){if(err.code==="ENOENT")return done(true);return done(false)}return done(false)})}function onError(err){if(options.stopOnError){return callback(err)}else if(!errs&&options.errs){errs=fs.createWriteStream(options.errs)}else if(!errs){errs=[]}if(typeof errs.write==="undefined"){errs.push(err)}else{errs.write(err.stack+"\n\n")}return doneOne()}function doneOne(skipped){if(!skipped)running--;finished++;if(started===finished&&running===0){if(callback!==undefined){return errs?callback(errs):callback(null)}}}}module.exports=ncp}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy/ncp.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/copy")},{"../util/utimes":113,_process:1069,buffer:919,"graceful-fs":115,path:1068}],93:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("fs");var path=require("path");var mkdir=require("../mkdirs");var remove=require("../remove");function emptyDir(dir,callback){fs.readdir(dir,function(err,items){if(err)return mkdir.mkdirs(dir,callback);items=items.map(function(item){return path.join(dir,item)});deleteItem();function deleteItem(){var item=items.pop();if(!item)return callback();remove.remove(item,function(err){if(err)return callback(err);deleteItem()})}})}function emptyDirSync(dir){var items;try{items=fs.readdirSync(dir)}catch(err){return mkdir.mkdirsSync(dir)}items.forEach(function(item){item=path.join(dir,item);remove.removeSync(item)})}module.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:emptyDir,emptydir:emptyDir}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/empty/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/empty")},{"../mkdirs":104,"../remove":109,_process:1069,buffer:919,fs:916,path:1068}],94:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var path=require("path");var fs=require("graceful-fs");var mkdir=require("../mkdirs");function createFile(file,callback){function makeFile(){fs.writeFile(file,"",function(err){if(err)return callback(err);callback()})}fs.exists(file,function(fileExists){if(fileExists)return callback();var dir=path.dirname(file);fs.exists(dir,function(dirExists){if(dirExists)return makeFile();mkdir.mkdirs(dir,function(err){if(err)return callback(err);makeFile()})})})}function createFileSync(file){if(fs.existsSync(file))return;var dir=path.dirname(file);if(!fs.existsSync(dir)){mkdir.mkdirsSync(dir)}fs.writeFileSync(file,"")}module.exports={createFile:createFile,createFileSync:createFileSync,ensureFile:createFile,ensureFileSync:createFileSync}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure/file.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure")},{"../mkdirs":104,_process:1069,buffer:919,"graceful-fs":115,path:1068}],95:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var file=require("./file");var link=require("./link");var symlink=require("./symlink");module.exports={createFile:file.createFile,createFileSync:file.createFileSync,ensureFile:file.createFile,ensureFileSync:file.createFileSync,createLink:link.createLink,createLinkSync:link.createLinkSync,ensureLink:link.createLink,ensureLinkSync:link.createLinkSync,createSymlink:symlink.createSymlink,createSymlinkSync:symlink.createSymlinkSync,ensureSymlink:symlink.createSymlink,ensureSymlinkSync:symlink.createSymlinkSync}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure")},{"./file":94,"./link":96,"./symlink":99,_process:1069,buffer:919}],96:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var path=require("path");var fs=require("graceful-fs");var mkdir=require("../mkdirs");function createLink(srcpath,dstpath,callback){function makeLink(srcpath,dstpath){fs.link(srcpath,dstpath,function(err){if(err)return callback(err);callback(null)})}fs.exists(dstpath,function(destinationExists){if(destinationExists)return callback(null);fs.lstat(srcpath,function(err,stat){if(err){err.message=err.message.replace("lstat","ensureLink");return callback(err)}var dir=path.dirname(dstpath);fs.exists(dir,function(dirExists){if(dirExists)return makeLink(srcpath,dstpath);mkdir.mkdirs(dir,function(err){if(err)return callback(err);makeLink(srcpath,dstpath)})})})})}function createLinkSync(srcpath,dstpath,callback){var destinationExists=fs.existsSync(dstpath);if(destinationExists)return undefined;try{fs.lstatSync(srcpath)}catch(err){err.message=err.message.replace("lstat","ensureLink");throw err}var dir=path.dirname(dstpath);var dirExists=fs.existsSync(dir);if(dirExists)return fs.linkSync(srcpath,dstpath);mkdir.mkdirsSync(dir);return fs.linkSync(srcpath,dstpath)}module.exports={createLink:createLink,createLinkSync:createLinkSync,ensureLink:createLink,ensureLinkSync:createLinkSync}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure/link.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure")},{"../mkdirs":104,_process:1069,buffer:919,"graceful-fs":115,path:1068}],97:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var path=require("path");path.isAbsolute=path.isAbsolute?path.isAbsolute:require("path-is-absolute");var fs=require("graceful-fs");function symlinkPaths(srcpath,dstpath,callback){if(path.isAbsolute(srcpath)){return fs.lstat(srcpath,function(err,stat){if(err){err.message=err.message.replace("lstat","ensureSymlink");return callback(err)}return callback(null,{toCwd:srcpath,toDst:srcpath})})}else{var dstdir=path.dirname(dstpath);var relativeToDst=path.join(dstdir,srcpath);return fs.exists(relativeToDst,function(exists){if(exists){return callback(null,{toCwd:relativeToDst,toDst:srcpath})}else{return fs.lstat(srcpath,function(err,stat){if(err){err.message=err.message.replace("lstat","ensureSymlink");return callback(err)}return callback(null,{toCwd:srcpath,toDst:path.relative(dstdir,srcpath)})})}})}}function symlinkPathsSync(srcpath,dstpath){var exists;if(path.isAbsolute(srcpath)){exists=fs.existsSync(srcpath);if(!exists)throw new Error("absolute srcpath does not exist");return{toCwd:srcpath,toDst:srcpath}}else{var dstdir=path.dirname(dstpath);var relativeToDst=path.join(dstdir,srcpath);exists=fs.existsSync(relativeToDst);if(exists){return{toCwd:relativeToDst,toDst:srcpath}}else{exists=fs.existsSync(srcpath);if(!exists)throw new Error("relative srcpath does not exist");return{toCwd:srcpath,toDst:path.relative(dstdir,srcpath)}}}}module.exports={symlinkPaths:symlinkPaths,symlinkPathsSync:symlinkPathsSync}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure/symlink-paths.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure")},{_process:1069,buffer:919,"graceful-fs":115,path:1068,"path-is-absolute":119}],98:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");function symlinkType(srcpath,type,callback){callback=typeof type==="function"?type:callback;type=typeof type==="function"?false:type;if(type)return callback(null,type);fs.lstat(srcpath,function(err,stats){if(err)return callback(null,"file");type=stats&&stats.isDirectory()?"dir":"file";callback(null,type)})}function symlinkTypeSync(srcpath,type){if(type)return type;try{var stats=fs.lstatSync(srcpath)}catch(e){return"file"}return stats&&stats.isDirectory()?"dir":"file"}module.exports={symlinkType:symlinkType,symlinkTypeSync:symlinkTypeSync}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure/symlink-type.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure")},{_process:1069,buffer:919,"graceful-fs":115}],99:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var path=require("path");var fs=require("graceful-fs");var _mkdirs=require("../mkdirs");var mkdirs=_mkdirs.mkdirs;var mkdirsSync=_mkdirs.mkdirsSync;var _symlinkPaths=require("./symlink-paths");var symlinkPaths=_symlinkPaths.symlinkPaths;var symlinkPathsSync=_symlinkPaths.symlinkPathsSync;var _symlinkType=require("./symlink-type");var symlinkType=_symlinkType.symlinkType;var symlinkTypeSync=_symlinkType.symlinkTypeSync;function createSymlink(srcpath,dstpath,type,callback){callback=typeof type==="function"?type:callback;type=typeof type==="function"?false:type;fs.exists(dstpath,function(destinationExists){if(destinationExists)return callback(null);symlinkPaths(srcpath,dstpath,function(err,relative){if(err)return callback(err);srcpath=relative.toDst;symlinkType(relative.toCwd,type,function(err,type){if(err)return callback(err);var dir=path.dirname(dstpath);fs.exists(dir,function(dirExists){if(dirExists)return fs.symlink(srcpath,dstpath,type,callback);mkdirs(dir,function(err){if(err)return callback(err);fs.symlink(srcpath,dstpath,type,callback)})})})})})}function createSymlinkSync(srcpath,dstpath,type,callback){callback=typeof type==="function"?type:callback;type=typeof type==="function"?false:type;var destinationExists=fs.existsSync(dstpath);if(destinationExists)return undefined;var relative=symlinkPathsSync(srcpath,dstpath);srcpath=relative.toDst;type=symlinkTypeSync(relative.toCwd,type);var dir=path.dirname(dstpath);var exists=fs.existsSync(dir);if(exists)return fs.symlinkSync(srcpath,dstpath,type);mkdirsSync(dir);return fs.symlinkSync(srcpath,dstpath,type)}module.exports={createSymlink:createSymlink,createSymlinkSync:createSymlinkSync,ensureSymlink:createSymlink,ensureSymlinkSync:createSymlinkSync}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure/symlink.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/ensure")},{"../mkdirs":104,"./symlink-paths":97,"./symlink-type":98,_process:1069,buffer:919,"graceful-fs":115,path:1068}],100:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var assign=require("./util/assign");var fse={};var gfs=require("graceful-fs");Object.keys(gfs).forEach(function(key){fse[key]=gfs[key]});var fs=fse;assign(fs,require("./copy"));assign(fs,require("./copy-sync"));assign(fs,require("./mkdirs"));assign(fs,require("./remove"));assign(fs,require("./json"));assign(fs,require("./move"));assign(fs,require("./streams"));assign(fs,require("./empty"));assign(fs,require("./ensure"));assign(fs,require("./output"));module.exports=fs;var jsonfile={};Object.defineProperty(jsonfile,"spaces",{get:function(){return fs.spaces},set:function(val){fs.spaces=val}});module.exports.jsonfile=jsonfile}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib")},{"./copy":91,"./copy-sync":89,"./empty":93,"./ensure":95,"./json":101,"./mkdirs":104,"./move":107,"./output":108,"./remove":109,"./streams":111,"./util/assign":112,_process:1069,buffer:919,"graceful-fs":115}],101:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var jsonFile=require("jsonfile");module.exports={outputJsonSync:require("./output-json-sync"),outputJson:require("./output-json"),outputJSONSync:require("./output-json-sync"),outputJSON:require("./output-json"),readJson:jsonFile.readFile,readJSON:jsonFile.readFile,readJsonSync:jsonFile.readFileSync,readJSONSync:jsonFile.readFileSync,writeJson:jsonFile.writeFile,writeJSON:jsonFile.writeFile,writeJsonSync:jsonFile.writeFileSync,writeJSONSync:jsonFile.writeFileSync,spaces:2}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/json/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/json")},{"./output-json":103,"./output-json-sync":102,_process:1069,buffer:919,jsonfile:118}],102:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var path=require("path");var jsonFile=require("jsonfile");var mkdir=require("../mkdirs");function outputJsonSync(file,data,options){var dir=path.dirname(file);if(!fs.existsSync(dir)){mkdir.mkdirsSync(dir)}jsonFile.writeFileSync(file,data,options)}module.exports=outputJsonSync}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/json/output-json-sync.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/json")},{"../mkdirs":104,_process:1069,buffer:919,"graceful-fs":115,jsonfile:118,path:1068}],103:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var path=require("path");var jsonFile=require("jsonfile");var mkdir=require("../mkdirs");function outputJson(file,data,options,callback){if(typeof options==="function"){callback=options;options={}}var dir=path.dirname(file);fs.exists(dir,function(itDoes){if(itDoes)return jsonFile.writeFile(file,data,options,callback);mkdir.mkdirs(dir,function(err){if(err)return callback(err);jsonFile.writeFile(file,data,options,callback)})})}module.exports=outputJson}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/json/output-json.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/json")},{"../mkdirs":104,_process:1069,buffer:919,"graceful-fs":115,jsonfile:118,path:1068}],104:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports={mkdirs:require("./mkdirs"),mkdirsSync:require("./mkdirs-sync"),mkdirp:require("./mkdirs"),mkdirpSync:require("./mkdirs-sync"),ensureDir:require("./mkdirs"),ensureDirSync:require("./mkdirs-sync")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/mkdirs/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/mkdirs")},{"./mkdirs":106,"./mkdirs-sync":105,_process:1069,buffer:919}],105:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var path=require("path");var o777=parseInt("0777",8);function mkdirsSync(p,opts,made){if(!opts||typeof opts!=="object"){opts={mode:opts}}var mode=opts.mode;var xfs=opts.fs||fs;if(mode===undefined){mode=o777&~process.umask()}if(!made)made=null;p=path.resolve(p);try{xfs.mkdirSync(p,mode);made=made||p}catch(err0){switch(err0.code){case"ENOENT":made=mkdirsSync(path.dirname(p),opts,made);mkdirsSync(p,opts,made);break;default:var stat;try{stat=xfs.statSync(p)}catch(err1){throw err0}if(!stat.isDirectory())throw err0;break}}return made}module.exports=mkdirsSync}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/mkdirs")},{_process:1069,buffer:919,"graceful-fs":115,path:1068}],106:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var path=require("path");var o777=parseInt("0777",8);function mkdirs(p,opts,callback,made){if(typeof opts==="function"){callback=opts;opts={}}else if(!opts||typeof opts!=="object"){opts={mode:opts}}var mode=opts.mode;var xfs=opts.fs||fs;if(mode===undefined){mode=o777&~process.umask()}if(!made)made=null;callback=callback||Function();p=path.resolve(p);xfs.mkdir(p,mode,function(er){if(!er){made=made||p;return callback(null,made)}switch(er.code){case"ENOENT":if(path.dirname(p)===p)return callback(er);mkdirs(path.dirname(p),opts,function(er,made){if(er)callback(er,made);else mkdirs(p,opts,callback,made)});break;default:xfs.stat(p,function(er2,stat){if(er2||!stat.isDirectory())callback(er,made);else callback(null,made)});break}})}module.exports=mkdirs}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/mkdirs/mkdirs.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/mkdirs")},{_process:1069,buffer:919,"graceful-fs":115,path:1068}],107:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var ncp=require("../copy/ncp");var path=require("path");var rimraf=require("rimraf");var mkdirp=require("../mkdirs").mkdirs;function mv(source,dest,options,callback){if(typeof options==="function"){callback=options;options={}}var shouldMkdirp="mkdirp"in options?options.mkdirp:true;var clobber="clobber"in options?options.clobber:false;var limit=options.limit||16;if(shouldMkdirp){mkdirs()}else{doRename()}function mkdirs(){mkdirp(path.dirname(dest),function(err){if(err)return callback(err);doRename()})}function doRename(){if(clobber){fs.rename(source,dest,function(err){if(!err)return callback();if(err.code==="ENOTEMPTY"||err.code==="EEXIST"){rimraf(dest,function(err){if(err)return callback(err);options.clobber=false;mv(source,dest,options,callback)});return}if(err.code==="EPERM"){setTimeout(function(){rimraf(dest,function(err){if(err)return callback(err);options.clobber=false;mv(source,dest,options,callback)})},200);return}if(err.code!=="EXDEV")return callback(err);moveAcrossDevice(source,dest,clobber,limit,callback)})}else{fs.link(source,dest,function(err){if(err){if(err.code==="EXDEV"||err.code==="EISDIR"||err.code==="EPERM"){moveAcrossDevice(source,dest,clobber,limit,callback);return}callback(err);return}fs.unlink(source,callback)})}}}function moveAcrossDevice(source,dest,clobber,limit,callback){fs.stat(source,function(err,stat){if(err){callback(err);return}if(stat.isDirectory()){moveDirAcrossDevice(source,dest,clobber,limit,callback)}else{moveFileAcrossDevice(source,dest,clobber,limit,callback)}})}function moveFileAcrossDevice(source,dest,clobber,limit,callback){var outFlags=clobber?"w":"wx";var ins=fs.createReadStream(source);var outs=fs.createWriteStream(dest,{flags:outFlags});ins.on("error",function(err){ins.destroy();outs.destroy();outs.removeListener("close",onClose);fs.unlink(dest,function(){if(err.code==="EISDIR"||err.code==="EPERM"){moveDirAcrossDevice(source,dest,clobber,limit,callback)}else{callback(err)}})});outs.on("error",function(err){ins.destroy();outs.destroy();outs.removeListener("close",onClose);callback(err)});outs.once("close",onClose);ins.pipe(outs);function onClose(){fs.unlink(source,callback)}}function moveDirAcrossDevice(source,dest,clobber,limit,callback){var options={stopOnErr:true,clobber:false,limit:limit};function startNcp(){ncp(source,dest,options,function(errList){if(errList)return callback(errList[0]);rimraf(source,callback)})}if(clobber){rimraf(dest,function(err){if(err)return callback(err);startNcp()})}else{startNcp()}}module.exports={move:mv}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/move/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/move")},{"../copy/ncp":92,"../mkdirs":104,_process:1069,buffer:919,"graceful-fs":115,path:1068,rimraf:131}],108:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var path=require("path");var fs=require("graceful-fs");var mkdir=require("../mkdirs");function outputFile(file,data,encoding,callback){if(typeof encoding==="function"){callback=encoding;encoding="utf8"}var dir=path.dirname(file);fs.exists(dir,function(itDoes){if(itDoes)return fs.writeFile(file,data,encoding,callback);mkdir.mkdirs(dir,function(err){if(err)return callback(err);fs.writeFile(file,data,encoding,callback)})})}function outputFileSync(file,data,encoding){var dir=path.dirname(file);if(fs.existsSync(dir)){return fs.writeFileSync.apply(fs,arguments)}mkdir.mkdirsSync(dir);fs.writeFileSync.apply(fs,arguments)}module.exports={outputFile:outputFile,outputFileSync:outputFileSync}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/output/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/output")},{"../mkdirs":104,_process:1069,buffer:919,"graceful-fs":115,path:1068}],109:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var rimraf=require("rimraf");function removeSync(dir){return rimraf.sync(dir)}function remove(dir,callback){return callback?rimraf(dir,callback):rimraf(dir,Function())}module.exports={remove:remove,removeSync:removeSync,"delete":remove,deleteSync:removeSync}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/remove/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/remove"); -},{_process:1069,buffer:919,rimraf:131}],110:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var path=require("path");var fs=require("fs");var mkdir=require("../mkdirs");var WriteStream=fs.WriteStream;function createOutputStream(file,options){var dirExists=false;var dir=path.dirname(file);options=options||{};if(options.fd){return fs.createWriteStream(file,options)}else{options.fd=-1}var ws=new WriteStream(file,options);var oldOpen=ws.open;ws.open=function(){ws.fd=null;if(dirExists)return oldOpen.call(ws);mkdir.mkdirs(dir,function(err){if(err){ws.destroy();ws.emit("error",err);return}dirExists=true;oldOpen.call(ws)})};ws.open();return ws}module.exports=createOutputStream}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/streams/create-output-stream.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/streams")},{"../mkdirs":104,_process:1069,buffer:919,fs:916,path:1068}],111:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports={createOutputStream:require("./create-output-stream")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/streams/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/streams")},{"./create-output-stream":110,_process:1069,buffer:919}],112:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){function assign(){var args=[].slice.call(arguments).filter(function(i){return i});var dest=args.shift();args.forEach(function(src){Object.keys(src).forEach(function(key){dest[key]=src[key]})});return dest}module.exports=assign}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/util/assign.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/util")},{_process:1069,buffer:919}],113:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("graceful-fs");var path=require("path");var os=require("os");function hasMillisResSync(){var tmpfile=path.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));tmpfile=path.join(os.tmpdir(),tmpfile);var d=new Date(1435410243862);fs.writeFileSync(tmpfile,"https://github.com/jprichardson/node-fs-extra/pull/141");var fd=fs.openSync(tmpfile,"r+");fs.futimesSync(fd,d,d);fs.closeSync(fd);return fs.statSync(tmpfile).mtime>1435410243e3}function hasMillisRes(callback){var tmpfile=path.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));tmpfile=path.join(os.tmpdir(),tmpfile);var d=new Date(1435410243862);fs.writeFile(tmpfile,"https://github.com/jprichardson/node-fs-extra/pull/141",function(err){if(err)return callback(err);fs.open(tmpfile,"r+",function(err,fd){if(err)return callback(err);fs.futimes(fd,d,d,function(err){if(err)return callback(err);fs.close(fd,function(err){if(err)return callback(err);fs.stat(tmpfile,function(err,stats){if(err)return callback(err);callback(null,stats.mtime>1435410243e3)})})})})})}function timeRemoveMillis(timestamp){if(typeof timestamp==="number"){return Math.floor(timestamp/1e3)*1e3}else if(timestamp instanceof Date){return new Date(Math.floor(timestamp.getTime()/1e3)*1e3)}else{throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}}function utimesMillis(path,atime,mtime,callback){fs.open(path,"r+",function(err,fd){if(err)return callback(err);fs.futimes(fd,atime,mtime,function(err){if(err)return callback(err);fs.close(fd,callback)})})}module.exports={hasMillisRes:hasMillisRes,hasMillisResSync:hasMillisResSync,timeRemoveMillis:timeRemoveMillis,utimesMillis:utimesMillis}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/util/utimes.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/lib/util")},{_process:1069,buffer:919,"graceful-fs":115,os:1067,path:1068}],114:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var fs=require("fs");module.exports=clone(fs);function clone(obj){if(obj===null||typeof obj!=="object")return obj;if(obj instanceof Object)var copy={__proto__:obj.__proto__};else var copy=Object.create(null);Object.getOwnPropertyNames(obj).forEach(function(key){Object.defineProperty(copy,key,Object.getOwnPropertyDescriptor(obj,key))});return copy}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/graceful-fs/fs.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/graceful-fs")},{_process:1069,buffer:919,fs:916}],115:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("fs");var polyfills=require("./polyfills.js");var legacy=require("./legacy-streams.js");var queue=[];var util=require("util");function noop(){}var debug=noop;if(util.debuglog)debug=util.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))debug=function(){var m=util.format.apply(util,arguments);m="GFS4: "+m.split(/\n/).join("\nGFS4: ");console.error(m)};if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",function(){debug(queue);require("assert").equal(queue.length,0)})}module.exports=patch(require("./fs.js"));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH){module.exports=patch(fs)}fs.close=function(fs$close){return function(fd,cb){return fs$close.call(fs,fd,function(err){if(!err)retry();if(typeof cb==="function")cb.apply(this,arguments)})}}(fs.close);fs.closeSync=function(fs$closeSync){return function(fd){var rval=fs$closeSync.apply(fs,arguments);retry();return rval}}(fs.closeSync);function patch(fs){polyfills(fs);fs.gracefulify=patch;fs.FileReadStream=ReadStream;fs.FileWriteStream=WriteStream;fs.createReadStream=createReadStream;fs.createWriteStream=createWriteStream;var fs$readFile=fs.readFile;fs.readFile=readFile;function readFile(path,options,cb){if(typeof options==="function")cb=options,options=null;return go$readFile(path,options,cb);function go$readFile(path,options,cb){return fs$readFile(path,options,function(err){if(err&&(err.code==="EMFILE"||err.code==="ENFILE"))enqueue([go$readFile,[path,options,cb]]);else{if(typeof cb==="function")cb.apply(this,arguments);retry()}})}}var fs$writeFile=fs.writeFile;fs.writeFile=writeFile;function writeFile(path,data,options,cb){if(typeof options==="function")cb=options,options=null;return go$writeFile(path,data,options,cb);function go$writeFile(path,data,options,cb){return fs$writeFile(path,data,options,function(err){if(err&&(err.code==="EMFILE"||err.code==="ENFILE"))enqueue([go$writeFile,[path,data,options,cb]]);else{if(typeof cb==="function")cb.apply(this,arguments);retry()}})}}var fs$appendFile=fs.appendFile;if(fs$appendFile)fs.appendFile=appendFile;function appendFile(path,data,options,cb){if(typeof options==="function")cb=options,options=null;return go$appendFile(path,data,options,cb);function go$appendFile(path,data,options,cb){return fs$appendFile(path,data,options,function(err){if(err&&(err.code==="EMFILE"||err.code==="ENFILE"))enqueue([go$appendFile,[path,data,options,cb]]);else{if(typeof cb==="function")cb.apply(this,arguments);retry()}})}}var fs$readdir=fs.readdir;fs.readdir=readdir;function readdir(path,cb){return go$readdir(path,cb);function go$readdir(){return fs$readdir(path,function(err,files){if(files&&files.sort)files.sort();if(err&&(err.code==="EMFILE"||err.code==="ENFILE"))enqueue([go$readdir,[path,cb]]);else{if(typeof cb==="function")cb.apply(this,arguments);retry()}})}}if(process.version.substr(0,4)==="v0.8"){var legStreams=legacy(fs);ReadStream=legStreams.ReadStream;WriteStream=legStreams.WriteStream}var fs$ReadStream=fs.ReadStream;ReadStream.prototype=Object.create(fs$ReadStream.prototype);ReadStream.prototype.open=ReadStream$open;var fs$WriteStream=fs.WriteStream;WriteStream.prototype=Object.create(fs$WriteStream.prototype);WriteStream.prototype.open=WriteStream$open;fs.ReadStream=ReadStream;fs.WriteStream=WriteStream;function ReadStream(path,options){if(this instanceof ReadStream)return fs$ReadStream.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var that=this;open(that.path,that.flags,that.mode,function(err,fd){if(err){if(that.autoClose)that.destroy();that.emit("error",err)}else{that.fd=fd;that.emit("open",fd);that.read()}})}function WriteStream(path,options){if(this instanceof WriteStream)return fs$WriteStream.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var that=this;open(that.path,that.flags,that.mode,function(err,fd){if(err){that.destroy();that.emit("error",err)}else{that.fd=fd;that.emit("open",fd)}})}function createReadStream(path,options){return new ReadStream(path,options)}function createWriteStream(path,options){return new WriteStream(path,options)}var fs$open=fs.open;fs.open=open;function open(path,flags,mode,cb){if(typeof mode==="function")cb=mode,mode=null;return go$open(path,flags,mode,cb);function go$open(path,flags,mode,cb){return fs$open(path,flags,mode,function(err,fd){if(err&&(err.code==="EMFILE"||err.code==="ENFILE"))enqueue([go$open,[path,flags,mode,cb]]);else{if(typeof cb==="function")cb.apply(this,arguments);retry()}})}}return fs}function enqueue(elem){debug("ENQUEUE",elem[0].name,elem[1]);queue.push(elem)}function retry(){var elem=queue.shift();if(elem){debug("RETRY",elem[0].name,elem[1]);elem[0].apply(null,elem[1])}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/graceful-fs")},{"./fs.js":114,"./legacy-streams.js":116,"./polyfills.js":117,_process:1069,assert:917,buffer:919,fs:916,util:1089}],116:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Stream=require("stream").Stream;module.exports=legacy;function legacy(fs){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(path,options){if(!(this instanceof ReadStream))return new ReadStream(path,options);Stream.call(this);var self=this;this.path=path;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;options=options||{};var keys=Object.keys(options);for(var index=0,length=keys.length;indexthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick(function(){self._read()});return}fs.open(this.path,this.flags,this.mode,function(err,fd){if(err){self.emit("error",err);self.readable=false;return}self.fd=fd;self.emit("open",fd);self._read()})}function WriteStream(path,options){if(!(this instanceof WriteStream))return new WriteStream(path,options);Stream.call(this);this.path=path;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;options=options||{};var keys=Object.keys(options);for(var index=0,length=keys.length;index= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=fs.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/graceful-fs/legacy-streams.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/graceful-fs")},{_process:1069,buffer:919,stream:1084}],117:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("./fs.js");var constants=require("constants");var origCwd=process.cwd;var cwd=null;process.cwd=function(){if(!cwd)cwd=origCwd.call(process);return cwd};try{process.cwd()}catch(er){}var chdir=process.chdir;process.chdir=function(d){cwd=null;chdir.call(process,d)};module.exports=patch;function patch(fs){if(constants.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(fs)}if(!fs.lutimes){patchLutimes(fs)}fs.chown=chownFix(fs.chown);fs.fchown=chownFix(fs.fchown);fs.lchown=chownFix(fs.lchown);fs.chmod=chownFix(fs.chmod);fs.fchmod=chownFix(fs.fchmod);fs.lchmod=chownFix(fs.lchmod);fs.chownSync=chownFixSync(fs.chownSync);fs.fchownSync=chownFixSync(fs.fchownSync);fs.lchownSync=chownFixSync(fs.lchownSync);fs.chmodSync=chownFix(fs.chmodSync);fs.fchmodSync=chownFix(fs.fchmodSync);fs.lchmodSync=chownFix(fs.lchmodSync);if(!fs.lchmod){fs.lchmod=function(path,mode,cb){process.nextTick(cb)};fs.lchmodSync=function(){}}if(!fs.lchown){fs.lchown=function(path,uid,gid,cb){process.nextTick(cb)};fs.lchownSync=function(){}}if(process.platform==="win32"){fs.rename=function(fs$rename){return function(from,to,cb){var start=Date.now();fs$rename(from,to,function CB(er){if(er&&(er.code==="EACCES"||er.code==="EPERM")&&Date.now()-start<1e3){return fs$rename(from,to,CB)}if(cb)cb(er)})}}(fs.rename)}fs.read=function(fs$read){return function(fd,buffer,offset,length,position,callback_){var callback;if(callback_&&typeof callback_==="function"){var eagCounter=0;callback=function(er,_,__){if(er&&er.code==="EAGAIN"&&eagCounter<10){eagCounter++;return fs$read.call(fs,fd,buffer,offset,length,position,callback)}callback_.apply(this,arguments)}}return fs$read.call(fs,fd,buffer,offset,length,position,callback)}}(fs.read);fs.readSync=function(fs$readSync){return function(fd,buffer,offset,length,position){var eagCounter=0;while(true){try{return fs$readSync.call(fs,fd,buffer,offset,length,position)}catch(er){if(er.code==="EAGAIN"&&eagCounter<10){eagCounter++;continue}throw er}}}}(fs.readSync)}function patchLchmod(fs){fs.lchmod=function(path,mode,callback){callback=callback||noop;fs.open(path,constants.O_WRONLY|constants.O_SYMLINK,mode,function(err,fd){if(err){callback(err);return}fs.fchmod(fd,mode,function(err){fs.close(fd,function(err2){callback(err||err2)})})})};fs.lchmodSync=function(path,mode){var fd=fs.openSync(path,constants.O_WRONLY|constants.O_SYMLINK,mode);var threw=true;var ret;try{ret=fs.fchmodSync(fd,mode);threw=false}finally{if(threw){try{fs.closeSync(fd)}catch(er){}}else{fs.closeSync(fd)}}return ret}}function patchLutimes(fs){if(constants.hasOwnProperty("O_SYMLINK")){fs.lutimes=function(path,at,mt,cb){fs.open(path,constants.O_SYMLINK,function(er,fd){cb=cb||noop;if(er)return cb(er);fs.futimes(fd,at,mt,function(er){fs.close(fd,function(er2){return cb(er||er2)})})})};fs.lutimesSync=function(path,at,mt){var fd=fs.openSync(path,constants.O_SYMLINK);var ret;var threw=true;try{ret=fs.futimesSync(fd,at,mt);threw=false}finally{if(threw){try{fs.closeSync(fd)}catch(er){}}else{fs.closeSync(fd)}}return ret}}else{fs.lutimes=function(_a,_b,_c,cb){process.nextTick(cb)};fs.lutimesSync=function(){}}}function chownFix(orig){if(!orig)return orig;return function(target,uid,gid,cb){return orig.call(fs,target,uid,gid,function(er,res){if(chownErOk(er))er=null;cb(er,res)})}}function chownFixSync(orig){if(!orig)return orig;return function(target,uid,gid){try{return orig.call(fs,target,uid,gid)}catch(er){if(!chownErOk(er))throw er}}}function chownErOk(er){if(!er)return true;if(er.code==="ENOSYS")return true;var nonroot=!process.getuid||process.getuid()!==0;if(nonroot){if(er.code==="EINVAL"||er.code==="EPERM")return true}return false}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/graceful-fs/polyfills.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/graceful-fs")},{"./fs.js":114,_process:1069,buffer:919,constants:923}],118:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var fs=require("fs");function readFile(file,options,callback){if(callback==null){callback=options;options={}}fs.readFile(file,options,function(err,data){if(err)return callback(err);var obj;try{obj=JSON.parse(data,options?options.reviver:null)}catch(err2){return callback(err2)}callback(null,obj)})}function readFileSync(file,options){options=options||{};if(typeof options==="string"){options={encoding:options}}var shouldThrow="throws"in options?options.throw:true;if(shouldThrow){return JSON.parse(fs.readFileSync(file,options),options.reviver)}else{try{return JSON.parse(fs.readFileSync(file,options),options.reviver)}catch(err){return null}}}function writeFile(file,obj,options,callback){if(callback==null){callback=options;options={}}var spaces=typeof options==="object"&&options!==null?"spaces"in options?options.spaces:this.spaces:this.spaces;var str="";try{str=JSON.stringify(obj,options?options.replacer:null,spaces)+"\n"}catch(err){if(callback)return callback(err,null)}fs.writeFile(file,str,options,callback)}function writeFileSync(file,obj,options){options=options||{};var spaces=typeof options==="object"&&options!==null?"spaces"in options?options.spaces:this.spaces:this.spaces;var str=JSON.stringify(obj,options.replacer,spaces)+"\n";return fs.writeFileSync(file,str,options)}var jsonfile={spaces:null,readFile:readFile,readFileSync:readFileSync,writeFile:writeFile,writeFileSync:writeFileSync};module.exports=jsonfile}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/jsonfile/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/jsonfile")},{_process:1069,buffer:919,fs:916}],119:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";function posix(path){return path.charAt(0)==="/"}function win32(path){var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var result=splitDeviceRe.exec(path);var device=result[1]||"";var isUnc=!!device&&device.charAt(1)!==":";return!!result[2]||isUnc}module.exports=process.platform==="win32"?win32:posix;module.exports.posix=posix;module.exports.win32=win32}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/path-is-absolute/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/path-is-absolute")},{_process:1069,buffer:919}],120:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){exports.alphasort=alphasort;exports.alphasorti=alphasorti;exports.setopts=setopts;exports.ownProp=ownProp;exports.makeAbs=makeAbs;exports.finish=finish;exports.mark=mark;exports.isIgnored=isIgnored;exports.childrenIgnored=childrenIgnored;function ownProp(obj,field){return Object.prototype.hasOwnProperty.call(obj,field)}var path=require("path");var minimatch=require("minimatch");var isAbsolute=require("path-is-absolute");var Minimatch=minimatch.Minimatch;function alphasorti(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}function alphasort(a,b){return a.localeCompare(b)}function setupIgnores(self,options){self.ignore=options.ignore||[];if(!Array.isArray(self.ignore))self.ignore=[self.ignore];if(self.ignore.length){self.ignore=self.ignore.map(ignoreMap)}}function ignoreMap(pattern){var gmatcher=null;if(pattern.slice(-3)==="/**"){var gpattern=pattern.replace(/(\/\*\*)+$/,"");gmatcher=new Minimatch(gpattern)}return{matcher:new Minimatch(pattern),gmatcher:gmatcher}}function setopts(self,pattern,options){if(!options)options={};if(options.matchBase&&-1===pattern.indexOf("/")){if(options.noglobstar){throw new Error("base matching requires globstar")}pattern="**/"+pattern}self.silent=!!options.silent;self.pattern=pattern;self.strict=options.strict!==false;self.realpath=!!options.realpath;self.realpathCache=options.realpathCache||Object.create(null);self.follow=!!options.follow;self.dot=!!options.dot;self.mark=!!options.mark;self.nodir=!!options.nodir;if(self.nodir)self.mark=true;self.sync=!!options.sync;self.nounique=!!options.nounique;self.nonull=!!options.nonull;self.nosort=!!options.nosort;self.nocase=!!options.nocase;self.stat=!!options.stat;self.noprocess=!!options.noprocess;self.maxLength=options.maxLength||Infinity;self.cache=options.cache||Object.create(null);self.statCache=options.statCache||Object.create(null);self.symlinks=options.symlinks||Object.create(null);setupIgnores(self,options);self.changedCwd=false;var cwd=process.cwd();if(!ownProp(options,"cwd"))self.cwd=cwd;else{self.cwd=options.cwd;self.changedCwd=path.resolve(options.cwd)!==cwd}self.root=options.root||path.resolve(self.cwd,"/");self.root=path.resolve(self.root);if(process.platform==="win32")self.root=self.root.replace(/\\/g,"/");self.nomount=!!options.nomount;options.nonegate=options.nonegate===false?false:true;options.nocomment=options.nocomment===false?false:true;deprecationWarning(options);self.minimatch=new Minimatch(pattern,options);self.options=self.minimatch.options}exports.deprecationWarned;function deprecationWarning(options){if(!options.nonegate||!options.nocomment){if(process.noDeprecation!==true&&!exports.deprecationWarned){var msg="glob WARNING: comments and negation will be disabled in v6";if(process.throwDeprecation)throw new Error(msg);else if(process.traceDeprecation)console.trace(msg);else console.error(msg);exports.deprecationWarned=true}}}function finish(self){var nou=self.nounique;var all=nou?[]:Object.create(null);for(var i=0,l=self.matches.length;i1)return true;for(var j=0;jthis.maxLength)return cb();if(!this.stat&&ownProp(this.cache,abs)){var c=this.cache[abs];if(Array.isArray(c))c="DIR";if(!needDir||c==="DIR")return cb(null,c);if(needDir&&c==="FILE")return cb()}var exists;var stat=this.statCache[abs];if(stat!==undefined){if(stat===false)return cb(null,stat);else{var type=stat.isDirectory()?"DIR":"FILE";if(needDir&&type==="FILE")return cb();else return cb(null,type,stat)}}var self=this;var statcb=inflight("stat\x00"+abs,lstatcb_);if(statcb)fs.lstat(abs,statcb);function lstatcb_(er,lstat){if(lstat&&lstat.isSymbolicLink()){return fs.stat(abs,function(er,stat){if(er)self._stat2(f,abs,null,lstat,cb);else self._stat2(f,abs,er,stat,cb)})}else{self._stat2(f,abs,er,lstat,cb)}}};Glob.prototype._stat2=function(f,abs,er,stat,cb){if(er){this.statCache[abs]=false;return cb()}var needDir=f.slice(-1)==="/";this.statCache[abs]=stat;if(abs.slice(-1)==="/"&&!stat.isDirectory())return cb(null,false,stat);var c=stat.isDirectory()?"DIR":"FILE";this.cache[abs]=this.cache[abs]||c;if(needDir&&c!=="DIR")return cb();return cb(null,c,stat)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/glob.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob")},{"./common.js":120,"./sync.js":130,_process:1069,assert:917,buffer:919,events:1061,fs:916,inflight:122,inherits:"inherits",minimatch:124,once:129,path:1068,"path-is-absolute":119,util:1089}],122:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var wrappy=require("wrappy");var reqs=Object.create(null);var once=require("once");module.exports=wrappy(inflight);function inflight(key,cb){if(reqs[key]){reqs[key].push(cb);return null}else{reqs[key]=[cb];return makeres(key)}}function makeres(key){return once(function RES(){var cbs=reqs[key];var len=cbs.length;var args=slice(arguments);for(var i=0;ilen){cbs.splice(0,len);process.nextTick(function(){RES.apply(null,args)})}else{delete reqs[key]}})}function slice(args){var length=args.length;var array=[];for(var i=0;i-1;n--){var nl=negativeLists[n];var nlBefore=re.slice(0,nl.reStart);var nlFirst=re.slice(nl.reStart,nl.reEnd-8);var nlLast=re.slice(nl.reEnd-8,nl.reEnd);var nlAfter=re.slice(nl.reEnd);nlLast+=nlAfter;var openParensBefore=nlBefore.split("(").length-1;var cleanAfter=nlAfter;for(i=0;i=0;i--){filename=f[i];if(filename)break}for(i=0;i>> no match, partial?",file,fr,pattern,pr);if(fr===fl)return true}return false}var hit;if(typeof p==="string"){if(options.nocase){hit=f.toLowerCase()===p.toLowerCase()}else{hit=f===p}this.debug("string match",p,f,hit)}else{hit=f.match(p);this.debug("pattern match",p,f,hit)}if(!hit)return false}if(fi===fl&&pi===pl){return true}else if(fi===fl){return partial}else if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch")},{_process:1069,"brace-expansion":125,buffer:919,path:1068}],125:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var concatMap=require("concat-map");var balanced=require("balanced-match");module.exports=expandTop;var escSlash="\x00SLASH"+Math.random()+"\x00";var escOpen="\x00OPEN"+Math.random()+"\x00";var escClose="\x00CLOSE"+Math.random()+"\x00";var escComma="\x00COMMA"+Math.random()+"\x00";var escPeriod="\x00PERIOD"+Math.random()+"\x00";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[];var m=balanced("{","}",str);if(!m)return str.split(",");var pre=m.pre;var body=m.body;var post=m.post;var p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);if(post.length){p[p.length-1]+=postParts.shift();p.push.apply(p,postParts)}parts.push.apply(parts,p);return parts}function expandTop(str){if(!str)return[];return expand(escapeBraces(str),true).map(unescapeBraces)}function identity(e){return e}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i,y){return i<=y}function gte(i,y){return i>=y}function expand(str,isTop){var expansions=[];var m=balanced("{","}",str);if(!m||/\$$/.test(m.pre))return[str];var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);var isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);var isSequence=isNumericSequence||isAlphaSequence;var isOptions=/^(.*,)+(.+)?$/.test(m.body);if(!isSequence&&!isOptions){if(m.post.match(/,.*}/)){str=m.pre+"{"+m.body+escClose+m.post;return expand(str)}return[str]}var n;if(isSequence){n=m.body.split(/\.\./)}else{n=parseCommaParts(m.body);if(n.length===1){n=expand(n[0],false).map(embrace);if(n.length===1){var post=m.post.length?expand(m.post,false):[""];return post.map(function(p){return m.pre+n[0]+p})}}}var pre=m.pre;var post=m.post.length?expand(m.post,false):[""];var N;if(isSequence){var x=numeric(n[0]);var y=numeric(n[1]);var width=Math.max(n[0].length,n[1].length);var incr=n.length==3?Math.abs(numeric(n[2])):1;var test=lte;var reverse=y0){var z=new Array(need+1).join("0");if(i<0)c="-"+z+c.slice(1);else c=z+c}}}N.push(c)}}else{N=concatMap(n,function(el){return expand(el,false)})}for(var j=0;j1?str.substring(m.start+a.length,m.end):"";m.post=str.slice(m.end+b.length);return m}}}if(bal&&ended){var start=m.start+a.length;m=balanced(a,b,str.substr(start));if(m){m.start+=start;m.end+=start;m.pre=str.slice(0,start)+m.pre}return m}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match")},{_process:1069,buffer:919}],127:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(xs,fn){var res=[];for(var i=0;ithis.maxLength)return false;if(!this.stat&&ownProp(this.cache,abs)){var c=this.cache[abs];if(Array.isArray(c))c="DIR";if(!needDir||c==="DIR")return c;if(needDir&&c==="FILE")return false}var exists;var stat=this.statCache[abs];if(!stat){var lstat;try{lstat=fs.lstatSync(abs)}catch(er){return false}if(lstat.isSymbolicLink()){try{stat=fs.statSync(abs)}catch(er){stat=lstat}}else{stat=lstat}}this.statCache[abs]=stat;var c=stat.isDirectory()?"DIR":"FILE";this.cache[abs]=this.cache[abs]||c;if(needDir&&c!=="DIR")return false;return c};GlobSync.prototype._mark=function(p){return common.mark(this,p)};GlobSync.prototype._makeAbs=function(f){return common.makeAbs(this,f)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/sync.js","/node_modules/@mitocgroup/deep-fs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob")},{"./common.js":120,"./glob.js":121,_process:1069,assert:917,buffer:919,fs:916,minimatch:124,path:1068,"path-is-absolute":119,util:1089}],131:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=rimraf;rimraf.sync=rimrafSync;var assert=require("assert");var path=require("path");var fs=require("fs");var glob=require("glob");var globOpts={nosort:true,nocomment:true,nonegate:true,silent:true};var timeout=0;var isWindows=process.platform==="win32";function defaults(options){var methods=["unlink","chmod","stat","lstat","rmdir","readdir"];methods.forEach(function(m){options[m]=options[m]||fs[m];m=m+"Sync";options[m]=options[m]||fs[m]});options.maxBusyTries=options.maxBusyTries||3;options.emfileWait=options.emfileWait||1e3;options.disableGlob=options.disableGlob||false}function rimraf(p,options,cb){if(typeof options==="function"){cb=options;options={}}assert(p,"rimraf: missing path");assert.equal(typeof p,"string","rimraf: path should be a string");assert(options,"rimraf: missing options");assert.equal(typeof options,"object","rimraf: options should be object");assert.equal(typeof cb,"function","rimraf: callback function required");defaults(options);var busyTries=0;var errState=null;var n=0;if(options.disableGlob||!glob.hasMagic(p))return afterGlob(null,[p]);fs.lstat(p,function(er,stat){if(!er)return afterGlob(null,[p]);glob(p,globOpts,afterGlob)});function next(er){errState=errState||er;if(--n===0)cb(errState)}function afterGlob(er,results){if(er)return cb(er);n=results.length;if(n===0)return cb();results.forEach(function(p){rimraf_(p,options,function CB(er){if(er){if(isWindows&&(er.code==="EBUSY"||er.code==="ENOTEMPTY"||er.code==="EPERM")&&busyTries=partBufferSize){var promise=this.addPart(this.currentBuffer);this.parts.push(promise);this.currentBuffer=new Buffer(0)}};MultiPartManager.prototype.flush=function(){if(this.currentBuffer.length){var promise=this.addPart(this.currentBuffer);this.parts.push(promise);this.currentBuffer=new Buffer(0)}};MultiPartManager.prototype.addPart=function(buffer){var self=this,partNumber=++this.partNumber,error;if(partNumber>maxParts){error=util.format("Unable to create partNumber:%d. The max partNumber is %d",partNumber,maxParts);return this.abort().then(function(){return Promise.reject(error)},function(){return Promise.reject(error)})}return this.uploadId().then(function(uploadId){return new Promise(function(resolve,reject){self.client.uploadPart({Bucket:self.bucket,Key:self.key,Body:buffer,UploadId:uploadId,PartNumber:partNumber},function(err,result){if(err){return self.abort().then(function(){reject(err)},function(){reject(err)})}result.PartNumber=partNumber;resolve(result)})})})};MultiPartManager.prototype.abort=function(){var self=this;return this.uploadId().then(function(uploadId){return new Promise(function(resolve,reject){self.client.abortMultipartUpload({Bucket:self.bucket,Key:self.key,UploadId:uploadId},function(err){if(err){return reject(err)}resolve()})})})};MultiPartManager.prototype.uploadId=function(){var self=this;return this._uploadIdPromise?this._uploadIdPromise:this._uploadIdPromise=function(){return new Promise(function(resolve,reject){self.client.createMultipartUpload({Bucket:self.bucket,Key:self.key},function(err,data){if(err){return reject(err)}resolve(data.UploadId)})})}()};MultiPartManager.prototype.put=function(){var self=this;return new Promise(function(resolve,reject){self.client.putObject({Bucket:self.bucket,Key:self.key,Body:self.currentBuffer},function(err,data){if(err){return reject(err)}resolve(data)})})};MultiPartManager.prototype.complete=function(){var self=this;return this.partNumber?this.uploadId().then(function(uploadId){self.flush();return Promise.all(self.parts).then(function(parts){return new Promise(function(resolve,reject){self.client.completeMultipartUpload({Bucket:self.bucket,Key:self.key,UploadId:uploadId,MultipartUpload:{Parts:parts}},function(err,data){if(err){return reject(err)}resolve(data)})})})}):this.put()};function S3WriteStream(client,bucket,key,options){if(!(this instanceof S3WriteStream)){return new S3WriteStream(client,bucket,key,options)}this.multiPartManager=new MultiPartManager(client,bucket,key);var streamOptions=extend(defaultOptions,options);Writable.call(this,streamOptions)}util.inherits(S3WriteStream,Writable);function execCb(cb){if(cb&&typeof cb==="function"){cb()}}S3WriteStream.prototype.write=function(chunk,enc,cb){this.multiPartManager.addChunk(chunk);execCb(cb)};S3WriteStream.prototype.end=function(chunk,encoding,cb){var self=this;if(chunk){this.multiPartManager.addChunk(chunk)}this.multiPartManager.complete().then(function(){self.emit("finish");execCb(cb)},function(reason){self.emit("error",reason);execCb(cb)})};module.exports=S3WriteStream})(module,require("stream").Writable,require("util"),require("extend"),require("bluebird"))}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/s3fs/lib/s3WriteStream.js","/node_modules/@mitocgroup/deep-fs/node_modules/s3fs/lib")},{_process:1069,bluebird:139,buffer:919,extend:"extend",stream:1084,util:1089}],137:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){(function(module,fsInterface,util,Promise,AWS,s3Utils,extend,S3WriteStream,Stats){"use strict";var directoryRegExp=/\/$/,defaultCreateOptions={};function S3fs(bucket,options){if(!(this instanceof S3fs)){return new S3fs(bucket,options)}if(!bucket){throw new Error("bucket is required")}if(typeof bucket!=="string"){throw new Error("bucket must be a string")}var bucketParts=s3Utils.decomposePath(bucket);this.s3=options instanceof AWS.S3?options:new AWS.S3(options);this.bucket=bucketParts[0];this.path=bucketParts.slice(1).join("/");if(this.path){this.path+="/"}}function whiteSpace(item){return item}util.inherits(S3fs,fsInterface);S3fs.prototype.createReadStream=function(name){return this.s3.getObject({Bucket:this.bucket,Key:this.path+s3Utils.toKey(name)}).createReadStream()};S3fs.prototype.createWriteStream=function(name){return new S3WriteStream(this.s3,this.bucket,this.path+s3Utils.toKey(name))};S3fs.prototype.exists=function(name,callback){var self=this;var promise=new Promise(function(resolve){var key=self.path+s3Utils.toKey(name);if(directoryRegExp.test(key)){return resolve(true)}else{self.s3.headObject({Bucket:self.bucket,Key:key},function(err){if(err){return resolve(false)}resolve(true)})}});if(!callback){return promise}promise.then(function(exists){callback(exists)},function(){callback(false)})};S3fs.prototype.mkdir=function mkdir(path,callback){var promise=putObject(this.s3,this.bucket,this.path+s3Utils.toKey(path)+"/");if(!callback){return promise}promise.then(function(data){callback(null,data)},function(reason){callback(reason)})};S3fs.prototype.mkdirp=S3fs.prototype.mkdir;S3fs.prototype.stat=function(path,callback){return getFileStats(this,path,callback)};S3fs.prototype.lstat=function(path,callback){return getFileStats(this,path,callback)};S3fs.prototype.readdir=function(name,callback){var prefix=this.path+s3Utils.toKey(name);if(prefix[prefix.length-1]!=="/"){prefix+="/"}var promise=listAllObjectsFiles(this.s3,this.bucket,prefix,"/");if(!callback){return promise}promise.then(function(files){callback(null,files)},function(reason){callback(reason)})};S3fs.prototype.readFile=function(name,options,callback){if(typeof options==="function"){callback=options;options=undefined}options=options||{};if(options.encoding){options.ResponseContentEncoding=options.encoding;delete options.encoding}var promise=getObject(this.s3,this.bucket,this.path+s3Utils.toKey(name,this.bucket,this.path),options);if(!callback){return promise}promise.then(function(data){callback(null,data.Body)},function(reason){callback(reason)})};S3fs.prototype.rmdir=function(path,callback){var promise=deleteObject(this.s3,this.bucket,this.path+s3Utils.toKey(path)+"/");if(!callback){return promise}promise.then(function(data){callback(null,data)},function(reason){callback(reason)})};S3fs.prototype.unlink=function(name,callback){var promise=deleteObject(this.s3,this.bucket,this.path+s3Utils.toKey(name));if(!callback){return promise}promise.then(function(data){callback(null,data)},function(reason){callback(reason)})};S3fs.prototype.writeFile=function(name,data,options,callback){if(typeof options==="function"){callback=options;options=undefined}options=options||{};if(options.encoding){options.ContentEncoding=options.encoding;delete options.encoding}var promise=putObject(this.s3,this.bucket,this.path+s3Utils.toKey(name),data,options);if(!callback){return promise}promise.then(function(data){callback(null,data)},function(reason){callback(reason)})};S3fs.prototype.clone=function(path){return new S3fs(s3Utils.joinPaths(this.bucket,s3Utils.joinPaths(this.path,path)),this.s3)};S3fs.prototype.copyFile=function(sourceFile,destinationFile,callback){var self=this;var promise=new Promise(function(resolve,reject){self.s3.copyObject({Bucket:self.bucket,Key:self.path+s3Utils.toKey(destinationFile),CopySource:[self.bucket,self.path+s3Utils.toKey(sourceFile)].join("/")},function(err){if(err){return reject(err)}return resolve()})});if(!callback){return promise}promise.then(function(){callback()},function(reason){callback(reason)})};S3fs.prototype.create=function(options,callback){if(typeof options==="function"){callback=options;options=undefined}var self=this;var params=extend(true,defaultCreateOptions,options,{Bucket:this.bucket});var promise=new Promise(function(resolve,reject){self.s3.createBucket(params,function(err,data){if(err){return reject(err)}resolve(data)})});if(!callback){return promise}promise.then(function(){callback()},function(reason){callback(reason)})};S3fs.prototype.delete=function(callback){var self=this;var promise=new Promise(function(resolve,reject){self.s3.deleteBucket({Bucket:self.bucket},function(err,data){if(err){return reject(err)}resolve(data)})});if(!callback){return promise}promise.then(function(){callback()},function(reason){callback(reason)})};S3fs.prototype.headObject=function(path,callback){var self=this;var promise=new Promise(function(resolve,reject){self.s3.headObject({Bucket:self.bucket,Key:self.path+s3Utils.toKey(path)},function(err,data){if(err){return reject(err)}resolve(data)})});if(!callback){return promise}promise.then(function(){callback()},function(reason){callback(reason)})};S3fs.prototype.listContents=function(path,marker,callback){if(typeof marker==="function"){callback=marker;marker=undefined}var promise=listAllObjects(this.s3,this.bucket,this.path+s3Utils.toKey(path)+"/","/",marker);if(!callback){return promise}promise.then(function(data){callback(null,data)},function(reason){callback(reason)})};S3fs.prototype.copyDir=function(sourcePath,destinationPath,callback){var self=this;var promise=listAllObjectsFiles(this.s3,this.bucket,this.path+s3Utils.toKey(sourcePath)+"/").then(function(files){var promises=[];files.forEach(function(file){promises.push(self.copyFile([s3Utils.toKey(sourcePath),file].join("/"),[s3Utils.toKey(destinationPath),file].join("/")))});return Promise.all(promises).return()});if(!callback){return promise}promise.then(function(){callback()},function(reason){callback(reason)})};S3fs.prototype.destroy=function(callback){var self=this;var promise=self.rmdirp().then(function(){return listAllObjectsFiles(self.s3,self.bucket).then(function(objects){return Promise.all(objects.filter(function(object){return!directoryRegExp.test(object)}).map(function(object){return deleteObject(self.s3,self.bucket,object)}).concat(objects.filter(function(object){return directoryRegExp.test(object)}).map(function(object){return deleteObject(self.s3,self.bucket,object)})))})}).then(function(){return self.delete()});if(!callback){return promise}promise.then(function(){callback()},function(reason){callback(reason)})};S3fs.prototype.putBucketLifecycle=function(name,prefix,days,callback){var promise=putBucketLifecycle(this.s3,this.bucket,name,prefix,days);if(!callback){return promise}promise.then(function(){callback()},function(reason){callback(reason)})};S3fs.prototype.readdirp=function(path,callback){var prefix=this.path+s3Utils.toKey(path);if(prefix[prefix.length-1]!=="/"){prefix+="/"}var promise=listAllObjectsFiles(this.s3,this.bucket,prefix);if(!callback){return promise}promise.then(function(data){callback(null,data)},function(reason){callback(reason)})};S3fs.prototype.rmdirp=function(path,callback){var self=this,promise=listAllObjectsFiles(this.s3,this.bucket,path?this.path+s3Utils.toKey(path)+"/":undefined).then(function(objects){return Promise.all(objects.filter(function(object){return!directoryRegExp.test(object)}).map(function(object){return self.unlink((path?s3Utils.toKey(path)+"/":"")+object)}).concat(objects.filter(function(object){return directoryRegExp.test(object)}).map(function(object){return self.rmdir((path?s3Utils.toKey(path)+"/":"")+object)})))});if(!callback){return promise}promise.then(function(){callback()},function(reason){callback(reason)})};function getFileStats(s3fs,path,callback){var promise=new Promise(function(resolve,reject){if(directoryRegExp.test(path)){var date=new Date,stats=new Stats({dev:0,ino:0,mode:0,nlink:1,uid:0,gid:0,rdev:0,size:0,atim_msec:date,mtim_msec:date,ctim_msec:date,path:path});return resolve(stats)}else{s3fs.s3.headObject({Bucket:s3fs.bucket,Key:s3fs.path+s3Utils.toKey(path,s3fs.bucket,s3fs.path)},function(err,data){if(err){err.message=err.name;return reject(err)}var stats=new Stats({dev:0,ino:0,mode:0,nlink:0,uid:0,gid:0,rdev:0,size:Number(data.ContentLength),atim_msec:data.LastModified,mtim_msec:data.LastModified,ctim_msec:data.LastModified,path:path});return resolve(stats)})}});if(!callback){return promise}promise.then(function(stats){callback(null,stats)},function(reason){callback(reason)})}function contentToKey(content){return content.Key}function contentPrefixesToPrefix(content){return content.Prefix}function listAllObjects(s3,bucket,prefix,delimiter,marker){var objectPrefix=prefix==="/"?undefined:prefix;return new Promise(function(resolve,reject){s3.listObjects({Bucket:bucket,Delimiter:delimiter,Marker:marker,Prefix:objectPrefix},function(err,data){if(err){return reject(err)}var contentsList=data.Contents.map(function(item){if(objectPrefix&&item&&item.Key&&item.Key.indexOf(objectPrefix)===0){item.Key=item.Key.replace(objectPrefix,"")}return item}).filter(function(item){return item&&item.Key});if(data.IsTruncated){return listAllObjects(s3,bucket,prefix,delimiter,data.KeyMarker).then(function(contents){resolve(contentsList.concat(contents))},function(reason){reject(reason)})}return resolve(contentsList)})})}function listAllObjectsFiles(s3,bucket,prefix,delimiter,marker){var objectPrefix=prefix==="/"?undefined:prefix;return new Promise(function(resolve,reject){s3.listObjects({Bucket:bucket,Delimiter:delimiter,Marker:marker,Prefix:objectPrefix},function(err,data){if(err){return reject(err)}var fileList=data.Contents.map(contentToKey).concat(data.CommonPrefixes.map(contentPrefixesToPrefix)).map(function(item){if(objectPrefix&&item.indexOf(objectPrefix)===0){return item.replace(objectPrefix,"")}return item});if(data.IsTruncated){return listAllObjectsFiles(s3,bucket,prefix,delimiter,data.KeyMarker).then(function(files){resolve(fileList.concat(files))},function(reason){reject(reason)})}resolve(fileList.filter(whiteSpace))})})}function getObject(s3,bucket,key,options){var s3Options=extend(typeof options==="object"?options:{},{Bucket:bucket,Key:key});return new Promise(function(resolve,reject){s3.getObject(s3Options,function(err,data){if(err){return reject(err)}resolve(data)})})}function putObject(s3,bucket,key,body,options){var s3Options=extend(typeof options==="object"?options:{},{Bucket:bucket,Key:key,Body:body});return new Promise(function(resolve,reject){s3.putObject(s3Options,function(err,data){if(err){return reject(err)}resolve(data)})})}function deleteObject(s3,bucket,key){return new Promise(function(resolve,reject){s3.deleteObject({Bucket:bucket,Key:key},function(err,data){if(err){return reject(err)}resolve(data)})})}function putBucketLifecycle(s3,bucket,name,prefix,days){var options={Bucket:bucket,LifecycleConfiguration:{Rules:[{Prefix:prefix,Status:"Enabled",Expiration:{Days:days},ID:name}]}};return new Promise(function(resolve,reject){s3.putBucketLifecycle(options,function(err,data){if(err){reject(err)}else{resolve(data)}})})}module.exports=S3fs})(module,require("./fsInterface"),require("util"),require("bluebird"),require("aws-sdk"),require("./utils"),require("extend"),require("./s3WriteStream"),require("./Stats"))}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/s3fs/lib/s3fs.js","/node_modules/@mitocgroup/deep-fs/node_modules/s3fs/lib")},{"./Stats":134,"./fsInterface":135,"./s3WriteStream":136,"./utils":138,_process:1069,"aws-sdk":"aws-sdk",bluebird:139,buffer:919,extend:"extend",util:1089}],138:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){(function(module){"use strict";var splitDeviceRegExp=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;module.exports={isAbsolute:function(path){if(path[0]==="/"){return true}if(path[1]===":"&&path[2]==="\\"){return true}if(path.substring(0,2)==="\\\\"){return true}return false},normalizeArray:function(parts,allowAboveRoot){var up=0,i,last;for(i=parts.length-1;i>=0;i--){last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts},normalizePath:function(path){var result=splitDeviceRegExp.exec(path),device=result[1]||"",isAbsolute=this.isAbsolute(path),tail=result[3],trailingSlash=/[\\\/]$/.test(tail);tail=this.normalizeArray(tail.split(/[\\\/]+/).filter(function(p){return!!p}),!isAbsolute).join("/");if(tail&&trailingSlash){tail+="/"}return(device+(isAbsolute?"\\":"")+tail).replace(/[\\\/]+/g,"/")},decomposePath:function(path){var pathArray=[];return path?path.split("/").reduce(function(array,value){if(value){array.push(value)}return array},pathArray):pathArray},toKey:function(fullPath,bucket,bucketPath){var path=fullPath,bucketKeyPath;if(bucket){bucketKeyPath=this.joinPaths(bucket,bucketPath);path=fullPath.replace(bucketKeyPath,"")}return this.normalizePath(this.decomposePath(path).join("/"))},joinPaths:function(){var args=Array.prototype.slice.call(arguments);return args.reduce(function(array,path){return array.concat(this.decomposePath(path))}.bind(this),[]).join("/")}}})(module)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/s3fs/lib/utils.js","/node_modules/@mitocgroup/deep-fs/node_modules/s3fs/lib")},{_process:1069,buffer:919}],139:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{ -var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o0};Async.prototype.throwLater=function(fn,arg){if(arguments.length===1){arg=fn;fn=function(){throw arg}}if(typeof setTimeout!=="undefined"){setTimeout(function(){fn(arg)},0)}else try{this._schedule(function(){fn(arg)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}};function AsyncInvokeLater(fn,receiver,arg){this._lateQueue.push(fn,receiver,arg);this._queueTick()}function AsyncInvoke(fn,receiver,arg){this._normalQueue.push(fn,receiver,arg);this._queueTick()}function AsyncSettlePromises(promise){this._normalQueue._pushOne(promise);this._queueTick()}if(!util.hasDevTools){Async.prototype.invokeLater=AsyncInvokeLater;Async.prototype.invoke=AsyncInvoke;Async.prototype.settlePromises=AsyncSettlePromises}else{if(schedule.isStatic){schedule=function(fn){setTimeout(fn,0)}}Async.prototype.invokeLater=function(fn,receiver,arg){if(this._trampolineEnabled){AsyncInvokeLater.call(this,fn,receiver,arg)}else{this._schedule(function(){setTimeout(function(){fn.call(receiver,arg)},100)})}};Async.prototype.invoke=function(fn,receiver,arg){if(this._trampolineEnabled){AsyncInvoke.call(this,fn,receiver,arg)}else{this._schedule(function(){fn.call(receiver,arg)})}};Async.prototype.settlePromises=function(promise){if(this._trampolineEnabled){AsyncSettlePromises.call(this,promise)}else{this._schedule(function(){promise._settlePromises()})}}}Async.prototype.invokeFirst=function(fn,receiver,arg){this._normalQueue.unshift(fn,receiver,arg);this._queueTick()};Async.prototype._drainQueue=function(queue){while(queue.length()>0){var fn=queue.shift();if(typeof fn!=="function"){fn._settlePromises();continue}var receiver=queue.shift();var arg=queue.shift();fn.call(receiver,arg)}};Async.prototype._drainQueues=function(){this._drainQueue(this._normalQueue);this._reset();this._drainQueue(this._lateQueue)};Async.prototype._queueTick=function(){if(!this._isTickUsed){this._isTickUsed=true;this._schedule(this.drainQueues)}};Async.prototype._reset=function(){this._isTickUsed=false};module.exports=new Async;module.exports.firstLineError=firstLineError},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL,tryConvertToPromise){var rejectThis=function(_,e){this._reject(e)};var targetRejected=function(e,context){context.promiseRejectionQueued=true;context.bindingPromise._then(rejectThis,rejectThis,null,this,e)};var bindingResolved=function(thisArg,context){if(this._isPending()){this._resolveCallback(context.target)}};var bindingRejected=function(e,context){if(!context.promiseRejectionQueued)this._reject(e)};Promise.prototype.bind=function(thisArg){var maybePromise=tryConvertToPromise(thisArg);var ret=new Promise(INTERNAL);ret._propagateFrom(this,1);var target=this._target();ret._setBoundTo(maybePromise);if(maybePromise instanceof Promise){var context={promiseRejectionQueued:false,promise:ret,target:target,bindingPromise:maybePromise};target._then(INTERNAL,targetRejected,ret._progress,ret,context);maybePromise._then(bindingResolved,bindingRejected,ret._progress,ret,context)}else{ret._resolveCallback(target)}return ret};Promise.prototype._setBoundTo=function(obj){if(obj!==undefined){this._bitField=this._bitField|131072;this._boundTo=obj}else{this._bitField=this._bitField&~131072}};Promise.prototype._isBound=function(){return(this._bitField&131072)===131072};Promise.bind=function(thisArg,value){var maybePromise=tryConvertToPromise(thisArg);var ret=new Promise(INTERNAL);ret._setBoundTo(maybePromise);if(maybePromise instanceof Promise){maybePromise._then(function(){ret._resolveCallback(value)},ret._reject,ret._progress,ret,null)}else{ret._resolveCallback(value)}return ret}}},{}],4:[function(_dereq_,module,exports){"use strict";var old;if(typeof Promise!=="undefined")old=Promise;function noConflict(){try{if(Promise===bluebird)Promise=old}catch(e){}return bluebird}var bluebird=_dereq_("./promise.js")();bluebird.noConflict=noConflict;module.exports=bluebird},{"./promise.js":23}],5:[function(_dereq_,module,exports){"use strict";var cr=Object.create;if(cr){var callerCache=cr(null);var getterCache=cr(null);callerCache[" size"]=getterCache[" size"]=0}module.exports=function(Promise){var util=_dereq_("./util.js");var canEvaluate=util.canEvaluate;var isIdentifier=util.isIdentifier;var getMethodCaller;var getGetter;if(!true){var makeMethodCaller=function(methodName){return new Function("ensureMethod"," \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g,methodName))(ensureMethod)};var makeGetter=function(propertyName){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",propertyName))};var getCompiled=function(name,compiler,cache){var ret=cache[name];if(typeof ret!=="function"){if(!isIdentifier(name)){return null}ret=compiler(name);cache[name]=ret;cache[" size"]++;if(cache[" size"]>512){var keys=Object.keys(cache);for(var i=0;i<256;++i)delete cache[keys[i]];cache[" size"]=keys.length-256}}return ret};getMethodCaller=function(name){return getCompiled(name,makeMethodCaller,callerCache)};getGetter=function(name){return getCompiled(name,makeGetter,getterCache)}}function ensureMethod(obj,methodName){var fn;if(obj!=null)fn=obj[methodName];if(typeof fn!=="function"){var message="Object "+util.classString(obj)+" has no method '"+util.toString(methodName)+"'";throw new Promise.TypeError(message)}return fn}function caller(obj){var methodName=this.pop();var fn=ensureMethod(obj,methodName);return fn.apply(obj,this)}Promise.prototype.call=function(methodName){var $_len=arguments.length;var args=new Array($_len-1);for(var $_i=1;$_i<$_len;++$_i){args[$_i-1]=arguments[$_i]}if(!true){if(canEvaluate){var maybeCaller=getMethodCaller(methodName);if(maybeCaller!==null){return this._then(maybeCaller,undefined,undefined,args,undefined)}}}args.push(methodName);return this._then(caller,undefined,undefined,args,undefined)};function namedGetter(obj){return obj[this]}function indexedGetter(obj){var index=+this;if(index<0)index=Math.max(0,index+obj.length);return obj[index]}Promise.prototype.get=function(propertyName){var isIndex=typeof propertyName==="number";var getter;if(!isIndex){if(canEvaluate){var maybeGetter=getGetter(propertyName);getter=maybeGetter!==null?maybeGetter:namedGetter}else{getter=namedGetter}}else{getter=indexedGetter}return this._then(getter,undefined,undefined,propertyName,undefined)}}},{"./util.js":38}],6:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise){var errors=_dereq_("./errors.js");var async=_dereq_("./async.js");var CancellationError=errors.CancellationError;Promise.prototype._cancel=function(reason){if(!this.isCancellable())return this;var parent;var promiseToReject=this;while((parent=promiseToReject._cancellationParent)!==undefined&&parent.isCancellable()){promiseToReject=parent}this._unsetCancellable();promiseToReject._target()._rejectCallback(reason,false,true)};Promise.prototype.cancel=function(reason){if(!this.isCancellable())return this;if(reason===undefined)reason=new CancellationError;async.invokeLater(this._cancel,this,reason);return this};Promise.prototype.cancellable=function(){if(this._cancellable())return this;async.enableTrampoline();this._setCancellable();this._cancellationParent=undefined;return this};Promise.prototype.uncancellable=function(){var ret=this.then();ret._unsetCancellable();return ret};Promise.prototype.fork=function(didFulfill,didReject,didProgress){var ret=this._then(didFulfill,didReject,didProgress,undefined,undefined);ret._setCancellable();ret._cancellationParent=undefined;return ret}}},{"./async.js":2,"./errors.js":13}],7:[function(_dereq_,module,exports){"use strict";module.exports=function(){var async=_dereq_("./async.js");var util=_dereq_("./util.js");var bluebirdFramePattern=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/;var stackFramePattern=null;var formatStack=null;var indentStackFrames=false;var warn;function CapturedTrace(parent){this._parent=parent;var length=this._length=1+(parent===undefined?0:parent._length);captureStackTrace(this,CapturedTrace);if(length>32)this.uncycle()}util.inherits(CapturedTrace,Error);CapturedTrace.prototype.uncycle=function(){var length=this._length;if(length<2)return;var nodes=[];var stackToIndex={};for(var i=0,node=this;node!==undefined;++i){nodes.push(node);node=node._parent}length=this._length=i;for(var i=length-1;i>=0;--i){var stack=nodes[i].stack;if(stackToIndex[stack]===undefined){stackToIndex[stack]=i}}for(var i=0;i0){nodes[index-1]._parent=undefined;nodes[index-1]._length=1}nodes[i]._parent=undefined;nodes[i]._length=1;var cycleEdgeNode=i>0?nodes[i-1]:this;if(index=0;--j){nodes[j]._length=currentChildLength;currentChildLength++}return}}};CapturedTrace.prototype.parent=function(){return this._parent};CapturedTrace.prototype.hasParent=function(){return this._parent!==undefined};CapturedTrace.prototype.attachExtraTrace=function(error){if(error.__stackCleaned__)return;this.uncycle();var parsed=CapturedTrace.parseStackAndMessage(error);var message=parsed.message;var stacks=[parsed.stack];var trace=this;while(trace!==undefined){stacks.push(cleanStack(trace.stack.split("\n")));trace=trace._parent}removeCommonRoots(stacks);removeDuplicateOrEmptyJumps(stacks);util.notEnumerableProp(error,"stack",reconstructStack(message,stacks));util.notEnumerableProp(error,"__stackCleaned__",true)};function reconstructStack(message,stacks){for(var i=0;i=0;--j){if(prev[j]===currentLastLine){commonRootMeetPoint=j;break}}for(var j=commonRootMeetPoint;j>=0;--j){var line=prev[j];if(current[currentLastIndex]===line){current.pop();currentLastIndex--}else{break}}current=prev}}function cleanStack(stack){var ret=[];for(var i=0;i0){stack=stack.slice(i)}return stack}CapturedTrace.parseStackAndMessage=function(error){var stack=error.stack;var message=error.toString();stack=typeof stack==="string"&&stack.length>0?stackFramesAsArray(error):[" (No stack trace)"];return{message:message,stack:cleanStack(stack)}};CapturedTrace.formatAndLogError=function(error,title){if(typeof console!=="undefined"){var message;if(typeof error==="object"||typeof error==="function"){var stack=error.stack;message=title+formatStack(stack,error)}else{message=title+String(error)}if(typeof warn==="function"){warn(message)}else if(typeof console.log==="function"||typeof console.log==="object"){console.log(message)}}};CapturedTrace.unhandledRejection=function(reason){CapturedTrace.formatAndLogError(reason,"^--- With additional stack trace: ")};CapturedTrace.isSupported=function(){return typeof captureStackTrace==="function"};CapturedTrace.fireRejectionEvent=function(name,localHandler,reason,promise){var localEventFired=false;try{if(typeof localHandler==="function"){localEventFired=true;if(name==="rejectionHandled"){localHandler(promise)}else{localHandler(reason,promise)}}}catch(e){async.throwLater(e)}var globalEventFired=false;try{globalEventFired=fireGlobalEvent(name,reason,promise)}catch(e){globalEventFired=true;async.throwLater(e)}var domEventFired=false;if(fireDomEvent){try{domEventFired=fireDomEvent(name.toLowerCase(),{reason:reason,promise:promise})}catch(e){domEventFired=true;async.throwLater(e)}}if(!globalEventFired&&!localEventFired&&!domEventFired&&name==="unhandledRejection"){CapturedTrace.formatAndLogError(reason,"Unhandled rejection ")}};function formatNonError(obj){var str;if(typeof obj==="function"){str="[function "+(obj.name||"anonymous")+"]"}else{str=obj.toString();var ruselessToString=/\[object [a-zA-Z0-9$_]+\]/;if(ruselessToString.test(str)){try{var newStr=JSON.stringify(obj);str=newStr}catch(e){}}if(str.length===0){str="(empty array)"}}return"(<"+snip(str)+">, no stack trace)"}function snip(str){var maxChars=41;if(str.length=lastIndex){return}shouldIgnore=function(line){if(bluebirdFramePattern.test(line))return true;var info=parseLineInfo(line);if(info){if(info.fileName===firstFileName&&(firstIndex<=info.line&&info.line<=lastIndex)){return true}}return false}};var captureStackTrace=function stackDetection(){var v8stackFramePattern=/^\s*at\s*/;var v8stackFormatter=function(stack,error){if(typeof stack==="string")return stack;if(error.name!==undefined&&error.message!==undefined){return error.toString()}return formatNonError(error)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit=Error.stackTraceLimit+6;stackFramePattern=v8stackFramePattern;formatStack=v8stackFormatter;var captureStackTrace=Error.captureStackTrace;shouldIgnore=function(line){return bluebirdFramePattern.test(line)};return function(receiver,ignoreUntil){Error.stackTraceLimit=Error.stackTraceLimit+6;captureStackTrace(receiver,ignoreUntil);Error.stackTraceLimit=Error.stackTraceLimit-6}}var err=new Error;if(typeof err.stack==="string"&&err.stack.split("\n")[0].indexOf("stackDetection@")>=0){stackFramePattern=/@/;formatStack=v8stackFormatter;indentStackFrames=true;return function captureStackTrace(o){o.stack=(new Error).stack}}var hasStackAfterThrow;try{throw new Error}catch(e){hasStackAfterThrow="stack"in e}if(!("stack"in err)&&hasStackAfterThrow&&typeof Error.stackTraceLimit==="number"){stackFramePattern=v8stackFramePattern;formatStack=v8stackFormatter;return function captureStackTrace(o){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){o.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6}}formatStack=function(stack,error){if(typeof stack==="string")return stack;if((typeof error==="object"||typeof error==="function")&&error.name!==undefined&&error.message!==undefined){return error.toString()}return formatNonError(error)};return null}([]);var fireDomEvent;var fireGlobalEvent=function(){if(util.isNode){return function(name,reason,promise){if(name==="rejectionHandled"){return process.emit(name,promise)}else{return process.emit(name,reason,promise)}}}else{var customEventWorks=false;var anyEventWorks=true;try{var ev=new self.CustomEvent("test");customEventWorks=ev instanceof CustomEvent}catch(e){}if(!customEventWorks){try{var event=document.createEvent("CustomEvent");event.initCustomEvent("testingtheevent",false,true,{});self.dispatchEvent(event)}catch(e){anyEventWorks=false}}if(anyEventWorks){fireDomEvent=function(type,detail){var event;if(customEventWorks){event=new self.CustomEvent(type,{detail:detail,bubbles:false,cancelable:true})}else if(self.dispatchEvent){event=document.createEvent("CustomEvent");event.initCustomEvent(type,false,true,detail)}return event?!self.dispatchEvent(event):false}}var toWindowMethodNameMap={};toWindowMethodNameMap["unhandledRejection"]=("on"+"unhandledRejection").toLowerCase();toWindowMethodNameMap["rejectionHandled"]=("on"+"rejectionHandled").toLowerCase();return function(name,reason,promise){var methodName=toWindowMethodNameMap[name];var method=self[methodName];if(!method)return false;if(name==="rejectionHandled"){method.call(self,promise)}else{method.call(self,reason,promise)}return true}}}();if(typeof console!=="undefined"&&typeof console.warn!=="undefined"){warn=function(message){console.warn(message)};if(util.isNode&&process.stderr.isTTY){warn=function(message){process.stderr.write(""+message+"\n")}}else if(!util.isNode&&typeof(new Error).stack==="string"){warn=function(message){console.warn("%c"+message,"color: red")}}}return CapturedTrace}},{"./async.js":2,"./util.js":38}],8:[function(_dereq_,module,exports){"use strict";module.exports=function(NEXT_FILTER){var util=_dereq_("./util.js");var errors=_dereq_("./errors.js");var tryCatch=util.tryCatch;var errorObj=util.errorObj;var keys=_dereq_("./es5.js").keys;var TypeError=errors.TypeError;function CatchFilter(instances,callback,promise){this._instances=instances;this._callback=callback;this._promise=promise}function safePredicate(predicate,e){var safeObject={};var retfilter=tryCatch(predicate).call(safeObject,e);if(retfilter===errorObj)return retfilter;var safeKeys=keys(safeObject);if(safeKeys.length){errorObj.e=new TypeError("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n");return errorObj}return retfilter}CatchFilter.prototype.doFilter=function(e){var cb=this._callback;var promise=this._promise;var boundTo=promise._boundValue();for(var i=0,len=this._instances.length;i=0){return contextStack[lastIndex]}return undefined}Promise.prototype._peekContext=peekContext;Promise.prototype._pushContext=Context.prototype._pushContext;Promise.prototype._popContext=Context.prototype._popContext;return createContext}},{}],10:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,CapturedTrace){var getDomain=Promise._getDomain;var async=_dereq_("./async.js");var Warning=_dereq_("./errors.js").Warning;var util=_dereq_("./util.js");var canAttachTrace=util.canAttachTrace;var unhandledRejectionHandled;var possiblyUnhandledRejection;var debugging=false||util.isNode&&(!!process.env["BLUEBIRD_DEBUG"]||process.env["NODE_ENV"]==="development");if(debugging){async.disableTrampolineIfNecessary()}Promise.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled();this._bitField=this._bitField|16777216};Promise.prototype._ensurePossibleRejectionHandled=function(){if((this._bitField&16777216)!==0)return;this._setRejectionIsUnhandled();async.invokeLater(this._notifyUnhandledRejection,this,undefined)};Promise.prototype._notifyUnhandledRejectionIsHandled=function(){CapturedTrace.fireRejectionEvent("rejectionHandled",unhandledRejectionHandled,undefined,this)};Promise.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var reason=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified();CapturedTrace.fireRejectionEvent("unhandledRejection",possiblyUnhandledRejection,reason,this)}};Promise.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=this._bitField|524288};Promise.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&~524288};Promise.prototype._isUnhandledRejectionNotified=function(){return(this._bitField&524288)>0};Promise.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|2097152};Promise.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&~2097152;if(this._isUnhandledRejectionNotified()){this._unsetUnhandledRejectionIsNotified();this._notifyUnhandledRejectionIsHandled()}};Promise.prototype._isRejectionUnhandled=function(){return(this._bitField&2097152)>0};Promise.prototype._setCarriedStackTrace=function(capturedTrace){this._bitField=this._bitField|1048576;this._fulfillmentHandler0=capturedTrace};Promise.prototype._isCarryingStackTrace=function(){return(this._bitField&1048576)>0};Promise.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:undefined};Promise.prototype._captureStackTrace=function(){if(debugging){this._trace=new CapturedTrace(this._peekContext())}return this};Promise.prototype._attachExtraTrace=function(error,ignoreSelf){if(debugging&&canAttachTrace(error)){var trace=this._trace;if(trace!==undefined){if(ignoreSelf)trace=trace._parent}if(trace!==undefined){trace.attachExtraTrace(error)}else if(!error.__stackCleaned__){var parsed=CapturedTrace.parseStackAndMessage(error);util.notEnumerableProp(error,"stack",parsed.message+"\n"+parsed.stack.join("\n"));util.notEnumerableProp(error,"__stackCleaned__",true)}}};Promise.prototype._warn=function(message){var warning=new Warning(message);var ctx=this._peekContext();if(ctx){ctx.attachExtraTrace(warning)}else{var parsed=CapturedTrace.parseStackAndMessage(warning);warning.stack=parsed.message+"\n"+parsed.stack.join("\n")}CapturedTrace.formatAndLogError(warning,"")};Promise.onPossiblyUnhandledRejection=function(fn){var domain=getDomain();possiblyUnhandledRejection=typeof fn==="function"?domain===null?fn:domain.bind(fn):undefined};Promise.onUnhandledRejectionHandled=function(fn){var domain=getDomain();unhandledRejectionHandled=typeof fn==="function"?domain===null?fn:domain.bind(fn):undefined};Promise.longStackTraces=function(){if(async.haveItemsQueued()&&debugging===false){throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n")}debugging=CapturedTrace.isSupported();if(debugging){async.disableTrampolineIfNecessary()}};Promise.hasLongStackTraces=function(){return debugging&&CapturedTrace.isSupported()};if(!CapturedTrace.isSupported()){Promise.longStackTraces=function(){};debugging=false}return function(){return debugging}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(_dereq_,module,exports){"use strict";var util=_dereq_("./util.js");var isPrimitive=util.isPrimitive;module.exports=function(Promise){var returner=function(){return this};var thrower=function(){throw this};var returnUndefined=function(){};var throwUndefined=function(){throw undefined};var wrapper=function(value,action){if(action===1){return function(){throw value}}else if(action===2){return function(){return value}}};Promise.prototype["return"]=Promise.prototype.thenReturn=function(value){if(value===undefined)return this.then(returnUndefined);if(isPrimitive(value)){return this._then(wrapper(value,2),undefined,undefined,undefined,undefined)}return this._then(returner,undefined,undefined,value,undefined)};Promise.prototype["throw"]=Promise.prototype.thenThrow=function(reason){if(reason===undefined)return this.then(throwUndefined);if(isPrimitive(reason)){return this._then(wrapper(reason,1),undefined,undefined,undefined,undefined)}return this._then(thrower,undefined,undefined,reason,undefined)}}},{"./util.js":38}],12:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var PromiseReduce=Promise.reduce;Promise.prototype.each=function(fn){return PromiseReduce(this,fn,null,INTERNAL)};Promise.each=function(promises,fn){return PromiseReduce(promises,fn,null,INTERNAL)}}},{}],13:[function(_dereq_,module,exports){"use strict";var es5=_dereq_("./es5.js");var Objectfreeze=es5.freeze;var util=_dereq_("./util.js");var inherits=util.inherits;var notEnumerableProp=util.notEnumerableProp;function subError(nameProperty,defaultMessage){function SubError(message){if(!(this instanceof SubError))return new SubError(message);notEnumerableProp(this,"message",typeof message==="string"?message:defaultMessage);notEnumerableProp(this,"name",nameProperty);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{Error.call(this)}}inherits(SubError,Error);return SubError}var _TypeError,_RangeError;var Warning=subError("Warning","warning");var CancellationError=subError("CancellationError","cancellation error");var TimeoutError=subError("TimeoutError","timeout error");var AggregateError=subError("AggregateError","aggregate error");try{_TypeError=TypeError;_RangeError=RangeError}catch(e){_TypeError=subError("TypeError","type error");_RangeError=subError("RangeError","range error")}var methods=("join pop push shift unshift slice filter forEach some "+"every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");for(var i=0;i=total){var handler=this.callers[total];promise._pushContext();var ret=tryCatch(handler)(this);promise._popContext();if(ret===errorObj){promise._rejectCallback(ret.e,false,true)}else{promise._resolveCallback(ret)}}else{this.now=now}};var reject=function(reason){this._reject(reason)}}}Promise.join=function(){var last=arguments.length-1;var fn;if(last>0&&typeof arguments[last]==="function"){fn=arguments[last];if(!true){if(last<6&&canEvaluate){var ret=new Promise(INTERNAL);ret._captureStackTrace();var holder=new Holder(last,fn);var callbacks=thenCallbacks;for(var i=0;i=1?[]:EMPTY_ARRAY;async.invoke(init,this,undefined)}util.inherits(MappingPromiseArray,PromiseArray);function init(){this._init$(undefined,-2)}MappingPromiseArray.prototype._init=function(){};MappingPromiseArray.prototype._promiseFulfilled=function(value,index){var values=this._values;var length=this.length();var preservedValues=this._preservedValues;var limit=this._limit;if(values[index]===PENDING){values[index]=value;if(limit>=1){this._inFlight--;this._drainQueue();if(this._isResolved())return}}else{if(limit>=1&&this._inFlight>=limit){values[index]=value;this._queue.push(index);return}if(preservedValues!==null)preservedValues[index]=value;var callback=this._callback;var receiver=this._promise._boundValue();this._promise._pushContext();var ret=tryCatch(callback).call(receiver,value,index,length);this._promise._popContext();if(ret===errorObj)return this._reject(ret.e);var maybePromise=tryConvertToPromise(ret,this._promise);if(maybePromise instanceof Promise){maybePromise=maybePromise._target();if(maybePromise._isPending()){if(limit>=1)this._inFlight++;values[index]=PENDING;return maybePromise._proxyPromiseArray(this,index)}else if(maybePromise._isFulfilled()){ret=maybePromise._value()}else{return this._reject(maybePromise._reason())}}values[index]=ret}var totalResolved=++this._totalResolved;if(totalResolved>=length){if(preservedValues!==null){this._filter(values,preservedValues)}else{this._resolve(values)}}};MappingPromiseArray.prototype._drainQueue=function(){var queue=this._queue;var limit=this._limit;var values=this._values;while(queue.length>0&&this._inFlight=1?limit:0;return new MappingPromiseArray(promises,fn,limit,_filter)}Promise.prototype.map=function(fn,options){if(typeof fn!=="function")return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");return map(this,fn,options,null).promise()};Promise.map=function(promises,fn,options,_filter){if(typeof fn!=="function")return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");return map(promises,fn,options,_filter).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL,tryConvertToPromise,apiRejection){var util=_dereq_("./util.js");var tryCatch=util.tryCatch;Promise.method=function(fn){if(typeof fn!=="function"){throw new Promise.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n")}return function(){var ret=new Promise(INTERNAL);ret._captureStackTrace();ret._pushContext();var value=tryCatch(fn).apply(this,arguments);ret._popContext();ret._resolveFromSyncValue(value);return ret}};Promise.attempt=Promise["try"]=function(fn,args,ctx){if(typeof fn!=="function"){return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n")}var ret=new Promise(INTERNAL);ret._captureStackTrace();ret._pushContext();var value=util.isArray(args)?tryCatch(fn).apply(ctx,args):tryCatch(fn).call(ctx,args);ret._popContext();ret._resolveFromSyncValue(value);return ret};Promise.prototype._resolveFromSyncValue=function(value){if(value===util.errorObj){this._rejectCallback(value.e,false,true)}else{this._resolveCallback(value,true)}}}},{"./util.js":38}],21:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise){var util=_dereq_("./util.js");var async=_dereq_("./async.js");var tryCatch=util.tryCatch;var errorObj=util.errorObj;function spreadAdapter(val,nodeback){var promise=this;if(!util.isArray(val))return successAdapter.call(promise,val,nodeback);var ret=tryCatch(nodeback).apply(promise._boundValue(),[null].concat(val));if(ret===errorObj){async.throwLater(ret.e)}}function successAdapter(val,nodeback){var promise=this;var receiver=promise._boundValue();var ret=val===undefined?tryCatch(nodeback).call(receiver,null):tryCatch(nodeback).call(receiver,null,val);if(ret===errorObj){async.throwLater(ret.e)}}function errorAdapter(reason,nodeback){var promise=this;if(!reason){var target=promise._target();var newReason=target._getCarriedStackTrace();newReason.cause=reason;reason=newReason}var ret=tryCatch(nodeback).call(promise._boundValue(),reason);if(ret===errorObj){async.throwLater(ret.e)}}Promise.prototype.asCallback=Promise.prototype.nodeify=function(nodeback,options){if(typeof nodeback=="function"){var adapter=successAdapter;if(options!==undefined&&Object(options).spread){adapter=spreadAdapter}this._then(adapter,errorAdapter,undefined,this,nodeback)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,PromiseArray){var util=_dereq_("./util.js");var async=_dereq_("./async.js");var tryCatch=util.tryCatch;var errorObj=util.errorObj;Promise.prototype.progressed=function(handler){return this._then(undefined,undefined,handler,undefined,undefined)};Promise.prototype._progress=function(progressValue){if(this._isFollowingOrFulfilledOrRejected())return;this._target()._progressUnchecked(progressValue)};Promise.prototype._progressHandlerAt=function(index){return index===0?this._progressHandler0:this[(index<<2)+index-5+2]};Promise.prototype._doProgressWith=function(progression){var progressValue=progression.value;var handler=progression.handler;var promise=progression.promise;var receiver=progression.receiver;var ret=tryCatch(handler).call(receiver,progressValue);if(ret===errorObj){if(ret.e!=null&&ret.e.name!=="StopProgressPropagation"){var trace=util.canAttachTrace(ret.e)?ret.e:new Error(util.toString(ret.e));promise._attachExtraTrace(trace);promise._progress(ret.e)}}else if(ret instanceof Promise){ret._then(promise._progress,null,null,promise,undefined)}else{promise._progress(ret)}};Promise.prototype._progressUnchecked=function(progressValue){var len=this._length();var progress=this._progress;for(var i=0;i1){var catchInstances=new Array(len-1),j=0,i;for(i=0;i0&&typeof didFulfill!=="function"&&typeof didReject!=="function"){var msg=".then() only accepts functions but was passed: "+util.classString(didFulfill);if(arguments.length>1){msg+=", "+util.classString(didReject)}this._warn(msg)}return this._then(didFulfill,didReject,didProgress,undefined,undefined)};Promise.prototype.done=function(didFulfill,didReject,didProgress){var promise=this._then(didFulfill,didReject,didProgress,undefined,undefined);promise._setIsFinal()};Promise.prototype.spread=function(didFulfill,didReject){return this.all()._then(didFulfill,didReject,undefined,APPLY,undefined)};Promise.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()};Promise.prototype.toJSON=function(){var ret={isFulfilled:false,isRejected:false,fulfillmentValue:undefined,rejectionReason:undefined};if(this.isFulfilled()){ret.fulfillmentValue=this.value();ret.isFulfilled=true}else if(this.isRejected()){ret.rejectionReason=this.reason();ret.isRejected=true}return ret};Promise.prototype.all=function(){return new PromiseArray(this).promise()};Promise.prototype.error=function(fn){return this.caught(util.originatesFromRejection,fn)};Promise.is=function(val){return val instanceof Promise};Promise.fromNode=function(fn){var ret=new Promise(INTERNAL);var result=tryCatch(fn)(nodebackForPromise(ret));if(result===errorObj){ret._rejectCallback(result.e,true,true)}return ret};Promise.all=function(promises){return new PromiseArray(promises).promise()};Promise.defer=Promise.pending=function(){var promise=new Promise(INTERNAL);return new PromiseResolver(promise)};Promise.cast=function(obj){var ret=tryConvertToPromise(obj);if(!(ret instanceof Promise)){var val=ret;ret=new Promise(INTERNAL);ret._fulfillUnchecked(val)}return ret};Promise.resolve=Promise.fulfilled=Promise.cast;Promise.reject=Promise.rejected=function(reason){var ret=new Promise(INTERNAL);ret._captureStackTrace();ret._rejectCallback(reason,true);return ret};Promise.setScheduler=function(fn){if(typeof fn!=="function")throw new TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");var prev=async._schedule;async._schedule=fn;return prev};Promise.prototype._then=function(didFulfill,didReject,didProgress,receiver,internalData){var haveInternalData=internalData!==undefined;var ret=haveInternalData?internalData:new Promise(INTERNAL);if(!haveInternalData){ret._propagateFrom(this,4|1);ret._captureStackTrace()}var target=this._target();if(target!==this){if(receiver===undefined)receiver=this._boundTo;if(!haveInternalData)ret._setIsMigrated()}var callbackIndex=target._addCallbacks(didFulfill,didReject,didProgress,ret,receiver,getDomain());if(target._isResolved()&&!target._isSettlePromisesQueued()){async.invoke(target._settlePromiseAtPostResolution,target,callbackIndex)}return ret};Promise.prototype._settlePromiseAtPostResolution=function(index){if(this._isRejectionUnhandled())this._unsetRejectionIsUnhandled();this._settlePromiseAt(index)};Promise.prototype._length=function(){return this._bitField&131071};Promise.prototype._isFollowingOrFulfilledOrRejected=function(){return(this._bitField&939524096)>0};Promise.prototype._isFollowing=function(){return(this._bitField&536870912)===536870912};Promise.prototype._setLength=function(len){this._bitField=this._bitField&-131072|len&131071};Promise.prototype._setFulfilled=function(){this._bitField=this._bitField|268435456};Promise.prototype._setRejected=function(){this._bitField=this._bitField|134217728};Promise.prototype._setFollowing=function(){this._bitField=this._bitField|536870912};Promise.prototype._setIsFinal=function(){this._bitField=this._bitField|33554432};Promise.prototype._isFinal=function(){return(this._bitField&33554432)>0};Promise.prototype._cancellable=function(){return(this._bitField&67108864)>0};Promise.prototype._setCancellable=function(){this._bitField=this._bitField|67108864};Promise.prototype._unsetCancellable=function(){this._bitField=this._bitField&~67108864};Promise.prototype._setIsMigrated=function(){this._bitField=this._bitField|4194304};Promise.prototype._unsetIsMigrated=function(){this._bitField=this._bitField&~4194304};Promise.prototype._isMigrated=function(){return(this._bitField&4194304)>0};Promise.prototype._receiverAt=function(index){var ret=index===0?this._receiver0:this[index*5-5+4];if(ret===undefined&&this._isBound()){return this._boundValue()}return ret};Promise.prototype._promiseAt=function(index){return index===0?this._promise0:this[index*5-5+3]};Promise.prototype._fulfillmentHandlerAt=function(index){return index===0?this._fulfillmentHandler0:this[index*5-5+0]};Promise.prototype._rejectionHandlerAt=function(index){return index===0?this._rejectionHandler0:this[index*5-5+1]};Promise.prototype._boundValue=function(){var ret=this._boundTo;if(ret!==undefined){if(ret instanceof Promise){if(ret.isFulfilled()){return ret.value()}else{return undefined}}}return ret};Promise.prototype._migrateCallbacks=function(follower,index){var fulfill=follower._fulfillmentHandlerAt(index);var reject=follower._rejectionHandlerAt(index);var progress=follower._progressHandlerAt(index);var promise=follower._promiseAt(index);var receiver=follower._receiverAt(index);if(promise instanceof Promise)promise._setIsMigrated();this._addCallbacks(fulfill,reject,progress,promise,receiver,null)};Promise.prototype._addCallbacks=function(fulfill,reject,progress,promise,receiver,domain){var index=this._length();if(index>=131071-5){index=0;this._setLength(0)}if(index===0){this._promise0=promise;if(receiver!==undefined)this._receiver0=receiver;if(typeof fulfill==="function"&&!this._isCarryingStackTrace()){this._fulfillmentHandler0=domain===null?fulfill:domain.bind(fulfill)}if(typeof reject==="function"){this._rejectionHandler0=domain===null?reject:domain.bind(reject)}if(typeof progress==="function"){this._progressHandler0=domain===null?progress:domain.bind(progress)}}else{var base=index*5-5;this[base+3]=promise;this[base+4]=receiver;if(typeof fulfill==="function"){this[base+0]=domain===null?fulfill:domain.bind(fulfill)}if(typeof reject==="function"){this[base+1]=domain===null?reject:domain.bind(reject)}if(typeof progress==="function"){this[base+2]=domain===null?progress:domain.bind(progress)}}this._setLength(index+1);return index};Promise.prototype._setProxyHandlers=function(receiver,promiseSlotValue){var index=this._length();if(index>=131071-5){index=0;this._setLength(0)}if(index===0){this._promise0=promiseSlotValue;this._receiver0=receiver}else{var base=index*5-5;this[base+3]=promiseSlotValue;this[base+4]=receiver}this._setLength(index+1)};Promise.prototype._proxyPromiseArray=function(promiseArray,index){this._setProxyHandlers(promiseArray,index)};Promise.prototype._resolveCallback=function(value,shouldBind){if(this._isFollowingOrFulfilledOrRejected())return;if(value===this)return this._rejectCallback(makeSelfResolutionError(),false,true);var maybePromise=tryConvertToPromise(value,this);if(!(maybePromise instanceof Promise))return this._fulfill(value);var propagationFlags=1|(shouldBind?4:0);this._propagateFrom(maybePromise,propagationFlags);var promise=maybePromise._target();if(promise._isPending()){var len=this._length();for(var i=0;i0&&parent._cancellable()){this._setCancellable();this._cancellationParent=parent}if((flags&4)>0&&parent._isBound()){this._setBoundTo(parent._boundTo)}};Promise.prototype._fulfill=function(value){if(this._isFollowingOrFulfilledOrRejected())return;this._fulfillUnchecked(value)};Promise.prototype._reject=function(reason,carriedStackTrace){if(this._isFollowingOrFulfilledOrRejected())return;this._rejectUnchecked(reason,carriedStackTrace)};Promise.prototype._settlePromiseAt=function(index){var promise=this._promiseAt(index);var isPromise=promise instanceof Promise;if(isPromise&&promise._isMigrated()){promise._unsetIsMigrated();return async.invoke(this._settlePromiseAt,this,index)}var handler=this._isFulfilled()?this._fulfillmentHandlerAt(index):this._rejectionHandlerAt(index);var carriedStackTrace=this._isCarryingStackTrace()?this._getCarriedStackTrace():undefined;var value=this._settledValue;var receiver=this._receiverAt(index);this._clearCallbackDataAtIndex(index);if(typeof handler==="function"){if(!isPromise){handler.call(receiver,value,promise)}else{this._settlePromiseFromHandler(handler,receiver,value,promise)}}else if(receiver instanceof PromiseArray){if(!receiver._isResolved()){if(this._isFulfilled()){receiver._promiseFulfilled(value,promise)}else{receiver._promiseRejected(value,promise)}}}else if(isPromise){if(this._isFulfilled()){promise._fulfill(value)}else{promise._reject(value,carriedStackTrace)}}if(index>=4&&(index&31)===4)async.invokeLater(this._setLength,this,0)};Promise.prototype._clearCallbackDataAtIndex=function(index){if(index===0){if(!this._isCarryingStackTrace()){this._fulfillmentHandler0=undefined}this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=undefined}else{var base=index*5-5;this[base+3]=this[base+4]=this[base+0]=this[base+1]=this[base+2]=undefined}};Promise.prototype._isSettlePromisesQueued=function(){return(this._bitField&-1073741824)===-1073741824};Promise.prototype._setSettlePromisesQueued=function(){this._bitField=this._bitField|-1073741824};Promise.prototype._unsetSettlePromisesQueued=function(){this._bitField=this._bitField&~-1073741824};Promise.prototype._queueSettlePromises=function(){async.settlePromises(this);this._setSettlePromisesQueued()};Promise.prototype._fulfillUnchecked=function(value){if(value===this){var err=makeSelfResolutionError();this._attachExtraTrace(err);return this._rejectUnchecked(err,undefined)}this._setFulfilled();this._settledValue=value;this._cleanValues();if(this._length()>0){this._queueSettlePromises()}};Promise.prototype._rejectUncheckedCheckError=function(reason){var trace=util.ensureErrorObject(reason);this._rejectUnchecked(reason,trace===reason?undefined:trace); -};Promise.prototype._rejectUnchecked=function(reason,trace){if(reason===this){var err=makeSelfResolutionError();this._attachExtraTrace(err);return this._rejectUnchecked(err)}this._setRejected();this._settledValue=reason;this._cleanValues();if(this._isFinal()){async.throwLater(function(e){if("stack"in e){async.invokeFirst(CapturedTrace.unhandledRejection,undefined,e)}throw e},trace===undefined?reason:trace);return}if(trace!==undefined&&trace!==reason){this._setCarriedStackTrace(trace)}if(this._length()>0){this._queueSettlePromises()}else{this._ensurePossibleRejectionHandled()}};Promise.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();var len=this._length();for(var i=0;i=this._length){this._resolve(this._values)}};PromiseArray.prototype._promiseRejected=function(reason,index){this._totalResolved++;this._reject(reason)};PromiseArray.prototype.shouldCopyValues=function(){return true};PromiseArray.prototype.getActualLength=function(len){return len};return PromiseArray}},{"./util.js":38}],25:[function(_dereq_,module,exports){"use strict";var util=_dereq_("./util.js");var maybeWrapAsError=util.maybeWrapAsError;var errors=_dereq_("./errors.js");var TimeoutError=errors.TimeoutError;var OperationalError=errors.OperationalError;var haveGetters=util.haveGetters;var es5=_dereq_("./es5.js");function isUntypedError(obj){return obj instanceof Error&&es5.getPrototypeOf(obj)===Error.prototype}var rErrorKey=/^(?:name|message|stack|cause)$/;function wrapAsOperationalError(obj){var ret;if(isUntypedError(obj)){ret=new OperationalError(obj);ret.name=obj.name;ret.message=obj.message;ret.stack=obj.stack;var keys=es5.keys(obj);for(var i=0;i2){var $_len=arguments.length;var args=new Array($_len-1);for(var $_i=1;$_i<$_len;++$_i){args[$_i-1]=arguments[$_i]}promise._fulfill(args)}else{promise._fulfill(value)}promise=null}}var PromiseResolver;if(!haveGetters){PromiseResolver=function(promise){this.promise=promise;this.asCallback=nodebackForPromise(promise);this.callback=this.asCallback}}else{PromiseResolver=function(promise){this.promise=promise}}if(haveGetters){var prop={get:function(){return nodebackForPromise(this.promise)}};es5.defineProperty(PromiseResolver.prototype,"asCallback",prop);es5.defineProperty(PromiseResolver.prototype,"callback",prop)}PromiseResolver._nodebackForPromise=nodebackForPromise;PromiseResolver.prototype.toString=function(){return"[object PromiseResolver]"};PromiseResolver.prototype.resolve=PromiseResolver.prototype.fulfill=function(value){if(!(this instanceof PromiseResolver)){throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n")}this.promise._resolveCallback(value)};PromiseResolver.prototype.reject=function(reason){if(!(this instanceof PromiseResolver)){throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n")}this.promise._rejectCallback(reason)};PromiseResolver.prototype.progress=function(value){if(!(this instanceof PromiseResolver)){throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n")}this.promise._progress(value)};PromiseResolver.prototype.cancel=function(err){this.promise.cancel(err)};PromiseResolver.prototype.timeout=function(){this.reject(new TimeoutError("timeout"))};PromiseResolver.prototype.isResolved=function(){return this.promise.isResolved()};PromiseResolver.prototype.toJSON=function(){return this.promise.toJSON()};module.exports=PromiseResolver},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var THIS={};var util=_dereq_("./util.js");var nodebackForPromise=_dereq_("./promise_resolver.js")._nodebackForPromise;var withAppended=util.withAppended;var maybeWrapAsError=util.maybeWrapAsError;var canEvaluate=util.canEvaluate;var TypeError=_dereq_("./errors").TypeError;var defaultSuffix="Async";var defaultPromisified={__isPromisified__:true};var noCopyProps=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"];var noCopyPropsPattern=new RegExp("^(?:"+noCopyProps.join("|")+")$");var defaultFilter=function(name){return util.isIdentifier(name)&&name.charAt(0)!=="_"&&name!=="constructor"};function propsFilter(key){return!noCopyPropsPattern.test(key)}function isPromisified(fn){try{return fn.__isPromisified__===true}catch(e){return false}}function hasPromisified(obj,key,suffix){var val=util.getDataPropertyOrDefault(obj,key+suffix,defaultPromisified);return val?isPromisified(val):false}function checkValid(ret,suffix,suffixRegexp){for(var i=0;i=min;--i){ret.push(i)}for(var i=likelyArgumentCount+1;i<=3;++i){ret.push(i)}return ret};var argumentSequence=function(argumentCount){return util.filledRange(argumentCount,"_arg","")};var parameterDeclaration=function(parameterCount){return util.filledRange(Math.max(parameterCount,3),"_arg","")};var parameterCount=function(fn){if(typeof fn.length==="number"){return Math.max(Math.min(fn.length,1023+1),0)}return 0};makeNodePromisifiedEval=function(callback,receiver,originalName,fn){var newParameterCount=Math.max(0,parameterCount(fn)-1);var argumentOrder=switchCaseArgumentOrder(newParameterCount);var shouldProxyThis=typeof callback==="string"||receiver===THIS;function generateCallForArgumentCount(count){var args=argumentSequence(count).join(", ");var comma=count>0?", ":"";var ret;if(shouldProxyThis){ret="ret = callback.call(this, {{args}}, nodeback); break;\n"}else{ret=receiver===undefined?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n"}return ret.replace("{{args}}",args).replace(", ",comma)}function generateArgumentSwitchCase(){var ret="";for(var i=0;i=this._length){var val={};var keyOffset=this.length();for(var i=0,len=this.length();i>1};function props(promises){var ret;var castValue=tryConvertToPromise(promises);if(!isObject(castValue)){return apiRejection("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}else if(castValue instanceof Promise){ret=castValue._then(Promise.props,undefined,undefined,undefined,undefined)}else{ret=new PropertiesPromiseArray(castValue).promise()}if(castValue instanceof Promise){ret._propagateFrom(castValue,4)}return ret}Promise.prototype.props=function(){return props(this)};Promise.props=function(promises){return props(promises)}}},{"./es5.js":14,"./util.js":38}],28:[function(_dereq_,module,exports){"use strict";function arrayMove(src,srcIndex,dst,dstIndex,len){for(var j=0;j=this._length){this._resolve(this._values)}};SettledPromiseArray.prototype._promiseFulfilled=function(value,index){var ret=new PromiseInspection;ret._bitField=268435456;ret._settledValue=value;this._promiseResolved(index,ret)};SettledPromiseArray.prototype._promiseRejected=function(reason,index){var ret=new PromiseInspection;ret._bitField=134217728;ret._settledValue=reason;this._promiseResolved(index,ret)};Promise.settle=function(promises){return new SettledPromiseArray(promises).promise()};Promise.prototype.settle=function(){return new SettledPromiseArray(this).promise()}}},{"./util.js":38}],33:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,PromiseArray,apiRejection){var util=_dereq_("./util.js");var RangeError=_dereq_("./errors.js").RangeError;var AggregateError=_dereq_("./errors.js").AggregateError;var isArray=util.isArray;function SomePromiseArray(values){this.constructor$(values);this._howMany=0;this._unwrap=false;this._initialized=false}util.inherits(SomePromiseArray,PromiseArray);SomePromiseArray.prototype._init=function(){if(!this._initialized){return}if(this._howMany===0){this._resolve([]);return}this._init$(undefined,-5);var isArrayResolved=isArray(this._values);if(!this._isResolved()&&isArrayResolved&&this._howMany>this._canPossiblyFulfill()){this._reject(this._getRangeError(this.length()))}};SomePromiseArray.prototype.init=function(){this._initialized=true;this._init()};SomePromiseArray.prototype.setUnwrap=function(){this._unwrap=true};SomePromiseArray.prototype.howMany=function(){return this._howMany};SomePromiseArray.prototype.setHowMany=function(count){this._howMany=count};SomePromiseArray.prototype._promiseFulfilled=function(value){this._addFulfilled(value);if(this._fulfilled()===this.howMany()){this._values.length=this.howMany();if(this.howMany()===1&&this._unwrap){this._resolve(this._values[0])}else{this._resolve(this._values)}}};SomePromiseArray.prototype._promiseRejected=function(reason){this._addRejected(reason);if(this.howMany()>this._canPossiblyFulfill()){var e=new AggregateError;for(var i=this.length();i0};PromiseInspection.prototype.isRejected=Promise.prototype._isRejected=function(){return(this._bitField&134217728)>0};PromiseInspection.prototype.isPending=Promise.prototype._isPending=function(){return(this._bitField&402653184)===0};PromiseInspection.prototype.isResolved=Promise.prototype._isResolved=function(){return(this._bitField&402653184)>0};Promise.prototype.isPending=function(){return this._target()._isPending()};Promise.prototype.isRejected=function(){return this._target()._isRejected()};Promise.prototype.isFulfilled=function(){return this._target()._isFulfilled()};Promise.prototype.isResolved=function(){return this._target()._isResolved()};Promise.prototype._value=function(){return this._settledValue};Promise.prototype._reason=function(){this._unsetRejectionIsUnhandled();return this._settledValue};Promise.prototype.value=function(){var target=this._target();if(!target.isFulfilled()){throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n")}return target._settledValue};Promise.prototype.reason=function(){var target=this._target();if(!target.isRejected()){throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n")}target._unsetRejectionIsUnhandled();return target._settledValue};Promise.PromiseInspection=PromiseInspection}},{}],35:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var util=_dereq_("./util.js");var errorObj=util.errorObj;var isObject=util.isObject;function tryConvertToPromise(obj,context){if(isObject(obj)){if(obj instanceof Promise){return obj}else if(isAnyBluebirdPromise(obj)){var ret=new Promise(INTERNAL);obj._then(ret._fulfillUnchecked,ret._rejectUncheckedCheckError,ret._progressUnchecked,ret,null);return ret}var then=util.tryCatch(getThen)(obj);if(then===errorObj){if(context)context._pushContext();var ret=Promise.reject(then.e);if(context)context._popContext();return ret}else if(typeof then==="function"){return doThenable(obj,then,context)}}return obj}function getThen(obj){return obj.then}var hasProp={}.hasOwnProperty;function isAnyBluebirdPromise(obj){return hasProp.call(obj,"_promise0")}function doThenable(x,then,context){var promise=new Promise(INTERNAL);var ret=promise;if(context)context._pushContext();promise._captureStackTrace();if(context)context._popContext();var synchronous=true;var result=util.tryCatch(then).call(x,resolveFromThenable,rejectFromThenable,progressFromThenable);synchronous=false;if(promise&&result===errorObj){promise._rejectCallback(result.e,true,true);promise=null}function resolveFromThenable(value){if(!promise)return;promise._resolveCallback(value);promise=null}function rejectFromThenable(reason){if(!promise)return;promise._rejectCallback(reason,synchronous,true);promise=null}function progressFromThenable(value){if(!promise)return;if(typeof promise._progress==="function"){promise._progress(value)}}return ret}return tryConvertToPromise}},{"./util.js":38}],36:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var util=_dereq_("./util.js");var TimeoutError=Promise.TimeoutError;var afterTimeout=function(promise,message){if(!promise.isPending())return;if(typeof message!=="string"){message="operation timed out"}var err=new TimeoutError(message);util.markAsOriginatingFromRejection(err);promise._attachExtraTrace(err);promise._cancel(err)};var afterValue=function(value){return delay(+this).thenReturn(value)};var delay=Promise.delay=function(value,ms){if(ms===undefined){ms=value;value=undefined;var ret=new Promise(INTERNAL);setTimeout(function(){ret._fulfill()},ms);return ret}ms=+ms;return Promise.resolve(value)._then(afterValue,null,null,ms,undefined)};Promise.prototype.delay=function(ms){return delay(this,ms)};function successClear(value){var handle=this;if(handle instanceof Number)handle=+handle;clearTimeout(handle);return value}function failureClear(reason){var handle=this;if(handle instanceof Number)handle=+handle;clearTimeout(handle);throw reason}Promise.prototype.timeout=function(ms,message){ms=+ms;var ret=this.then().cancellable();ret._cancellationParent=this;var handle=setTimeout(function timeoutTimeout(){afterTimeout(ret,message)},ms);return ret._then(successClear,failureClear,undefined,handle,undefined)}}},{"./util.js":38}],37:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,apiRejection,tryConvertToPromise,createContext){var TypeError=_dereq_("./errors.js").TypeError;var inherits=_dereq_("./util.js").inherits;var PromiseInspection=Promise.PromiseInspection;function inspectionMapper(inspections){var len=inspections.length;for(var i=0;i=len)return ret.resolve();var maybePromise=castPreservingDisposable(resources[i++]);if(maybePromise instanceof Promise&&maybePromise._isDisposable()){try{maybePromise=tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection),resources.promise)}catch(e){return thrower(e)}if(maybePromise instanceof Promise){return maybePromise._then(iterator,thrower,null,null,null)}}iterator()}iterator();return ret.promise}function disposerSuccess(value){var inspection=new PromiseInspection;inspection._settledValue=value;inspection._bitField=268435456;return dispose(this,inspection).thenReturn(value)}function disposerFail(reason){var inspection=new PromiseInspection;inspection._settledValue=reason;inspection._bitField=134217728;return dispose(this,inspection).thenThrow(reason)}function Disposer(data,promise,context){this._data=data;this._promise=promise;this._context=context}Disposer.prototype.data=function(){return this._data};Disposer.prototype.promise=function(){return this._promise};Disposer.prototype.resource=function(){if(this.promise().isFulfilled()){return this.promise().value()}return null};Disposer.prototype.tryDispose=function(inspection){var resource=this.resource();var context=this._context;if(context!==undefined)context._pushContext();var ret=resource!==null?this.doDispose(resource,inspection):null;if(context!==undefined)context._popContext();this._promise._unsetDisposable();this._data=null;return ret};Disposer.isDisposer=function(d){return d!=null&&typeof d.resource==="function"&&typeof d.tryDispose==="function"};function FunctionDisposer(fn,promise,context){this.constructor$(fn,promise,context)}inherits(FunctionDisposer,Disposer);FunctionDisposer.prototype.doDispose=function(resource,inspection){var fn=this.data();return fn.call(resource,resource,inspection)};function maybeUnwrapDisposer(value){if(Disposer.isDisposer(value)){this.resources[this.index]._setDisposable(value);return value.promise()}return value}Promise.using=function(){var len=arguments.length;if(len<2)return apiRejection("you must pass at least 2 arguments to Promise.using");var fn=arguments[len-1];if(typeof fn!=="function")return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");len--;var resources=new Array(len);for(var i=0;i0};Promise.prototype._getDisposer=function(){return this._disposer};Promise.prototype._unsetDisposable=function(){this._bitField=this._bitField&~262144;this._disposer=undefined};Promise.prototype.disposer=function(fn){if(typeof fn==="function"){return new FunctionDisposer(fn,this,createContext())}throw new TypeError}}},{"./errors.js":13,"./util.js":38}],38:[function(_dereq_,module,exports){"use strict";var es5=_dereq_("./es5.js");var canEvaluate=typeof navigator=="undefined";var haveGetters=function(){try{var o={};es5.defineProperty(o,"f",{get:function(){return 3}});return o.f===3}catch(e){return false}}();var errorObj={e:{}};var tryCatchTarget;function tryCatcher(){try{var target=tryCatchTarget;tryCatchTarget=null;return target.apply(this,arguments)}catch(e){errorObj.e=e;return errorObj}}function tryCatch(fn){tryCatchTarget=fn;return tryCatcher}var inherits=function(Child,Parent){var hasProp={}.hasOwnProperty;function T(){this.constructor=Child;this.constructor$=Parent;for(var propertyName in Parent.prototype){if(hasProp.call(Parent.prototype,propertyName)&&propertyName.charAt(propertyName.length-1)!=="$"){this[propertyName+"$"]=Parent.prototype[propertyName]}}}T.prototype=Parent.prototype;Child.prototype=new T;return Child.prototype};function isPrimitive(val){return val==null||val===true||val===false||typeof val==="string"||typeof val==="number"}function isObject(value){return!isPrimitive(value)}function maybeWrapAsError(maybeError){if(!isPrimitive(maybeError))return maybeError;return new Error(safeToString(maybeError))}function withAppended(target,appendee){var len=target.length;var ret=new Array(len+1);var i;for(i=0;i1;var hasMethodsOtherThanConstructor=keys.length>0&&!(keys.length===1&&keys[0]==="constructor");var hasThisAssignmentAndStaticMethods=thisAssignmentPattern.test(fn+"")&&es5.names(fn).length>0;if(hasMethods||hasMethodsOtherThanConstructor||hasThisAssignmentAndStaticMethods){return true}}return false}catch(e){return false}}function toFastProperties(obj){function f(){}f.prototype=obj;var l=8;while(l--)new f;return obj;eval(obj)}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(str){return rident.test(str)}function filledRange(count,prefix,suffix){var ret=new Array(count);for(var i=0;i10||version[0]>0}();if(ret.isNode)ret.toFastProperties(process);try{throw new Error}catch(e){ret.lastLineError=e}module.exports=ret},{"./es5.js":14}]},{},[4])(4)});if(typeof window!=="undefined"&&window!==null){window.P=window.Promise}else if(typeof self!=="undefined"&&self!==null){self.P=self.Promise}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-fs/node_modules/s3fs/node_modules/bluebird/js/browser/bluebird.js","/node_modules/@mitocgroup/deep-fs/node_modules/s3fs/node_modules/bluebird/js/browser")},{_process:1069,buffer:919}],140:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}switch(type.toLowerCase()){case"console":driver=new(_bind.apply(_DriverConsoleDriver.ConsoleDriver,[null].concat(args)));break;case"raven":case"sentry":var DriverPrototype=this.container.get(_mitocgroupDeepKernel2["default"].CONTEXT).isFrontend?_DriverRavenBrowserDriver.RavenBrowserDriver:_DriverRavenDriver.RavenDriver;driver=new DriverPrototype(args[0].dns);break;default:throw new _mitocgroupDeepCore2["default"].Exception.InvalidArgumentException(type,"[Console, Raven, Sentry]")}return driver}},{key:"register",value:function register(driver){if(typeof driver=="string"){for(var _len2=arguments.length,args=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2]}driver=this.create.apply(this,[driver].concat(args))}if(!(driver instanceof _DriverAbstractDriver.AbstractDriver)){throw new _mitocgroupDeepCore2["default"].Exception.InvalidArgumentException(driver,"AbstractDriver")}this._drivers.add(driver);return this}},{key:"log",value:function log(msg){var level=arguments.length<=1||arguments[1]===undefined?Log.INFO:arguments[1];var context=arguments.length<=2||arguments[2]===undefined?{}:arguments[2];var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=this._drivers.iterator[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var driver=_step.value;driver.log(msg,level,context)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]){_iterator["return"]()}}finally{if(_didIteratorError){throw _iteratorError}}}return this}},{key:"drivers",get:function get(){return this._drivers}}],[{key:"LEVELS",get:function get(){return[Log.EMERGENCY,Log.ALERT,Log.CRITICAL,Log.ERROR,Log.WARNING,Log.NOTICE,Log.INFO,Log.DEBUG]}},{key:"EMERGENCY",get:function get(){return"emergency"}},{key:"ALERT",get:function get(){return"alert"}},{key:"CRITICAL",get:function get(){return"critical"}},{key:"ERROR",get:function get(){return"error"}},{key:"WARNING",get:function get(){return"warning"}},{key:"NOTICE",get:function get(){return"notice"}},{key:"INFO",get:function get(){return"info"}},{key:"DEBUG",get:function get(){return"debug"}}]);return Log}(_mitocgroupDeepKernel2["default"].ContainerAware);exports.Log=Log}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-log/lib.compiled/Log.js","/node_modules/@mitocgroup/deep-log/lib.compiled")},{"./Driver/AbstractDriver":147,"./Driver/ConsoleDriver":148,"./Driver/RavenBrowserDriver":149,"./Driver/RavenDriver":150,"@mitocgroup/deep-core":"@mitocgroup/deep-core","@mitocgroup/deep-kernel":"@mitocgroup/deep-kernel",_process:1069,buffer:919}],152:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _mitocgroupDeepCore=require("@mitocgroup/deep-core");var _mitocgroupDeepCore2=_interopRequireDefault(_mitocgroupDeepCore);var Exception=function(_Core$Exception$Exception){_inherits(Exception,_Core$Exception$Exception);function Exception(){_classCallCheck(this,Exception);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_get(Object.getPrototypeOf(Exception.prototype),"constructor",this).apply(this,args)}return Exception}(_mitocgroupDeepCore2["default"].Exception.Exception);exports.Exception=Exception}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/lib.compiled/Exception/Exception.js","/node_modules/@mitocgroup/deep-resource/lib.compiled/Exception")},{"@mitocgroup/deep-core":"@mitocgroup/deep-core",_process:1069,buffer:919}],153:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _Exception2=require("./Exception");var MissingResourceException=function(_Exception){_inherits(MissingResourceException,_Exception);function MissingResourceException(microserviceIdentifier,resourceIdentifier){_classCallCheck(this,MissingResourceException);_get(Object.getPrototypeOf(MissingResourceException.prototype),"constructor",this).call(this,"Missing resource "+resourceIdentifier+" in "+microserviceIdentifier); -}return MissingResourceException}(_Exception2.Exception);exports.MissingResourceException=MissingResourceException}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/lib.compiled/Exception/MissingResourceException.js","/node_modules/@mitocgroup/deep-resource/lib.compiled/Exception")},{"./Exception":152,_process:1069,buffer:919}],154:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0?this._methods[0]:Instance.HTTP_VERBS[0]);if(this._methods.length>0&&this._methods.indexOf(method)==-1){throw new _ExceptionUnknownMethodException.UnknownMethodException(method,this._methods)}var RequestImplementation=this._resource.localBackend?_LocalRequest.LocalRequest:_Request.Request;var requestObject=new RequestImplementation(this,payload,method);if(this._resource.cache){requestObject.cacheImpl=this._resource.cache}return requestObject}},{key:"name",get:function get(){return this._name}},{key:"type",get:function get(){return this._type}},{key:"methods",get:function get(){return this._methods}},{key:"source",get:function get(){return this._source}},{key:"region",get:function get(){return this._region}}],[{key:"HTTP_VERBS",get:function get(){return["GET","POST","DELETE","HEAD","PUT","OPTIONS","PATCH"]}},{key:"LAMBDA",get:function get(){return"lambda"}},{key:"EXTERNAL",get:function get(){return"external"}}]);return Action}();exports.Action=Action}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Action.js","/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource")},{"./Exception/UnknownMethodException":159,"./Instance":160,"./LocalRequest":162,"./Request":163,"@mitocgroup/deep-kernel":"@mitocgroup/deep-kernel",_process:1069,buffer:919}],156:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _ExceptionException=require("../../Exception/Exception");var CachedRequestException=function(_Exception){_inherits(CachedRequestException,_Exception);function CachedRequestException(exception){_classCallCheck(this,CachedRequestException);_get(Object.getPrototypeOf(CachedRequestException.prototype),"constructor",this).call(this,"Error while working with cached response: "+exception)}return CachedRequestException}(_ExceptionException.Exception);exports.CachedRequestException=CachedRequestException}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Exception/CachedRequestException.js","/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Exception")},{"../../Exception/Exception":152,_process:1069,buffer:919}],157:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _ExceptionException=require("../../Exception/Exception");var MissingActionException=function(_Exception){_inherits(MissingActionException,_Exception);function MissingActionException(resourceName,actionName){_classCallCheck(this,MissingActionException);_get(Object.getPrototypeOf(MissingActionException.prototype),"constructor",this).call(this,"Missing action "+actionName+" in "+resourceName+" resource.")}return MissingActionException}(_ExceptionException.Exception);exports.MissingActionException=MissingActionException}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Exception/MissingActionException.js","/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Exception")},{"../../Exception/Exception":152,_process:1069,buffer:919}],158:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _ExceptionException=require("../../Exception/Exception");var MissingCacheImplementationException=function(_Exception){_inherits(MissingCacheImplementationException,_Exception);function MissingCacheImplementationException(){_classCallCheck(this,MissingCacheImplementationException);_get(Object.getPrototypeOf(MissingCacheImplementationException.prototype),"constructor",this).call(this,"Missing cache implementation in Request object")}return MissingCacheImplementationException}(_ExceptionException.Exception);exports.MissingCacheImplementationException=MissingCacheImplementationException}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Exception/MissingCacheImplementationException.js","/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Exception")},{"../../Exception/Exception":152,_process:1069,buffer:919}],159:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _ExceptionException=require("../../Exception/Exception");var UnknownMethodException=function(_Exception){_inherits(UnknownMethodException,_Exception);function UnknownMethodException(requestedMethod,availableMethods){_classCallCheck(this,UnknownMethodException);var availableList=availableMethods.join(", ");_get(Object.getPrototypeOf(UnknownMethodException.prototype),"constructor",this).call(this,"Requested method "+requestedMethod+" must be one of "+availableList)}return UnknownMethodException}(_ExceptionException.Exception);exports.UnknownMethodException=UnknownMethodException}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Exception/UnknownMethodException.js","/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Exception")},{"../../Exception/Exception":152,_process:1069,buffer:919}],160:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}return(_action=this.action(actionName)).request.apply(_action,args)}},{key:"name",get:function get(){return this._name}},{key:"cache",get:function get(){return this._cache},set:function set(cache){this._cache=cache}},{key:"localBackend",get:function get(){return this._localBackend},set:function set(state){this._localBackend=state}},{key:"actions",get:function get(){if(this._actions===null){this._actions={};for(var actionName in this._rawActions){if(!this._rawActions.hasOwnProperty(actionName)){continue}var actionMetadata=this._rawActions[actionName];this._actions[actionName]=new _Action.Action(this,actionName,actionMetadata.type,actionMetadata.methods,actionMetadata.source,actionMetadata.region)}}return this._actions}}]);return Instance}();exports.Instance=Instance}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource/Instance.js","/node_modules/@mitocgroup/deep-resource/lib.compiled/Resource")},{"./Action":155,"./Exception/MissingActionException":157,"./Exception/UnknownMethodException":159,"@mitocgroup/deep-kernel":"@mitocgroup/deep-kernel",_process:1069,buffer:919}],161:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;ithis.expireTime){return true}else{return this.expired||!this.accessKeyId||!this.secretAccessKey}},get:function get(callback){var self=this;if(this.needsRefresh()){this.refresh(function(err){if(!err)self.expired=false;if(callback)callback(err)})}else if(callback){callback()}},refresh:function refresh(callback){this.expired=false;callback()}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib")},{"./core":167,_process:1069,buffer:919}],169:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.CognitoIdentityCredentials=AWS.util.inherit(AWS.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function CognitoIdentityCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params;this.data=null;this.identityId=null;this.loadCachedId()},refresh:function refresh(callback){var self=this;self.createClients();self.data=null;self.identityId=null;self.getId(function(err){if(!err){if(!self.params.RoleArn){self.getCredentialsForIdentity(callback)}else{self.getCredentialsFromSTS(callback)}}else{self.clearCachedId();callback(err)}})},clearCachedId:function clearCache(){this.identityId=null;delete this.params.IdentityId;var poolId=this.params.IdentityPoolId;delete this.storage[this.localStorageKey.id+poolId];delete this.storage[this.localStorageKey.providers+poolId]},getId:function getId(callback){var self=this;if(typeof self.params.IdentityId==="string"){return callback(null,self.params.IdentityId)}self.cognito.getId(function(err,data){if(!err&&data.IdentityId){self.params.IdentityId=data.IdentityId;callback(null,data.IdentityId)}else{callback(err)}})},loadCredentials:function loadCredentials(data,credentials){if(!data||!credentials)return;credentials.expired=false;credentials.accessKeyId=data.Credentials.AccessKeyId;credentials.secretAccessKey=data.Credentials.SecretKey;credentials.sessionToken=data.Credentials.SessionToken;credentials.expireTime=data.Credentials.Expiration},getCredentialsForIdentity:function getCredentialsForIdentity(callback){var self=this;self.cognito.getCredentialsForIdentity(function(err,data){if(!err){self.cacheId(data);self.data=data;self.loadCredentials(self.data,self)}else{self.clearCachedId()}callback(err)})},getCredentialsFromSTS:function getCredentialsFromSTS(callback){var self=this;self.cognito.getOpenIdToken(function(err,data){if(!err){self.cacheId(data);self.params.WebIdentityToken=data.Token;self.webIdentityCredentials.refresh(function(webErr){if(!webErr){self.data=self.webIdentityCredentials.data;self.sts.credentialsFrom(self.data,self)}else{self.clearCachedId()}callback(webErr)})}else{self.clearCachedId();callback(err)}})},loadCachedId:function loadCachedId(){var self=this;if(AWS.util.isBrowser()&&!self.params.IdentityId){var id=self.getStorage("id");if(id&&self.params.Logins){var actualProviders=Object.keys(self.params.Logins);var cachedProviders=(self.getStorage("providers")||"").split(",");var intersect=cachedProviders.filter(function(n){return actualProviders.indexOf(n)!==-1});if(intersect.length!==0){self.params.IdentityId=id}}else if(id){self.params.IdentityId=id}}},createClients:function(){this.webIdentityCredentials=this.webIdentityCredentials||new AWS.WebIdentityCredentials(this.params);this.cognito=this.cognito||new AWS.CognitoIdentity({params:this.params});this.sts=this.sts||new AWS.STS},cacheId:function cacheId(data){this.identityId=data.IdentityId;this.params.IdentityId=this.identityId;if(AWS.util.isBrowser()){this.setStorage("id",data.IdentityId);if(this.params.Logins){this.setStorage("providers",Object.keys(this.params.Logins).join(","))}}},getStorage:function getStorage(key){return this.storage[this.localStorageKey[key]+this.params.IdentityPoolId]},setStorage:function setStorage(key,val){try{this.storage[this.localStorageKey[key]+this.params.IdentityPoolId]=val}catch(_){}},storage:function(){try{return AWS.util.isBrowser()&&window.localStorage!==null&&typeof window.localStorage==="object"?window.localStorage:{}}catch(_){return{}}}()})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials/cognito_identity_credentials.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials")},{"../core":167,_process:1069,buffer:919}],170:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.CredentialProviderChain=AWS.util.inherit(AWS.Credentials,{constructor:function CredentialProviderChain(providers){if(providers){this.providers=providers}else{this.providers=AWS.CredentialProviderChain.defaultProviders.slice(0)}},resolve:function resolve(callback){if(this.providers.length===0){callback(new Error("No providers"));return this}var index=0;var providers=this.providers.slice(0);function resolveNext(err,creds){if(!err&&creds||index===providers.length){callback(err,creds);return}var provider=providers[index++];if(typeof provider==="function"){creds=provider.call()}else{creds=provider}if(creds.get){creds.get(function(getErr){resolveNext(getErr,getErr?null:creds)})}else{resolveNext(null,creds)}}resolveNext();return this}});AWS.CredentialProviderChain.defaultProviders=[]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials/credential_provider_chain.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials")},{"../core":167,_process:1069,buffer:919}],171:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.SAMLCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function SAMLCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.assumeRoleWithSAML(function(err,data){if(!err){self.service.credentialsFrom(data,self)}callback(err)})},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials/saml_credentials.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials")},{"../core":167,_process:1069,buffer:919}],172:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.TemporaryCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function TemporaryCredentials(params){AWS.Credentials.call(this);this.loadMasterCredentials();this.expired=true;this.params=params||{};if(this.params.RoleArn){this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials"}},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.config.credentials=self.masterCredentials;var operation=self.params.RoleArn?self.service.assumeRole:self.service.getSessionToken;operation.call(self.service,function(err,data){if(!err){self.service.credentialsFrom(data,self)}callback(err)})},loadMasterCredentials:function loadMasterCredentials(){this.masterCredentials=AWS.config.credentials;while(this.masterCredentials.masterCredentials){this.masterCredentials=this.masterCredentials.masterCredentials}},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials/temporary_credentials.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials")},{"../core":167,_process:1069,buffer:919}],173:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.WebIdentityCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function WebIdentityCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params;this.params.RoleSessionName=this.params.RoleSessionName||"web-identity";this.data=null},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.assumeRoleWithWebIdentity(function(err,data){self.data=null;if(!err){self.data=data;self.service.credentialsFrom(data,self)}callback(err)})},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials/web_identity_credentials.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/credentials")},{"../core":167,_process:1069,buffer:919}],174:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var SequentialExecutor=require("./sequential_executor");AWS.EventListeners={Core:{}};AWS.EventListeners={Core:(new SequentialExecutor).addNamedListeners(function(add,addAsync){addAsync("VALIDATE_CREDENTIALS","validate",function VALIDATE_CREDENTIALS(req,done){if(!req.service.api.signatureVersion)return done();req.service.config.getCredentials(function(err){if(err){req.response.error=AWS.util.error(err,{code:"CredentialsError",message:"Missing credentials in config"})}done()})});add("VALIDATE_REGION","validate",function VALIDATE_REGION(req){if(!req.service.config.region&&!req.service.isGlobalEndpoint){req.response.error=AWS.util.error(new Error,{code:"ConfigError",message:"Missing region in config"})}});add("VALIDATE_PARAMETERS","validate",function VALIDATE_PARAMETERS(req){var rules=req.service.api.operations[req.operation].input;(new AWS.ParamValidator).validate(rules,req.params)});addAsync("COMPUTE_SHA256","afterBuild",function COMPUTE_SHA256(req,done){req.haltHandlersOnError();if(!req.service.api.signatureVersion)return done();if(req.service.getSignerClass(req)===AWS.Signers.V4){var body=req.httpRequest.body||"";AWS.util.computeSha256(body,function(err,sha){if(err){done(err)}else{req.httpRequest.headers["X-Amz-Content-Sha256"]=sha;done()}})}else{done()}});add("SET_CONTENT_LENGTH","afterBuild",function SET_CONTENT_LENGTH(req){if(req.httpRequest.headers["Content-Length"]===undefined){var length=AWS.util.string.byteLength(req.httpRequest.body);req.httpRequest.headers["Content-Length"]=length}});add("SET_HTTP_HOST","afterBuild",function SET_HTTP_HOST(req){req.httpRequest.headers["Host"]=req.httpRequest.endpoint.host});add("RESTART","restart",function RESTART(){var err=this.response.error;if(!err||!err.retryable)return;this.httpRequest=new AWS.HttpRequest(this.service.endpoint,this.service.region);if(this.response.retryCount=60*10){this.emit("sign",[this],function(err){if(err)done(err);else executeSend()})}else{executeSend()}});add("HTTP_HEADERS","httpHeaders",function HTTP_HEADERS(statusCode,headers,resp){resp.httpResponse.statusCode=statusCode;resp.httpResponse.headers=headers;resp.httpResponse.body=new AWS.util.Buffer("");resp.httpResponse.buffers=[];resp.httpResponse.numBytes=0});add("HTTP_DATA","httpData",function HTTP_DATA(chunk,resp){if(chunk){if(AWS.util.isNode()){resp.httpResponse.numBytes+=chunk.length;var total=resp.httpResponse.headers["content-length"];var progress={loaded:resp.httpResponse.numBytes,total:total};resp.request.emit("httpDownloadProgress",[progress,resp]); -}resp.httpResponse.buffers.push(new AWS.util.Buffer(chunk))}});add("HTTP_DONE","httpDone",function HTTP_DONE(resp){if(resp.httpResponse.buffers&&resp.httpResponse.buffers.length>0){var body=AWS.util.buffer.concat(resp.httpResponse.buffers);resp.httpResponse.body=body}delete resp.httpResponse.numBytes;delete resp.httpResponse.buffers});add("FINALIZE_ERROR","retry",function FINALIZE_ERROR(resp){if(resp.httpResponse.statusCode){resp.error.statusCode=resp.httpResponse.statusCode;if(resp.error.retryable===undefined){resp.error.retryable=this.service.retryableError(resp.error,this)}}});add("INVALIDATE_CREDENTIALS","retry",function INVALIDATE_CREDENTIALS(resp){if(!resp.error)return;switch(resp.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":resp.error.retryable=true;resp.request.service.config.credentials.expired=true}});add("EXPIRED_SIGNATURE","retry",function EXPIRED_SIGNATURE(resp){var err=resp.error;if(!err)return;if(typeof err.code==="string"&&typeof err.message==="string"){if(err.code.match(/Signature/)&&err.message.match(/expired/)){resp.error.retryable=true}}});add("REDIRECT","retry",function REDIRECT(resp){if(resp.error&&resp.error.statusCode>=300&&resp.error.statusCode<400&&resp.httpResponse.headers["location"]){this.httpRequest.endpoint=new AWS.Endpoint(resp.httpResponse.headers["location"]);this.httpRequest.headers["Host"]=this.httpRequest.endpoint.host;resp.error.redirect=true;resp.error.retryable=true}});add("RETRY_CHECK","retry",function RETRY_CHECK(resp){if(resp.error){if(resp.error.redirect&&resp.redirectCount=this.HEADERS_RECEIVED&&!headersEmitted){try{xhr.responseType="arraybuffer"}catch(e){}emitter.statusCode=xhr.status;emitter.headers=self.parseHeaders(xhr.getAllResponseHeaders());emitter.emit("headers",emitter.statusCode,emitter.headers);headersEmitted=true}if(this.readyState===this.DONE){self.finishRequest(xhr,emitter)}},false);xhr.upload.addEventListener("progress",function(evt){emitter.emit("sendProgress",evt)});xhr.addEventListener("progress",function(evt){emitter.emit("receiveProgress",evt)},false);xhr.addEventListener("timeout",function(){errCallback(AWS.util.error(new Error("Timeout"),{code:"TimeoutError"}))},false);xhr.addEventListener("error",function(){errCallback(AWS.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},false);callback(emitter);xhr.open(httpRequest.method,href,httpOptions.xhrAsync!==false);AWS.util.each(httpRequest.headers,function(key,value){if(key!=="Content-Length"&&key!=="User-Agent"&&key!=="Host"){xhr.setRequestHeader(key,value)}});if(httpOptions.timeout&&httpOptions.xhrAsync!==false){xhr.timeout=httpOptions.timeout}if(httpOptions.xhrWithCredentials){xhr.withCredentials=true}try{xhr.send(httpRequest.body)}catch(err){if(httpRequest.body&&typeof httpRequest.body.buffer==="object"){xhr.send(httpRequest.body.buffer)}else{throw err}}return emitter},parseHeaders:function parseHeaders(rawHeaders){var headers={};AWS.util.arrayEach(rawHeaders.split(/\r?\n/),function(line){var key=line.split(":",1)[0];var value=line.substring(key.length+2);if(key.length>0)headers[key.toLowerCase()]=value});return headers},finishRequest:function finishRequest(xhr,emitter){var buffer;if(xhr.responseType==="arraybuffer"&&xhr.response){var ab=xhr.response;buffer=new AWS.util.Buffer(ab.byteLength);var view=new Uint8Array(ab);for(var i=0;i1){var msg=this.errors.join("\n* ");if(this.errors.length>1){msg="There were "+this.errors.length+" validation errors:\n* "+msg;throw AWS.util.error(new Error(msg),{code:"MultipleValidationErrors",errors:this.errors})}}else if(this.errors.length===1){throw this.errors[0]}else{return true}},validateStructure:function validateStructure(shape,params,context){this.validateType(context,params,["object"],"structure");var paramName;for(var i=0;shape.required&&i0){var e=JSON.parse(httpResponse.body.toString());if(e.__type||e.code){error.code=(e.__type||e.code).split("#").pop()}if(error.code==="RequestEntityTooLarge"){error.message="Request body must be less than 1 MB"}else{error.message=e.message||e.Message||null}}else{error.statusCode=httpResponse.statusCode;error.message=httpResponse.statusCode.toString()}resp.error=util.error(new Error,error)}function extractData(resp){var body=resp.httpResponse.body.toString()||"{}";if(resp.request.service.config.convertResponseTypes===false){resp.data=JSON.parse(body)}else{var operation=resp.request.service.api.operations[resp.request.operation];var shape=operation.output||{};var parser=new JsonParser;resp.data=parser.parse(body,shape)}}module.exports={buildRequest:buildRequest,extractError:extractError,extractData:extractData}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/protocol/json.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/protocol")},{"../json/builder":177,"../json/parser":178,"../util":215,_process:1069,buffer:919}],187:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var util=require("../util");var QueryParamSerializer=require("../query/query_param_serializer");var Shape=require("../model/shape");function buildRequest(req){var operation=req.service.api.operations[req.operation];var httpRequest=req.httpRequest;httpRequest.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8";httpRequest.params={Version:req.service.api.apiVersion,Action:operation.name};var builder=new QueryParamSerializer;builder.serialize(req.params,operation.input,function(name,value){httpRequest.params[name]=value});httpRequest.body=util.queryParamsToString(httpRequest.params)}function extractError(resp){var data,body=resp.httpResponse.body.toString();if(body.match("=0?"&":"?";var parts=[];util.arrayEach(Object.keys(queryString).sort(),function(key){if(!Array.isArray(queryString[key])){queryString[key]=[queryString[key]]}for(var i=0;i0){parser=new AWS.XML.Parser;var data=parser.parse(body.toString(),output);util.update(resp.data,data)}}module.exports={buildRequest:buildRequest,extractError:extractError,extractData:extractData}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/protocol/rest_xml.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/protocol")},{"../core":167,"../util":215,"./rest":188,_process:1069,buffer:919}],191:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var util=require("../util");function QueryParamSerializer(){}QueryParamSerializer.prototype.serialize=function(params,shape,fn){serializeStructure("",params,shape,fn)};function ucfirst(shape){if(shape.isQueryName||shape.api.protocol!=="ec2"){return shape.name}else{return shape.name[0].toUpperCase()+shape.name.substr(1)}}function serializeStructure(prefix,struct,rules,fn){util.each(rules.members,function(name,member){var value=struct[name];if(value===null||value===undefined)return;var memberName=ucfirst(member);memberName=prefix?prefix+"."+memberName:memberName;serializeMember(memberName,value,member,fn)})}function serializeMap(name,map,rules,fn){var i=1;util.each(map,function(key,value){var prefix=rules.flattened?".":".entry.";var position=prefix+i++ +".";var keyName=position+(rules.key.name||"key");var valueName=position+(rules.value.name||"value");serializeMember(name+keyName,key,rules.key,fn);serializeMember(name+valueName,value,rules.value,fn)})}function serializeList(name,list,rules,fn){var memberRules=rules.member||{};if(list.length===0){fn.call(this,name,null);return}util.arrayEach(list,function(v,n){var suffix="."+(n+1);if(rules.api.protocol==="ec2"){suffix=suffix+""}else if(rules.flattened){if(memberRules.name){var parts=name.split(".");parts.pop();parts.push(ucfirst(memberRules));name=parts.join(".")}}else{suffix=".member"+suffix}serializeMember(name+suffix,v,memberRules,fn)})}function serializeMember(name,value,rules,fn){if(value===null||value===undefined)return;if(rules.type==="structure"){serializeStructure(name,value,rules,fn)}else if(rules.type==="list"){serializeList(name,value,rules,fn)}else if(rules.type==="map"){serializeMap(name,value,rules,fn)}else{fn(name,rules.toWireFormat(value).toString())}}module.exports=QueryParamSerializer}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/query/query_param_serializer.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/query")},{"../util":215,_process:1069,buffer:919}],192:[function(require,module,exports){module.exports={rules:{"*/*":{endpoint:"{service}.{region}.amazonaws.com"},"cn-*/*":{endpoint:"{service}.{region}.amazonaws.com.cn"},"*/cloudfront":"globalSSL","*/iam":"globalSSL","*/sts":"globalSSL","*/importexport":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2",globalEndpoint:true},"*/route53":{endpoint:"https://{service}.amazonaws.com",signatureVersion:"v3https",globalEndpoint:true},"us-gov-*/iam":"globalGovCloud","us-gov-*/sts":{endpoint:"{service}.{region}.amazonaws.com"},"us-gov-west-1/s3":"s3dash","us-west-1/s3":"s3dash","us-west-2/s3":"s3dash","eu-west-1/s3":"s3dash","ap-southeast-1/s3":"s3dash","ap-southeast-2/s3":"s3dash","ap-northeast-1/s3":"s3dash","sa-east-1/s3":"s3dash","us-east-1/s3":{endpoint:"{service}.amazonaws.com",signatureVersion:"s3"},"us-east-1/sdb":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2"},"*/sdb":{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"v2"}},patterns:{globalSSL:{endpoint:"https://{service}.amazonaws.com",globalEndpoint:true},globalGovCloud:{endpoint:"{service}.us-gov.amazonaws.com"},s3dash:{endpoint:"{service}-{region}.amazonaws.com",signatureVersion:"s3"}}}},{}],193:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var util=require("./util");var regionConfig=require("./region_config.json");function generateRegionPrefix(region){if(!region)return null;var parts=region.split("-");if(parts.length<3)return null;return parts.slice(0,parts.length-2).join("-")+"-*"}function derivedKeys(service){var region=service.config.region;var regionPrefix=generateRegionPrefix(region);var endpointPrefix=service.api.endpointPrefix;return[[region,endpointPrefix],[regionPrefix,endpointPrefix],[region,"*"],[regionPrefix,"*"],["*",endpointPrefix],["*","*"]].map(function(item){return item[0]&&item[1]?item.join("/"):null})}function applyConfig(service,config){util.each(config,function(key,value){if(key==="globalEndpoint")return;if(service.config[key]===undefined||service.config[key]===null){service.config[key]=value}})}function configureEndpoint(service){var keys=derivedKeys(service);for(var i=0;i=0){return null}if(this.expectedValue){return r===this.expectedValue}else{return r?true:false}},checkError:function checkError(resp){var value=this.config.successValue;if(typeof value==="number"){return resp.httpResponse.statusCode===value}else{return resp.error&&resp.error.code===value}},loadWaiterConfig:function loadWaiterConfig(state,noException){if(!this.service.api.waiters[state]){if(noException)return;throw new AWS.util.error(new Error,{code:"StateNotFoundError",message:"State "+state+" not found."})}this.config=this.service.api.waiters[state];var config=this.config;(function(){config.successType=config.successType||config.acceptorType;config.successPath=config.successPath||config.acceptorPath;config.successValue=config.successValue||config.acceptorValue;config.failureType=config.failureType||config.acceptorType;config.failurePath=config.failurePath||config.acceptorPath; -config.failureValue=config.failureValue||config.acceptorValue})()}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/resource_waiter.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib")},{"./core":167,_process:1069,buffer:919}],196:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var inherit=AWS.util.inherit;AWS.Response=inherit({constructor:function Response(request){this.request=request;this.data=null;this.error=null;this.retryCount=0;this.redirectCount=0;this.httpResponse=new AWS.HttpResponse;if(request){this.maxRetries=request.service.numRetries();this.maxRedirects=request.service.config.maxRedirects}},nextPage:function nextPage(callback){var config;var service=this.request.service;var operation=this.request.operation;try{config=service.paginationConfig(operation,true)}catch(e){this.error=e}if(!this.hasNextPage()){if(callback)callback(this.error,null);else if(this.error)throw this.error;return null}var params=AWS.util.copy(this.request.params);if(!this.nextPageTokens){return callback?callback(null,null):null}else{var inputTokens=config.inputToken;if(typeof inputTokens==="string")inputTokens=[inputTokens];for(var i=0;iself.partSize)self.partSize=newPartSize}else{self.totalBytes=undefined}},isDoneChunking:false,partPos:0,totalChunkedBytes:0,totalUploadedBytes:0,totalBytes:undefined,numParts:0,totalPartNumbers:0,activeParts:0,doneParts:0,parts:null,completeInfo:null,failed:false,multipartReq:null,partBuffers:null,partBufferLength:0,fillBuffer:function fillBuffer(){var self=this;var bodyLen=byteLength(self.body);if(bodyLen===0){self.isDoneChunking=true;self.numParts=1;self.nextChunk(self.body);return}while(self.activeParts=self.queueSize)return;var buf=self.body.read(self.partSize-self.partBufferLength)||self.body.read();if(buf){self.partBuffers.push(buf);self.partBufferLength+=buf.length;self.totalChunkedBytes+=buf.length}if(self.partBufferLength>=self.partSize){var pbuf=Buffer.concat(self.partBuffers);self.partBuffers=[];self.partBufferLength=0;if(pbuf.length>self.partSize){var rest=pbuf.slice(self.partSize);self.partBuffers.push(rest);self.partBufferLength+=rest.length;pbuf=pbuf.slice(0,self.partSize)}self.nextChunk(pbuf)}if(self.isDoneChunking&&!self.isDoneSending){pbuf=Buffer.concat(self.partBuffers);self.partBuffers=[];self.partBufferLength=0;self.totalBytes=self.totalChunkedBytes;self.isDoneSending=true;if(self.numParts===0||pbuf.length>0){self.numParts++;self.nextChunk(pbuf)}}self.body.read(0)},nextChunk:function nextChunk(chunk){var self=this;if(self.failed)return null;var partNumber=++self.totalPartNumbers;if(self.isDoneChunking&&partNumber===1){var req=self.service.putObject({Body:chunk});req._managedUpload=self;req.on("httpUploadProgress",self.progress).send(self.finishSinglePart);return null}self.activeParts++;if(!self.service.config.params.UploadId){if(!self.multipartReq){self.multipartReq=self.service.createMultipartUpload();self.multipartReq.on("success",function(resp){self.service.config.params.UploadId=resp.data.UploadId;self.multipartReq=null});self.queueChunks(chunk,partNumber);self.multipartReq.on("error",function(err){self.cleanup(err)});self.multipartReq.send()}else{self.queueChunks(chunk,partNumber)}}else{self.uploadPart(chunk,partNumber)}},uploadPart:function uploadPart(chunk,partNumber){var self=this;var partParams={Body:chunk,ContentLength:AWS.util.string.byteLength(chunk),PartNumber:partNumber};var partInfo={ETag:null,PartNumber:partNumber};self.completeInfo.push(partInfo);var req=self.service.uploadPart(partParams);self.parts[partNumber]=req;req._lastUploadedBytes=0;req._managedUpload=self;req.on("httpUploadProgress",self.progress);req.send(function(err,data){delete self.parts[partParams.PartNumber];self.activeParts--;if(!err&&(!data||!data.ETag)){var message="No access to ETag property on response.";if(AWS.util.isBrowser()){message+=" Check CORS configuration to expose ETag header."}err=AWS.util.error(new Error(message),{code:"ETagMissing",retryable:false})}if(err)return self.cleanup(err);partInfo.ETag=data.ETag;self.doneParts++;if(self.isDoneChunking&&self.doneParts===self.numParts){self.finishMultiPart()}else{self.fillQueue.call(self)}})},queueChunks:function queueChunks(chunk,partNumber){var self=this;self.multipartReq.on("success",function(){self.uploadPart(chunk,partNumber)})},cleanup:function cleanup(err){var self=this;if(self.failed)return;if(typeof self.body.removeAllListeners==="function"&&typeof self.body.resume==="function"){self.body.removeAllListeners("readable");self.body.removeAllListeners("end");self.body.resume()}if(self.service.config.params.UploadId&&!self.leavePartsOnError){self.service.abortMultipartUpload().send()}AWS.util.each(self.parts,function(partNumber,part){part.removeAllListeners("complete");part.abort()});self.parts={};self.callback(err);self.failed=true},finishMultiPart:function finishMultiPart(){var self=this;var completeParams={MultipartUpload:{Parts:self.completeInfo}};self.service.completeMultipartUpload(completeParams,function(err,data){if(err)return self.cleanup(err);else self.callback(err,data)})},finishSinglePart:function finishSinglePart(err,data){var upload=this.request._managedUpload;var httpReq=this.request.httpRequest;var url=AWS.util.urlFormat(httpReq.endpoint);if(err)return upload.callback(err);data.Location=url.substr(0,url.length-1)+httpReq.path;upload.callback(err,data)},progress:function progress(info){var upload=this._managedUpload;if(this.operation==="putObject"){info.part=1}else{upload.totalUploadedBytes+=info.loaded-this._lastUploadedBytes;this._lastUploadedBytes=info.loaded;info={loaded:upload.totalUploadedBytes,total:upload.totalBytes,part:this.params.PartNumber}}upload.emit("httpUploadProgress",[info])}});AWS.util.mixin(AWS.S3.ManagedUpload,AWS.SequentialExecutor);module.exports=AWS.S3.ManagedUpload}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/s3/managed_upload.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/s3")},{"../core":167,_process:1069,buffer:919}],198:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");AWS.SequentialExecutor=AWS.util.inherit({constructor:function SequentialExecutor(){this._events={}},listeners:function listeners(eventName){return this._events[eventName]?this._events[eventName].slice(0):[]},on:function on(eventName,listener){if(this._events[eventName]){this._events[eventName].push(listener)}else{this._events[eventName]=[listener]}return this},onAsync:function onAsync(eventName,listener){listener._isAsync=true;return this.on(eventName,listener)},removeListener:function removeListener(eventName,listener){var listeners=this._events[eventName];if(listeners){var length=listeners.length;var position=-1;for(var i=0;i-1){listeners.splice(position,1)}}return this},removeAllListeners:function removeAllListeners(eventName){if(eventName){delete this._events[eventName]}else{this._events={}}return this},emit:function emit(eventName,eventArgs,doneCallback){if(!doneCallback)doneCallback=function(){};var listeners=this.listeners(eventName);var count=listeners.length;this.callListeners(listeners,eventArgs,doneCallback);return count>0},callListeners:function callListeners(listeners,args,doneCallback,prevError){var self=this;var error=prevError||null;function callNextListener(err){if(err){error=AWS.util.error(error||new Error,err);if(self._haltHandlersOnError){return doneCallback.call(self,error)}}self.callListeners(listeners,args,doneCallback,error)}while(listeners.length>0){var listener=listeners.shift();if(listener._isAsync){listener.apply(self,args.concat([callNextListener]));return}else{try{listener.apply(self,args)}catch(err){error=AWS.util.error(error||new Error,err)}if(error&&self._haltHandlersOnError){doneCallback.call(self,error);return}}}doneCallback.call(self,error)},addListeners:function addListeners(listeners){var self=this;if(listeners._events)listeners=listeners._events;AWS.util.each(listeners,function(event,callbacks){if(typeof callbacks==="function")callbacks=[callbacks];AWS.util.arrayEach(callbacks,function(callback){self.on(event,callback)})});return self},addNamedListener:function addNamedListener(name,eventName,callback){this[name]=callback;this.addListener(eventName,callback);return this},addNamedAsyncListener:function addNamedAsyncListener(name,eventName,callback){callback._isAsync=true;return this.addNamedListener(name,eventName,callback)},addNamedListeners:function addNamedListeners(callback){var self=this;callback(function(){self.addNamedListener.apply(self,arguments)},function(){self.addNamedAsyncListener.apply(self,arguments)});return this}});AWS.SequentialExecutor.prototype.addListener=AWS.SequentialExecutor.prototype.on;module.exports=AWS.SequentialExecutor}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/sequential_executor.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib")},{"./core":167,_process:1069,buffer:919}],199:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var Api=require("./model/api");var regionConfig=require("./region_config");var inherit=AWS.util.inherit;AWS.Service=inherit({constructor:function Service(config){if(!this.loadServiceClass){throw AWS.util.error(new Error,"Service must be constructed with `new' operator")}var ServiceClass=this.loadServiceClass(config||{});if(ServiceClass)return new ServiceClass(config);this.initialize(config)},initialize:function initialize(config){var svcConfig=AWS.config[this.serviceIdentifier];this.config=new AWS.Config(AWS.config);if(svcConfig)this.config.update(svcConfig,true);if(config)this.config.update(config,true);this.validateService();if(!this.config.endpoint)regionConfig(this);this.config.endpoint=this.endpointFromTemplate(this.config.endpoint);this.setEndpoint(this.config.endpoint)},validateService:function validateService(){},loadServiceClass:function loadServiceClass(serviceConfig){var config=serviceConfig;if(!AWS.util.isEmpty(this.api)){return null}else if(config.apiConfig){return AWS.Service.defineServiceApi(this.constructor,config.apiConfig)}else if(!this.constructor.services){return null}else{config=new AWS.Config(AWS.config);config.update(serviceConfig,true);var version=config.apiVersions[this.constructor.serviceIdentifier];version=version||config.apiVersion;return this.getLatestServiceClass(version)}},getLatestServiceClass:function getLatestServiceClass(version){version=this.getLatestServiceVersion(version);if(this.constructor.services[version]===null){AWS.Service.defineServiceApi(this.constructor,version)}return this.constructor.services[version]},getLatestServiceVersion:function getLatestServiceVersion(version){if(!this.constructor.services||this.constructor.services.length===0){throw new Error("No services defined on "+this.constructor.serviceIdentifier)}if(!version){version="latest"}else if(AWS.util.isType(version,Date)){version=AWS.util.date.iso8601(version).split("T")[0]}if(Object.hasOwnProperty(this.constructor.services,version)){return version}var keys=Object.keys(this.constructor.services).sort();var selectedVersion=null;for(var i=keys.length-1;i>=0;i--){if(keys[i][keys[i].length-1]!=="*"){selectedVersion=keys[i]}if(keys[i].substr(0,10)<=version){return selectedVersion}}throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+version+"'")},api:{},defaultRetryCount:3,makeRequest:function makeRequest(operation,params,callback){if(typeof params==="function"){callback=params;params=null}params=params||{};if(this.config.params){var rules=this.api.operations[operation];if(rules){params=AWS.util.copy(params);AWS.util.each(this.config.params,function(key,value){if(rules.input.members[key]){if(params[key]===undefined||params[key]===null){params[key]=value}}})}}var request=new AWS.Request(this,operation,params);this.addAllRequestListeners(request);if(callback)request.send(callback);return request},makeUnauthenticatedRequest:function makeUnauthenticatedRequest(operation,params,callback){if(typeof params==="function"){callback=params;params={}}var request=this.makeRequest(operation,params).toUnauthenticated();return callback?request.send(callback):request},waitFor:function waitFor(state,params,callback){var waiter=new AWS.ResourceWaiter(this,state);return waiter.wait(params,callback)},addAllRequestListeners:function addAllRequestListeners(request){var list=[AWS.events,AWS.EventListeners.Core,this.serviceInterface(),AWS.EventListeners.CorePost];for(var i=0;i=500)return true;return false},networkingError:function networkingError(error){return error.code==="NetworkingError"},expiredCredentialsError:function expiredCredentialsError(error){return error.code==="ExpiredTokenException"},throttledError:function throttledError(error){switch(error.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":return true;default:return false}},endpointFromTemplate:function endpointFromTemplate(endpoint){if(typeof endpoint!=="string")return endpoint;var e=endpoint;e=e.replace(/\{service\}/g,this.api.endpointPrefix);e=e.replace(/\{region\}/g,this.config.region);e=e.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http");return e},setEndpoint:function setEndpoint(endpoint){this.endpoint=new AWS.Endpoint(endpoint,this.config)},paginationConfig:function paginationConfig(operation,throwException){var paginator=this.api.operations[operation].paginator;if(!paginator){if(throwException){var e=new Error;throw AWS.util.error(e,"No pagination configuration for "+operation)}return null}return paginator}});AWS.util.update(AWS.Service,{defineMethods:function defineMethods(svc){AWS.util.each(svc.prototype.api.operations,function iterator(method){if(svc.prototype[method])return;svc.prototype[method]=function(params,callback){return this.makeRequest(method,params,callback)}})},defineService:function defineService(serviceIdentifier,versions,features){AWS.Service._serviceMap[serviceIdentifier]=true;if(!Array.isArray(versions)){features=versions;versions=[]}var svc=inherit(AWS.Service,features||{});if(typeof serviceIdentifier==="string"){AWS.Service.addVersions(svc,versions);var identifier=svc.serviceIdentifier||serviceIdentifier;svc.serviceIdentifier=identifier}else{svc.prototype.api=serviceIdentifier;AWS.Service.defineMethods(svc)}return svc},addVersions:function addVersions(svc,versions){if(!Array.isArray(versions))versions=[versions];svc.services=svc.services||{};for(var i=0;i=1024*1024){req.httpRequest.headers["Expect"]="100-continue"}},addContentType:function addContentType(req){var httpRequest=req.httpRequest;if(httpRequest.method==="GET"||httpRequest.method==="HEAD"){delete httpRequest.headers["Content-Type"];return}if(!httpRequest.headers["Content-Type"]){httpRequest.headers["Content-Type"]="application/octet-stream"}var contentType=httpRequest.headers["Content-Type"];if(AWS.util.isBrowser()){if(typeof httpRequest.body==="string"&&!contentType.match(/;\s*charset=/)){var charset="; charset=UTF-8";httpRequest.headers["Content-Type"]+=charset}else{var replaceFn=function(_,prefix,charsetName){return prefix+charsetName.toUpperCase()};httpRequest.headers["Content-Type"]=contentType.replace(/(;\s*charset=)(.+)$/,replaceFn)}}},computableChecksumOperations:{putBucketCors:true,putBucketLifecycle:true,putBucketTagging:true,deleteObjects:true},willComputeChecksums:function willComputeChecksums(req){if(this.computableChecksumOperations[req.operation])return true;if(!this.config.computeChecksums)return false;if(!AWS.util.Buffer.isBuffer(req.httpRequest.body)&&typeof req.httpRequest.body!=="string"){return false}var rules=req.service.api.operations[req.operation].input.members;if(req.service.getSignerClass(req)===AWS.Signers.V4){if(rules.ContentMD5&&!rules.ContentMD5.required)return false}if(rules.ContentMD5&&!req.params.ContentMD5)return true; -},computeContentMd5:function computeContentMd5(req){if(req.service.willComputeChecksums(req)){var md5=AWS.util.crypto.md5(req.httpRequest.body,"base64");req.httpRequest.headers["Content-MD5"]=md5}},computeSseCustomerKeyMd5:function computeSseCustomerKeyMd5(req){var keys={SSECustomerKey:"x-amz-server-side-encryption-customer-key-MD5",CopySourceSSECustomerKey:"x-amz-copy-source-server-side-encryption-customer-key-MD5"};AWS.util.each(keys,function(key,header){if(req.params[key]){var value=AWS.util.crypto.md5(req.params[key],"base64");req.httpRequest.headers[header]=value}})},pathStyleBucketName:function pathStyleBucketName(bucketName){if(this.config.s3ForcePathStyle)return true;if(this.config.s3BucketEndpoint)return false;if(this.dnsCompatibleBucketName(bucketName)){return this.config.sslEnabled&&bucketName.match(/\./)?true:false}else{return true}},dnsCompatibleBucketName:function dnsCompatibleBucketName(bucketName){var b=bucketName;var domain=new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/);var ipAddress=new RegExp(/(\d+\.){3}\d+/);var dots=new RegExp(/\.\./);return b.match(domain)&&!b.match(ipAddress)&&!b.match(dots)?true:false},successfulResponse:function successfulResponse(resp){var req=resp.request;var httpResponse=resp.httpResponse;if(req.operation==="completeMultipartUpload"&&httpResponse.body.toString().match("")){return false}else{return httpResponse.statusCode<300}},retryableError:function retryableError(error,request){if(request.operation==="completeMultipartUpload"&&error.statusCode===200){return true}else if(error&&error.code==="RequestTimeout"){return true}else{var _super=AWS.Service.prototype.retryableError;return _super.call(this,error,request)}},extractData:function extractData(resp){var req=resp.request;if(req.operation==="getBucketLocation"){var match=resp.httpResponse.body.toString().match(/>(.+)<\/Location/);delete resp.data["_"];if(match){resp.data.LocationConstraint=match[1]}else{resp.data.LocationConstraint=""}}},extractError:function extractError(resp){var codes={304:"NotModified",403:"Forbidden",400:"BadRequest",404:"NotFound"};var code=resp.httpResponse.statusCode;var body=resp.httpResponse.body||"";if(codes[code]&&body.length===0){resp.error=AWS.util.error(new Error,{code:codes[resp.httpResponse.statusCode],message:null})}else{var data=(new AWS.XML.Parser).parse(body.toString());resp.error=AWS.util.error(new Error,{code:data.Code||code,message:data.Message||null})}},getSignedUrl:function getSignedUrl(operation,params,callback){params=AWS.util.copy(params||{});var expires=params.Expires||900;delete params.Expires;var request=this.makeRequest(operation,params);return request.presign(expires,callback)},prepareSignedUrl:function prepareSignedUrl(request){request.addListener("validate",request.service.noPresignedContentLength);request.removeListener("build",request.service.addContentType);if(!request.params.Body){request.removeListener("build",request.service.computeContentMd5)}else{request.addListener("afterBuild",AWS.EventListeners.Core.COMPUTE_SHA256)}},noPresignedContentLength:function noPresignedContentLength(request){if(request.params.ContentLength!==undefined){throw AWS.util.error(new Error,{code:"UnexpectedParameter",message:"ContentLength is not supported in pre-signed URLs."})}},createBucket:function createBucket(params,callback){if(!params)params={};var hostname=this.endpoint.hostname;if(hostname!==this.api.globalEndpoint&&!params.CreateBucketConfiguration){params.CreateBucketConfiguration={LocationConstraint:this.config.region}}return this.makeRequest("createBucket",params,callback)},upload:function upload(params,options,callback){if(typeof options==="function"&&callback===undefined){callback=options;options=null}options=options||{};options=AWS.util.merge(options||{},{service:this,params:params});var uploader=new AWS.S3.ManagedUpload(options);if(typeof callback==="function")uploader.send(callback);return uploader}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/services/s3.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/services")},{"../core":167,"../s3/managed_upload":197,_process:1069,buffer:919}],205:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.util.update(AWS.SQS.prototype,{setupRequestListeners:function setupRequestListeners(request){request.addListener("build",this.buildEndpoint);if(request.service.config.computeChecksums){if(request.operation==="sendMessage"){request.addListener("extractData",this.verifySendMessageChecksum)}else if(request.operation==="sendMessageBatch"){request.addListener("extractData",this.verifySendMessageBatchChecksum)}else if(request.operation==="receiveMessage"){request.addListener("extractData",this.verifyReceiveMessageChecksum)}}},verifySendMessageChecksum:function verifySendMessageChecksum(response){if(!response.data)return;var md5=response.data.MD5OfMessageBody;var body=this.params.MessageBody;var calculatedMd5=this.service.calculateChecksum(body);if(calculatedMd5!==md5){var msg='Got "'+response.data.MD5OfMessageBody+'", expecting "'+calculatedMd5+'".';this.service.throwInvalidChecksumError(response,[response.data.MessageId],msg)}},verifySendMessageBatchChecksum:function verifySendMessageBatchChecksum(response){if(!response.data)return;var service=this.service;var entries={};var errors=[];var messageIds=[];AWS.util.arrayEach(response.data.Successful,function(entry){entries[entry.Id]=entry});AWS.util.arrayEach(this.params.Entries,function(entry){if(entries[entry.Id]){var md5=entries[entry.Id].MD5OfMessageBody;var body=entry.MessageBody;if(!service.isChecksumValid(md5,body)){errors.push(entry.Id);messageIds.push(entries[entry.Id].MessageId)}}});if(errors.length>0){service.throwInvalidChecksumError(response,messageIds,"Invalid messages: "+errors.join(", "))}},verifyReceiveMessageChecksum:function verifyReceiveMessageChecksum(response){if(!response.data)return;var service=this.service;var messageIds=[];AWS.util.arrayEach(response.data.Messages,function(message){var md5=message.MD5OfBody;var body=message.Body;if(!service.isChecksumValid(md5,body)){messageIds.push(message.MessageId)}});if(messageIds.length>0){service.throwInvalidChecksumError(response,messageIds,"Invalid messages: "+messageIds.join(", "))}},throwInvalidChecksumError:function throwInvalidChecksumError(response,ids,message){response.error=AWS.util.error(new Error,{retryable:true,code:"InvalidChecksum",messageIds:ids,message:response.request.operation+" returned an invalid MD5 response. "+message})},isChecksumValid:function isChecksumValid(checksum,data){return this.calculateChecksum(data)===checksum},calculateChecksum:function calculateChecksum(data){return AWS.util.crypto.md5(data,"hex")},buildEndpoint:function buildEndpoint(request){var url=request.httpRequest.params.QueueUrl;if(url){request.httpRequest.endpoint=new AWS.Endpoint(url);var matches=request.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./);if(matches)request.httpRequest.region=matches[1]}}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/services/sqs.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/services")},{"../core":167,_process:1069,buffer:919}],206:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.util.update(AWS.STS.prototype,{credentialsFrom:function credentialsFrom(data,credentials){if(!data)return null;if(!credentials)credentials=new AWS.TemporaryCredentials;credentials.expired=false;credentials.accessKeyId=data.Credentials.AccessKeyId;credentials.secretAccessKey=data.Credentials.SecretAccessKey;credentials.sessionToken=data.Credentials.SessionToken;credentials.expireTime=data.Credentials.Expiration;return credentials},assumeRoleWithWebIdentity:function assumeRoleWithWebIdentity(params,callback){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",params,callback)},assumeRoleWithSAML:function assumeRoleWithSAML(params,callback){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",params,callback)}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/services/sts.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/services")},{"../core":167,_process:1069,buffer:919}],207:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;var expiresHeader="presigned-expires";function signedUrlBuilder(request){var expires=request.httpRequest.headers[expiresHeader];delete request.httpRequest.headers["User-Agent"];delete request.httpRequest.headers["X-Amz-User-Agent"];if(request.service.getSignerClass()===AWS.Signers.V4){if(expires>604800){var message="Presigning does not support expiry time greater "+"than a week with SigV4 signing.";throw AWS.util.error(new Error,{code:"InvalidExpiryTime",message:message,retryable:false})}request.httpRequest.headers[expiresHeader]=expires}else if(request.service.getSignerClass()===AWS.Signers.S3){request.httpRequest.headers[expiresHeader]=parseInt(AWS.util.date.unixTimestamp()+expires,10).toString()}else{throw AWS.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:false})}}function signedUrlSigner(request){var endpoint=request.httpRequest.endpoint;var parsedUrl=AWS.util.urlParse(request.httpRequest.path);var queryParams={};if(parsedUrl.search){queryParams=AWS.util.queryStringParse(parsedUrl.search.substr(1))}AWS.util.each(request.httpRequest.headers,function(key,value){if(key===expiresHeader)key="Expires";queryParams[key]=value});delete request.httpRequest.headers[expiresHeader];var auth=queryParams["Authorization"].split(" ");if(auth[0]==="AWS"){auth=auth[1].split(":");queryParams["AWSAccessKeyId"]=auth[0];queryParams["Signature"]=auth[1]}else if(auth[0]==="AWS4-HMAC-SHA256"){auth.shift();var rest=auth.join(" ");var signature=rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];queryParams["X-Amz-Signature"]=signature;delete queryParams["Expires"]}delete queryParams["Authorization"];delete queryParams["Host"];endpoint.pathname=parsedUrl.pathname;endpoint.search=AWS.util.queryParamsToString(queryParams)}AWS.Signers.Presign=inherit({sign:function sign(request,expireTime,callback){request.httpRequest.headers[expiresHeader]=expireTime||3600;request.on("build",signedUrlBuilder);request.on("sign",signedUrlSigner);request.removeListener("afterBuild",AWS.EventListeners.Core.SET_CONTENT_LENGTH);request.removeListener("afterBuild",AWS.EventListeners.Core.COMPUTE_SHA256);request.emit("beforePresign",[request]);if(callback){request.build(function(){if(this.response.error)callback(this.response.error);else{callback(null,AWS.util.urlFormat(request.httpRequest.endpoint))}})}else{request.build();if(request.response.error)throw request.response.error;return AWS.util.urlFormat(request.httpRequest.endpoint)}}});module.exports=AWS.Signers.Presign}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/signers/presign.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/signers")},{"../core":167,_process:1069,buffer:919}],208:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;AWS.Signers.RequestSigner=inherit({constructor:function RequestSigner(request){this.request=request}});AWS.Signers.RequestSigner.getVersion=function getVersion(version){switch(version){case"v2":return AWS.Signers.V2;case"v3":return AWS.Signers.V3;case"v4":return AWS.Signers.V4;case"s3":return AWS.Signers.S3;case"v3https":return AWS.Signers.V3Https}throw new Error("Unknown signing version "+version)};require("./v2");require("./v3");require("./v3https");require("./v4");require("./s3");require("./presign")}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/signers/request_signer.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/signers")},{"../core":167,"./presign":207,"./s3":209,"./v2":210,"./v3":211,"./v3https":212,"./v4":213,_process:1069,buffer:919}],209:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;AWS.Signers.S3=inherit(AWS.Signers.RequestSigner,{subResources:{acl:1,cors:1,lifecycle:1,"delete":1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:function addAuthorization(credentials,date){if(!this.request.headers["presigned-expires"]){this.request.headers["X-Amz-Date"]=AWS.util.date.rfc822(date)}if(credentials.sessionToken){this.request.headers["x-amz-security-token"]=credentials.sessionToken}var signature=this.sign(credentials.secretAccessKey,this.stringToSign());var auth="AWS "+credentials.accessKeyId+":"+signature;this.request.headers["Authorization"]=auth},stringToSign:function stringToSign(){var r=this.request;var parts=[];parts.push(r.method);parts.push(r.headers["Content-MD5"]||"");parts.push(r.headers["Content-Type"]||"");parts.push(r.headers["presigned-expires"]||"");var headers=this.canonicalizedAmzHeaders();if(headers)parts.push(headers);parts.push(this.canonicalizedResource());return parts.join("\n")},canonicalizedAmzHeaders:function canonicalizedAmzHeaders(){var amzHeaders=[];AWS.util.each(this.request.headers,function(name){if(name.match(/^x-amz-/i))amzHeaders.push(name)});amzHeaders.sort(function(a,b){return a.toLowerCase()=0?"&":"?";this.request.path+=sep+AWS.util.queryParamsToString(qs)},authorization:function authorization(credentials,datetime){var parts=[];var credString=this.credentialString(datetime);parts.push(this.algorithm+" Credential="+credentials.accessKeyId+"/"+credString);parts.push("SignedHeaders="+this.signedHeaders());parts.push("Signature="+this.signature(credentials,datetime));return parts.join(", ")},signature:function signature(credentials,datetime){var cache=cachedSecret[this.serviceName];var date=datetime.substr(0,8);if(!cache||cache.akid!==credentials.accessKeyId||cache.region!==this.request.region||cache.date!==date){var kSecret=credentials.secretAccessKey;var kDate=AWS.util.crypto.hmac("AWS4"+kSecret,date,"buffer");var kRegion=AWS.util.crypto.hmac(kDate,this.request.region,"buffer");var kService=AWS.util.crypto.hmac(kRegion,this.serviceName,"buffer");var kCredentials=AWS.util.crypto.hmac(kService,"aws4_request","buffer");cachedSecret[this.serviceName]={region:this.request.region,date:date,key:kCredentials,akid:credentials.accessKeyId}}var key=cachedSecret[this.serviceName].key;return AWS.util.crypto.hmac(key,this.stringToSign(datetime),"hex")},stringToSign:function stringToSign(datetime){var parts=[];parts.push("AWS4-HMAC-SHA256");parts.push(datetime);parts.push(this.credentialString(datetime));parts.push(this.hexEncodedHash(this.canonicalString()));return parts.join("\n")},canonicalString:function canonicalString(){var parts=[],pathname=this.request.pathname();if(this.serviceName!=="s3")pathname=AWS.util.uriEscapePath(pathname);parts.push(this.request.method);parts.push(pathname);parts.push(this.request.search());parts.push(this.canonicalHeaders()+"\n");parts.push(this.signedHeaders());parts.push(this.hexEncodedBodyHash());return parts.join("\n")},canonicalHeaders:function canonicalHeaders(){var headers=[];AWS.util.each.call(this,this.request.headers,function(key,item){headers.push([key,item])});headers.sort(function(a,b){return a[0].toLowerCase()=buffer.length)return readable.push(null);var end=pos+size;if(end>buffer.length)end=buffer.length;readable.push(buffer.slice(pos,end));pos=end};return readable},concat:function(buffers){var length=0,offset=0,buffer=null,i;for(i=0;i0){results=objects;return util.abort}});return results},find:function find(expression,data){return util.jamespath.query(expression,data)[0]}},date:{getDate:function getDate(){if(!AWS)AWS=require("./core");if(AWS.config.systemClockOffset){return new Date((new Date).getTime()+AWS.config.systemClockOffset)}else{return new Date}},iso8601:function iso8601(date){if(date===undefined){date=util.date.getDate()}return date.toISOString().replace(/\.\d{3}Z$/,"Z")},rfc822:function rfc822(date){if(date===undefined){date=util.date.getDate()}return date.toUTCString()},unixTimestamp:function unixTimestamp(date){if(date===undefined){date=util.date.getDate()}return date.getTime()/1e3},from:function format(date){if(typeof date==="number"){return new Date(date*1e3)}else{return new Date(date)}},format:function format(date,formatter){if(!formatter)formatter="iso8601";return util.date[formatter](util.date.from(date))},parseTimestamp:function parseTimestamp(value){if(typeof value==="number"){return new Date(value*1e3)}else if(value.match(/^\d+$/)){return new Date(value*1e3)}else if(value.match(/^\d{4}/)){return new Date(value)}else if(value.match(/^\w{3},/)){return new Date(value)}else{throw util.error(new Error("unhandled timestamp format: "+value),{code:"TimestampParserError"})}}},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:function crc32(data){var tbl=util.crypto.crc32Table;var crc=0^-1;if(typeof data==="string"){data=new Buffer(data)}for(var i=0;i>>8^tbl[(crc^code)&255]}return(crc^-1)>>>0},hmac:function hmac(key,string,digest,fn){if(!digest)digest="binary";if(digest==="buffer"){digest=undefined}if(!fn)fn="sha256";if(typeof string==="string")string=new Buffer(string);return cryptoLib.createHmac(fn,key).update(string).digest(digest)},md5:function md5(data,digest,callback){return util.crypto.hash("md5",data,digest,callback)},sha256:function sha256(data,digest,callback){return util.crypto.hash("sha256",data,digest,callback)},hash:function(algorithm,data,digest,callback){var hash=util.crypto.createHash(algorithm);if(!digest){digest="binary"}if(digest==="buffer"){digest=undefined}if(typeof data==="string")data=new Buffer(data);var sliceFn=util.arraySliceFn(data);var isBuffer=Buffer.isBuffer(data);if(callback&&typeof data==="object"&&typeof data.on==="function"&&!isBuffer){data.on("data",function(chunk){hash.update(chunk)});data.on("error",function(err){callback(err)});data.on("end",function(){callback(null,hash.digest(digest))})}else if(callback&&sliceFn&&!isBuffer&&typeof FileReader!=="undefined"){var index=0,size=1024*512;var reader=new FileReader;reader.onerror=function(){callback(new Error("Failed to read data."))};reader.onload=function(){var buf=new Buffer(new Uint8Array(reader.result));hash.update(buf);index+=buf.length;reader._continueReading()};reader._continueReading=function(){if(index>=data.size){callback(null,hash.digest(digest));return}var back=index+size;if(back>data.size)back=data.size;reader.readAsArrayBuffer(sliceFn.call(data,index,back))};reader._continueReading()}else{if(util.isBrowser()&&typeof data==="object"&&!isBuffer){data=new Buffer(new Uint8Array(data))}var out=hash.update(data).digest(digest);if(callback)callback(null,out);return out}},toHex:function toHex(data){var out=[];for(var i=0;i0||noEmpty?xml.root().toString():""};function serialize(xml,value,shape){switch(shape.type){case"structure":return serializeStructure(xml,value,shape);case"map":return serializeMap(xml,value,shape);case"list":return serializeList(xml,value,shape);default:return serializeScalar(xml,value,shape)}}function serializeStructure(xml,params,shape){util.arrayEach(shape.memberNames,function(memberName){var memberShape=shape.members[memberName];if(memberShape.location!=="body")return;var value=params[memberName];var name=memberShape.name;if(value!==undefined&&value!==null){if(memberShape.isXmlAttribute){xml.att(name,value)}else if(memberShape.flattened){serialize(xml,value,memberShape)}else{var element=xml.ele(name);applyNamespaces(element,memberShape);serialize(element,value,memberShape)}}})}function serializeMap(xml,map,shape){var xmlKey=shape.key.name||"key";var xmlValue=shape.value.name||"value";util.each(map,function(key,value){var entry=xml.ele(shape.flattened?shape.name:"entry");serialize(entry.ele(xmlKey),key,shape.key);serialize(entry.ele(xmlValue),value,shape.value)})}function serializeList(xml,list,shape){if(shape.flattened){util.arrayEach(list,function(value){var name=shape.member.name||shape.name;var element=xml.ele(name);serialize(element,value,shape.member)})}else{util.arrayEach(list,function(value){var name=shape.member.name||"member";var element=xml.ele(name);serialize(element,value,shape.member)})}}function serializeScalar(xml,value,shape){xml.txt(shape.toWireFormat(value))}function applyNamespaces(xml,shape){var uri,prefix="xmlns";if(shape.xmlNamespaceUri){uri=shape.xmlNamespaceUri;if(shape.xmlNamespacePrefix)prefix+=":"+shape.xmlNamespacePrefix}else if(xml.isRoot&&shape.api.xmlNamespaceUri){uri=shape.api.xmlNamespaceUri}if(uri)xml.att(prefix,uri)}module.exports=XmlBuilder}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/xml/builder.js","/node_modules/@mitocgroup/deep-resource/node_modules/aws-sdk/lib/xml")},{"../util":215,_process:1069,buffer:919,xmlbuilder:"xmlbuilder"}],218:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){exports=module.exports=debug;exports.coerce=coerce;exports.disable=disable;exports.enable=enable;exports.enabled=enabled;exports.humanize=require("ms");exports.names=[];exports.skips=[];exports.formatters={};var prevColor=0;var prevTime;function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(namespace){function disabled(){}disabled.enabled=false;function enabled(){var self=enabled;var curr=+new Date;var ms=curr-(prevTime||curr);self.diff=ms;self.prev=prevTime;self.curr=curr;prevTime=curr;if(null==self.useColors)self.useColors=exports.useColors();if(null==self.color&&self.useColors)self.color=selectColor();var args=Array.prototype.slice.call(arguments);args[0]=exports.coerce(args[0]);if("string"!==typeof args[0]){args=["%o"].concat(args)}var index=0;args[0]=args[0].replace(/%([a-z%])/g,function(match,format){if(match==="%%")return match;index++;var formatter=exports.formatters[format];if("function"===typeof formatter){var val=args[index];match=formatter.call(self,val);args.splice(index,1);index--}return match});if("function"===typeof exports.formatArgs){args=exports.formatArgs.apply(self,args)}var logFn=enabled.log||exports.log||console.log.bind(console);logFn.apply(self,args)}enabled.enabled=true;var fn=exports.enabled(namespace)?enabled:disabled;fn.namespace=namespace;return fn}function enable(namespaces){exports.save(namespaces);var split=(namespaces||"").split(/[\s,]+/);var len=split.length;for(var i=0;iself.maxFieldsSize){self._error(new Error("maxFieldsSize exceeded, received "+self._fieldsSize+" bytes of field data"));return}value+=decoder.write(buffer)});part.on("end",function(){self.emit("field",part.name,value)});return}this._flushing++;var file=new File({path:this._uploadPath(part.filename),name:part.filename,type:part.mime,hash:self.hash});this.emit("fileBegin",part.name,file);file.open();this.openedFiles.push(file);part.on("data",function(buffer){self.pause();file.write(buffer,function(){self.resume()})});part.on("end",function(){file.end(function(){self._flushing--;self.emit("file",part.name,file);self._maybeEnd()})})};function dummyParser(self){return{end:function(){self.ended=true;self._maybeEnd();return null}}}IncomingForm.prototype._parseContentType=function(){if(this.bytesExpected===0){this._parser=dummyParser(this);return}if(!this.headers["content-type"]){this._error(new Error("bad content-type header, no content-type"));return}if(this.headers["content-type"].match(/octet-stream/i)){this._initOctetStream();return}if(this.headers["content-type"].match(/urlencoded/i)){this._initUrlencoded();return}if(this.headers["content-type"].match(/multipart/i)){var m;if(m=this.headers["content-type"].match(/boundary=(?:"([^"]+)"|([^;]+))/i)){this._initMultipart(m[1]||m[2])}else{this._error(new Error("bad content-type header, no multipart boundary"))}return}if(this.headers["content-type"].match(/json/i)){this._initJSONencoded();return}this._error(new Error("bad content-type header, unknown content-type: "+this.headers["content-type"]))};IncomingForm.prototype._error=function(err){if(this.error||this.ended){return}this.error=err;this.pause();this.emit("error",err);if(Array.isArray(this.openedFiles)){this.openedFiles.forEach(function(file){file._writeStream.destroy();setTimeout(fs.unlink,0,file.path)})}};IncomingForm.prototype._parseContentLength=function(){this.bytesReceived=0;if(this.headers["content-length"]){this.bytesExpected=parseInt(this.headers["content-length"],10)}else if(this.headers["transfer-encoding"]===undefined){this.bytesExpected=0}if(this.bytesExpected!==null){this.emit("progress",this.bytesReceived,this.bytesExpected)}};IncomingForm.prototype._newParser=function(){return new MultipartParser};IncomingForm.prototype._initMultipart=function(boundary){this.type="multipart";var parser=new MultipartParser,self=this,headerField,headerValue,part;parser.initWithBoundary(boundary);parser.onPartBegin=function(){part=new Stream;part.readable=true;part.headers={};part.name=null;part.filename=null;part.mime=null;part.transferEncoding="binary";part.transferBuffer="";headerField="";headerValue=""};parser.onHeaderField=function(b,start,end){headerField+=b.toString(self.encoding,start,end)};parser.onHeaderValue=function(b,start,end){headerValue+=b.toString(self.encoding,start,end)};parser.onHeaderEnd=function(){headerField=headerField.toLowerCase();part.headers[headerField]=headerValue;var m;if(headerField=="content-disposition"){if(m=headerValue.match(/\bname="([^"]+)"/i)){part.name=m[1]}part.filename=self._fileName(headerValue)}else if(headerField=="content-type"){part.mime=headerValue}else if(headerField=="content-transfer-encoding"){part.transferEncoding=headerValue.toLowerCase()}headerField="";headerValue=""};parser.onHeadersEnd=function(){switch(part.transferEncoding){case"binary":case"7bit":case"8bit":parser.onPartData=function(b,start,end){part.emit("data",b.slice(start,end))};parser.onPartEnd=function(){part.emit("end")};break;case"base64":parser.onPartData=function(b,start,end){part.transferBuffer+=b.slice(start,end).toString("ascii");var offset=parseInt(part.transferBuffer.length/4)*4;part.emit("data",new Buffer(part.transferBuffer.substring(0,offset),"base64"));part.transferBuffer=part.transferBuffer.substring(offset)};parser.onPartEnd=function(){part.emit("data",new Buffer(part.transferBuffer,"base64"));part.emit("end")};break;default:return self._error(new Error("unknown transfer-encoding"))}self.onPart(part)};parser.onEnd=function(){self.ended=true;self._maybeEnd()};this._parser=parser};IncomingForm.prototype._fileName=function(headerValue){var m=headerValue.match(/\bfilename="(.*?)"($|; )/i);if(!m)return;var filename=m[1].substr(m[1].lastIndexOf("\\")+1);filename=filename.replace(/%22/g,'"');filename=filename.replace(/&#([\d]{4});/g,function(m,code){return String.fromCharCode(code)});return filename};IncomingForm.prototype._initUrlencoded=function(){this.type="urlencoded";var parser=new QuerystringParser(this.maxFields),self=this;parser.onField=function(key,val){self.emit("field",key,val)};parser.onEnd=function(){self.ended=true;self._maybeEnd()};this._parser=parser};IncomingForm.prototype._initOctetStream=function(){this.type="octet-stream";var filename=this.headers["x-file-name"];var mime=this.headers["content-type"];var file=new File({path:this._uploadPath(filename),name:filename,type:mime});file.open();this.emit("fileBegin",filename,file);this._flushing++;var self=this;self._parser=new OctetParser;var outstandingWrites=0;self._parser.on("data",function(buffer){self.pause();outstandingWrites++;file.write(buffer,function(){outstandingWrites--;self.resume();if(self.ended){self._parser.emit("doneWritingFile")}})});self._parser.on("end",function(){self._flushing--;self.ended=true;var done=function(){self.emit("file","file",file);self._maybeEnd()};if(outstandingWrites===0){done()}else{self._parser.once("doneWritingFile",done)}})};IncomingForm.prototype._initJSONencoded=function(){this.type="json";var parser=new JSONParser,self=this;if(this.bytesExpected){parser.initWithLength(this.bytesExpected)}parser.onField=function(key,val){self.emit("field",key,val)};parser.onEnd=function(){self.ended=true;self._maybeEnd()};this._parser=parser};IncomingForm.prototype._uploadPath=function(filename){var name="";for(var i=0;i<32;i++){name+=Math.floor(Math.random()*16).toString(16)}if(this.keepExtensions){var ext=path.extname(filename);ext=ext.replace(/(\.[a-z0-9]+).*/,"$1");name+=ext}return path.join(this.uploadDir,name)};IncomingForm.prototype._maybeEnd=function(){if(!this.ended||this._flushing||this.error){return}this.emit("end")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib/incoming_form.js","/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib")},{"./file":220,"./json_parser":222,"./multipart_parser":223,"./octet_parser":224,"./querystring_parser":225,_process:1069,buffer:919,events:1061,fs:916,os:1067,path:1068,stream:1084,string_decoder:"string_decoder",util:1089}],222:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){if(global.GENTLY)require=GENTLY.hijack(require);var Buffer=require("buffer").Buffer;function JSONParser(){this.data=new Buffer("");this.bytesWritten=0}exports.JSONParser=JSONParser;JSONParser.prototype.initWithLength=function(length){this.data=new Buffer(length)};JSONParser.prototype.write=function(buffer){if(this.data.length>=this.bytesWritten+buffer.length){buffer.copy(this.data,this.bytesWritten)}else{this.data=Buffer.concat([this.data,buffer])}this.bytesWritten+=buffer.length;return buffer.length};JSONParser.prototype.end=function(){try{var fields=JSON.parse(this.data.toString("utf8"));for(var field in fields){this.onField(field,fields[field])}}catch(e){}this.data=null;this.onEnd()}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib/json_parser.js","/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib")},{_process:1069,buffer:919}],223:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Buffer=require("buffer").Buffer,s=0,S={PARSER_UNINITIALIZED:s++,START:s++,START_BOUNDARY:s++,HEADER_FIELD_START:s++,HEADER_FIELD:s++,HEADER_VALUE_START:s++,HEADER_VALUE:s++,HEADER_VALUE_ALMOST_DONE:s++,HEADERS_ALMOST_DONE:s++,PART_DATA_START:s++,PART_DATA:s++,PART_END:s++,END:s++},f=1,F={PART_BOUNDARY:f,LAST_BOUNDARY:f*=2},LF=10,CR=13,SPACE=32,HYPHEN=45,COLON=58,A=97,Z=122,lower=function(c){return c|32};for(s in S){exports[s]=S[s]}function MultipartParser(){this.boundary=null;this.boundaryChars=null;this.lookbehind=null;this.state=S.PARSER_UNINITIALIZED;this.index=null;this.flags=0}exports.MultipartParser=MultipartParser;MultipartParser.stateToString=function(stateNumber){for(var state in S){var number=S[state];if(number===stateNumber)return state}};MultipartParser.prototype.initWithBoundary=function(str){this.boundary=new Buffer(str.length+4);this.boundary.write("\r\n--","ascii",0);this.boundary.write(str,"ascii",4);this.lookbehind=new Buffer(this.boundary.length+8);this.state=S.START;this.boundaryChars={};for(var i=0;iZ){return i}break;case S.HEADER_VALUE_START:if(c==SPACE){break}mark("headerValue");state=S.HEADER_VALUE;case S.HEADER_VALUE:if(c==CR){dataCallback("headerValue",true);callback("headerEnd");state=S.HEADER_VALUE_ALMOST_DONE}break;case S.HEADER_VALUE_ALMOST_DONE:if(c!=LF){return i}state=S.HEADER_FIELD_START;break;case S.HEADERS_ALMOST_DONE:if(c!=LF){return i}callback("headersEnd");state=S.PART_DATA_START;break;case S.PART_DATA_START:state=S.PART_DATA;mark("partData");case S.PART_DATA:prevIndex=index;if(index==0){i+=boundaryEnd;while(i0){lookbehind[index-1]=c}else if(prevIndex>0){callback("partData",lookbehind,0,prevIndex);prevIndex=0;mark("partData");i--}break;case S.END:break;default:return i}}dataCallback("headerField");dataCallback("headerValue");dataCallback("partData");this.index=index;this.state=state;this.flags=flags;return len};MultipartParser.prototype.end=function(){var callback=function(self,name){var callbackSymbol="on"+name.substr(0,1).toUpperCase()+name.substr(1);if(callbackSymbol in self){self[callbackSymbol]()}};if(this.state==S.HEADER_FIELD_START&&this.index==0||this.state==S.PART_DATA&&this.index==this.boundary.length){callback(this,"partEnd");callback(this,"end")}else if(this.state!=S.END){return new Error("MultipartParser.end(): stream ended unexpectedly: "+this.explain())}};MultipartParser.prototype.explain=function(){return"state = "+MultipartParser.stateToString(this.state)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib/multipart_parser.js","/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib")},{_process:1069,buffer:919}],224:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var EventEmitter=require("events").EventEmitter,util=require("util");function OctetParser(options){if(!(this instanceof OctetParser))return new OctetParser(options);EventEmitter.call(this)}util.inherits(OctetParser,EventEmitter);exports.OctetParser=OctetParser;OctetParser.prototype.write=function(buffer){this.emit("data",buffer);return buffer.length};OctetParser.prototype.end=function(){this.emit("end")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib/octet_parser.js","/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib")},{_process:1069,buffer:919,events:1061,util:1089}],225:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){if(global.GENTLY)require=GENTLY.hijack(require);var querystring=require("querystring");function QuerystringParser(maxKeys){this.maxKeys=maxKeys;this.buffer=""}exports.QuerystringParser=QuerystringParser;QuerystringParser.prototype.write=function(buffer){this.buffer+=buffer.toString("ascii");return buffer.length};QuerystringParser.prototype.end=function(){var fields=querystring.parse(this.buffer,"&","=",{maxKeys:this.maxKeys});for(var field in fields){this.onField(field,fields[field])}this.buffer="";this.onEnd()}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib/querystring_parser.js","/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/formidable/lib")},{_process:1069,buffer:919,querystring:1073}],226:[function(require,module,exports){module.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mdp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"], -"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-nzb":["nzb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-research-info-systems":["ris"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp4":["mp4a","m4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/opentype":["otf"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-mrsid-image":["sid"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/sgml":["sgml","sgm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["markdown","md","mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-pascal":["p","pas"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],227:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Stringify=require("./stringify");var Parse=require("./parse");var internals={};module.exports={stringify:Stringify,parse:Parse}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/qs/lib/index.js","/node_modules/@mitocgroup/deep-resource/node_modules/superagent/node_modules/qs/lib")},{"./parse":228,"./stringify":229,_process:1069,buffer:919}],228:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Utils=require("./utils");var internals={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};internals.parseValues=function(str,options){var obj={};var parts=str.split(options.delimiter,options.parameterLimit===Infinity?undefined:options.parameterLimit);for(var i=0,il=parts.length;i=0&&index<=options.arrayLimit){obj=[];obj[index]=internals.parseObject(chain,val,options)}else{obj[cleanRoot]=internals.parseObject(chain,val,options)}}return obj};internals.parseKeys=function(key,val,options){if(!key){return}var parent=/^([^\[\]]*)/;var child=/(\[[^\[\]]*\])/g;var segment=parent.exec(key);if(Object.prototype.hasOwnProperty(segment[1])){return}var keys=[];if(segment[1]){keys.push(segment[1])}var i=0;while((segment=child.exec(key))!==null&&i0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else{if(state.decoder&&!addToFront&&!encoding)chunk=state.decoder.write(chunk);state.length+=state.objectMode?1:chunk.length;if(addToFront){state.buffer.unshift(chunk)}else{state.reading=false;state.buffer.push(chunk)}if(state.needReadable)emitReadable(stream);maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM){n=MAX_HWM}else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(isNaN(n)||n===null){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=roundUpToNextPowerOf2(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else return state.length}return n}Readable.prototype.read=function(n){var state=this._readableState;state.calledRead=true;var nOrig=n;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;if(state.length-n<=state.highWaterMark)doRead=true;if(state.ended||state.reading)doRead=false;if(doRead){state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false}if(doRead&&!state.reading)n=howMuchToRead(nOrig,state);var ret;if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(state.ended&&!state.endEmitted&&state.length===0)endReadable(this);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode&&!er){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.length>0)emitReadable(stream);else endReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(state.emittedReadable)return;state.emittedReadable=true;if(state.sync)process.nextTick(function(){emitReadable_(stream)});else emitReadable_(stream); -}function emitReadable_(stream){stream.emit("readable")}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(function(){maybeReadMore_(stream,state)})}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length0)return}if(state.pipesCount===0){state.flowing=false;if(EE.listenerCount(src,"data")>0)emitDataEvents(src);return}state.ranOut=true}function pipeOnReadable(){if(this._readableState.ranOut){this._readableState.ranOut=false;flow(this)}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;for(var i=0;i=length){if(stringMode)ret=list.join("");else ret=Buffer.concat(list,length);list.length=0}else{if(n0)throw new Error("endReadable called on non-empty stream");if(!state.endEmitted&&state.calledRead){state.ended=true;process.nextTick(function(){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}})}}function forEach(xs,f){for(var i=0,l=xs.length;ithis.expireTime){return true}else{return this.expired||!this.accessKeyId||!this.secretAccessKey}},get:function get(callback){var self=this;if(this.needsRefresh()){this.refresh(function(err){if(!err)self.expired=false;if(callback)callback(err)})}else if(callback){callback()}},refresh:function refresh(callback){this.expired=false;callback()}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib")},{"./core":244,_process:1069,buffer:919}],246:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.CognitoIdentityCredentials=AWS.util.inherit(AWS.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function CognitoIdentityCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params;this.data=null;this.identityId=null;this.loadCachedId()},refresh:function refresh(callback){var self=this;self.createClients();self.data=null;self.identityId=null;self.getId(function(err){if(!err){if(!self.params.RoleArn){self.getCredentialsForIdentity(callback)}else{self.getCredentialsFromSTS(callback)}}else{self.clearCachedId();callback(err)}})},clearCachedId:function clearCache(){this.identityId=null;delete this.params.IdentityId;var poolId=this.params.IdentityPoolId;delete this.storage[this.localStorageKey.id+poolId];delete this.storage[this.localStorageKey.providers+poolId]},getId:function getId(callback){var self=this;if(typeof self.params.IdentityId==="string"){return callback(null,self.params.IdentityId)}self.cognito.getId(function(err,data){if(!err&&data.IdentityId){self.params.IdentityId=data.IdentityId;callback(null,data.IdentityId)}else{callback(err)}})},loadCredentials:function loadCredentials(data,credentials){if(!data||!credentials)return;credentials.expired=false;credentials.accessKeyId=data.Credentials.AccessKeyId;credentials.secretAccessKey=data.Credentials.SecretKey;credentials.sessionToken=data.Credentials.SessionToken;credentials.expireTime=data.Credentials.Expiration},getCredentialsForIdentity:function getCredentialsForIdentity(callback){var self=this;self.cognito.getCredentialsForIdentity(function(err,data){if(!err){self.cacheId(data);self.data=data;self.loadCredentials(self.data,self)}else{self.clearCachedId()}callback(err)})},getCredentialsFromSTS:function getCredentialsFromSTS(callback){var self=this;self.cognito.getOpenIdToken(function(err,data){if(!err){self.cacheId(data);self.params.WebIdentityToken=data.Token;self.webIdentityCredentials.refresh(function(webErr){if(!webErr){self.data=self.webIdentityCredentials.data;self.sts.credentialsFrom(self.data,self)}else{self.clearCachedId()}callback(webErr)})}else{self.clearCachedId();callback(err)}})},loadCachedId:function loadCachedId(){var self=this;if(AWS.util.isBrowser()&&!self.params.IdentityId){var id=self.getStorage("id");if(id&&self.params.Logins){var actualProviders=Object.keys(self.params.Logins);var cachedProviders=(self.getStorage("providers")||"").split(",");var intersect=cachedProviders.filter(function(n){return actualProviders.indexOf(n)!==-1});if(intersect.length!==0){self.params.IdentityId=id}}else if(id){self.params.IdentityId=id}}},createClients:function(){this.webIdentityCredentials=this.webIdentityCredentials||new AWS.WebIdentityCredentials(this.params);this.cognito=this.cognito||new AWS.CognitoIdentity({params:this.params});this.sts=this.sts||new AWS.STS},cacheId:function cacheId(data){this.identityId=data.IdentityId;this.params.IdentityId=this.identityId;if(AWS.util.isBrowser()){this.setStorage("id",data.IdentityId);if(this.params.Logins){this.setStorage("providers",Object.keys(this.params.Logins).join(","))}}},getStorage:function getStorage(key){return this.storage[this.localStorageKey[key]+this.params.IdentityPoolId]},setStorage:function setStorage(key,val){try{this.storage[this.localStorageKey[key]+this.params.IdentityPoolId]=val}catch(_){}},storage:function(){try{return AWS.util.isBrowser()&&window.localStorage!==null&&typeof window.localStorage==="object"?window.localStorage:{}}catch(_){return{}}}()})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials/cognito_identity_credentials.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials")},{"../core":244,_process:1069,buffer:919}],247:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.CredentialProviderChain=AWS.util.inherit(AWS.Credentials,{constructor:function CredentialProviderChain(providers){if(providers){this.providers=providers}else{this.providers=AWS.CredentialProviderChain.defaultProviders.slice(0)}},resolve:function resolve(callback){if(this.providers.length===0){callback(new Error("No providers"));return this}var index=0;var providers=this.providers.slice(0);function resolveNext(err,creds){if(!err&&creds||index===providers.length){callback(err,creds);return}var provider=providers[index++];if(typeof provider==="function"){creds=provider.call()}else{creds=provider}if(creds.get){creds.get(function(getErr){resolveNext(getErr,getErr?null:creds)})}else{resolveNext(null,creds)}}resolveNext();return this}});AWS.CredentialProviderChain.defaultProviders=[]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials/credential_provider_chain.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials")},{"../core":244,_process:1069,buffer:919}],248:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.SAMLCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function SAMLCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.assumeRoleWithSAML(function(err,data){if(!err){self.service.credentialsFrom(data,self)}callback(err)})},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials/saml_credentials.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials")},{"../core":244,_process:1069,buffer:919}],249:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.TemporaryCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function TemporaryCredentials(params){AWS.Credentials.call(this);this.loadMasterCredentials();this.expired=true;this.params=params||{};if(this.params.RoleArn){this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials"}},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.config.credentials=self.masterCredentials;var operation=self.params.RoleArn?self.service.assumeRole:self.service.getSessionToken;operation.call(self.service,function(err,data){if(!err){self.service.credentialsFrom(data,self)}callback(err)})},loadMasterCredentials:function loadMasterCredentials(){this.masterCredentials=AWS.config.credentials;while(this.masterCredentials.masterCredentials){this.masterCredentials=this.masterCredentials.masterCredentials}},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials/temporary_credentials.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials")},{"../core":244,_process:1069,buffer:919}],250:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.WebIdentityCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function WebIdentityCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params;this.params.RoleSessionName=this.params.RoleSessionName||"web-identity";this.data=null},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.assumeRoleWithWebIdentity(function(err,data){self.data=null;if(!err){self.data=data;self.service.credentialsFrom(data,self)}callback(err)})},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials/web_identity_credentials.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/credentials")},{"../core":244,_process:1069,buffer:919}],251:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var SequentialExecutor=require("./sequential_executor");AWS.EventListeners={Core:{}};AWS.EventListeners={Core:(new SequentialExecutor).addNamedListeners(function(add,addAsync){addAsync("VALIDATE_CREDENTIALS","validate",function VALIDATE_CREDENTIALS(req,done){if(!req.service.api.signatureVersion)return done();req.service.config.getCredentials(function(err){if(err){req.response.error=AWS.util.error(err,{code:"CredentialsError",message:"Missing credentials in config"})}done()})});add("VALIDATE_REGION","validate",function VALIDATE_REGION(req){if(!req.service.config.region&&!req.service.isGlobalEndpoint){req.response.error=AWS.util.error(new Error,{code:"ConfigError",message:"Missing region in config"})}});add("VALIDATE_PARAMETERS","validate",function VALIDATE_PARAMETERS(req){var rules=req.service.api.operations[req.operation].input;(new AWS.ParamValidator).validate(rules,req.params)});addAsync("COMPUTE_SHA256","afterBuild",function COMPUTE_SHA256(req,done){req.haltHandlersOnError();if(!req.service.api.signatureVersion)return done();if(req.service.getSignerClass(req)===AWS.Signers.V4){var body=req.httpRequest.body||"";AWS.util.computeSha256(body,function(err,sha){if(err){done(err)}else{req.httpRequest.headers["X-Amz-Content-Sha256"]=sha;done()}})}else{done()}});add("SET_CONTENT_LENGTH","afterBuild",function SET_CONTENT_LENGTH(req){if(req.httpRequest.headers["Content-Length"]===undefined){var length=AWS.util.string.byteLength(req.httpRequest.body);req.httpRequest.headers["Content-Length"]=length}});add("SET_HTTP_HOST","afterBuild",function SET_HTTP_HOST(req){req.httpRequest.headers["Host"]=req.httpRequest.endpoint.host});add("RESTART","restart",function RESTART(){var err=this.response.error;if(!err||!err.retryable)return;this.httpRequest=new AWS.HttpRequest(this.service.endpoint,this.service.region);if(this.response.retryCount=60*10){this.emit("sign",[this],function(err){if(err)done(err);else executeSend()})}else{executeSend()}});add("HTTP_HEADERS","httpHeaders",function HTTP_HEADERS(statusCode,headers,resp){resp.httpResponse.statusCode=statusCode;resp.httpResponse.headers=headers;resp.httpResponse.body=new AWS.util.Buffer("");resp.httpResponse.buffers=[];resp.httpResponse.numBytes=0});add("HTTP_DATA","httpData",function HTTP_DATA(chunk,resp){if(chunk){if(AWS.util.isNode()){resp.httpResponse.numBytes+=chunk.length;var total=resp.httpResponse.headers["content-length"];var progress={loaded:resp.httpResponse.numBytes,total:total};resp.request.emit("httpDownloadProgress",[progress,resp])}resp.httpResponse.buffers.push(new AWS.util.Buffer(chunk))}});add("HTTP_DONE","httpDone",function HTTP_DONE(resp){if(resp.httpResponse.buffers&&resp.httpResponse.buffers.length>0){var body=AWS.util.buffer.concat(resp.httpResponse.buffers);resp.httpResponse.body=body}delete resp.httpResponse.numBytes;delete resp.httpResponse.buffers});add("FINALIZE_ERROR","retry",function FINALIZE_ERROR(resp){if(resp.httpResponse.statusCode){resp.error.statusCode=resp.httpResponse.statusCode;if(resp.error.retryable===undefined){resp.error.retryable=this.service.retryableError(resp.error,this)}}});add("INVALIDATE_CREDENTIALS","retry",function INVALIDATE_CREDENTIALS(resp){if(!resp.error)return;switch(resp.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":resp.error.retryable=true;resp.request.service.config.credentials.expired=true}});add("EXPIRED_SIGNATURE","retry",function EXPIRED_SIGNATURE(resp){var err=resp.error;if(!err)return;if(typeof err.code==="string"&&typeof err.message==="string"){if(err.code.match(/Signature/)&&err.message.match(/expired/)){resp.error.retryable=true}}});add("REDIRECT","retry",function REDIRECT(resp){if(resp.error&&resp.error.statusCode>=300&&resp.error.statusCode<400&&resp.httpResponse.headers["location"]){this.httpRequest.endpoint=new AWS.Endpoint(resp.httpResponse.headers["location"]);this.httpRequest.headers["Host"]=this.httpRequest.endpoint.host;resp.error.redirect=true;resp.error.retryable=true}});add("RETRY_CHECK","retry",function RETRY_CHECK(resp){if(resp.error){if(resp.error.redirect&&resp.redirectCount=this.HEADERS_RECEIVED&&!headersEmitted){try{xhr.responseType="arraybuffer"}catch(e){}emitter.statusCode=xhr.status;emitter.headers=self.parseHeaders(xhr.getAllResponseHeaders());emitter.emit("headers",emitter.statusCode,emitter.headers);headersEmitted=true}if(this.readyState===this.DONE){self.finishRequest(xhr,emitter)}},false);xhr.upload.addEventListener("progress",function(evt){emitter.emit("sendProgress",evt)});xhr.addEventListener("progress",function(evt){emitter.emit("receiveProgress",evt)},false);xhr.addEventListener("timeout",function(){errCallback(AWS.util.error(new Error("Timeout"),{code:"TimeoutError"}))},false);xhr.addEventListener("error",function(){errCallback(AWS.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},false);callback(emitter);xhr.open(httpRequest.method,href,httpOptions.xhrAsync!==false);AWS.util.each(httpRequest.headers,function(key,value){if(key!=="Content-Length"&&key!=="User-Agent"&&key!=="Host"){xhr.setRequestHeader(key,value)}});if(httpOptions.timeout&&httpOptions.xhrAsync!==false){xhr.timeout=httpOptions.timeout}if(httpOptions.xhrWithCredentials){xhr.withCredentials=true}try{xhr.send(httpRequest.body)}catch(err){if(httpRequest.body&&typeof httpRequest.body.buffer==="object"){xhr.send(httpRequest.body.buffer)}else{throw err}}return emitter},parseHeaders:function parseHeaders(rawHeaders){var headers={};AWS.util.arrayEach(rawHeaders.split(/\r?\n/),function(line){var key=line.split(":",1)[0];var value=line.substring(key.length+2);if(key.length>0)headers[key.toLowerCase()]=value});return headers},finishRequest:function finishRequest(xhr,emitter){var buffer;if(xhr.responseType==="arraybuffer"&&xhr.response){var ab=xhr.response;buffer=new AWS.util.Buffer(ab.byteLength);var view=new Uint8Array(ab);for(var i=0;i1){var msg=this.errors.join("\n* ");if(this.errors.length>1){msg="There were "+this.errors.length+" validation errors:\n* "+msg;throw AWS.util.error(new Error(msg),{code:"MultipleValidationErrors",errors:this.errors})}}else if(this.errors.length===1){throw this.errors[0]}else{return true}},validateStructure:function validateStructure(shape,params,context){this.validateType(context,params,["object"],"structure");var paramName;for(var i=0;shape.required&&i0){var e=JSON.parse(httpResponse.body.toString());if(e.__type||e.code){error.code=(e.__type||e.code).split("#").pop()}if(error.code==="RequestEntityTooLarge"){error.message="Request body must be less than 1 MB"}else{error.message=e.message||e.Message||null}}else{error.statusCode=httpResponse.statusCode;error.message=httpResponse.statusCode.toString()}resp.error=util.error(new Error,error); -}function extractData(resp){var body=resp.httpResponse.body.toString()||"{}";if(resp.request.service.config.convertResponseTypes===false){resp.data=JSON.parse(body)}else{var operation=resp.request.service.api.operations[resp.request.operation];var shape=operation.output||{};var parser=new JsonParser;resp.data=parser.parse(body,shape)}}module.exports={buildRequest:buildRequest,extractError:extractError,extractData:extractData}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/protocol/json.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/protocol")},{"../json/builder":254,"../json/parser":255,"../util":292,_process:1069,buffer:919}],264:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var util=require("../util");var QueryParamSerializer=require("../query/query_param_serializer");var Shape=require("../model/shape");function buildRequest(req){var operation=req.service.api.operations[req.operation];var httpRequest=req.httpRequest;httpRequest.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8";httpRequest.params={Version:req.service.api.apiVersion,Action:operation.name};var builder=new QueryParamSerializer;builder.serialize(req.params,operation.input,function(name,value){httpRequest.params[name]=value});httpRequest.body=util.queryParamsToString(httpRequest.params)}function extractError(resp){var data,body=resp.httpResponse.body.toString();if(body.match("=0?"&":"?";var parts=[];util.arrayEach(Object.keys(queryString).sort(),function(key){if(!Array.isArray(queryString[key])){queryString[key]=[queryString[key]]}for(var i=0;i0){parser=new AWS.XML.Parser;var data=parser.parse(body.toString(),output);util.update(resp.data,data)}}module.exports={buildRequest:buildRequest,extractError:extractError,extractData:extractData}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/protocol/rest_xml.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/protocol")},{"../core":244,"../util":292,"./rest":265,_process:1069,buffer:919}],268:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var util=require("../util");function QueryParamSerializer(){}QueryParamSerializer.prototype.serialize=function(params,shape,fn){serializeStructure("",params,shape,fn)};function ucfirst(shape){if(shape.isQueryName||shape.api.protocol!=="ec2"){return shape.name}else{return shape.name[0].toUpperCase()+shape.name.substr(1)}}function serializeStructure(prefix,struct,rules,fn){util.each(rules.members,function(name,member){var value=struct[name];if(value===null||value===undefined)return;var memberName=ucfirst(member);memberName=prefix?prefix+"."+memberName:memberName;serializeMember(memberName,value,member,fn)})}function serializeMap(name,map,rules,fn){var i=1;util.each(map,function(key,value){var prefix=rules.flattened?".":".entry.";var position=prefix+i++ +".";var keyName=position+(rules.key.name||"key");var valueName=position+(rules.value.name||"value");serializeMember(name+keyName,key,rules.key,fn);serializeMember(name+valueName,value,rules.value,fn)})}function serializeList(name,list,rules,fn){var memberRules=rules.member||{};if(list.length===0){fn.call(this,name,null);return}util.arrayEach(list,function(v,n){var suffix="."+(n+1);if(rules.api.protocol==="ec2"){suffix=suffix+""}else if(rules.flattened){if(memberRules.name){var parts=name.split(".");parts.pop();parts.push(ucfirst(memberRules));name=parts.join(".")}}else{suffix=".member"+suffix}serializeMember(name+suffix,v,memberRules,fn)})}function serializeMember(name,value,rules,fn){if(value===null||value===undefined)return;if(rules.type==="structure"){serializeStructure(name,value,rules,fn)}else if(rules.type==="list"){serializeList(name,value,rules,fn)}else if(rules.type==="map"){serializeMap(name,value,rules,fn)}else{fn(name,rules.toWireFormat(value).toString())}}module.exports=QueryParamSerializer}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/query/query_param_serializer.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/query")},{"../util":292,_process:1069,buffer:919}],269:[function(require,module,exports){arguments[4][192][0].apply(exports,arguments)},{dup:192}],270:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var util=require("./util");var regionConfig=require("./region_config.json");function generateRegionPrefix(region){if(!region)return null;var parts=region.split("-");if(parts.length<3)return null;return parts.slice(0,parts.length-2).join("-")+"-*"}function derivedKeys(service){var region=service.config.region;var regionPrefix=generateRegionPrefix(region);var endpointPrefix=service.api.endpointPrefix;return[[region,endpointPrefix],[regionPrefix,endpointPrefix],[region,"*"],[regionPrefix,"*"],["*",endpointPrefix],["*","*"]].map(function(item){return item[0]&&item[1]?item.join("/"):null})}function applyConfig(service,config){util.each(config,function(key,value){if(key==="globalEndpoint")return;if(service.config[key]===undefined||service.config[key]===null){service.config[key]=value}})}function configureEndpoint(service){var keys=derivedKeys(service);for(var i=0;i=0){return null}if(this.expectedValue){return r===this.expectedValue}else{return r?true:false}},checkError:function checkError(resp){var value=this.config.successValue;if(typeof value==="number"){return resp.httpResponse.statusCode===value}else{return resp.error&&resp.error.code===value}},loadWaiterConfig:function loadWaiterConfig(state,noException){if(!this.service.api.waiters[state]){if(noException)return;throw new AWS.util.error(new Error,{code:"StateNotFoundError",message:"State "+state+" not found."})}this.config=this.service.api.waiters[state];var config=this.config;(function(){config.successType=config.successType||config.acceptorType;config.successPath=config.successPath||config.acceptorPath;config.successValue=config.successValue||config.acceptorValue;config.failureType=config.failureType||config.acceptorType;config.failurePath=config.failurePath||config.acceptorPath;config.failureValue=config.failureValue||config.acceptorValue})()}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/resource_waiter.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib")},{"./core":244,_process:1069,buffer:919}],273:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var inherit=AWS.util.inherit;AWS.Response=inherit({constructor:function Response(request){this.request=request;this.data=null;this.error=null;this.retryCount=0;this.redirectCount=0;this.httpResponse=new AWS.HttpResponse;if(request){this.maxRetries=request.service.numRetries();this.maxRedirects=request.service.config.maxRedirects}},nextPage:function nextPage(callback){var config;var service=this.request.service;var operation=this.request.operation;try{config=service.paginationConfig(operation,true)}catch(e){this.error=e}if(!this.hasNextPage()){if(callback)callback(this.error,null);else if(this.error)throw this.error;return null}var params=AWS.util.copy(this.request.params);if(!this.nextPageTokens){return callback?callback(null,null):null}else{var inputTokens=config.inputToken;if(typeof inputTokens==="string")inputTokens=[inputTokens];for(var i=0;iself.partSize)self.partSize=newPartSize; -}else{self.totalBytes=undefined}},isDoneChunking:false,partPos:0,totalChunkedBytes:0,totalUploadedBytes:0,totalBytes:undefined,numParts:0,totalPartNumbers:0,activeParts:0,doneParts:0,parts:null,completeInfo:null,failed:false,multipartReq:null,partBuffers:null,partBufferLength:0,fillBuffer:function fillBuffer(){var self=this;var bodyLen=byteLength(self.body);if(bodyLen===0){self.isDoneChunking=true;self.numParts=1;self.nextChunk(self.body);return}while(self.activeParts=self.queueSize)return;var buf=self.body.read(self.partSize-self.partBufferLength)||self.body.read();if(buf){self.partBuffers.push(buf);self.partBufferLength+=buf.length;self.totalChunkedBytes+=buf.length}if(self.partBufferLength>=self.partSize){var pbuf=Buffer.concat(self.partBuffers);self.partBuffers=[];self.partBufferLength=0;if(pbuf.length>self.partSize){var rest=pbuf.slice(self.partSize);self.partBuffers.push(rest);self.partBufferLength+=rest.length;pbuf=pbuf.slice(0,self.partSize)}self.nextChunk(pbuf)}if(self.isDoneChunking&&!self.isDoneSending){pbuf=Buffer.concat(self.partBuffers);self.partBuffers=[];self.partBufferLength=0;self.totalBytes=self.totalChunkedBytes;self.isDoneSending=true;if(self.numParts===0||pbuf.length>0){self.numParts++;self.nextChunk(pbuf)}}self.body.read(0)},nextChunk:function nextChunk(chunk){var self=this;if(self.failed)return null;var partNumber=++self.totalPartNumbers;if(self.isDoneChunking&&partNumber===1){var req=self.service.putObject({Body:chunk});req._managedUpload=self;req.on("httpUploadProgress",self.progress).send(self.finishSinglePart);return null}self.activeParts++;if(!self.service.config.params.UploadId){if(!self.multipartReq){self.multipartReq=self.service.createMultipartUpload();self.multipartReq.on("success",function(resp){self.service.config.params.UploadId=resp.data.UploadId;self.multipartReq=null});self.queueChunks(chunk,partNumber);self.multipartReq.on("error",function(err){self.cleanup(err)});self.multipartReq.send()}else{self.queueChunks(chunk,partNumber)}}else{self.uploadPart(chunk,partNumber)}},uploadPart:function uploadPart(chunk,partNumber){var self=this;var partParams={Body:chunk,ContentLength:AWS.util.string.byteLength(chunk),PartNumber:partNumber};var partInfo={ETag:null,PartNumber:partNumber};self.completeInfo.push(partInfo);var req=self.service.uploadPart(partParams);self.parts[partNumber]=req;req._lastUploadedBytes=0;req._managedUpload=self;req.on("httpUploadProgress",self.progress);req.send(function(err,data){delete self.parts[partParams.PartNumber];self.activeParts--;if(!err&&(!data||!data.ETag)){var message="No access to ETag property on response.";if(AWS.util.isBrowser()){message+=" Check CORS configuration to expose ETag header."}err=AWS.util.error(new Error(message),{code:"ETagMissing",retryable:false})}if(err)return self.cleanup(err);partInfo.ETag=data.ETag;self.doneParts++;if(self.isDoneChunking&&self.doneParts===self.numParts){self.finishMultiPart()}else{self.fillQueue.call(self)}})},queueChunks:function queueChunks(chunk,partNumber){var self=this;self.multipartReq.on("success",function(){self.uploadPart(chunk,partNumber)})},cleanup:function cleanup(err){var self=this;if(self.failed)return;if(typeof self.body.removeAllListeners==="function"&&typeof self.body.resume==="function"){self.body.removeAllListeners("readable");self.body.removeAllListeners("end");self.body.resume()}if(self.service.config.params.UploadId&&!self.leavePartsOnError){self.service.abortMultipartUpload().send()}AWS.util.each(self.parts,function(partNumber,part){part.removeAllListeners("complete");part.abort()});self.parts={};self.callback(err);self.failed=true},finishMultiPart:function finishMultiPart(){var self=this;var completeParams={MultipartUpload:{Parts:self.completeInfo}};self.service.completeMultipartUpload(completeParams,function(err,data){if(err)return self.cleanup(err);else self.callback(err,data)})},finishSinglePart:function finishSinglePart(err,data){var upload=this.request._managedUpload;var httpReq=this.request.httpRequest;var url=AWS.util.urlFormat(httpReq.endpoint);if(err)return upload.callback(err);data.Location=url.substr(0,url.length-1)+httpReq.path;upload.callback(err,data)},progress:function progress(info){var upload=this._managedUpload;if(this.operation==="putObject"){info.part=1}else{upload.totalUploadedBytes+=info.loaded-this._lastUploadedBytes;this._lastUploadedBytes=info.loaded;info={loaded:upload.totalUploadedBytes,total:upload.totalBytes,part:this.params.PartNumber}}upload.emit("httpUploadProgress",[info])}});AWS.util.mixin(AWS.S3.ManagedUpload,AWS.SequentialExecutor);module.exports=AWS.S3.ManagedUpload}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/s3/managed_upload.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/s3")},{"../core":244,_process:1069,buffer:919}],275:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");AWS.SequentialExecutor=AWS.util.inherit({constructor:function SequentialExecutor(){this._events={}},listeners:function listeners(eventName){return this._events[eventName]?this._events[eventName].slice(0):[]},on:function on(eventName,listener){if(this._events[eventName]){this._events[eventName].push(listener)}else{this._events[eventName]=[listener]}return this},onAsync:function onAsync(eventName,listener){listener._isAsync=true;return this.on(eventName,listener)},removeListener:function removeListener(eventName,listener){var listeners=this._events[eventName];if(listeners){var length=listeners.length;var position=-1;for(var i=0;i-1){listeners.splice(position,1)}}return this},removeAllListeners:function removeAllListeners(eventName){if(eventName){delete this._events[eventName]}else{this._events={}}return this},emit:function emit(eventName,eventArgs,doneCallback){if(!doneCallback)doneCallback=function(){};var listeners=this.listeners(eventName);var count=listeners.length;this.callListeners(listeners,eventArgs,doneCallback);return count>0},callListeners:function callListeners(listeners,args,doneCallback,prevError){var self=this;var error=prevError||null;function callNextListener(err){if(err){error=AWS.util.error(error||new Error,err);if(self._haltHandlersOnError){return doneCallback.call(self,error)}}self.callListeners(listeners,args,doneCallback,error)}while(listeners.length>0){var listener=listeners.shift();if(listener._isAsync){listener.apply(self,args.concat([callNextListener]));return}else{try{listener.apply(self,args)}catch(err){error=AWS.util.error(error||new Error,err)}if(error&&self._haltHandlersOnError){doneCallback.call(self,error);return}}}doneCallback.call(self,error)},addListeners:function addListeners(listeners){var self=this;if(listeners._events)listeners=listeners._events;AWS.util.each(listeners,function(event,callbacks){if(typeof callbacks==="function")callbacks=[callbacks];AWS.util.arrayEach(callbacks,function(callback){self.on(event,callback)})});return self},addNamedListener:function addNamedListener(name,eventName,callback){this[name]=callback;this.addListener(eventName,callback);return this},addNamedAsyncListener:function addNamedAsyncListener(name,eventName,callback){callback._isAsync=true;return this.addNamedListener(name,eventName,callback)},addNamedListeners:function addNamedListeners(callback){var self=this;callback(function(){self.addNamedListener.apply(self,arguments)},function(){self.addNamedAsyncListener.apply(self,arguments)});return this}});AWS.SequentialExecutor.prototype.addListener=AWS.SequentialExecutor.prototype.on;module.exports=AWS.SequentialExecutor}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/sequential_executor.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib")},{"./core":244,_process:1069,buffer:919}],276:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var Api=require("./model/api");var regionConfig=require("./region_config");var inherit=AWS.util.inherit;AWS.Service=inherit({constructor:function Service(config){if(!this.loadServiceClass){throw AWS.util.error(new Error,"Service must be constructed with `new' operator")}var ServiceClass=this.loadServiceClass(config||{});if(ServiceClass)return new ServiceClass(config);this.initialize(config)},initialize:function initialize(config){var svcConfig=AWS.config[this.serviceIdentifier];this.config=new AWS.Config(AWS.config);if(svcConfig)this.config.update(svcConfig,true);if(config)this.config.update(config,true);this.validateService();if(!this.config.endpoint)regionConfig(this);this.config.endpoint=this.endpointFromTemplate(this.config.endpoint);this.setEndpoint(this.config.endpoint)},validateService:function validateService(){},loadServiceClass:function loadServiceClass(serviceConfig){var config=serviceConfig;if(!AWS.util.isEmpty(this.api)){return null}else if(config.apiConfig){return AWS.Service.defineServiceApi(this.constructor,config.apiConfig)}else if(!this.constructor.services){return null}else{config=new AWS.Config(AWS.config);config.update(serviceConfig,true);var version=config.apiVersions[this.constructor.serviceIdentifier];version=version||config.apiVersion;return this.getLatestServiceClass(version)}},getLatestServiceClass:function getLatestServiceClass(version){version=this.getLatestServiceVersion(version);if(this.constructor.services[version]===null){AWS.Service.defineServiceApi(this.constructor,version)}return this.constructor.services[version]},getLatestServiceVersion:function getLatestServiceVersion(version){if(!this.constructor.services||this.constructor.services.length===0){throw new Error("No services defined on "+this.constructor.serviceIdentifier)}if(!version){version="latest"}else if(AWS.util.isType(version,Date)){version=AWS.util.date.iso8601(version).split("T")[0]}if(Object.hasOwnProperty(this.constructor.services,version)){return version}var keys=Object.keys(this.constructor.services).sort();var selectedVersion=null;for(var i=keys.length-1;i>=0;i--){if(keys[i][keys[i].length-1]!=="*"){selectedVersion=keys[i]}if(keys[i].substr(0,10)<=version){return selectedVersion}}throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+version+"'")},api:{},defaultRetryCount:3,makeRequest:function makeRequest(operation,params,callback){if(typeof params==="function"){callback=params;params=null}params=params||{};if(this.config.params){var rules=this.api.operations[operation];if(rules){params=AWS.util.copy(params);AWS.util.each(this.config.params,function(key,value){if(rules.input.members[key]){if(params[key]===undefined||params[key]===null){params[key]=value}}})}}var request=new AWS.Request(this,operation,params);this.addAllRequestListeners(request);if(callback)request.send(callback);return request},makeUnauthenticatedRequest:function makeUnauthenticatedRequest(operation,params,callback){if(typeof params==="function"){callback=params;params={}}var request=this.makeRequest(operation,params).toUnauthenticated();return callback?request.send(callback):request},waitFor:function waitFor(state,params,callback){var waiter=new AWS.ResourceWaiter(this,state);return waiter.wait(params,callback)},addAllRequestListeners:function addAllRequestListeners(request){var list=[AWS.events,AWS.EventListeners.Core,this.serviceInterface(),AWS.EventListeners.CorePost];for(var i=0;i=500)return true;return false},networkingError:function networkingError(error){return error.code==="NetworkingError"},expiredCredentialsError:function expiredCredentialsError(error){return error.code==="ExpiredTokenException"},throttledError:function throttledError(error){switch(error.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":return true;default:return false}},endpointFromTemplate:function endpointFromTemplate(endpoint){if(typeof endpoint!=="string")return endpoint;var e=endpoint;e=e.replace(/\{service\}/g,this.api.endpointPrefix);e=e.replace(/\{region\}/g,this.config.region);e=e.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http");return e},setEndpoint:function setEndpoint(endpoint){this.endpoint=new AWS.Endpoint(endpoint,this.config)},paginationConfig:function paginationConfig(operation,throwException){var paginator=this.api.operations[operation].paginator;if(!paginator){if(throwException){var e=new Error;throw AWS.util.error(e,"No pagination configuration for "+operation)}return null}return paginator}});AWS.util.update(AWS.Service,{defineMethods:function defineMethods(svc){AWS.util.each(svc.prototype.api.operations,function iterator(method){if(svc.prototype[method])return;svc.prototype[method]=function(params,callback){return this.makeRequest(method,params,callback)}})},defineService:function defineService(serviceIdentifier,versions,features){AWS.Service._serviceMap[serviceIdentifier]=true;if(!Array.isArray(versions)){features=versions;versions=[]}var svc=inherit(AWS.Service,features||{});if(typeof serviceIdentifier==="string"){AWS.Service.addVersions(svc,versions);var identifier=svc.serviceIdentifier||serviceIdentifier;svc.serviceIdentifier=identifier}else{svc.prototype.api=serviceIdentifier;AWS.Service.defineMethods(svc)}return svc},addVersions:function addVersions(svc,versions){if(!Array.isArray(versions))versions=[versions];svc.services=svc.services||{};for(var i=0;i=1024*1024){req.httpRequest.headers["Expect"]="100-continue"}},addContentType:function addContentType(req){var httpRequest=req.httpRequest;if(httpRequest.method==="GET"||httpRequest.method==="HEAD"){delete httpRequest.headers["Content-Type"];return}if(!httpRequest.headers["Content-Type"]){httpRequest.headers["Content-Type"]="application/octet-stream"}var contentType=httpRequest.headers["Content-Type"];if(AWS.util.isBrowser()){if(typeof httpRequest.body==="string"&&!contentType.match(/;\s*charset=/)){var charset="; charset=UTF-8";httpRequest.headers["Content-Type"]+=charset}else{var replaceFn=function(_,prefix,charsetName){return prefix+charsetName.toUpperCase()};httpRequest.headers["Content-Type"]=contentType.replace(/(;\s*charset=)(.+)$/,replaceFn)}}},computableChecksumOperations:{putBucketCors:true,putBucketLifecycle:true,putBucketTagging:true,deleteObjects:true},willComputeChecksums:function willComputeChecksums(req){if(this.computableChecksumOperations[req.operation])return true;if(!this.config.computeChecksums)return false;if(!AWS.util.Buffer.isBuffer(req.httpRequest.body)&&typeof req.httpRequest.body!=="string"){return false}var rules=req.service.api.operations[req.operation].input.members;if(req.service.getSignerClass(req)===AWS.Signers.V4){if(rules.ContentMD5&&!rules.ContentMD5.required)return false}if(rules.ContentMD5&&!req.params.ContentMD5)return true},computeContentMd5:function computeContentMd5(req){if(req.service.willComputeChecksums(req)){var md5=AWS.util.crypto.md5(req.httpRequest.body,"base64");req.httpRequest.headers["Content-MD5"]=md5}},computeSseCustomerKeyMd5:function computeSseCustomerKeyMd5(req){var keys={SSECustomerKey:"x-amz-server-side-encryption-customer-key-MD5",CopySourceSSECustomerKey:"x-amz-copy-source-server-side-encryption-customer-key-MD5"};AWS.util.each(keys,function(key,header){if(req.params[key]){var value=AWS.util.crypto.md5(req.params[key],"base64");req.httpRequest.headers[header]=value}})},pathStyleBucketName:function pathStyleBucketName(bucketName){if(this.config.s3ForcePathStyle)return true;if(this.config.s3BucketEndpoint)return false;if(this.dnsCompatibleBucketName(bucketName)){return this.config.sslEnabled&&bucketName.match(/\./)?true:false}else{return true}},dnsCompatibleBucketName:function dnsCompatibleBucketName(bucketName){var b=bucketName;var domain=new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/);var ipAddress=new RegExp(/(\d+\.){3}\d+/);var dots=new RegExp(/\.\./);return b.match(domain)&&!b.match(ipAddress)&&!b.match(dots)?true:false},successfulResponse:function successfulResponse(resp){var req=resp.request;var httpResponse=resp.httpResponse;if(req.operation==="completeMultipartUpload"&&httpResponse.body.toString().match("")){return false}else{return httpResponse.statusCode<300}},retryableError:function retryableError(error,request){if(request.operation==="completeMultipartUpload"&&error.statusCode===200){return true}else if(error&&error.code==="RequestTimeout"){return true}else{var _super=AWS.Service.prototype.retryableError;return _super.call(this,error,request)}},extractData:function extractData(resp){var req=resp.request;if(req.operation==="getBucketLocation"){var match=resp.httpResponse.body.toString().match(/>(.+)<\/Location/);delete resp.data["_"];if(match){resp.data.LocationConstraint=match[1]}else{resp.data.LocationConstraint=""}}},extractError:function extractError(resp){var codes={304:"NotModified",403:"Forbidden",400:"BadRequest",404:"NotFound"};var code=resp.httpResponse.statusCode;var body=resp.httpResponse.body||"";if(codes[code]&&body.length===0){resp.error=AWS.util.error(new Error,{code:codes[resp.httpResponse.statusCode],message:null})}else{var data=(new AWS.XML.Parser).parse(body.toString());resp.error=AWS.util.error(new Error,{code:data.Code||code,message:data.Message||null})}},getSignedUrl:function getSignedUrl(operation,params,callback){params=AWS.util.copy(params||{});var expires=params.Expires||900;delete params.Expires;var request=this.makeRequest(operation,params);return request.presign(expires,callback)},prepareSignedUrl:function prepareSignedUrl(request){request.addListener("validate",request.service.noPresignedContentLength);request.removeListener("build",request.service.addContentType);if(!request.params.Body){request.removeListener("build",request.service.computeContentMd5)}else{request.addListener("afterBuild",AWS.EventListeners.Core.COMPUTE_SHA256)}},noPresignedContentLength:function noPresignedContentLength(request){if(request.params.ContentLength!==undefined){throw AWS.util.error(new Error,{code:"UnexpectedParameter",message:"ContentLength is not supported in pre-signed URLs."})}},createBucket:function createBucket(params,callback){if(!params)params={};var hostname=this.endpoint.hostname;if(hostname!==this.api.globalEndpoint&&!params.CreateBucketConfiguration){params.CreateBucketConfiguration={LocationConstraint:this.config.region}}return this.makeRequest("createBucket",params,callback)},upload:function upload(params,options,callback){if(typeof options==="function"&&callback===undefined){callback=options;options=null}options=options||{};options=AWS.util.merge(options||{},{service:this,params:params});var uploader=new AWS.S3.ManagedUpload(options);if(typeof callback==="function")uploader.send(callback);return uploader}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/services/s3.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/services")},{"../core":244,"../s3/managed_upload":274,_process:1069,buffer:919}],282:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.util.update(AWS.SQS.prototype,{setupRequestListeners:function setupRequestListeners(request){request.addListener("build",this.buildEndpoint);if(request.service.config.computeChecksums){if(request.operation==="sendMessage"){request.addListener("extractData",this.verifySendMessageChecksum)}else if(request.operation==="sendMessageBatch"){request.addListener("extractData",this.verifySendMessageBatchChecksum)}else if(request.operation==="receiveMessage"){request.addListener("extractData",this.verifyReceiveMessageChecksum)}}},verifySendMessageChecksum:function verifySendMessageChecksum(response){if(!response.data)return;var md5=response.data.MD5OfMessageBody;var body=this.params.MessageBody;var calculatedMd5=this.service.calculateChecksum(body);if(calculatedMd5!==md5){var msg='Got "'+response.data.MD5OfMessageBody+'", expecting "'+calculatedMd5+'".';this.service.throwInvalidChecksumError(response,[response.data.MessageId],msg)}},verifySendMessageBatchChecksum:function verifySendMessageBatchChecksum(response){ -if(!response.data)return;var service=this.service;var entries={};var errors=[];var messageIds=[];AWS.util.arrayEach(response.data.Successful,function(entry){entries[entry.Id]=entry});AWS.util.arrayEach(this.params.Entries,function(entry){if(entries[entry.Id]){var md5=entries[entry.Id].MD5OfMessageBody;var body=entry.MessageBody;if(!service.isChecksumValid(md5,body)){errors.push(entry.Id);messageIds.push(entries[entry.Id].MessageId)}}});if(errors.length>0){service.throwInvalidChecksumError(response,messageIds,"Invalid messages: "+errors.join(", "))}},verifyReceiveMessageChecksum:function verifyReceiveMessageChecksum(response){if(!response.data)return;var service=this.service;var messageIds=[];AWS.util.arrayEach(response.data.Messages,function(message){var md5=message.MD5OfBody;var body=message.Body;if(!service.isChecksumValid(md5,body)){messageIds.push(message.MessageId)}});if(messageIds.length>0){service.throwInvalidChecksumError(response,messageIds,"Invalid messages: "+messageIds.join(", "))}},throwInvalidChecksumError:function throwInvalidChecksumError(response,ids,message){response.error=AWS.util.error(new Error,{retryable:true,code:"InvalidChecksum",messageIds:ids,message:response.request.operation+" returned an invalid MD5 response. "+message})},isChecksumValid:function isChecksumValid(checksum,data){return this.calculateChecksum(data)===checksum},calculateChecksum:function calculateChecksum(data){return AWS.util.crypto.md5(data,"hex")},buildEndpoint:function buildEndpoint(request){var url=request.httpRequest.params.QueueUrl;if(url){request.httpRequest.endpoint=new AWS.Endpoint(url);var matches=request.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./);if(matches)request.httpRequest.region=matches[1]}}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/services/sqs.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/services")},{"../core":244,_process:1069,buffer:919}],283:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.util.update(AWS.STS.prototype,{credentialsFrom:function credentialsFrom(data,credentials){if(!data)return null;if(!credentials)credentials=new AWS.TemporaryCredentials;credentials.expired=false;credentials.accessKeyId=data.Credentials.AccessKeyId;credentials.secretAccessKey=data.Credentials.SecretAccessKey;credentials.sessionToken=data.Credentials.SessionToken;credentials.expireTime=data.Credentials.Expiration;return credentials},assumeRoleWithWebIdentity:function assumeRoleWithWebIdentity(params,callback){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",params,callback)},assumeRoleWithSAML:function assumeRoleWithSAML(params,callback){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",params,callback)}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/services/sts.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/services")},{"../core":244,_process:1069,buffer:919}],284:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;var expiresHeader="presigned-expires";function signedUrlBuilder(request){var expires=request.httpRequest.headers[expiresHeader];delete request.httpRequest.headers["User-Agent"];delete request.httpRequest.headers["X-Amz-User-Agent"];if(request.service.getSignerClass()===AWS.Signers.V4){if(expires>604800){var message="Presigning does not support expiry time greater "+"than a week with SigV4 signing.";throw AWS.util.error(new Error,{code:"InvalidExpiryTime",message:message,retryable:false})}request.httpRequest.headers[expiresHeader]=expires}else if(request.service.getSignerClass()===AWS.Signers.S3){request.httpRequest.headers[expiresHeader]=parseInt(AWS.util.date.unixTimestamp()+expires,10).toString()}else{throw AWS.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:false})}}function signedUrlSigner(request){var endpoint=request.httpRequest.endpoint;var parsedUrl=AWS.util.urlParse(request.httpRequest.path);var queryParams={};if(parsedUrl.search){queryParams=AWS.util.queryStringParse(parsedUrl.search.substr(1))}AWS.util.each(request.httpRequest.headers,function(key,value){if(key===expiresHeader)key="Expires";queryParams[key]=value});delete request.httpRequest.headers[expiresHeader];var auth=queryParams["Authorization"].split(" ");if(auth[0]==="AWS"){auth=auth[1].split(":");queryParams["AWSAccessKeyId"]=auth[0];queryParams["Signature"]=auth[1]}else if(auth[0]==="AWS4-HMAC-SHA256"){auth.shift();var rest=auth.join(" ");var signature=rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];queryParams["X-Amz-Signature"]=signature;delete queryParams["Expires"]}delete queryParams["Authorization"];delete queryParams["Host"];endpoint.pathname=parsedUrl.pathname;endpoint.search=AWS.util.queryParamsToString(queryParams)}AWS.Signers.Presign=inherit({sign:function sign(request,expireTime,callback){request.httpRequest.headers[expiresHeader]=expireTime||3600;request.on("build",signedUrlBuilder);request.on("sign",signedUrlSigner);request.removeListener("afterBuild",AWS.EventListeners.Core.SET_CONTENT_LENGTH);request.removeListener("afterBuild",AWS.EventListeners.Core.COMPUTE_SHA256);request.emit("beforePresign",[request]);if(callback){request.build(function(){if(this.response.error)callback(this.response.error);else{callback(null,AWS.util.urlFormat(request.httpRequest.endpoint))}})}else{request.build();if(request.response.error)throw request.response.error;return AWS.util.urlFormat(request.httpRequest.endpoint)}}});module.exports=AWS.Signers.Presign}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/signers/presign.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/signers")},{"../core":244,_process:1069,buffer:919}],285:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;AWS.Signers.RequestSigner=inherit({constructor:function RequestSigner(request){this.request=request}});AWS.Signers.RequestSigner.getVersion=function getVersion(version){switch(version){case"v2":return AWS.Signers.V2;case"v3":return AWS.Signers.V3;case"v4":return AWS.Signers.V4;case"s3":return AWS.Signers.S3;case"v3https":return AWS.Signers.V3Https}throw new Error("Unknown signing version "+version)};require("./v2");require("./v3");require("./v3https");require("./v4");require("./s3");require("./presign")}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/signers/request_signer.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/signers")},{"../core":244,"./presign":284,"./s3":286,"./v2":287,"./v3":288,"./v3https":289,"./v4":290,_process:1069,buffer:919}],286:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;AWS.Signers.S3=inherit(AWS.Signers.RequestSigner,{subResources:{acl:1,cors:1,lifecycle:1,"delete":1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:function addAuthorization(credentials,date){if(!this.request.headers["presigned-expires"]){this.request.headers["X-Amz-Date"]=AWS.util.date.rfc822(date)}if(credentials.sessionToken){this.request.headers["x-amz-security-token"]=credentials.sessionToken}var signature=this.sign(credentials.secretAccessKey,this.stringToSign());var auth="AWS "+credentials.accessKeyId+":"+signature;this.request.headers["Authorization"]=auth},stringToSign:function stringToSign(){var r=this.request;var parts=[];parts.push(r.method);parts.push(r.headers["Content-MD5"]||"");parts.push(r.headers["Content-Type"]||"");parts.push(r.headers["presigned-expires"]||"");var headers=this.canonicalizedAmzHeaders();if(headers)parts.push(headers);parts.push(this.canonicalizedResource());return parts.join("\n")},canonicalizedAmzHeaders:function canonicalizedAmzHeaders(){var amzHeaders=[];AWS.util.each(this.request.headers,function(name){if(name.match(/^x-amz-/i))amzHeaders.push(name)});amzHeaders.sort(function(a,b){return a.toLowerCase()=0?"&":"?";this.request.path+=sep+AWS.util.queryParamsToString(qs)},authorization:function authorization(credentials,datetime){var parts=[];var credString=this.credentialString(datetime);parts.push(this.algorithm+" Credential="+credentials.accessKeyId+"/"+credString);parts.push("SignedHeaders="+this.signedHeaders());parts.push("Signature="+this.signature(credentials,datetime));return parts.join(", ")},signature:function signature(credentials,datetime){var cache=cachedSecret[this.serviceName];var date=datetime.substr(0,8);if(!cache||cache.akid!==credentials.accessKeyId||cache.region!==this.request.region||cache.date!==date){var kSecret=credentials.secretAccessKey;var kDate=AWS.util.crypto.hmac("AWS4"+kSecret,date,"buffer");var kRegion=AWS.util.crypto.hmac(kDate,this.request.region,"buffer");var kService=AWS.util.crypto.hmac(kRegion,this.serviceName,"buffer");var kCredentials=AWS.util.crypto.hmac(kService,"aws4_request","buffer");cachedSecret[this.serviceName]={region:this.request.region,date:date,key:kCredentials,akid:credentials.accessKeyId}}var key=cachedSecret[this.serviceName].key;return AWS.util.crypto.hmac(key,this.stringToSign(datetime),"hex")},stringToSign:function stringToSign(datetime){var parts=[];parts.push("AWS4-HMAC-SHA256");parts.push(datetime);parts.push(this.credentialString(datetime));parts.push(this.hexEncodedHash(this.canonicalString()));return parts.join("\n")},canonicalString:function canonicalString(){var parts=[],pathname=this.request.pathname();if(this.serviceName!=="s3")pathname=AWS.util.uriEscapePath(pathname);parts.push(this.request.method);parts.push(pathname);parts.push(this.request.search());parts.push(this.canonicalHeaders()+"\n");parts.push(this.signedHeaders());parts.push(this.hexEncodedBodyHash());return parts.join("\n")},canonicalHeaders:function canonicalHeaders(){var headers=[];AWS.util.each.call(this,this.request.headers,function(key,item){headers.push([key,item])});headers.sort(function(a,b){return a[0].toLowerCase()=buffer.length)return readable.push(null);var end=pos+size;if(end>buffer.length)end=buffer.length;readable.push(buffer.slice(pos,end));pos=end};return readable},concat:function(buffers){var length=0,offset=0,buffer=null,i;for(i=0;i0){results=objects;return util.abort}});return results},find:function find(expression,data){return util.jamespath.query(expression,data)[0]}},date:{getDate:function getDate(){if(!AWS)AWS=require("./core");if(AWS.config.systemClockOffset){return new Date((new Date).getTime()+AWS.config.systemClockOffset)}else{return new Date}},iso8601:function iso8601(date){if(date===undefined){date=util.date.getDate()}return date.toISOString().replace(/\.\d{3}Z$/,"Z")},rfc822:function rfc822(date){if(date===undefined){date=util.date.getDate()}return date.toUTCString()},unixTimestamp:function unixTimestamp(date){if(date===undefined){date=util.date.getDate()}return date.getTime()/1e3},from:function format(date){if(typeof date==="number"){return new Date(date*1e3)}else{return new Date(date)}},format:function format(date,formatter){if(!formatter)formatter="iso8601";return util.date[formatter](util.date.from(date))},parseTimestamp:function parseTimestamp(value){if(typeof value==="number"){return new Date(value*1e3)}else if(value.match(/^\d+$/)){return new Date(value*1e3)}else if(value.match(/^\d{4}/)){return new Date(value)}else if(value.match(/^\w{3},/)){return new Date(value)}else{throw util.error(new Error("unhandled timestamp format: "+value),{code:"TimestampParserError"})}}},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117], -crc32:function crc32(data){var tbl=util.crypto.crc32Table;var crc=0^-1;if(typeof data==="string"){data=new Buffer(data)}for(var i=0;i>>8^tbl[(crc^code)&255]}return(crc^-1)>>>0},hmac:function hmac(key,string,digest,fn){if(!digest)digest="binary";if(digest==="buffer"){digest=undefined}if(!fn)fn="sha256";if(typeof string==="string")string=new Buffer(string);return cryptoLib.createHmac(fn,key).update(string).digest(digest)},md5:function md5(data,digest,callback){return util.crypto.hash("md5",data,digest,callback)},sha256:function sha256(data,digest,callback){return util.crypto.hash("sha256",data,digest,callback)},hash:function(algorithm,data,digest,callback){var hash=util.crypto.createHash(algorithm);if(!digest){digest="binary"}if(digest==="buffer"){digest=undefined}if(typeof data==="string")data=new Buffer(data);var sliceFn=util.arraySliceFn(data);var isBuffer=Buffer.isBuffer(data);if(callback&&typeof data==="object"&&typeof data.on==="function"&&!isBuffer){data.on("data",function(chunk){hash.update(chunk)});data.on("error",function(err){callback(err)});data.on("end",function(){callback(null,hash.digest(digest))})}else if(callback&&sliceFn&&!isBuffer&&typeof FileReader!=="undefined"){var index=0,size=1024*512;var reader=new FileReader;reader.onerror=function(){callback(new Error("Failed to read data."))};reader.onload=function(){var buf=new Buffer(new Uint8Array(reader.result));hash.update(buf);index+=buf.length;reader._continueReading()};reader._continueReading=function(){if(index>=data.size){callback(null,hash.digest(digest));return}var back=index+size;if(back>data.size)back=data.size;reader.readAsArrayBuffer(sliceFn.call(data,index,back))};reader._continueReading()}else{if(util.isBrowser()&&typeof data==="object"&&!isBuffer){data=new Buffer(new Uint8Array(data))}var out=hash.update(data).digest(digest);if(callback)callback(null,out);return out}},toHex:function toHex(data){var out=[];for(var i=0;i0||noEmpty?xml.root().toString():""};function serialize(xml,value,shape){switch(shape.type){case"structure":return serializeStructure(xml,value,shape);case"map":return serializeMap(xml,value,shape);case"list":return serializeList(xml,value,shape);default:return serializeScalar(xml,value,shape)}}function serializeStructure(xml,params,shape){util.arrayEach(shape.memberNames,function(memberName){var memberShape=shape.members[memberName];if(memberShape.location!=="body")return;var value=params[memberName];var name=memberShape.name;if(value!==undefined&&value!==null){if(memberShape.isXmlAttribute){xml.att(name,value)}else if(memberShape.flattened){serialize(xml,value,memberShape)}else{var element=xml.ele(name);applyNamespaces(element,memberShape);serialize(element,value,memberShape)}}})}function serializeMap(xml,map,shape){var xmlKey=shape.key.name||"key";var xmlValue=shape.value.name||"value";util.each(map,function(key,value){var entry=xml.ele(shape.flattened?shape.name:"entry");serialize(entry.ele(xmlKey),key,shape.key);serialize(entry.ele(xmlValue),value,shape.value)})}function serializeList(xml,list,shape){if(shape.flattened){util.arrayEach(list,function(value){var name=shape.member.name||shape.name;var element=xml.ele(name);serialize(element,value,shape.member)})}else{util.arrayEach(list,function(value){var name=shape.member.name||"member";var element=xml.ele(name);serialize(element,value,shape.member)})}}function serializeScalar(xml,value,shape){xml.txt(shape.toWireFormat(value))}function applyNamespaces(xml,shape){var uri,prefix="xmlns";if(shape.xmlNamespaceUri){uri=shape.xmlNamespaceUri;if(shape.xmlNamespacePrefix)prefix+=":"+shape.xmlNamespacePrefix}else if(xml.isRoot&&shape.api.xmlNamespaceUri){uri=shape.api.xmlNamespaceUri}if(uri)xml.att(prefix,uri)}module.exports=XmlBuilder}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/xml/builder.js","/node_modules/@mitocgroup/deep-security/node_modules/aws-sdk/lib/xml")},{"../util":292,_process:1069,buffer:919,xmlbuilder:"xmlbuilder"}],295:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _mitocgroupDeepCore=require("@mitocgroup/deep-core");var _mitocgroupDeepCore2=_interopRequireDefault(_mitocgroupDeepCore);var Exception=function(_Core$Exception$Exception){_inherits(Exception,_Core$Exception$Exception);function Exception(){_classCallCheck(this,Exception);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_get(Object.getPrototypeOf(Exception.prototype),"constructor",this).apply(this,args)}return Exception}(_mitocgroupDeepCore2["default"].Exception.Exception);exports.Exception=Exception}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/lib.compiled/Exception/Exception.js","/node_modules/@mitocgroup/deep-validation/lib.compiled/Exception")},{"@mitocgroup/deep-core":"@mitocgroup/deep-core",_process:1069,buffer:919}],296:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _Exception2=require("./Exception");var InvalidSchemaException=function(_Exception){_inherits(InvalidSchemaException,_Exception);function InvalidSchemaException(model,errorString){_classCallCheck(this,InvalidSchemaException);_get(Object.getPrototypeOf(InvalidSchemaException.prototype),"constructor",this).call(this,"deep-db model "+JSON.stringify(model)+" validation schema fails: "+errorString)}return InvalidSchemaException}(_Exception2.Exception);exports.InvalidSchemaException=InvalidSchemaException}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/lib.compiled/Exception/InvalidSchemaException.js","/node_modules/@mitocgroup/deep-validation/lib.compiled/Exception")},{"./Exception":295,_process:1069,buffer:919}],297:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _Exception2=require("./Exception");var ModelNotFoundException=function(_Exception){_inherits(ModelNotFoundException,_Exception);function ModelNotFoundException(modelName){_classCallCheck(this,ModelNotFoundException);_get(Object.getPrototypeOf(ModelNotFoundException.prototype),"constructor",this).call(this,"Model "+modelName+" was not found")}return ModelNotFoundException}(_Exception2.Exception);exports.ModelNotFoundException=ModelNotFoundException}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/lib.compiled/Exception/ModelNotFoundException.js","/node_modules/@mitocgroup/deep-validation/lib.compiled/Exception")},{"./Exception":295,_process:1069,buffer:919}],298:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _get=function get(_x,_x2,_x3){var _again=true;_function:while(_again){var object=_x,property=_x2,receiver=_x3;desc=parent=getter=undefined;_again=false;if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined}else{_x=parent;_x2=property;_x3=receiver;_again=true;continue _function}}else if("value"in desc){return desc.value}else{var getter=desc.get;if(getter===undefined){return undefined}return getter.call(receiver)}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}var _Exception2=require("./Exception");var ObjectValidationFailedException=function(_Exception){_inherits(ObjectValidationFailedException,_Exception);function ObjectValidationFailedException(schemaName,error){_classCallCheck(this,ObjectValidationFailedException);_get(Object.getPrototypeOf(ObjectValidationFailedException.prototype),"constructor",this).call(this,"Object validation failed on schema "+schemaName+": "+error)}return ObjectValidationFailedException}(_Exception2.Exception);exports.ObjectValidationFailedException=ObjectValidationFailedException}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/lib.compiled/Exception/ObjectValidationFailedException.js","/node_modules/@mitocgroup/deep-validation/lib.compiled/Exception")},{"./Exception":295,_process:1069,buffer:919}],299:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0,key+" should be one of "+values.join(", "))}}};module.exports=internals.Any=function(){Cast=Cast||require("./cast");this.isJoi=true;this._type="any";this._settings=null;this._valids=new internals.Set;this._invalids=new internals.Set;this._tests=[];this._refs=[];this._flags={};this._description=null;this._unit=null;this._notes=[];this._tags=[];this._examples=[];this._meta=[];this._inner={}};internals.Any.prototype.isImmutable=true;internals.Any.prototype.clone=function(){var obj=Object.create(Object.getPrototypeOf(this));obj.isJoi=true;obj._type=this._type;obj._settings=internals.concatSettings(this._settings);obj._valids=Hoek.clone(this._valids);obj._invalids=Hoek.clone(this._invalids);obj._tests=this._tests.slice();obj._refs=this._refs.slice();obj._flags=Hoek.clone(this._flags);obj._description=this._description;obj._unit=this._unit;obj._notes=this._notes.slice();obj._tags=this._tags.slice();obj._examples=this._examples.slice();obj._meta=this._meta.slice();obj._inner={};var inners=Object.keys(this._inner);for(var i=0,il=inners.length;i=0){target[keys[sourceKey]]={key:sourceKey,schema:target[keys[sourceKey]].schema.concat(source[k].schema)}}else{target.push(source[k])}}}else{obj._inner[key]=obj._inner[key].concat(source)}}else{obj._inner[key]=source.slice()}}}return obj};internals.Any.prototype._test=function(name,arg,func){Hoek.assert(!this._flags.allowOnly,"Cannot define rules when valid values specified");var obj=this.clone();obj._tests.push({func:func,name:name,arg:arg});return obj};internals.Any.prototype.options=function(options){Hoek.assert(!options.context,"Cannot override context");internals.checkOptions(options);var obj=this.clone();obj._settings=internals.concatSettings(obj._settings,options);return obj};internals.Any.prototype.strict=function(isStrict){var obj=this.clone();obj._settings=obj._settings||{};obj._settings.convert=isStrict===undefined?false:!isStrict;return obj};internals.Any.prototype.raw=function(isRaw){var obj=this.clone();obj._settings=obj._settings||{};obj._settings.raw=isRaw===undefined?true:isRaw;return obj};internals.Any.prototype._allow=function(){var values=Hoek.flatten(Array.prototype.slice.call(arguments));for(var i=0,il=values.length;i0,"description must be provided when default value is a function")}}var obj=this.clone();obj._flags.default=value;Ref.push(obj._refs,value);return obj};internals.Any.prototype.empty=function(schema){var obj;if(schema===undefined){obj=this.clone();obj._flags.empty=undefined}else{schema=Cast.schema(schema);obj=this.clone();obj._flags.empty=schema}return obj};internals.Any.prototype.when=function(ref,options){Hoek.assert(options&&typeof options==="object","Invalid options");Hoek.assert(options.then!==undefined||options.otherwise!==undefined,'options must have at least one of "then" or "otherwise"');var then=options.then?this.concat(Cast.schema(options.then)):this;var otherwise=options.otherwise?this.concat(Cast.schema(options.otherwise)):this;Alternatives=Alternatives||require("./alternatives");var obj=Alternatives.when(ref,{is:options.is,then:then,otherwise:otherwise});obj._flags.presence="ignore";return obj};internals.Any.prototype.description=function(desc){Hoek.assert(desc&&typeof desc==="string","Description must be a non-empty string");var obj=this.clone();obj._description=desc;return obj};internals.Any.prototype.notes=function(notes){Hoek.assert(notes&&(typeof notes==="string"||Array.isArray(notes)),"Notes must be a non-empty string or array");var obj=this.clone();obj._notes=obj._notes.concat(notes);return obj};internals.Any.prototype.tags=function(tags){Hoek.assert(tags&&(typeof tags==="string"||Array.isArray(tags)),"Tags must be a non-empty string or array");var obj=this.clone();obj._tags=obj._tags.concat(tags);return obj};internals.Any.prototype.meta=function(meta){Hoek.assert(meta!==undefined,"Meta cannot be undefined");var obj=this.clone();obj._meta=obj._meta.concat(meta);return obj};internals.Any.prototype.example=function(value){Hoek.assert(arguments.length,"Missing example");var result=this._validate(value,null,internals.defaults);Hoek.assert(!result.errors,"Bad example:",result.errors&&Errors.process(result.errors,value));var obj=this.clone();obj._examples=obj._examples.concat(value);return obj};internals.Any.prototype.unit=function(name){Hoek.assert(name&&typeof name==="string","Unit name must be a non-empty string");var obj=this.clone();obj._unit=name;return obj};internals._try=function(fn,arg){var err;var result;try{result=fn.call(null,arg)}catch(e){err=e}return{value:result,error:err}};internals.Any.prototype._validate=function(value,state,options,reference){var self=this;var originalValue=value;state=state||{key:"",path:"",parent:null,reference:reference};if(this._settings){options=internals.concatSettings(options,this._settings)}var errors=[];var finish=function(){var finalValue;if(!self._flags.strip){if(value!==undefined){finalValue=options.raw?originalValue:value}else if(options.noDefaults){finalValue=originalValue}else if(Ref.isRef(self._flags.default)){finalValue=self._flags.default(state.parent,options)}else if(typeof self._flags.default==="function"&&!(self._type==="func"&&!self._flags.default.description)){var arg;if(state.parent!==null&&self._flags.default.length>0){arg=Hoek.clone(state.parent)}var defaultValue=internals._try(self._flags.default,arg);finalValue=defaultValue.value;if(defaultValue.error){errors.push(Errors.create("any.default",defaultValue.error,state,options))}}else{finalValue=self._flags.default}}return{value:finalValue,errors:errors.length?errors:null}};var presence=this._flags.presence||options.presence;if(presence==="optional"){if(value===undefined){var isDeepDefault=this._flags.hasOwnProperty("default")&&this._flags.default===undefined;if(isDeepDefault&&this._type==="object"){value={}}else{return finish()}}}else if(presence==="required"&&value===undefined){errors.push(Errors.create("any.required",null,state,options));return finish()}else if(presence==="forbidden"){if(value===undefined){return finish()}errors.push(Errors.create("any.unknown",null,state,options));return finish()}if(this._flags.empty&&!this._flags.empty._validate(value,null,internals.defaults).errors){value=undefined;return finish()}if(this._valids.has(value,state,options,this._flags.insensitive)){return finish()}if(this._invalids.has(value,state,options,this._flags.insensitive)){errors.push(Errors.create(value===""?"any.empty":"any.invalid",null,state,options));if(options.abortEarly||value===undefined){return finish()}}if(this._base){var base=this._base.call(this,value,state,options);if(base.errors){value=base.value;errors=errors.concat(base.errors);return finish()}if(base.value!==value){value=base.value;if(this._valids.has(value,state,options,this._flags.insensitive)){return finish()}if(this._invalids.has(value,state,options,this._flags.insensitive)){errors.push(Errors.create("any.invalid",null,state,options));if(options.abortEarly){return finish()}}}}if(this._flags.allowOnly){errors.push(Errors.create("any.allowOnly",{valids:this._valids.values({stripUndefined:true})},state,options));if(options.abortEarly){return finish()}}for(var i=0,il=this._tests.length;i=0,"limit must be a positive integer");return this._test("min",limit,function(value,state,options){if(value.length>=limit){return null}return Errors.create("array.min",{limit:limit,value:value},state,options)})};internals.Array.prototype.max=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("max",limit,function(value,state,options){if(value.length<=limit){return null}return Errors.create("array.max",{limit:limit,value:value},state,options)})};internals.Array.prototype.length=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("length",limit,function(value,state,options){if(value.length===limit){return null}return Errors.create("array.length",{limit:limit,value:value},state,options)})};internals.Array.prototype.unique=function(){return this._test("unique",undefined,function(value,state,options){var found={string:{},number:{},undefined:{},"boolean":{},object:[],"function":[]};for(var i=0,il=value.length;i=0,"limit must be a positive integer");return this._test("min",limit,function(value,state,options){if(value.length>=limit){return null}return Errors.create("binary.min",{limit:limit,value:value},state,options)})};internals.Binary.prototype.max=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("max",limit,function(value,state,options){ -if(value.length<=limit){return null}return Errors.create("binary.max",{limit:limit,value:value},state,options)})};internals.Binary.prototype.length=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("length",limit,function(value,state,options){if(value.length===limit){return null}return Errors.create("binary.length",{limit:limit,value:value},state,options)})};module.exports=new internals.Binary}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib/binary.js","/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib")},{"./any":304,"./errors":310,_process:1069,buffer:919,hoek:"hoek"}],307:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Any=require("./any");var Errors=require("./errors");var Hoek=require("hoek");var internals={};internals.Boolean=function(){Any.call(this);this._type="boolean"};Hoek.inherits(internals.Boolean,Any);internals.Boolean.prototype._base=function(value,state,options){var result={value:value};if(typeof value==="string"&&options.convert){var lower=value.toLowerCase();result.value=lower==="true"||lower==="yes"||lower==="on"?true:lower==="false"||lower==="no"||lower==="off"?false:value}result.errors=typeof result.value==="boolean"?null:Errors.create("boolean.base",null,state,options);return result};module.exports=new internals.Boolean}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib/boolean.js","/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib")},{"./any":304,"./errors":310,_process:1069,buffer:919,hoek:"hoek"}],308:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Hoek=require("hoek");var Ref=require("./ref");var internals={any:null,date:require("./date"),string:require("./string"),number:require("./number"),"boolean":require("./boolean"),alt:null,object:null};exports.schema=function(config){internals.any=internals.any||new(require("./any"));internals.alt=internals.alt||require("./alternatives");internals.object=internals.object||require("./object");if(config&&typeof config==="object"){if(config.isJoi){return config}if(Array.isArray(config)){return internals.alt.try(config)}if(config instanceof RegExp){return internals.string.regex(config)}if(config instanceof Date){return internals.date.valid(config)}return internals.object.keys(config)}if(typeof config==="string"){return internals.string.valid(config)}if(typeof config==="number"){return internals.number.valid(config)}if(typeof config==="boolean"){return internals.boolean.valid(config)}if(Ref.isRef(config)){return internals.any.valid(config)}Hoek.assert(config===null,"Invalid schema content:",config);return internals.any.valid(null)};exports.ref=function(id){return Ref.isRef(id)?id:Ref.create(id)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib/cast.js","/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib")},{"./alternatives":303,"./any":304,"./boolean":307,"./date":309,"./number":313,"./object":314,"./ref":315,"./string":316,_process:1069,buffer:919,hoek:"hoek"}],309:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Any=require("./any");var Errors=require("./errors");var Ref=require("./ref");var Hoek=require("hoek");var Moment=require("moment");var internals={};internals.isoDate=/^(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/;internals.invalidDate=new Date("");internals.isIsoDate=function(){var isoString=internals.isoDate.toString();return function(date){return date&&date.toString()===isoString}}();internals.Date=function(){Any.call(this);this._type="date"};Hoek.inherits(internals.Date,Any);internals.Date.prototype._base=function(value,state,options){var result={value:options.convert&&internals.toDate(value,this._flags.format)||value};if(result.value instanceof Date&&!isNaN(result.value.getTime())){result.errors=null}else{result.errors=Errors.create(internals.isIsoDate(this._flags.format)?"date.isoDate":"date.base",null,state,options)}return result};internals.toDate=function(value,format){if(value instanceof Date){return value}if(typeof value==="string"||Hoek.isInteger(value)){if(typeof value==="string"&&/^[+-]?\d+$/.test(value)){value=parseInt(value,10)}var date;if(format){if(internals.isIsoDate(format)){date=format.test(value)?new Date(value):internals.invalidDate}else{date=Moment(value,format,true);date=date.isValid()?date.toDate():internals.invalidDate}}else{date=new Date(value)}if(!isNaN(date.getTime())){return date}}return null};internals.compare=function(type,compare){return function(date){var isNow=date==="now";var isRef=Ref.isRef(date);if(!isNow&&!isRef){date=internals.toDate(date)}Hoek.assert(date,"Invalid date format");return this._test(type,date,function(value,state,options){var compareTo;if(isNow){compareTo=Date.now()}else if(isRef){compareTo=internals.toDate(date(state.parent,options));if(!compareTo){return Errors.create("date.ref",{ref:date.key},state,options)}compareTo=compareTo.getTime()}else{compareTo=date.getTime()}if(compare(value.getTime(),compareTo)){return null}return Errors.create("date."+type,{limit:new Date(compareTo)},state,options)})}};internals.Date.prototype.min=internals.compare("min",function(value,date){return value>=date});internals.Date.prototype.max=internals.compare("max",function(value,date){return value<=date});internals.Date.prototype.format=function(format){Hoek.assert(typeof format==="string"||Array.isArray(format)&&format.every(function(f){return typeof f==="string"}),"Invalid format.");var obj=this.clone();obj._flags.format=format;return obj};internals.Date.prototype.iso=function(){var obj=this.clone();obj._flags.format=internals.isoDate;return obj};internals.Date.prototype._isIsoDate=function(value){return internals.isoDate.test(value)};module.exports=new internals.Date}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib/date.js","/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib")},{"./any":304,"./errors":310,"./ref":315,_process:1069,buffer:919,hoek:"hoek",moment:"moment"}],310:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Hoek=require("hoek");var Language=require("./language");var internals={};internals.stringify=function(value,wrapArrays){var type=typeof value;if(value===null){return"null"}if(type==="string"){return value}if(value instanceof internals.Err||type==="function"){return value.toString()}if(type==="object"){if(Array.isArray(value)){var partial="";for(var i=0,il=value.length;i2&&format[0]==="!"&&format[1]==="!";if(skipKey){format=format.slice(2)}if(!hasKey&&!skipKey){format=(Hoek.reach(localized,"key")||Hoek.reach(Language.errors,"key"))+format}var wrapArrays=Hoek.reach(localized,"messages.wrapArrays");if(typeof wrapArrays!=="boolean"){wrapArrays=Language.errors.messages.wrapArrays}var message=format.replace(/\{\{(\!?)([^}]+)\}\}/g,function($0,isSecure,name){var value=Hoek.reach(self.context,name);var normalized=internals.stringify(value,wrapArrays);return isSecure?Hoek.escapeHtml(normalized):normalized});return message};exports.create=function(type,context,state,options){return new internals.Err(type,context,state,options)};exports.process=function(errors,object){if(!errors||!errors.length){return null}var message="";var details=[];var processErrors=function(localErrors,parent){for(var i=0,il=localErrors.length;i0){var thisPos=stack.indexOf(this);if(~thisPos){stack.length=thisPos+1;keys.length=thisPos+1;keys[thisPos]=key}else{stack.push(this);keys.push(key)}if(~stack.indexOf(value)){value=cycleReplacer.call(this,key,value)}}else{stack.push(value)}return value}};internals.annotate=function(){var obj=Hoek.clone(this._object||{});var lookup={};var el=this.details.length;for(var e=el-1;e>=0;--e){var pos=el-e;var error=this.details[e];var path=error.path.split(".");var ref=obj;for(var i=0,il=path.length;i=limit});internals.Number.prototype.max=internals.compare("max",function(value,limit){return value<=limit});internals.Number.prototype.greater=internals.compare("greater",function(value,limit){return value>limit});internals.Number.prototype.less=internals.compare("less",function(value,limit){return value0,"multiple must be greater than 0");return this._test("multiple",base,function(value,state,options){if(value%base===0){return null}return Errors.create("number.multiple",{multiple:base,value:value},state,options)})};internals.Number.prototype.integer=function(){return this._test("integer",undefined,function(value,state,options){return Hoek.isInteger(value)?null:Errors.create("number.integer",{value:value},state,options)})};internals.Number.prototype.negative=function(){return this._test("negative",undefined,function(value,state,options){if(value<0){return null}return Errors.create("number.negative",{value:value},state,options)})};internals.Number.prototype.positive=function(){return this._test("positive",undefined,function(value,state,options){if(value>0){return null}return Errors.create("number.positive",{value:value},state,options)})};internals.precisionRx=/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/;internals.Number.prototype.precision=function(limit){Hoek.assert(Hoek.isInteger(limit),"limit must be an integer");Hoek.assert(!("precision"in this._flags),"precision already set");var obj=this._test("precision",limit,function(value,state,options){var places=value.toString().match(internals.precisionRx);var decimals=Math.max((places[1]?places[1].length:0)-(places[2]?parseInt(places[2],10):0),0);if(decimals<=limit){return null}return Errors.create("number.precision",{limit:limit,value:value},state,options)});obj._flags.precision=limit;return obj};module.exports=new internals.Number}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib/number.js","/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib")},{"./any":304,"./errors":310,"./ref":315,_process:1069,buffer:919,hoek:"hoek"}],314:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Hoek=require("hoek");var Topo=require("topo");var Any=require("./any");var Cast=require("./cast");var Errors=require("./errors");var internals={};internals.Object=function(){Any.call(this);this._type="object";this._inner.children=null;this._inner.renames=[];this._inner.dependencies=[];this._inner.patterns=[]};Hoek.inherits(internals.Object,Any);internals.Object.prototype._base=function(value,state,options){var item,key,localState,result;var target=value;var errors=[];var finish=function(){return{value:target,errors:errors.length?errors:null}};if(typeof value==="string"&&options.convert){try{value=JSON.parse(value)}catch(parseErr){}}if(!value||typeof value!=="object"||Array.isArray(value)){errors.push(Errors.create("object.base",null,state,options));return finish()}if(!this._inner.renames.length&&!this._inner.dependencies.length&&!this._inner.children&&!this._inner.patterns.length){target=value;return finish()}if(target===value){target=Object.create(Object.getPrototypeOf(value));var valueKeys=Object.keys(value);for(var t=0,tl=valueKeys.length;t=0,"limit must be a positive integer");return this._test("length",limit,function(value,state,options){if(Object.keys(value).length===limit){return null}return Errors.create("object.length",{limit:limit},state,options)})};internals.Object.prototype.min=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("min",limit,function(value,state,options){if(Object.keys(value).length>=limit){return null}return Errors.create("object.min",{limit:limit},state,options)})};internals.Object.prototype.max=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("max",limit,function(value,state,options){if(Object.keys(value).length<=limit){return null}return Errors.create("object.max",{limit:limit},state,options)})};internals.Object.prototype.pattern=function(pattern,schema){Hoek.assert(pattern instanceof RegExp,"Invalid regular expression");Hoek.assert(schema!==undefined,"Invalid rule");pattern=new RegExp(pattern.source,pattern.ignoreCase?"i":undefined);var obj=this.clone();obj._inner.patterns.push({regex:pattern,rule:Cast.schema(schema)});return obj};internals.Object.prototype.with=function(key,peers){return this._dependency("with",key,peers)};internals.Object.prototype.without=function(key,peers){return this._dependency("without",key,peers)};internals.Object.prototype.xor=function(){var peers=Hoek.flatten(Array.prototype.slice.call(arguments));return this._dependency("xor",null,peers)};internals.Object.prototype.or=function(){var peers=Hoek.flatten(Array.prototype.slice.call(arguments));return this._dependency("or",null,peers)};internals.Object.prototype.and=function(){var peers=Hoek.flatten(Array.prototype.slice.call(arguments));return this._dependency("and",null,peers)};internals.Object.prototype.nand=function(){var peers=Hoek.flatten(Array.prototype.slice.call(arguments));return this._dependency("nand",null,peers)};internals.Object.prototype.requiredKeys=function(children){children=Hoek.flatten(Array.prototype.slice.call(arguments));return this.applyFunctionToChildren(children,"required")};internals.Object.prototype.optionalKeys=function(children){children=Hoek.flatten(Array.prototype.slice.call(arguments));return this.applyFunctionToChildren(children,"optional")};internals.renameDefaults={alias:false,multiple:false,override:false};internals.Object.prototype.rename=function(from,to,options){Hoek.assert(typeof from==="string","Rename missing the from argument");Hoek.assert(typeof to==="string","Rename missing the to argument");Hoek.assert(to!==from,"Cannot rename key to same name:",from);for(var i=0,il=this._inner.renames.length;i0,"expected at least one children");var groupedChildren=internals.groupChildren(children);var obj;if(""in groupedChildren){obj=this[fn].apply(this,args);delete groupedChildren[""]}else{obj=this.clone()}if(obj._inner.children){root=root?root+".":"";for(var i=0,il=obj._inner.children.length;i1,"Cannot use assertions for root level references - use direct key rules instead");message=message||"pass the assertion test";var cast=Cast.schema(schema);var key=ref.path[ref.path.length-1];var path=ref.path.join(".");return this._test("assert",{cast:cast,ref:ref},function(value,state,options){var result=cast._validate(ref(value),null,options,value);if(!result.errors){return null}var localState=Hoek.merge({},state);localState.key=key;localState.path=path;return Errors.create("object.assert",{ref:localState.path,message:message},localState,options)})};internals.Object.prototype.type=function(constructor,name){Hoek.assert(typeof constructor==="function","type must be a constructor function");name=name||constructor.name;return this._test("type",name,function(value,state,options){if(value instanceof constructor){return null}return Errors.create("object.type",{type:name},state,options)})};module.exports=new internals.Object}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib/object.js","/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib")},{"./any":304,"./cast":308,"./errors":310,_process:1069,buffer:919,hoek:"hoek",topo:"topo"}],315:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Hoek=require("hoek");var internals={};exports.create=function(key,options){Hoek.assert(typeof key==="string","Invalid reference key:",key);var settings=Hoek.clone(options);var ref=function(value,validationOptions){return Hoek.reach(ref.isContext?validationOptions.context:value,ref.key,settings)};ref.isContext=key[0]===(settings&&settings.contextPrefix||"$");ref.key=ref.isContext?key.slice(1):key;ref.path=ref.key.split(settings&&settings.separator||".");ref.depth=ref.path.length;ref.root=ref.path[0];ref.isJoi=true;ref.toString=function(){return(ref.isContext?"context:":"ref:")+ref.key};return ref};exports.isRef=function(ref){return typeof ref==="function"&&ref.isJoi};exports.push=function(array,ref){if(exports.isRef(ref)&&!ref.isContext){array.push(ref.root)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib/ref.js","/node_modules/@mitocgroup/deep-validation/node_modules/joi/lib")},{_process:1069,buffer:919,hoek:"hoek"}],316:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Net=require("net");var Hoek=require("hoek");var Isemail=require("isemail");var Any=require("./any");var Ref=require("./ref");var JoiDate=require("./date");var Errors=require("./errors");var Uri=require("./string/uri");var Ip=require("./string/ip");var internals={uriRegex:Uri.createUriRegex(),ipRegex:Ip.createIpRegex(["ipv4","ipv6","ipvfuture"],"optional")};internals.String=function(){Any.call(this);this._type="string";this._invalids.add("")};Hoek.inherits(internals.String,Any);internals.compare=function(type,compare){return function(limit,encoding){var isRef=Ref.isRef(limit);Hoek.assert(Hoek.isInteger(limit)&&limit>=0||isRef,"limit must be a positive integer or reference");Hoek.assert(!encoding||Buffer.isEncoding(encoding),"Invalid encoding:",encoding);return this._test(type,limit,function(value,state,options){var compareTo;if(isRef){compareTo=limit(state.parent,options);if(!Hoek.isInteger(compareTo)){return Errors.create("string.ref",{ref:limit.key},state,options)}}else{compareTo=limit}if(compare(value,compareTo,encoding)){return null}return Errors.create("string."+type,{limit:compareTo,value:value,encoding:encoding},state,options)})}};internals.String.prototype._base=function(value,state,options){if(typeof value==="string"&&options.convert){if(this._flags.case){value=this._flags.case==="upper"?value.toLocaleUpperCase():value.toLocaleLowerCase()}if(this._flags.trim){value=value.trim()}if(this._inner.replacements){for(var r=0,rl=this._inner.replacements.length;r=limit});internals.String.prototype.max=internals.compare("max",function(value,limit,encoding){var length=encoding?Buffer.byteLength(value,encoding):value.length;return length<=limit});internals.String.prototype.creditCard=function(){return this._test("creditCard",undefined,function(value,state,options){var i=value.length;var sum=0;var mul=1;var char;while(i--){char=value.charAt(i)*mul;sum+=char-(char>9)*9;mul^=3}var check=sum%10===0&&sum>0;return check?null:Errors.create("string.creditCard",{value:value},state,options)})};internals.String.prototype.length=internals.compare("length",function(value,limit,encoding){var length=encoding?Buffer.byteLength(value,encoding):value.length;return length===limit});internals.String.prototype.regex=function(pattern,name){Hoek.assert(pattern instanceof RegExp,"pattern must be a RegExp");pattern=new RegExp(pattern.source,pattern.ignoreCase?"i":undefined);return this._test("regex",pattern,function(value,state,options){if(pattern.test(value)){return null}return Errors.create(name?"string.regex.name":"string.regex.base",{name:name,pattern:pattern,value:value},state,options)})};internals.String.prototype.alphanum=function(){return this._test("alphanum",undefined,function(value,state,options){if(/^[a-zA-Z0-9]+$/.test(value)){return null}return Errors.create("string.alphanum",{value:value},state,options)})};internals.String.prototype.token=function(){return this._test("token",undefined,function(value,state,options){if(/^\w+$/.test(value)){return null}return Errors.create("string.token",{value:value},state,options)})};internals.String.prototype.email=function(isEmailOptions){if(isEmailOptions){Hoek.assert(typeof isEmailOptions==="object","email options must be an object");Hoek.assert(typeof isEmailOptions.checkDNS==="undefined","checkDNS option is not supported");Hoek.assert(typeof isEmailOptions.tldWhitelist==="undefined"||typeof isEmailOptions.tldWhitelist==="object","tldWhitelist must be an array or object");Hoek.assert(typeof isEmailOptions.minDomainAtoms==="undefined"||Hoek.isInteger(isEmailOptions.minDomainAtoms)&&isEmailOptions.minDomainAtoms>0,"minDomainAtoms must be a positive integer");Hoek.assert(typeof isEmailOptions.errorLevel==="undefined"||typeof isEmailOptions.errorLevel==="boolean"||Hoek.isInteger(isEmailOptions.errorLevel)&&isEmailOptions.errorLevel>=0,"errorLevel must be a non-negative integer or boolean")}return this._test("email",isEmailOptions,function(value,state,options){try{var result=Isemail(value,isEmailOptions);if(result===true||result===0){return null}}catch(e){}return Errors.create("string.email",{value:value},state,options)})};internals.String.prototype.ip=function(ipOptions){var regex=internals.ipRegex;ipOptions=ipOptions||{};Hoek.assert(typeof ipOptions==="object","options must be an object");if(ipOptions.cidr){Hoek.assert(typeof ipOptions.cidr==="string","cidr must be a string");ipOptions.cidr=ipOptions.cidr.toLowerCase();Hoek.assert(ipOptions.cidr in Ip.cidrs,"cidr must be one of "+Object.keys(Ip.cidrs).join(", "));if(!ipOptions.version&&ipOptions.cidr!=="optional"){regex=Ip.createIpRegex(["ipv4","ipv6","ipvfuture"],ipOptions.cidr)}}else{ipOptions.cidr="optional"}if(ipOptions.version){if(!Array.isArray(ipOptions.version)){ipOptions.version=[ipOptions.version]}Hoek.assert(ipOptions.version.length>=1,"version must have at least 1 version specified");var versions=[];for(var i=0,il=ipOptions.version.length;i=1,"scheme must have at least 1 scheme specified");for(var i=0,il=uriOptions.scheme.length;i=256){return"\\u"+internals.padLeft(""+charCode,4)}var hexValue=new Buffer(String.fromCharCode(charCode),"ascii").toString("hex");return"\\x"+internals.padLeft(hexValue,2)};internals.escapeHtmlChar=function(charCode){var namedEscape=internals.namedHtml[charCode];if(typeof namedEscape!=="undefined"){return namedEscape}if(charCode>=256){return"&#"+charCode+";"}var hexValue=new Buffer(String.fromCharCode(charCode),"ascii").toString("hex");return"&#x"+internals.padLeft(hexValue,2)+";"};internals.padLeft=function(str,len){while(str.length=97||i>=65&&i<=90||i>=48&&i<=57||i===32||i===46||i===44||i===45||i===58||i===95){safe[i]=null}}return safe}()}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/joi/node_modules/hoek/lib/escape.js","/node_modules/@mitocgroup/deep-validation/node_modules/joi/node_modules/hoek/lib")},{_process:1069,buffer:919}],321:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Crypto=require("crypto");var Path=require("path");var Util=require("util");var Escape=require("./escape");var internals={};exports.clone=function(obj,seen){if(typeof obj!=="object"||obj===null){return obj}seen=seen||{orig:[],copy:[]};var lookup=seen.orig.indexOf(obj);if(lookup!==-1){return seen.copy[lookup]}var newObj;var cloneDeep=false;if(!Array.isArray(obj)){if(Buffer.isBuffer(obj)){newObj=new Buffer(obj)}else if(obj instanceof Date){newObj=new Date(obj.getTime())}else if(obj instanceof RegExp){newObj=new RegExp(obj)}else{var proto=Object.getPrototypeOf(obj);if(proto&&proto.isImmutable){newObj=obj}else{newObj=Object.create(proto);cloneDeep=true}}}else{newObj=[];cloneDeep=true}seen.orig.push(obj);seen.copy.push(newObj);if(cloneDeep){var keys=Object.getOwnPropertyNames(obj);for(var i=0,il=keys.length;i=2,"Insufficient arguments");exports.assert(typeof ref==="string"||typeof ref==="object","Reference must be string or an object");exports.assert(values.length,"Values array cannot be empty");var compare,compareFlags;if(options.deep){compare=exports.deepEqual;var hasOnly=options.hasOwnProperty("only"),hasPart=options.hasOwnProperty("part");compareFlags={prototype:hasOnly?options.only:hasPart?!options.part:false,part:hasOnly?!options.only:hasPart?options.part:true}}else{compare=function(a,b){return a===b}}var misses=false;var matches=new Array(values.length);for(var i=0,il=matches.length;i1||!options.part&&!matches[i]){return false}}if(options.only&&misses){return false}return result};exports.flatten=function(array,target){ -var result=target||[];for(var i=0,il=array.length;i\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute),"Bad attribute value ("+attribute+")");return attribute.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')};exports.escapeHtml=function(string){return Escape.escapeHtml(string)};exports.escapeJavaScript=function(string){return Escape.escapeJavaScript(string)};exports.nextTick=function(callback){return function(){var args=arguments;process.nextTick(function(){callback.apply(null,args)})}};exports.once=function(method){if(method._hoekOnce){return method}var once=false;var wrapped=function(){if(!once){once=true;method.apply(null,arguments)}};wrapped._hoekOnce=true;return wrapped};exports.isAbsolutePath=function(path,platform){if(!path){return false}if(Path.isAbsolute){return Path.isAbsolute(path)}platform=platform||process.platform;if(platform!=="win32"){return path[0]==="/"}return!!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path)};exports.isInteger=function(value){return typeof value==="number"&&parseFloat(value)===parseInt(value,10)&&!isNaN(value)};exports.ignore=function(){};exports.inherits=Util.inherits;exports.format=Util.format;exports.transform=function(source,transform,options){exports.assert(source===null||source===undefined||typeof source==="object","Invalid source object: must be null, undefined, or an object");var result={};var keys=Object.keys(transform);for(var k=0,kl=keys.length;k1){segment=path.shift();if(!res[segment]){res[segment]={}}res=res[segment]}segment=path.shift();res[segment]=exports.reach(source,sourcePath,options)}return result};exports.uniqueFilename=function(path,extension){if(extension){extension=extension[0]!=="."?"."+extension:extension}else{extension=""}path=Path.resolve(path);var name=[Date.now(),process.pid,Crypto.randomBytes(8).toString("hex")].join("-")+extension;return Path.join(path,name)};exports.stringify=function(){try{return JSON.stringify.apply(null,arguments)}catch(err){return"[Cannot display object: "+err.message+"]"}};exports.shallow=function(source){var target={};var keys=Object.keys(source);for(var i=0,il=keys.length;i=0;i--){lookup[i]=false}for(var i=0;imax){max=chr}lookup[chr]=true}lookup.length=max;var body="var lookup = "+JSON.stringify(lookup)+";\n";body+="return function(code) {\n";body+=" if (code < "+min+" || code > "+max+") {\n";body+=" return false;\n";body+=" }\n";body+=" return lookup[code];\n";body+="}";return new Function(body)()}var specialsLookup=optimizeLookup(SPECIALS);var IPv4_REGEX=/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;var IPv6_REGEX=/^[a-fA-F\d]{0,4}$/;var IPv6_REGEX_TEST=IPv6_REGEX.test.bind(IPv6_REGEX);var hasOwn=Object.prototype.hasOwnProperty;function maxValue(array){var v=-Infinity,i=0,n=array.length;for(;iv){v=array[i]}}return v}function isEmail(email,options,callback){if(typeof options==="function"){callback=options;options={}}options||(options={});var threshold,diagnose;if(typeof options.errorLevel==="number"){diagnose=true;threshold=options.errorLevel}else{diagnose=!!options.errorLevel;threshold=ISEMAIL_VALID}if(options.tldWhitelist&&typeof options.tldWhitelist!=="object"){throw new TypeError("expected array or object tldWhitelist")}if(options.minDomainAtoms&&(options.minDomainAtoms!==(+options.minDomainAtoms|0)||options.minDomainAtoms<0)){throw new TypeError("expected positive integer minDomainAtoms")}var maxResult=ISEMAIL_VALID;function updateResult(value){if(value>maxResult){maxResult=value}}var context={now:COMPONENT_LOCALPART,prev:COMPONENT_LOCALPART,stack:[COMPONENT_LOCALPART]};var token="",prevToken="",charCode=0;var parseData={local:"",domain:""};var atomList={local:[""],domain:[""]};var elementCount=0,elementLength=0,crlfCount=0;var hyphenFlag=false,assertEnd=false;for(var i=0;i64){updateResult(ISEMAIL_RFC5322_LOCAL_TOOLONG)}else if(context.prev===CONTEXT_COMMENT||context.prev===CONTEXT_FWS){updateResult(ISEMAIL_DEPREC_CFWS_NEAR_AT)}context.now=COMPONENT_DOMAIN;context.stack[0]=COMPONENT_DOMAIN;elementCount=0;elementLength=0;assertEnd=false;break;default:if(assertEnd){switch(context.prev){case CONTEXT_COMMENT:case CONTEXT_FWS:updateResult(ISEMAIL_ERR_ATEXT_AFTER_CFWS);break;case CONTEXT_QUOTEDSTRING:updateResult(ISEMAIL_ERR_ATEXT_AFTER_QS);break;default:throw new Error("more atext found where none is allowed, "+"but unrecognized prev context: "+context.prev)}}else{context.prev=context.now;charCode=token.charCodeAt(0);if(charCode<33||charCode>126||charCode===10||specialsLookup(charCode)){updateResult(ISEMAIL_ERR_EXPECTING_ATEXT)}parseData.local+=token;atomList.local[elementCount]+=token;elementLength++}}break;case COMPONENT_DOMAIN:switch(token){case"(":if(elementLength===0){updateResult(elementCount===0?ISEMAIL_DEPREC_CFWS_NEAR_AT:ISEMAIL_DEPREC_COMMENT)}else{updateResult(ISEMAIL_CFWS_COMMENT);assertEnd=true}context.stack.push(context.now);context.now=CONTEXT_COMMENT;break;case".":if(elementLength===0){updateResult(elementCount===0?ISEMAIL_ERR_DOT_START:ISEMAIL_ERR_CONSECUTIVEDOTS)}else if(hyphenFlag){updateResult(ISEMAIL_ERR_DOMAINHYPHENEND)}else if(elementLength>63){updateResult(ISEMAIL_RFC5322_LABEL_TOOLONG)}assertEnd=false;elementLength=0;elementCount++;atomList.domain[elementCount]="";parseData.domain+=token;break;case"[":if(parseData.domain.length===0){assertEnd=true;elementLength++;context.stack.push(context.now);context.now=COMPONENT_LITERAL;parseData.domain+=token;atomList.domain[elementCount]+=token;parseData.literal=""}else{updateResult(ISEMAIL_ERR_EXPECTING_ATEXT)}break;case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF);break}case" ":case" ":if(elementLength===0){updateResult(elementCount===0?ISEMAIL_DEPREC_CFWS_NEAR_AT:ISEMAIL_DEPREC_FWS)}else{updateResult(ISEMAIL_CFWS_FWS);assertEnd=true}context.stack.push(context.now);context.now=CONTEXT_FWS;prevToken=token;break;default:if(assertEnd){switch(context.prev){case CONTEXT_COMMENT:case CONTEXT_FWS:updateResult(ISEMAIL_ERR_ATEXT_AFTER_CFWS);break;case COMPONENT_LITERAL:updateResult(ISEMAIL_ERR_ATEXT_AFTER_DOMLIT);break;default:throw new Error("more atext found where none is allowed, "+"but unrecognized prev context: "+context.prev)}}charCode=token.charCodeAt(0);hyphenFlag=false;if(charCode<33||charCode>126||specialsLookup(charCode)){updateResult(ISEMAIL_ERR_EXPECTING_ATEXT)}else if(token==="-"){if(elementLength===0){updateResult(ISEMAIL_ERR_DOMAINHYPHENSTART)}hyphenFlag=true}else if(!(charCode>47&&charCode<58||charCode>64&&charCode<91||charCode>96&&charCode<123)){updateResult(ISEMAIL_RFC5322_DOMAIN)}parseData.domain+=token;atomList.domain[elementCount]+=token;elementLength++}break;case COMPONENT_LITERAL:switch(token){case"]":if(maxResultmaxGroups){updateResult(ISEMAIL_RFC5322_IPV6_MAXGRPS)}else if(matchesIP.length===maxGroups){updateResult(ISEMAIL_RFC5321_IPV6DEPRECATED)}}if(match[0]===":"&&match[1]!==":"){updateResult(ISEMAIL_RFC5322_IPV6_COLONSTRT)}else if(match[match.length-1]===":"&&match[match.length-2]!==":"){updateResult(ISEMAIL_RFC5322_IPV6_COLONEND)}else if(matchesIP.every(IPv6_REGEX_TEST)){updateResult(ISEMAIL_RFC5321_ADDRESSLITERAL)}else{updateResult(ISEMAIL_RFC5322_IPV6_BADCHAR)}}}else{updateResult(ISEMAIL_RFC5322_DOMAINLITERAL)}parseData.domain+=token;atomList.domain[elementCount]+=token;elementLength++;context.prev=context.now;context.now=context.stack.pop();break;case"\\":updateResult(ISEMAIL_RFC5322_DOMLIT_OBSDTEXT);context.stack.push(context.now);context.now=CONTEXT_QUOTEDPAIR;break;case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF);break}case" ":case" ":updateResult(ISEMAIL_CFWS_FWS);context.stack.push(context.now);context.now=CONTEXT_FWS;prevToken=token;break;default:charCode=token.charCodeAt(0);if(charCode>127||charCode===0||token==="["){updateResult(ISEMAIL_ERR_EXPECTING_DTEXT);break}else if(charCode<33||charCode===127){updateResult(ISEMAIL_RFC5322_DOMLIT_OBSDTEXT)}parseData.literal+=token;parseData.domain+=token;atomList.domain[elementCount]+=token;elementLength++}break;case CONTEXT_QUOTEDSTRING:switch(token){case"\\":context.stack.push(context.now);context.now=CONTEXT_QUOTEDPAIR;break;case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF);break}case" ":parseData.local+=" ";atomList.local[elementCount]+=" ";elementLength++;updateResult(ISEMAIL_CFWS_FWS);context.stack.push(context.now);context.now=CONTEXT_FWS;prevToken=token;break;case'"':parseData.local+=token;atomList.local[elementCount]+=token;elementLength++;context.prev=context.now;context.now=context.stack.pop();break;default:charCode=token.charCodeAt(0);if(charCode>127||charCode===0||charCode===10){updateResult(ISEMAIL_ERR_EXPECTING_QTEXT)}else if(charCode<32||charCode===127){updateResult(ISEMAIL_DEPREC_QTEXT)}parseData.local+=token;atomList.local[elementCount]+=token;elementLength++}break;case CONTEXT_QUOTEDPAIR:charCode=token.charCodeAt(0);if(charCode>127){updateResult(ISEMAIL_ERR_EXPECTING_QPAIR)}else if(charCode<31&&charCode!==9||charCode===127){updateResult(ISEMAIL_DEPREC_QP)}context.prev=context.now;context.now=context.stack.pop();token="\\"+token;switch(context.now){case CONTEXT_COMMENT:break;case CONTEXT_QUOTEDSTRING:parseData.local+=token;atomList.local[elementCount]+=token;elementLength+=2;break;case COMPONENT_LITERAL:parseData.domain+=token;atomList.domain[elementCount]+=token;elementLength+=2;break;default:throw new Error("quoted pair logic invoked in an invalid context: "+context.now)}break;case CONTEXT_COMMENT:switch(token){case"(":context.stack.push(context.now);context.now=CONTEXT_COMMENT;break;case")":context.prev=context.now;context.now=context.stack.pop();break;case"\\":context.stack.push(context.now);context.now=CONTEXT_QUOTEDPAIR;break;case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF);break}case" ":case" ":updateResult(ISEMAIL_CFWS_FWS);context.stack.push(context.now);context.now=CONTEXT_FWS;prevToken=token;break;default:charCode=token.charCodeAt(0);if(charCode>127||charCode===0||charCode===10){updateResult(ISEMAIL_ERR_EXPECTING_CTEXT);break}else if(charCode<32||charCode===127){updateResult(ISEMAIL_DEPREC_CTEXT)}}break;case CONTEXT_FWS:if(prevToken==="\r"){if(token==="\r"){updateResult(ISEMAIL_ERR_FWS_CRLF_X2);break}if(++crlfCount>1){updateResult(ISEMAIL_DEPREC_FWS)}else{crlfCount=1}}switch(token){case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF)}break;case" ":case" ":break;default:if(prevToken==="\r"){updateResult(ISEMAIL_ERR_FWS_CRLF_END)}crlfCount=0;context.prev=context.now;context.now=context.stack.pop();i--}prevToken=token;break;default:throw new Error("unknown context: "+context.now)}if(maxResult>ISEMAIL_RFC5322){break}}if(maxResult255){updateResult(ISEMAIL_RFC5322_DOMAIN_TOOLONG)}else if(parseData.local.length+parseData.domain.length+1>254){updateResult(ISEMAIL_RFC5322_TOOLONG)}else if(elementLength>63){updateResult(ISEMAIL_RFC5322_LABEL_TOOLONG)}else if(options.minDomainAtoms&&atomList.domain.length=48&&charCode<=57){updateResult(ISEMAIL_RFC5321_TLDNUMERIC)}}}if(maxResult=2){return match[1].split(internals.splitOperandsRegex)}else{return null}};exports.parse=function(str){return _.reduce(internals.actionWords,function(result,actionWord){result[actionWord]=internals.match(actionWord,str);return result},{})};exports.serializeUpdateExpression=function(schema,item){var datatypes=schema._modelDatatypes;var data=utils.omitPrimaryKeys(schema,item);var memo={expressions:{},attributeNames:{},values:{}};memo.expressions=_.reduce(internals.actionWords,function(result,key){result[key]=[];return result},{});var result=_.reduce(data,function(result,value,key){var valueKey=":"+key;var nameKey="#"+key;if(_.isNull(value)){result.expressions.REMOVE.push(nameKey);result.attributeNames[nameKey]=key}else if(_.isPlainObject(value)&&value.$add){result.expressions.ADD.push(nameKey+" "+valueKey);result.values[valueKey]=serializer.serializeAttribute(value.$add,datatypes[key]);result.attributeNames[nameKey]=key}else if(_.isPlainObject(value)&&value.$del){result.expressions.DELETE.push(nameKey+" "+valueKey);result.values[valueKey]=serializer.serializeAttribute(value.$del,datatypes[key]);result.attributeNames[nameKey]=key}else{result.expressions.SET.push(nameKey+" = "+valueKey);result.values[valueKey]=serializer.serializeAttribute(value,datatypes[key]);result.attributeNames[nameKey]=key}return result},memo);return result};exports.stringify=function(expressions){return _.reduce(expressions,function(result,value,key){if(!_.isEmpty(value)){if(_.isArray(value)){result.push(key+" "+value.join(", "))}else{result.push(key+" "+value)}}return result},[]).join(" ")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/expressions.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{"./serializer":332,"./utils":334,_process:1069,buffer:919,lodash:"lodash"}],326:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var _=require("lodash"),util=require("util"),AWS=require("aws-sdk"),DOC=require("dynamodb-doc"),Table=require("./table"),Schema=require("./schema"),serializer=require("./serializer"),batch=require("./batch"),Item=require("./item"),createTables=require("./createTables");var vogels=module.exports;vogels.AWS=AWS;var internals={};vogels.dynamoDriver=internals.dynamoDriver=function(driver){if(driver){internals.dynamodb=driver;var docClient=internals.loadDocClient(driver);internals.updateDynamoDBDocClientForAllModels(docClient)}else{internals.dynamodb=internals.dynamodb||new vogels.AWS.DynamoDB({apiVersion:"2012-08-10"})}return internals.dynamodb};internals.updateDynamoDBDocClientForAllModels=function(docClient){_.each(vogels.models,function(model){model.config({docClient:docClient})})};internals.loadDocClient=function(driver){if(driver){internals.docClient=new DOC.DynamoDB(driver)}else{internals.docClient=internals.docClient||new DOC.DynamoDB(internals.dynamoDriver())}return internals.docClient};internals.compileModel=function(name,schema){var tableName=name.toLowerCase()+"s";var table=new Table(tableName,schema,serializer,internals.loadDocClient());var Model=function(attrs){Item.call(this,attrs,table)};util.inherits(Model,Item);Model.get=_.bind(table.get,table);Model.create=_.bind(table.create,table);Model.update=_.bind(table.update,table);Model.destroy=_.bind(table.destroy,table);Model.query=_.bind(table.query,table);Model.scan=_.bind(table.scan,table);Model.parallelScan=_.bind(table.parallelScan,table);Model.getItems=batch(table,serializer).getItems;Model.batchGetItems=batch(table,serializer).getItems; -Model.createTable=_.bind(table.createTable,table);Model.updateTable=_.bind(table.updateTable,table);Model.describeTable=_.bind(table.describeTable,table);Model.deleteTable=_.bind(table.deleteTable,table);Model.tableName=_.bind(table.tableName,table);table.itemFactory=Model;Model.after=_.bind(table.after,table);Model.before=_.bind(table.before,table);Model.__defineGetter__("docClient",function(){return table.docClient});Model.config=function(config){config=config||{};if(config.tableName){table.config.name=config.tableName}if(config.docClient){table.docClient=config.docClient}else if(config.dynamodb){table.docClient=new DOC.DynamoDB(config.dynamodb)}return table.config};return vogels.model(name,Model)};internals.addModel=function(name,model){vogels.models[name]=model;return vogels.models[name]};vogels.reset=function(){vogels.models={}};vogels.Set=function(){return internals.docClient.Set.apply(internals.docClient,arguments)};vogels.define=function(modelName,config){if(_.isFunction(config)){throw new Error("define no longer accepts schema callback, migrate to new api")}var schema=new Schema(config);var compiledTable=internals.compileModel(modelName,schema);return compiledTable};vogels.model=function(name,model){if(model){internals.addModel(name,model)}return vogels.models[name]||null};vogels.createTables=function(options,callback){if(typeof options==="function"&&!callback){callback=options;options={}}callback=callback||_.noop;options=options||{};return createTables(vogels.models,options,callback)};vogels.types=Schema.types;vogels.reset()}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/index.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{"./batch":323,"./createTables":324,"./item":327,"./schema":331,"./serializer":332,"./table":333,_process:1069,"aws-sdk":"aws-sdk",buffer:919,"dynamodb-doc":"dynamodb-doc",lodash:"lodash",util:1089}],327:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var util=require("util"),_=require("lodash"),events=require("events");var internals={};internals.identity=function(){};var Item=module.exports=function(attrs,table){events.EventEmitter.call(this);this.table=table;this.set(attrs||{})};util.inherits(Item,events.EventEmitter);Item.prototype.get=function(key){if(key){return this.attrs[key]}else{return this.attrs}};Item.prototype.set=function(params){this.attrs=_.merge({},this.attrs,params);return this};Item.prototype.save=function(callback){var self=this;callback=callback||internals.identity;self.table.create(this.attrs,function(err,item){if(err){return callback(err)}self.set(item.attrs);return callback(null,item)})};Item.prototype.update=function(options,callback){var self=this;if(typeof options==="function"&&!callback){callback=options;options={}}options=options||{};callback=callback||internals.identity;self.table.update(this.attrs,options,function(err,item){if(err){return callback(err)}if(item){self.set(item.attrs)}return callback(null,item)})};Item.prototype.destroy=function(options,callback){var self=this;if(typeof options==="function"&&!callback){callback=options;options={}}options=options||{};callback=callback||internals.identity;self.table.destroy(this.attrs,options,callback)};Item.prototype.toJSON=function(){return this.attrs}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/item.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{_process:1069,buffer:919,events:1061,lodash:"lodash",util:1089}],328:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var Scan=require("./scan"),async=require("async"),NodeUtil=require("util"),utils=require("./utils"),Readable=require("stream").Readable,_=require("lodash");var ParallelScan=module.exports=function(table,serializer,totalSegments){Scan.call(this,table,serializer);this.totalSegments=totalSegments};NodeUtil.inherits(ParallelScan,Scan);ParallelScan.prototype.exec=function(callback){var self=this;var streamMode=false;var combinedStream=new Readable({objectMode:true});if(!callback){streamMode=true;callback=function(err){if(err){combinedStream.emit("error",err)}}}var scanFuncs=[];_.times(self.totalSegments,function(segment){var scn=new Scan(self.table,self.serializer);scn.request=_.cloneDeep(self.request);scn=scn.segments(segment,self.totalSegments).loadAll();var scanFunc=function(callback){if(streamMode){var stream=scn.exec();stream.on("error",callback);stream.on("readable",function(){var data=stream.read();if(data){combinedStream.push(data)}});stream.on("end",callback)}else{return scn.exec(callback)}};scanFuncs.push(scanFunc)});var started=false;var startScans=function(){if(started){return}started=true;async.parallel(scanFuncs,function(err,responses){if(err){return callback(err)}combinedStream.push(null);return callback(null,utils.mergeResults(responses,self.table.tableName()))})};if(streamMode){combinedStream._read=startScans}else{startScans()}return combinedStream}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/parallelScan.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{"./scan":330,"./utils":334,_process:1069,async:"async",buffer:919,lodash:"lodash",stream:1084,util:1089}],329:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var _=require("lodash"),utils=require("./utils");var internals={};internals.keyCondition=function(keyName,schema,query){var f=function(operator){return function(){var copy=[].slice.call(arguments);var args=[keyName,operator].concat(copy);var cond=query.buildAttributeValue.apply(query,args);return query.addKeyCondition(cond)}};return{equals:f("EQ"),lte:f("LE"),lt:f("LT"),gte:f("GE"),gt:f("GT"),beginsWith:f("BEGINS_WITH"),between:f("BETWEEN")}};internals.queryFilter=function(keyName,schema,query){var f=function(operator){return function(value){if(operator==="NOT_NULL"){if(_.isBoolean(value)&&value===false){operator="NULL"}var nullCond=query.table.docClient.Condition(keyName,operator);return query.addFilterCondition(nullCond)}else{var copy=[].slice.call(arguments);var args=[keyName,operator].concat(copy);var cond=query.buildAttributeValue.apply(query,args);return query.addFilterCondition(cond)}}};return{equals:f("EQ"),notEquals:f("NE"),lte:f("LE"),lt:f("LT"),gte:f("GE"),gt:f("GT"),exists:f("NOT_NULL"),contains:f("CONTAINS"),notContains:f("NOT_CONTAINS"),beginsWith:f("BEGINS_WITH"),"in":f("IN"),between:f("BETWEEN")}};internals.isUsingGlobalIndex=function(query){return query.request.IndexName&&query.table.schema.globalIndexes[query.request.IndexName]};var Query=module.exports=function(hashKey,table,serializer){this.hashKey=hashKey;this.table=table;this.serializer=serializer;this.options={loadAll:false};this.request={}};Query.prototype.limit=function(num){if(num<=0){throw new Error("Limit must be greater than 0")}this.request.Limit=num;return this};Query.prototype.filterExpression=function(expression){this.request.FilterExpression=expression;return this};Query.prototype.expressionAttributeValues=function(data){this.request.ExpressionAttributeValues=data;return this};Query.prototype.expressionAttributeNames=function(data){this.request.ExpressionAttributeNames=data;return this};Query.prototype.projectionExpression=function(data){this.request.ProjectionExpression=data;return this};Query.prototype.usingIndex=function(name){this.request.IndexName=name;return this};Query.prototype.consistentRead=function(read){if(!_.isBoolean(read)){read=true}this.request.ConsistentRead=read;return this};Query.prototype.addKeyCondition=function(condition){if(!this.request.KeyConditions){this.request.KeyConditions=[]}this.request.KeyConditions.push(condition);return this};Query.prototype.addFilterCondition=function(condition){if(!this.request.QueryFilter){this.request.QueryFilter=[]}this.request.QueryFilter.push(condition);return this};Query.prototype.startKey=function(hashKey,rangeKey){this.request.ExclusiveStartKey=this.serializer.buildKey(hashKey,rangeKey,this.table.schema);return this};Query.prototype.attributes=function(attrs){if(!_.isArray(attrs)){attrs=[attrs]}this.request.AttributesToGet=attrs;return this};Query.prototype.ascending=function(){this.request.ScanIndexForward=true;return this};Query.prototype.descending=function(){this.request.ScanIndexForward=false;return this};Query.prototype.select=function(value){this.request.Select=value;return this};Query.prototype.returnConsumedCapacity=function(value){if(_.isUndefined(value)){value="TOTAL"}this.request.ReturnConsumedCapacity=value;return this};Query.prototype.loadAll=function(){this.options.loadAll=true;return this};Query.prototype.where=function(keyName){return internals.keyCondition(keyName,this.table.schema,this)};Query.prototype.filter=function(keyName){return internals.queryFilter(keyName,this.table.schema,this)};Query.prototype.exec=function(callback){var self=this;var runQuery=function(params,callback){self.table.runQuery(params,callback)};return utils.paginatedRequest(self,runQuery,callback)};Query.prototype.buildKey=function(){var key=this.table.schema.hashKey;if(internals.isUsingGlobalIndex(this)){key=this.table.schema.globalIndexes[this.request.IndexName].hashKey}return this.buildAttributeValue(key,"EQ",this.hashKey)};internals.formatAttributeValue=function(val){if(_.isDate(val)){return val.toISOString()}return val};Query.prototype.buildAttributeValue=function(key,operator,val1,val2){var self=this;var v1=internals.formatAttributeValue(val1);var v2=internals.formatAttributeValue(val2);return self.table.docClient.Condition(key,operator,v1,v2)};Query.prototype.buildRequest=function(){this.addKeyCondition(this.buildKey());return _.merge({},this.request,{TableName:this.table.tableName()})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/query.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{"./utils":334,_process:1069,buffer:919,lodash:"lodash"}],330:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var _=require("lodash"),utils=require("./utils");var internals={};internals.keyCondition=function(keyName,schema,scan){var f=function(operator){return function(){var copy=[].slice.call(arguments);var args=[keyName,operator].concat(copy);var cond=scan.buildAttributeValue.apply(scan,args);return scan.addKeyCondition(cond)}};return{equals:f("EQ"),eq:f("EQ"),ne:f("NE"),lte:f("LE"),lt:f("LT"),gte:f("GE"),gt:f("GT"),"null":f("NULL"),notNull:f("NOT_NULL"),contains:f("CONTAINS"),notContains:f("NOT_CONTAINS"),"in":f("IN"),beginsWith:f("BEGINS_WITH"),between:f("BETWEEN")}};var Scan=module.exports=function(table,serializer){this.table=table;this.serializer=serializer;this.options={loadAll:false};this.request={}};Scan.prototype.limit=function(num){if(num<=0){throw new Error("Limit must be greater than 0")}this.request.Limit=num;return this};Scan.prototype.addKeyCondition=function(condition){if(!this.request.ScanFilter){this.request.ScanFilter=[]}this.request.ScanFilter.push(condition);return this};Scan.prototype.startKey=function(hashKey,rangeKey){this.request.ExclusiveStartKey=this.serializer.buildKey(hashKey,rangeKey,this.table.schema);return this};Scan.prototype.attributes=function(attrs){if(!_.isArray(attrs)){attrs=[attrs]}this.request.AttributesToGet=attrs;return this};Scan.prototype.select=function(value){this.request.Select=value;return this};Scan.prototype.returnConsumedCapacity=function(value){if(_.isUndefined(value)){value="TOTAL"}this.request.ReturnConsumedCapacity=value;return this};Scan.prototype.segments=function(segment,totalSegments){this.request.Segment=segment;this.request.TotalSegments=totalSegments;return this};Scan.prototype.where=function(keyName){return internals.keyCondition(keyName,this.table.schema,this)};Scan.prototype.filterExpression=function(expression){this.request.FilterExpression=expression;return this};Scan.prototype.expressionAttributeValues=function(data){this.request.ExpressionAttributeValues=data;return this};Scan.prototype.expressionAttributeNames=function(data){this.request.ExpressionAttributeNames=data;return this};Scan.prototype.projectionExpression=function(data){this.request.ProjectionExpression=data;return this};Scan.prototype.exec=function(callback){var self=this;var runScan=function(params,callback){self.table.runScan(params,callback)};return utils.paginatedRequest(self,runScan,callback)};Scan.prototype.loadAll=function(){this.options.loadAll=true;return this};internals.formatAttributeValue=function(val){if(_.isDate(val)){return val.toISOString()}return val};Scan.prototype.buildAttributeValue=function(key,operator,val1,val2){var self=this;var v1=internals.formatAttributeValue(val1);var v2=internals.formatAttributeValue(val2);return self.table.docClient.Condition(key,operator,v1,v2)};Scan.prototype.buildRequest=function(){return _.merge({},this.request,{TableName:this.table.tableName()})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/scan.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{"./utils":334,_process:1069,buffer:919,lodash:"lodash"}],331:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var Joi=require("joi"),nodeUUID=require("node-uuid"),_=require("lodash");var internals={};internals.secondaryIndexSchema=Joi.object().keys({hashKey:Joi.string().when("type",{is:"local",then:Joi.ref("$hashKey"),otherwise:Joi.required()}),rangeKey:Joi.string().when("type",{is:"local",then:Joi.required(),otherwise:Joi.optional()}),type:Joi.string().valid("local","global").required(),name:Joi.string().required(),projection:Joi.object(),readCapacity:Joi.number().when("type",{is:"global",then:Joi.optional(),otherwise:Joi.forbidden()}),writeCapacity:Joi.number().when("type",{is:"global",then:Joi.optional(),otherwise:Joi.forbidden()})});internals.configSchema=Joi.object().keys({hashKey:Joi.string().required(),rangeKey:Joi.string(),tableName:Joi.alternatives().try(Joi.string(),Joi.func()),indexes:Joi.array().includes(internals.secondaryIndexSchema),schema:Joi.object(),timestamps:Joi.boolean().default(false),createdAt:Joi.alternatives().try(Joi.string(),Joi.boolean()),updatedAt:Joi.alternatives().try(Joi.string(),Joi.boolean())}).required();internals.wireType=function(key){switch(key){case"string":return"S";case"date":return"DATE";case"number":return"N";case"boolean":return"BOOL";case"binary":return"B";case"array":return"L";default:return null}};internals.findDynamoTypeMetadata=function(data){var meta=_.find(data.meta,function(data){return _.isString(data.dynamoType)});if(meta){return meta.dynamoType}else{return internals.wireType(data.type)}};internals.parseDynamoTypes=function(data){if(_.isPlainObject(data)&&data.type==="object"&&_.isPlainObject(data.children)){return internals.parseDynamoTypes(data.children)}var mapped=_.reduce(data,function(result,val,key){if(val.type==="object"&&_.isPlainObject(val.children)){result[key]=internals.parseDynamoTypes(val.children)}else{result[key]=internals.findDynamoTypeMetadata(val)}return result},{});return mapped};var Schema=module.exports=function(config){this.secondaryIndexes={};this.globalIndexes={};var context={hashKey:config.hashKey};var self=this;Joi.validate(config,internals.configSchema,{context:context},function(err,data){if(err){var msg="Invalid table schema, check your config ";throw new Error(msg+err.annotate())}self.hashKey=data.hashKey;self.rangeKey=data.rangeKey;self.tableName=data.tableName;self.timestamps=data.timestamps;self.createdAt=data.createdAt;self.updatedAt=data.updatedAt;if(data.indexes){self.globalIndexes=_.chain(data.indexes).filter({type:"global"}).indexBy("name").value();self.secondaryIndexes=_.chain(data.indexes).filter({type:"local"}).indexBy("name").value()}if(data.schema){self._modelSchema=_.isPlainObject(data.schema)?Joi.object().keys(data.schema):data.schema}else{self._modelSchema=Joi.object()}if(self.timestamps){var valids={};var createdAtParamName="createdAt";var updatedAtParamName="updatedAt";if(self.createdAt){if(_.isString(self.createdAt)){createdAtParamName=self.createdAt}}if(self.updatedAt){if(_.isString(self.updatedAt)){updatedAtParamName=self.updatedAt}}if(self.createdAt!==false){valids[createdAtParamName]=Joi.date()}if(self.updatedAt!==false){valids[updatedAtParamName]=Joi.date()}var extended=self._modelSchema.keys(valids);self._modelSchema=extended}self._modelDatatypes=internals.parseDynamoTypes(self._modelSchema.describe())})};Schema.types={};Schema.types.stringSet=function(){var set=Joi.array().includes(Joi.string()).meta({dynamoType:"SS"});return set};Schema.types.numberSet=function(){var set=Joi.array().includes(Joi.number()).meta({dynamoType:"NS"});return set};Schema.types.binarySet=function(){var set=Joi.array().includes(Joi.binary(),Joi.string()).meta({dynamoType:"BS"});return set};Schema.types.uuid=function(){return Joi.string().guid().default(nodeUUID.v4)};Schema.types.timeUUID=function(){return Joi.string().guid().default(nodeUUID.v1)};Schema.prototype.validate=function(params,options){options=options||{};return Joi.validate(params,this._modelSchema,options)};internals.invokeDefaultFunctions=function(data){return _.mapValues(data,function(val){if(_.isFunction(val)){return val.call(null)}else if(_.isPlainObject(val)){return internals.invokeDefaultFunctions(val)}else{return val}})};Schema.prototype.applyDefaults=function(data){var result=this.validate(data,{abortEarly:false});return internals.invokeDefaultFunctions(result.value)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/schema.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{_process:1069,buffer:919,joi:"joi",lodash:"lodash","node-uuid":"node-uuid"}],332:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var _=require("lodash"),utils=require("./utils"),DOC=require("dynamodb-doc");var serializer=module.exports;var internals={};internals.docClient=new DOC.DynamoDB;internals.createSet=function(value,type){if(_.isArray(value)){return internals.docClient.Set(value,type)}else{return internals.docClient.Set([value],type)}};var serialize=internals.serialize={binary:function(value){if(_.isString(value)){return internals.docClient.StrToBin(value)}return value},date:function(value){if(_.isDate(value)){return value.toISOString()}else{return new Date(value).toISOString()}},"boolean":function(value){if(value&&value!=="false"){return true}else{return false}},stringSet:function(value){return internals.createSet(value,"S")},numberSet:function(value){return internals.createSet(value,"N")},binarySet:function(value){var bins=value;if(!_.isArray(value)){bins=[value]}var vals=_.map(bins,serialize.binary);return internals.createSet(vals,"B")}};internals.deserializeAttribute=function(value){if(_.isObject(value)&&_.isFunction(value.toArray)){return value.toArray()}else{return value}};internals.serializeAttribute=serializer.serializeAttribute=function(value,type,options){if(!type){return value}if(_.isNull(value)){return null}options=options||{};switch(type){case"DATE":return serialize.date(value);case"BOOL":return serialize.boolean(value);case"B":return serialize.binary(value);case"NS":return serialize.numberSet(value);case"SS":return serialize.stringSet(value);case"BS":return serialize.binarySet(value);default:return value}};serializer.buildKey=function(hashKey,rangeKey,schema){var obj={};if(_.isPlainObject(hashKey)){obj[schema.hashKey]=hashKey[schema.hashKey];if(schema.rangeKey&&!_.isNull(hashKey[schema.rangeKey])&&!_.isUndefined(hashKey[schema.rangeKey])){obj[schema.rangeKey]=hashKey[schema.rangeKey]}_.each(schema.globalIndexes,function(keys){if(_.has(hashKey,keys.hashKey)){obj[keys.hashKey]=hashKey[keys.hashKey]}if(_.has(hashKey,keys.rangeKey)){obj[keys.rangeKey]=hashKey[keys.rangeKey]}});_.each(schema.secondaryIndexes,function(keys){if(_.has(hashKey,keys.rangeKey)){obj[keys.rangeKey]=hashKey[keys.rangeKey]}})}else{obj[schema.hashKey]=hashKey;if(schema.rangeKey&&!_.isNull(rangeKey)&&!_.isUndefined(rangeKey)){obj[schema.rangeKey]=rangeKey}}return serializer.serializeItem(schema,obj)};serializer.serializeItem=function(schema,item,options){options=options||{};var serialize=function(item,datatypes){datatypes=datatypes||{};if(!item){return null}return _.reduce(item,function(result,val,key){if(options.expected&&_.isObject(val)&&_.isBoolean(val.Exists)){result[key]=val;return result}if(_.isPlainObject(val)){result[key]=serialize(val,datatypes[key]);return result}var attr=internals.serializeAttribute(val,datatypes[key],options);if(!_.isNull(attr)||options.returnNulls){if(options.expected){result[key]={Value:attr}}else{result[key]=attr}}return result},{})};return serialize(item,schema._modelDatatypes)};serializer.serializeItemForUpdate=function(schema,action,item){var datatypes=schema._modelDatatypes;var data=utils.omitPrimaryKeys(schema,item);return _.reduce(data,function(result,value,key){if(_.isNull(value)){result[key]={Action:"DELETE"}}else if(_.isPlainObject(value)&&value.$add){result[key]={Action:"ADD",Value:internals.serializeAttribute(value.$add,datatypes[key])}}else if(_.isPlainObject(value)&&value.$del){result[key]={Action:"DELETE",Value:internals.serializeAttribute(value.$del,datatypes[key])}}else{result[key]={Action:action,Value:internals.serializeAttribute(value,datatypes[key])}}return result},{})};serializer.deserializeItem=function(item){if(_.isNull(item)){return null}var formatter=function(data){var map=_.mapValues;if(_.isArray(data)){map=_.map}return map(data,function(value){var result;if(_.isPlainObject(value)){result=formatter(value)}else if(_.isArray(value)){result=formatter(value)}else{result=internals.deserializeAttribute(value)}return result})};return formatter(item)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/serializer.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{"./utils":334,_process:1069,buffer:919,"dynamodb-doc":"dynamodb-doc",lodash:"lodash"}],333:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var _=require("lodash"),Item=require("./item"),Query=require("./query"),Scan=require("./scan"),EventEmitter=require("events").EventEmitter,async=require("async"),utils=require("./utils"),ParallelScan=require("./parallelScan"),expressions=require("./expressions");var internals={};var Table=module.exports=function(name,schema,serializer,docClient){this.config={name:name};this.schema=schema;this.serializer=serializer;this.docClient=docClient;this._before=new EventEmitter;this.before=this._before.on.bind(this._before);this._after=new EventEmitter;this.after=this._after.on.bind(this._after)};Table.prototype.initItem=function(attrs){var self=this;if(self.itemFactory){return new self.itemFactory(attrs)}else{return new Item(attrs,self)}};Table.prototype.tableName=function(){if(this.schema.tableName){if(_.isFunction(this.schema.tableName)){return this.schema.tableName.call(this)}else{return this.schema.tableName}}else{return this.config.name}};Table.prototype.get=function(hashKey,rangeKey,options,callback){var self=this;if(_.isPlainObject(rangeKey)&&typeof options==="function"&&!callback){callback=options;options=rangeKey;rangeKey=null}else if(typeof rangeKey==="function"&&!callback){callback=rangeKey;options={};rangeKey=null}else if(typeof options==="function"&&!callback){callback=options;options={}}var params={TableName:self.tableName(),Key:self.serializer.buildKey(hashKey,rangeKey,self.schema)};params=_.merge({},params,options);self.docClient.getItem(params,function(err,data){if(err){return callback(err)}var item=null;if(data.Item){item=self.initItem(self.serializer.deserializeItem(data.Item))}return callback(null,item)})};internals.callBeforeHooks=function(table,name,startFun,callback){var listeners=table._before.listeners(name);return async.waterfall([startFun].concat(listeners),callback)};Table.prototype.create=function(item,options,callback){var self=this;if(typeof options==="function"&&!callback){callback=options;options={}}callback=callback||_.noop;options=options||{};var start=function(callback){var data=self.schema.applyDefaults(item);var paramName=_.isString(self.schema.createdAt)?self.schema.createdAt:"createdAt";if(self.schema.timestamps&&self.schema.createdAt!==false&&!_.has(data,paramName)){data[paramName]=Date.now()}return callback(null,data)};internals.callBeforeHooks(self,"create",start,function(err,data){if(err){return callback(err)}var result=self.schema.validate(data);if(result.error){return callback(result.error)}var attrs=utils.omitNulls(data);var params={TableName:self.tableName(),Item:self.serializer.serializeItem(self.schema,attrs)};if(options.expected){params.Expected=self.serializer.serializeItem(self.schema,options.expected,{expected:true});options=_.omit(options,"expected")}params=_.merge({},params,options);self.docClient.putItem(params,function(err){if(err){return callback(err)}var item=self.initItem(attrs);self._after.emit("create",item);return callback(null,item)})})};internals.updateExpressions=function(schema,data,options){var exp=expressions.serializeUpdateExpression(schema,data);if(options.UpdateExpression){var parsed=expressions.parse(options.UpdateExpression);exp.expressions=_.reduce(parsed,function(result,val,key){if(!_.isEmpty(val)){result[key]=result[key].concat(val)}return result},exp.expressions)}if(_.isPlainObject(options.ExpressionAttributeValues)){exp.values=_.merge({},exp.values,options.ExpressionAttributeValues)}if(_.isPlainObject(options.ExpressionAttributeNames)){exp.attributeNames=_.merge({},exp.attributeNames,options.ExpressionAttributeNames)}return _.merge({},{ExpressionAttributeValues:exp.values,ExpressionAttributeNames:exp.attributeNames,UpdateExpression:expressions.stringify(exp.expressions)})};Table.prototype.update=function(item,options,callback){var self=this;if(typeof options==="function"&&!callback){callback=options;options={}}callback=callback||_.noop;options=options||{};var start=function(callback){var paramName=_.isString(self.schema.updatedAt)?self.schema.updatedAt:"updatedAt";if(self.schema.timestamps&&self.schema.updatedAt!==false&&!_.has(item,paramName)){item[paramName]=Date.now()}return callback(null,item)};internals.callBeforeHooks(self,"update",start,function(err,data){if(err){return callback(err)}var hashKey=data[self.schema.hashKey];var rangeKey=data[self.schema.rangeKey]||null;var params={TableName:self.tableName(),Key:self.serializer.buildKey(hashKey,rangeKey,self.schema),ReturnValues:"ALL_NEW"};var exp=internals.updateExpressions(self.schema,data,options);if(exp.UpdateExpression){params.UpdateExpression=exp.UpdateExpression;delete options.UpdateExpression}if(exp.ExpressionAttributeValues){params.ExpressionAttributeValues=exp.ExpressionAttributeValues;delete options.ExpressionAttributeValues}if(exp.ExpressionAttributeNames){params.ExpressionAttributeNames=exp.ExpressionAttributeNames;delete options.ExpressionAttributeNames}if(options.expected){options.Expected=self.serializer.serializeItem(self.schema,options.expected,{expected:true});delete options.expected}params=_.chain({}).merge(params,options).omit(_.isEmpty).value();self.docClient.updateItem(params,function(err,data){if(err){return callback(err)}var result=null;if(data.Attributes){result=self.initItem(self.serializer.deserializeItem(data.Attributes))}self._after.emit("update",result);return callback(null,result)})})};Table.prototype.destroy=function(hashKey,rangeKey,options,callback){var self=this;if(_.isPlainObject(rangeKey)&&typeof options==="function"&&!callback){callback=options;options=rangeKey;rangeKey=null}else if(typeof rangeKey==="function"&&!callback){callback=rangeKey;options={};rangeKey=null}else if(_.isPlainObject(rangeKey)&&!callback){callback=options;options=rangeKey;rangeKey=null}else if(typeof options==="function"&&!callback){callback=options;options={}}callback=callback||_.noop;options=options||{};if(_.isPlainObject(hashKey)){rangeKey=hashKey[self.schema.rangeKey]||null;hashKey=hashKey[self.schema.hashKey]}var params={TableName:self.tableName(),Key:self.serializer.buildKey(hashKey,rangeKey,self.schema)};if(options.expected){options.Expected=self.serializer.serializeItem(self.schema,options.expected,{expected:true});delete options.expected}params=_.merge({},params,options);self.docClient.deleteItem(params,function(err,data){if(err){return callback(err)}var item=null;if(data.Attributes){item=self.initItem(self.serializer.deserializeItem(data.Attributes))}self._after.emit("destroy",item);return callback(null,item)})};Table.prototype.query=function(hashKey){var self=this;return new Query(hashKey,self,self.serializer)};Table.prototype.scan=function(){var self=this;return new Scan(self,self.serializer)};Table.prototype.parallelScan=function(totalSegments){var self=this;return new ParallelScan(self,self.serializer,totalSegments)};internals.deserializeItems=function(table,callback){return function(err,data){if(err){return callback(err)}var result={};if(data.Items){result.Items=_.map(data.Items,function(i){return table.initItem(table.serializer.deserializeItem(i))});delete data.Items}if(data.LastEvaluatedKey){result.LastEvaluatedKey=data.LastEvaluatedKey;delete data.LastEvaluatedKey}return callback(null,_.merge({},data,result))}};Table.prototype.runQuery=function(params,callback){var self=this;self.docClient.query(params,internals.deserializeItems(self,callback))};Table.prototype.runScan=function(params,callback){var self=this;self.docClient.scan(params,internals.deserializeItems(self,callback))};Table.prototype.runBatchGetItems=function(params,callback){var self=this;self.docClient.batchGetItem(params,callback)};internals.attributeDefinition=function(schema,key){var type=schema._modelDatatypes[key];if(type==="DATE"){type="S"}return{AttributeName:key,AttributeType:type}};internals.keySchema=function(hashKey,rangeKey){var result=[{AttributeName:hashKey,KeyType:"HASH"}];if(rangeKey){result.push({AttributeName:rangeKey,KeyType:"RANGE"})}return result};internals.secondaryIndex=function(schema,params){var projection=params.projection||{ -ProjectionType:"ALL"};return{IndexName:params.name,KeySchema:internals.keySchema(schema.hashKey,params.rangeKey),Projection:projection}};internals.globalIndex=function(indexName,params){var projection=params.projection||{ProjectionType:"ALL"};return{IndexName:indexName,KeySchema:internals.keySchema(params.hashKey,params.rangeKey),Projection:projection,ProvisionedThroughput:{ReadCapacityUnits:params.readCapacity||1,WriteCapacityUnits:params.writeCapacity||1}}};Table.prototype.createTable=function(options,callback){var self=this;if(typeof options==="function"&&!callback){callback=options;options={}}var attributeDefinitions=[];attributeDefinitions.push(internals.attributeDefinition(self.schema,self.schema.hashKey));if(self.schema.rangeKey){attributeDefinitions.push(internals.attributeDefinition(self.schema,self.schema.rangeKey))}var localSecondaryIndexes=[];_.forEach(self.schema.secondaryIndexes,function(params){attributeDefinitions.push(internals.attributeDefinition(self.schema,params.rangeKey));localSecondaryIndexes.push(internals.secondaryIndex(self.schema,params))});var globalSecondaryIndexes=[];_.forEach(self.schema.globalIndexes,function(params,indexName){if(!_.find(attributeDefinitions,{AttributeName:params.hashKey})){attributeDefinitions.push(internals.attributeDefinition(self.schema,params.hashKey))}if(params.rangeKey&&!_.find(attributeDefinitions,{AttributeName:params.rangeKey})){attributeDefinitions.push(internals.attributeDefinition(self.schema,params.rangeKey))}globalSecondaryIndexes.push(internals.globalIndex(indexName,params))});var keySchema=internals.keySchema(self.schema.hashKey,self.schema.rangeKey);var params={AttributeDefinitions:attributeDefinitions,TableName:self.tableName(),KeySchema:keySchema,ProvisionedThroughput:{ReadCapacityUnits:options.readCapacity||1,WriteCapacityUnits:options.writeCapacity||1}};if(localSecondaryIndexes.length>=1){params.LocalSecondaryIndexes=localSecondaryIndexes}if(globalSecondaryIndexes.length>=1){params.GlobalSecondaryIndexes=globalSecondaryIndexes}self.docClient.createTable(params,callback)};Table.prototype.describeTable=function(callback){var params={TableName:this.tableName()};this.docClient.describeTable(params,callback)};Table.prototype.deleteTable=function(callback){callback=callback||_.noop;var params={TableName:this.tableName()};this.docClient.deleteTable(params,callback)};Table.prototype.updateTable=function(throughput,callback){callback=callback||_.noop;var params={TableName:this.tableName(),ProvisionedThroughput:{ReadCapacityUnits:throughput.readCapacity,WriteCapacityUnits:throughput.writeCapacity}};this.docClient.updateTable(params,callback)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/table.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{"./expressions":325,"./item":327,"./parallelScan":328,"./query":329,"./scan":330,"./utils":334,_process:1069,async:"async",buffer:919,events:1061,lodash:"lodash"}],334:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var _=require("lodash"),Readable=require("stream").Readable,async=require("async");var utils=module.exports;utils.omitNulls=function(data){return _.omit(data,function(value){return _.isNull(value)||_.isUndefined(value)||_.isArray(value)&&_.isEmpty(value)})};utils.mergeResults=function(responses,tableName){var result={Items:[],ConsumedCapacity:{CapacityUnits:0,TableName:tableName},Count:0,ScannedCount:0};var merged=_.reduce(responses,function(memo,resp){if(!resp){return memo}memo.Count+=resp.Count||0;memo.ScannedCount+=resp.ScannedCount||0;if(resp.ConsumedCapacity){memo.ConsumedCapacity.CapacityUnits+=resp.ConsumedCapacity.CapacityUnits||0}if(resp.Items){memo.Items=memo.Items.concat(resp.Items)}if(resp.LastEvaluatedKey){memo.LastEvaluatedKey=resp.LastEvaluatedKey}return memo},result);if(merged.ConsumedCapacity.CapacityUnits===0){delete merged.ConsumedCapacity}if(merged.ScannedCount===0){delete merged.ScannedCount}return merged};utils.paginatedRequest=function(self,runRequestFunc,callback){if(!callback){return utils.streamRequest(self,runRequestFunc)}var lastEvaluatedKey=null;var responses=[];var retry=false;var doFunc=function(callback){if(lastEvaluatedKey){self.startKey(lastEvaluatedKey)}runRequestFunc(self.buildRequest(),function(err,resp){if(err&&err.retryable){retry=true;return setImmediate(callback)}else if(err){retry=false;return setImmediate(callback,err)}retry=false;lastEvaluatedKey=resp.LastEvaluatedKey;responses.push(resp);return setImmediate(callback)})};var testFunc=function(){return self.options.loadAll&&lastEvaluatedKey||retry};var resulsFunc=function(err){if(err){return callback(err)}return callback(null,utils.mergeResults(responses,self.table.tableName()))};async.doWhilst(doFunc,testFunc,resulsFunc)};utils.streamRequest=function(self,runRequestFunc){var lastEvaluatedKey=null;var performRequest=true;var stream=new Readable({objectMode:true});var startRead=function(){if(!performRequest){return}if(lastEvaluatedKey){self.startKey(lastEvaluatedKey)}runRequestFunc(self.buildRequest(),function(err,resp){if(err&&err.retryable){return setTimeout(startRead,1e3)}else if(err){return stream.emit("error",err)}else{lastEvaluatedKey=resp.LastEvaluatedKey;if(!self.options.loadAll||!lastEvaluatedKey){performRequest=false}stream.push(resp);if(!self.options.loadAll||!lastEvaluatedKey){stream.push(null)}}})};stream._read=function(){startRead()};return stream};utils.omitPrimaryKeys=function(schema,params){return _.omit(params,schema.hashKey,schema.rangeKey)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib/utils.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/lib")},{_process:1069,async:"async",buffer:919,lodash:"lodash",stream:1084}],335:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");require("./credentials");require("./credentials/credential_provider_chain");AWS.Config=AWS.util.inherit({constructor:function Config(options){if(options===undefined)options={};options=this.extractCredentials(options);AWS.util.each.call(this,this.keys,function(key,value){this.set(key,options[key],value)})},getCredentials:function getCredentials(callback){var self=this;function finish(err){callback(err,err?null:self.credentials)}function credError(msg,err){return new AWS.util.error(err||new Error,{code:"CredentialsError",message:msg})}function getAsyncCredentials(){self.credentials.get(function(err){if(err){var msg="Could not load credentials from "+self.credentials.constructor.name;err=credError(msg,err)}finish(err)})}function getStaticCredentials(){var err=null;if(!self.credentials.accessKeyId||!self.credentials.secretAccessKey){err=credError("Missing credentials")}finish(err)}if(self.credentials){if(typeof self.credentials.get==="function"){getAsyncCredentials()}else{getStaticCredentials()}}else if(self.credentialProvider){self.credentialProvider.resolve(function(err,creds){if(err){err=credError("Could not load credentials from any providers",err)}self.credentials=creds;finish(err)})}else{finish(credError("No credentials to load"))}},update:function update(options,allowUnknownKeys){allowUnknownKeys=allowUnknownKeys||false;options=this.extractCredentials(options);AWS.util.each.call(this,options,function(key,value){if(allowUnknownKeys||this.keys.hasOwnProperty(key)||AWS.Service.hasService(key)){this.set(key,value)}})},loadFromPath:function loadFromPath(path){this.clear();var options=JSON.parse(AWS.util.readFileSync(path));var fileSystemCreds=new AWS.FileSystemCredentials(path);var chain=new AWS.CredentialProviderChain;chain.providers.unshift(fileSystemCreds);chain.resolve(function(err,creds){if(err)throw err;else options.credentials=creds});this.constructor(options);return this},clear:function clear(){AWS.util.each.call(this,this.keys,function(key){delete this[key]});this.set("credentials",undefined);this.set("credentialProvider",undefined)},set:function set(property,value,defaultValue){if(value===undefined){if(defaultValue===undefined){defaultValue=this.keys[property]}if(typeof defaultValue==="function"){this[property]=defaultValue.call(this)}else{this[property]=defaultValue}}else if(property==="httpOptions"&&this[property]){this[property]=AWS.util.merge(this[property],value)}else{this[property]=value}},keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:undefined,httpOptions:{timeout:12e4},maxRetries:undefined,maxRedirects:10,paramValidation:true,sslEnabled:true,s3ForcePathStyle:false,s3BucketEndpoint:false,computeChecksums:true,convertResponseTypes:true,dynamoDbCrc32:true,systemClockOffset:0,signatureVersion:null},extractCredentials:function extractCredentials(options){if(options.accessKeyId&&options.secretAccessKey){options=AWS.util.copy(options);options.credentials=new AWS.Credentials(options)}return options}});AWS.config=new AWS.Config}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/config.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib")},{"./core":336,"./credentials":337,"./credentials/credential_provider_chain":339,_process:1069,buffer:919}],336:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS={util:require("./util")};var _hidden={};_hidden.toString();module.exports=AWS;AWS.util.update(AWS,{VERSION:"2.1.47",Signers:{},Protocol:{Json:require("./protocol/json"),Query:require("./protocol/query"),Rest:require("./protocol/rest"),RestJson:require("./protocol/rest_json"),RestXml:require("./protocol/rest_xml")},XML:{Builder:require("./xml/builder"),Parser:null},JSON:{Builder:require("./json/builder"),Parser:require("./json/parser")},Model:{Api:require("./model/api"),Operation:require("./model/operation"),Shape:require("./model/shape"),Paginator:require("./model/paginator"),ResourceWaiter:require("./model/resource_waiter")},util:require("./util"),apiLoader:function(){throw new Error("No API loader set")}});require("./service");require("./credentials");require("./credentials/credential_provider_chain");require("./credentials/temporary_credentials");require("./credentials/web_identity_credentials");require("./credentials/cognito_identity_credentials");require("./credentials/saml_credentials");require("./config");require("./http");require("./sequential_executor");require("./event_listeners");require("./request");require("./response");require("./resource_waiter");require("./signers/request_signer");require("./param_validator");AWS.events=new AWS.SequentialExecutor}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/core.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib")},{"./config":335,"./credentials":337,"./credentials/cognito_identity_credentials":338,"./credentials/credential_provider_chain":339,"./credentials/saml_credentials":340,"./credentials/temporary_credentials":341,"./credentials/web_identity_credentials":342,"./event_listeners":343,"./http":344,"./json/builder":346,"./json/parser":347,"./model/api":348,"./model/operation":350,"./model/paginator":351,"./model/resource_waiter":352,"./model/shape":353,"./param_validator":354,"./protocol/json":355,"./protocol/query":356,"./protocol/rest":357,"./protocol/rest_json":358,"./protocol/rest_xml":359,"./request":363,"./resource_waiter":364,"./response":365,"./sequential_executor":367,"./service":368,"./signers/request_signer":377,"./util":384,"./xml/builder":386,_process:1069,buffer:919}],337:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");AWS.Credentials=AWS.util.inherit({constructor:function Credentials(){AWS.util.hideProperties(this,["secretAccessKey"]);this.expired=false;this.expireTime=null;if(arguments.length===1&&typeof arguments[0]==="object"){var creds=arguments[0].credentials||arguments[0];this.accessKeyId=creds.accessKeyId;this.secretAccessKey=creds.secretAccessKey;this.sessionToken=creds.sessionToken}else{this.accessKeyId=arguments[0];this.secretAccessKey=arguments[1];this.sessionToken=arguments[2]}},expiryWindow:15,needsRefresh:function needsRefresh(){var currentTime=AWS.util.date.getDate().getTime();var adjustedTime=new Date(currentTime+this.expiryWindow*1e3);if(this.expireTime&&adjustedTime>this.expireTime){return true}else{return this.expired||!this.accessKeyId||!this.secretAccessKey}},get:function get(callback){var self=this;if(this.needsRefresh()){this.refresh(function(err){if(!err)self.expired=false;if(callback)callback(err)})}else if(callback){callback()}},refresh:function refresh(callback){this.expired=false;callback()}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib")},{"./core":336,_process:1069,buffer:919}],338:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.CognitoIdentityCredentials=AWS.util.inherit(AWS.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function CognitoIdentityCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params;this.data=null;this.identityId=null;this.loadCachedId()},refresh:function refresh(callback){var self=this;self.createClients();self.data=null;self.identityId=null;self.getId(function(err){if(!err){if(!self.params.RoleArn){self.getCredentialsForIdentity(callback)}else{self.getCredentialsFromSTS(callback)}}else{self.clearCachedId();callback(err)}})},clearCachedId:function clearCache(){this.identityId=null;delete this.params.IdentityId;var poolId=this.params.IdentityPoolId;delete this.storage[this.localStorageKey.id+poolId];delete this.storage[this.localStorageKey.providers+poolId]},getId:function getId(callback){var self=this;if(typeof self.params.IdentityId==="string"){return callback(null,self.params.IdentityId)}self.cognito.getId(function(err,data){if(!err&&data.IdentityId){self.params.IdentityId=data.IdentityId;callback(null,data.IdentityId)}else{callback(err)}})},loadCredentials:function loadCredentials(data,credentials){if(!data||!credentials)return;credentials.expired=false;credentials.accessKeyId=data.Credentials.AccessKeyId;credentials.secretAccessKey=data.Credentials.SecretKey;credentials.sessionToken=data.Credentials.SessionToken;credentials.expireTime=data.Credentials.Expiration},getCredentialsForIdentity:function getCredentialsForIdentity(callback){var self=this;self.cognito.getCredentialsForIdentity(function(err,data){if(!err){self.cacheId(data);self.data=data;self.loadCredentials(self.data,self)}else{self.clearCachedId()}callback(err)})},getCredentialsFromSTS:function getCredentialsFromSTS(callback){var self=this;self.cognito.getOpenIdToken(function(err,data){if(!err){self.cacheId(data);self.params.WebIdentityToken=data.Token;self.webIdentityCredentials.refresh(function(webErr){if(!webErr){self.data=self.webIdentityCredentials.data;self.sts.credentialsFrom(self.data,self)}else{self.clearCachedId()}callback(webErr)})}else{self.clearCachedId();callback(err)}})},loadCachedId:function loadCachedId(){var self=this;if(AWS.util.isBrowser()&&!self.params.IdentityId){var id=self.getStorage("id");if(id&&self.params.Logins){var actualProviders=Object.keys(self.params.Logins);var cachedProviders=(self.getStorage("providers")||"").split(",");var intersect=cachedProviders.filter(function(n){return actualProviders.indexOf(n)!==-1});if(intersect.length!==0){self.params.IdentityId=id}}else if(id){self.params.IdentityId=id}}},createClients:function(){this.webIdentityCredentials=this.webIdentityCredentials||new AWS.WebIdentityCredentials(this.params);this.cognito=this.cognito||new AWS.CognitoIdentity({params:this.params});this.sts=this.sts||new AWS.STS},cacheId:function cacheId(data){this.identityId=data.IdentityId;this.params.IdentityId=this.identityId;if(AWS.util.isBrowser()){this.setStorage("id",data.IdentityId);if(this.params.Logins){this.setStorage("providers",Object.keys(this.params.Logins).join(","))}}},getStorage:function getStorage(key){return this.storage[this.localStorageKey[key]+this.params.IdentityPoolId]},setStorage:function setStorage(key,val){try{this.storage[this.localStorageKey[key]+this.params.IdentityPoolId]=val}catch(_){}},storage:function(){try{return AWS.util.isBrowser()&&window.localStorage!==null&&typeof window.localStorage==="object"?window.localStorage:{}}catch(_){return{}}}()})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials/cognito_identity_credentials.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials")},{"../core":336,_process:1069,buffer:919}],339:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.CredentialProviderChain=AWS.util.inherit(AWS.Credentials,{constructor:function CredentialProviderChain(providers){if(providers){this.providers=providers}else{this.providers=AWS.CredentialProviderChain.defaultProviders.slice(0)}},resolve:function resolve(callback){if(this.providers.length===0){callback(new Error("No providers"));return this}var index=0;var providers=this.providers.slice(0);function resolveNext(err,creds){if(!err&&creds||index===providers.length){callback(err,creds);return}var provider=providers[index++];if(typeof provider==="function"){creds=provider.call()}else{creds=provider}if(creds.get){creds.get(function(getErr){resolveNext(getErr,getErr?null:creds)})}else{resolveNext(null,creds)}}resolveNext();return this}});AWS.CredentialProviderChain.defaultProviders=[]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials/credential_provider_chain.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials")},{"../core":336,_process:1069,buffer:919}],340:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.SAMLCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function SAMLCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.assumeRoleWithSAML(function(err,data){if(!err){self.service.credentialsFrom(data,self)}callback(err)})},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials/saml_credentials.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials")},{"../core":336,_process:1069,buffer:919}],341:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.TemporaryCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function TemporaryCredentials(params){AWS.Credentials.call(this);this.loadMasterCredentials();this.expired=true;this.params=params||{};if(this.params.RoleArn){this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials"}},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.config.credentials=self.masterCredentials;var operation=self.params.RoleArn?self.service.assumeRole:self.service.getSessionToken;operation.call(self.service,function(err,data){if(!err){self.service.credentialsFrom(data,self)}callback(err)})},loadMasterCredentials:function loadMasterCredentials(){this.masterCredentials=AWS.config.credentials;while(this.masterCredentials.masterCredentials){this.masterCredentials=this.masterCredentials.masterCredentials}},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials/temporary_credentials.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials")},{"../core":336,_process:1069,buffer:919}],342:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.WebIdentityCredentials=AWS.util.inherit(AWS.Credentials,{constructor:function WebIdentityCredentials(params){AWS.Credentials.call(this);this.expired=true;this.params=params;this.params.RoleSessionName=this.params.RoleSessionName||"web-identity";this.data=null},refresh:function refresh(callback){var self=this;self.createClients();if(!callback)callback=function(err){if(err)throw err};self.service.assumeRoleWithWebIdentity(function(err,data){self.data=null;if(!err){self.data=data;self.service.credentialsFrom(data,self)}callback(err)})},createClients:function(){this.service=this.service||new AWS.STS({params:this.params})}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials/web_identity_credentials.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/credentials")},{"../core":336,_process:1069,buffer:919}],343:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var SequentialExecutor=require("./sequential_executor");AWS.EventListeners={Core:{}};AWS.EventListeners={Core:(new SequentialExecutor).addNamedListeners(function(add,addAsync){addAsync("VALIDATE_CREDENTIALS","validate",function VALIDATE_CREDENTIALS(req,done){if(!req.service.api.signatureVersion)return done();req.service.config.getCredentials(function(err){if(err){req.response.error=AWS.util.error(err,{code:"CredentialsError",message:"Missing credentials in config"})}done()})});add("VALIDATE_REGION","validate",function VALIDATE_REGION(req){if(!req.service.config.region&&!req.service.isGlobalEndpoint){req.response.error=AWS.util.error(new Error,{code:"ConfigError",message:"Missing region in config"})}});add("VALIDATE_PARAMETERS","validate",function VALIDATE_PARAMETERS(req){var rules=req.service.api.operations[req.operation].input;(new AWS.ParamValidator).validate(rules,req.params)});addAsync("COMPUTE_SHA256","afterBuild",function COMPUTE_SHA256(req,done){req.haltHandlersOnError();if(!req.service.api.signatureVersion)return done();if(req.service.getSignerClass(req)===AWS.Signers.V4){var body=req.httpRequest.body||"";AWS.util.computeSha256(body,function(err,sha){if(err){done(err)}else{req.httpRequest.headers["X-Amz-Content-Sha256"]=sha;done()}})}else{done()}});add("SET_CONTENT_LENGTH","afterBuild",function SET_CONTENT_LENGTH(req){if(req.httpRequest.headers["Content-Length"]===undefined){var length=AWS.util.string.byteLength(req.httpRequest.body);req.httpRequest.headers["Content-Length"]=length}});add("SET_HTTP_HOST","afterBuild",function SET_HTTP_HOST(req){req.httpRequest.headers["Host"]=req.httpRequest.endpoint.host});add("RESTART","restart",function RESTART(){var err=this.response.error;if(!err||!err.retryable)return;this.httpRequest=new AWS.HttpRequest(this.service.endpoint,this.service.region);if(this.response.retryCount=60*10){this.emit("sign",[this],function(err){if(err)done(err);else executeSend()})}else{executeSend()}});add("HTTP_HEADERS","httpHeaders",function HTTP_HEADERS(statusCode,headers,resp){resp.httpResponse.statusCode=statusCode;resp.httpResponse.headers=headers;resp.httpResponse.body=new AWS.util.Buffer("");resp.httpResponse.buffers=[];resp.httpResponse.numBytes=0});add("HTTP_DATA","httpData",function HTTP_DATA(chunk,resp){if(chunk){if(AWS.util.isNode()){resp.httpResponse.numBytes+=chunk.length;var total=resp.httpResponse.headers["content-length"];var progress={loaded:resp.httpResponse.numBytes,total:total};resp.request.emit("httpDownloadProgress",[progress,resp])}resp.httpResponse.buffers.push(new AWS.util.Buffer(chunk))}});add("HTTP_DONE","httpDone",function HTTP_DONE(resp){if(resp.httpResponse.buffers&&resp.httpResponse.buffers.length>0){var body=AWS.util.buffer.concat(resp.httpResponse.buffers);resp.httpResponse.body=body}delete resp.httpResponse.numBytes;delete resp.httpResponse.buffers});add("FINALIZE_ERROR","retry",function FINALIZE_ERROR(resp){if(resp.httpResponse.statusCode){resp.error.statusCode=resp.httpResponse.statusCode;if(resp.error.retryable===undefined){resp.error.retryable=this.service.retryableError(resp.error,this)}}});add("INVALIDATE_CREDENTIALS","retry",function INVALIDATE_CREDENTIALS(resp){if(!resp.error)return;switch(resp.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":resp.error.retryable=true;resp.request.service.config.credentials.expired=true}});add("EXPIRED_SIGNATURE","retry",function EXPIRED_SIGNATURE(resp){var err=resp.error;if(!err)return;if(typeof err.code==="string"&&typeof err.message==="string"){if(err.code.match(/Signature/)&&err.message.match(/expired/)){resp.error.retryable=true}}});add("REDIRECT","retry",function REDIRECT(resp){if(resp.error&&resp.error.statusCode>=300&&resp.error.statusCode<400&&resp.httpResponse.headers["location"]){this.httpRequest.endpoint=new AWS.Endpoint(resp.httpResponse.headers["location"]);this.httpRequest.headers["Host"]=this.httpRequest.endpoint.host;resp.error.redirect=true;resp.error.retryable=true}});add("RETRY_CHECK","retry",function RETRY_CHECK(resp){if(resp.error){if(resp.error.redirect&&resp.redirectCount=this.HEADERS_RECEIVED&&!headersEmitted){try{xhr.responseType="arraybuffer"}catch(e){}emitter.statusCode=xhr.status;emitter.headers=self.parseHeaders(xhr.getAllResponseHeaders());emitter.emit("headers",emitter.statusCode,emitter.headers);headersEmitted=true}if(this.readyState===this.DONE){self.finishRequest(xhr,emitter)}},false);xhr.upload.addEventListener("progress",function(evt){emitter.emit("sendProgress",evt)});xhr.addEventListener("progress",function(evt){emitter.emit("receiveProgress",evt)},false);xhr.addEventListener("timeout",function(){errCallback(AWS.util.error(new Error("Timeout"),{code:"TimeoutError"}))},false);xhr.addEventListener("error",function(){errCallback(AWS.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},false);callback(emitter);xhr.open(httpRequest.method,href,httpOptions.xhrAsync!==false);AWS.util.each(httpRequest.headers,function(key,value){if(key!=="Content-Length"&&key!=="User-Agent"&&key!=="Host"){xhr.setRequestHeader(key,value)}});if(httpOptions.timeout&&httpOptions.xhrAsync!==false){xhr.timeout=httpOptions.timeout}if(httpOptions.xhrWithCredentials){xhr.withCredentials=true}try{xhr.send(httpRequest.body)}catch(err){if(httpRequest.body&&typeof httpRequest.body.buffer==="object"){xhr.send(httpRequest.body.buffer)}else{throw err}}return emitter},parseHeaders:function parseHeaders(rawHeaders){var headers={};AWS.util.arrayEach(rawHeaders.split(/\r?\n/),function(line){var key=line.split(":",1)[0];var value=line.substring(key.length+2);if(key.length>0)headers[key.toLowerCase()]=value});return headers},finishRequest:function finishRequest(xhr,emitter){var buffer;if(xhr.responseType==="arraybuffer"&&xhr.response){var ab=xhr.response;buffer=new AWS.util.Buffer(ab.byteLength);var view=new Uint8Array(ab);for(var i=0;i1){var msg=this.errors.join("\n* ");if(this.errors.length>1){msg="There were "+this.errors.length+" validation errors:\n* "+msg;throw AWS.util.error(new Error(msg),{code:"MultipleValidationErrors",errors:this.errors})}}else if(this.errors.length===1){throw this.errors[0]}else{return true}},validateStructure:function validateStructure(shape,params,context){this.validateType(context,params,["object"],"structure");var paramName;for(var i=0;shape.required&&i0){var e=JSON.parse(httpResponse.body.toString());if(e.__type||e.code){error.code=(e.__type||e.code).split("#").pop()}if(error.code==="RequestEntityTooLarge"){error.message="Request body must be less than 1 MB"}else{error.message=e.message||e.Message||null}}else{error.statusCode=httpResponse.statusCode;error.message=httpResponse.statusCode.toString()}resp.error=util.error(new Error,error)}function extractData(resp){var body=resp.httpResponse.body.toString()||"{}";if(resp.request.service.config.convertResponseTypes===false){resp.data=JSON.parse(body)}else{var operation=resp.request.service.api.operations[resp.request.operation];var shape=operation.output||{};var parser=new JsonParser;resp.data=parser.parse(body,shape)}}module.exports={buildRequest:buildRequest,extractError:extractError,extractData:extractData}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/protocol/json.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/protocol")},{"../json/builder":346,"../json/parser":347,"../util":384,_process:1069,buffer:919}],356:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var util=require("../util");var QueryParamSerializer=require("../query/query_param_serializer");var Shape=require("../model/shape");function buildRequest(req){var operation=req.service.api.operations[req.operation];var httpRequest=req.httpRequest;httpRequest.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8";httpRequest.params={Version:req.service.api.apiVersion,Action:operation.name};var builder=new QueryParamSerializer;builder.serialize(req.params,operation.input,function(name,value){httpRequest.params[name]=value});httpRequest.body=util.queryParamsToString(httpRequest.params)}function extractError(resp){var data,body=resp.httpResponse.body.toString();if(body.match("=0?"&":"?";var parts=[];util.arrayEach(Object.keys(queryString).sort(),function(key){if(!Array.isArray(queryString[key])){queryString[key]=[queryString[key]]}for(var i=0;i0){parser=new AWS.XML.Parser;var data=parser.parse(body.toString(),output);util.update(resp.data,data)}}module.exports={buildRequest:buildRequest,extractError:extractError,extractData:extractData}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/protocol/rest_xml.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/protocol")},{"../core":336,"../util":384,"./rest":357,_process:1069,buffer:919}],360:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var util=require("../util");function QueryParamSerializer(){}QueryParamSerializer.prototype.serialize=function(params,shape,fn){serializeStructure("",params,shape,fn)};function ucfirst(shape){if(shape.isQueryName||shape.api.protocol!=="ec2"){return shape.name}else{return shape.name[0].toUpperCase()+shape.name.substr(1)}}function serializeStructure(prefix,struct,rules,fn){util.each(rules.members,function(name,member){var value=struct[name];if(value===null||value===undefined)return;var memberName=ucfirst(member);memberName=prefix?prefix+"."+memberName:memberName;serializeMember(memberName,value,member,fn)})}function serializeMap(name,map,rules,fn){var i=1;util.each(map,function(key,value){var prefix=rules.flattened?".":".entry.";var position=prefix+i++ +".";var keyName=position+(rules.key.name||"key");var valueName=position+(rules.value.name||"value");serializeMember(name+keyName,key,rules.key,fn);serializeMember(name+valueName,value,rules.value,fn)})}function serializeList(name,list,rules,fn){var memberRules=rules.member||{};if(list.length===0){fn.call(this,name,null);return}util.arrayEach(list,function(v,n){var suffix="."+(n+1);if(rules.api.protocol==="ec2"){suffix=suffix+""}else if(rules.flattened){if(memberRules.name){var parts=name.split(".");parts.pop();parts.push(ucfirst(memberRules));name=parts.join(".")}}else{suffix=".member"+suffix}serializeMember(name+suffix,v,memberRules,fn)})}function serializeMember(name,value,rules,fn){if(value===null||value===undefined)return;if(rules.type==="structure"){serializeStructure(name,value,rules,fn)}else if(rules.type==="list"){serializeList(name,value,rules,fn)}else if(rules.type==="map"){serializeMap(name,value,rules,fn)}else{fn(name,rules.toWireFormat(value).toString())}}module.exports=QueryParamSerializer}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/query/query_param_serializer.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/query")},{"../util":384,_process:1069,buffer:919}],361:[function(require,module,exports){arguments[4][192][0].apply(exports,arguments)},{dup:192}],362:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var util=require("./util");var regionConfig=require("./region_config.json");function generateRegionPrefix(region){if(!region)return null;var parts=region.split("-");if(parts.length<3)return null;return parts.slice(0,parts.length-2).join("-")+"-*"}function derivedKeys(service){var region=service.config.region;var regionPrefix=generateRegionPrefix(region);var endpointPrefix=service.api.endpointPrefix;return[[region,endpointPrefix],[regionPrefix,endpointPrefix],[region,"*"],[regionPrefix,"*"],["*",endpointPrefix],["*","*"]].map(function(item){return item[0]&&item[1]?item.join("/"):null})}function applyConfig(service,config){util.each(config,function(key,value){if(key==="globalEndpoint")return;if(service.config[key]===undefined||service.config[key]===null){service.config[key]=value}})}function configureEndpoint(service){var keys=derivedKeys(service);for(var i=0;i=0){return null}if(this.expectedValue){return r===this.expectedValue}else{return r?true:false}},checkError:function checkError(resp){var value=this.config.successValue;if(typeof value==="number"){return resp.httpResponse.statusCode===value}else{return resp.error&&resp.error.code===value}},loadWaiterConfig:function loadWaiterConfig(state,noException){if(!this.service.api.waiters[state]){if(noException)return;throw new AWS.util.error(new Error,{code:"StateNotFoundError",message:"State "+state+" not found."})}this.config=this.service.api.waiters[state];var config=this.config;(function(){config.successType=config.successType||config.acceptorType;config.successPath=config.successPath||config.acceptorPath;config.successValue=config.successValue||config.acceptorValue;config.failureType=config.failureType||config.acceptorType;config.failurePath=config.failurePath||config.acceptorPath;config.failureValue=config.failureValue||config.acceptorValue})()}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/resource_waiter.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib")},{"./core":336,_process:1069,buffer:919}],365:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var inherit=AWS.util.inherit;AWS.Response=inherit({constructor:function Response(request){this.request=request;this.data=null;this.error=null;this.retryCount=0;this.redirectCount=0;this.httpResponse=new AWS.HttpResponse;if(request){this.maxRetries=request.service.numRetries();this.maxRedirects=request.service.config.maxRedirects}},nextPage:function nextPage(callback){var config;var service=this.request.service;var operation=this.request.operation;try{config=service.paginationConfig(operation,true)}catch(e){this.error=e}if(!this.hasNextPage()){if(callback)callback(this.error,null);else if(this.error)throw this.error;return null}var params=AWS.util.copy(this.request.params);if(!this.nextPageTokens){return callback?callback(null,null):null}else{var inputTokens=config.inputToken;if(typeof inputTokens==="string")inputTokens=[inputTokens];for(var i=0;iself.partSize)self.partSize=newPartSize}else{self.totalBytes=undefined}},isDoneChunking:false,partPos:0,totalChunkedBytes:0,totalUploadedBytes:0,totalBytes:undefined,numParts:0,totalPartNumbers:0,activeParts:0,doneParts:0,parts:null,completeInfo:null,failed:false,multipartReq:null,partBuffers:null,partBufferLength:0,fillBuffer:function fillBuffer(){var self=this;var bodyLen=byteLength(self.body);if(bodyLen===0){self.isDoneChunking=true;self.numParts=1;self.nextChunk(self.body);return}while(self.activeParts=self.queueSize)return;var buf=self.body.read(self.partSize-self.partBufferLength)||self.body.read();if(buf){self.partBuffers.push(buf);self.partBufferLength+=buf.length;self.totalChunkedBytes+=buf.length}if(self.partBufferLength>=self.partSize){var pbuf=Buffer.concat(self.partBuffers);self.partBuffers=[];self.partBufferLength=0;if(pbuf.length>self.partSize){var rest=pbuf.slice(self.partSize);self.partBuffers.push(rest);self.partBufferLength+=rest.length;pbuf=pbuf.slice(0,self.partSize)}self.nextChunk(pbuf)}if(self.isDoneChunking&&!self.isDoneSending){pbuf=Buffer.concat(self.partBuffers);self.partBuffers=[];self.partBufferLength=0;self.totalBytes=self.totalChunkedBytes;self.isDoneSending=true;if(self.numParts===0||pbuf.length>0){self.numParts++;self.nextChunk(pbuf)}}self.body.read(0)},nextChunk:function nextChunk(chunk){var self=this;if(self.failed)return null;var partNumber=++self.totalPartNumbers;if(self.isDoneChunking&&partNumber===1){var req=self.service.putObject({Body:chunk});req._managedUpload=self;req.on("httpUploadProgress",self.progress).send(self.finishSinglePart);return null}self.activeParts++;if(!self.service.config.params.UploadId){if(!self.multipartReq){self.multipartReq=self.service.createMultipartUpload();self.multipartReq.on("success",function(resp){self.service.config.params.UploadId=resp.data.UploadId;self.multipartReq=null});self.queueChunks(chunk,partNumber);self.multipartReq.on("error",function(err){self.cleanup(err)});self.multipartReq.send()}else{self.queueChunks(chunk,partNumber)}}else{self.uploadPart(chunk,partNumber)}},uploadPart:function uploadPart(chunk,partNumber){var self=this;var partParams={Body:chunk,ContentLength:AWS.util.string.byteLength(chunk),PartNumber:partNumber};var partInfo={ETag:null,PartNumber:partNumber};self.completeInfo.push(partInfo);var req=self.service.uploadPart(partParams);self.parts[partNumber]=req;req._lastUploadedBytes=0;req._managedUpload=self;req.on("httpUploadProgress",self.progress);req.send(function(err,data){delete self.parts[partParams.PartNumber];self.activeParts--;if(!err&&(!data||!data.ETag)){var message="No access to ETag property on response.";if(AWS.util.isBrowser()){message+=" Check CORS configuration to expose ETag header."}err=AWS.util.error(new Error(message),{code:"ETagMissing",retryable:false})}if(err)return self.cleanup(err);partInfo.ETag=data.ETag;self.doneParts++;if(self.isDoneChunking&&self.doneParts===self.numParts){self.finishMultiPart()}else{self.fillQueue.call(self)}})},queueChunks:function queueChunks(chunk,partNumber){var self=this;self.multipartReq.on("success",function(){self.uploadPart(chunk,partNumber)})},cleanup:function cleanup(err){var self=this;if(self.failed)return;if(typeof self.body.removeAllListeners==="function"&&typeof self.body.resume==="function"){self.body.removeAllListeners("readable");self.body.removeAllListeners("end");self.body.resume()}if(self.service.config.params.UploadId&&!self.leavePartsOnError){self.service.abortMultipartUpload().send()}AWS.util.each(self.parts,function(partNumber,part){part.removeAllListeners("complete");part.abort()});self.parts={};self.callback(err);self.failed=true},finishMultiPart:function finishMultiPart(){var self=this;var completeParams={MultipartUpload:{Parts:self.completeInfo}};self.service.completeMultipartUpload(completeParams,function(err,data){if(err)return self.cleanup(err);else self.callback(err,data)})},finishSinglePart:function finishSinglePart(err,data){var upload=this.request._managedUpload;var httpReq=this.request.httpRequest;var url=AWS.util.urlFormat(httpReq.endpoint);if(err)return upload.callback(err);data.Location=url.substr(0,url.length-1)+httpReq.path;upload.callback(err,data)},progress:function progress(info){var upload=this._managedUpload;if(this.operation==="putObject"){info.part=1}else{upload.totalUploadedBytes+=info.loaded-this._lastUploadedBytes;this._lastUploadedBytes=info.loaded;info={loaded:upload.totalUploadedBytes,total:upload.totalBytes,part:this.params.PartNumber}}upload.emit("httpUploadProgress",[info])}});AWS.util.mixin(AWS.S3.ManagedUpload,AWS.SequentialExecutor);module.exports=AWS.S3.ManagedUpload}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/s3/managed_upload.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/s3")},{"../core":336,_process:1069,buffer:919}],367:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");AWS.SequentialExecutor=AWS.util.inherit({constructor:function SequentialExecutor(){this._events={}},listeners:function listeners(eventName){return this._events[eventName]?this._events[eventName].slice(0):[]},on:function on(eventName,listener){if(this._events[eventName]){this._events[eventName].push(listener)}else{this._events[eventName]=[listener]}return this},onAsync:function onAsync(eventName,listener){listener._isAsync=true;return this.on(eventName,listener)},removeListener:function removeListener(eventName,listener){var listeners=this._events[eventName];if(listeners){var length=listeners.length;var position=-1;for(var i=0;i-1){listeners.splice(position,1)}}return this},removeAllListeners:function removeAllListeners(eventName){if(eventName){delete this._events[eventName]}else{this._events={}}return this},emit:function emit(eventName,eventArgs,doneCallback){if(!doneCallback)doneCallback=function(){};var listeners=this.listeners(eventName);var count=listeners.length;this.callListeners(listeners,eventArgs,doneCallback);return count>0},callListeners:function callListeners(listeners,args,doneCallback,prevError){var self=this;var error=prevError||null;function callNextListener(err){if(err){error=AWS.util.error(error||new Error,err);if(self._haltHandlersOnError){return doneCallback.call(self,error)}}self.callListeners(listeners,args,doneCallback,error)}while(listeners.length>0){var listener=listeners.shift();if(listener._isAsync){listener.apply(self,args.concat([callNextListener]));return}else{try{listener.apply(self,args)}catch(err){error=AWS.util.error(error||new Error,err)}if(error&&self._haltHandlersOnError){doneCallback.call(self,error);return}}}doneCallback.call(self,error)},addListeners:function addListeners(listeners){var self=this;if(listeners._events)listeners=listeners._events;AWS.util.each(listeners,function(event,callbacks){if(typeof callbacks==="function")callbacks=[callbacks];AWS.util.arrayEach(callbacks,function(callback){self.on(event,callback)})});return self},addNamedListener:function addNamedListener(name,eventName,callback){this[name]=callback;this.addListener(eventName,callback);return this},addNamedAsyncListener:function addNamedAsyncListener(name,eventName,callback){callback._isAsync=true;return this.addNamedListener(name,eventName,callback)},addNamedListeners:function addNamedListeners(callback){var self=this;callback(function(){self.addNamedListener.apply(self,arguments)},function(){self.addNamedAsyncListener.apply(self,arguments)});return this}});AWS.SequentialExecutor.prototype.addListener=AWS.SequentialExecutor.prototype.on;module.exports=AWS.SequentialExecutor}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/sequential_executor.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib")},{"./core":336,_process:1069,buffer:919}],368:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("./core");var Api=require("./model/api");var regionConfig=require("./region_config");var inherit=AWS.util.inherit;AWS.Service=inherit({constructor:function Service(config){if(!this.loadServiceClass){throw AWS.util.error(new Error,"Service must be constructed with `new' operator")}var ServiceClass=this.loadServiceClass(config||{});if(ServiceClass)return new ServiceClass(config);this.initialize(config)},initialize:function initialize(config){var svcConfig=AWS.config[this.serviceIdentifier];this.config=new AWS.Config(AWS.config);if(svcConfig)this.config.update(svcConfig,true);if(config)this.config.update(config,true);this.validateService();if(!this.config.endpoint)regionConfig(this);this.config.endpoint=this.endpointFromTemplate(this.config.endpoint);this.setEndpoint(this.config.endpoint)},validateService:function validateService(){},loadServiceClass:function loadServiceClass(serviceConfig){var config=serviceConfig;if(!AWS.util.isEmpty(this.api)){return null}else if(config.apiConfig){return AWS.Service.defineServiceApi(this.constructor,config.apiConfig)}else if(!this.constructor.services){return null}else{config=new AWS.Config(AWS.config);config.update(serviceConfig,true);var version=config.apiVersions[this.constructor.serviceIdentifier];version=version||config.apiVersion;return this.getLatestServiceClass(version)}},getLatestServiceClass:function getLatestServiceClass(version){version=this.getLatestServiceVersion(version);if(this.constructor.services[version]===null){AWS.Service.defineServiceApi(this.constructor,version)}return this.constructor.services[version]},getLatestServiceVersion:function getLatestServiceVersion(version){if(!this.constructor.services||this.constructor.services.length===0){throw new Error("No services defined on "+this.constructor.serviceIdentifier)}if(!version){version="latest"}else if(AWS.util.isType(version,Date)){version=AWS.util.date.iso8601(version).split("T")[0]}if(Object.hasOwnProperty(this.constructor.services,version)){return version}var keys=Object.keys(this.constructor.services).sort();var selectedVersion=null;for(var i=keys.length-1;i>=0;i--){if(keys[i][keys[i].length-1]!=="*"){selectedVersion=keys[i]}if(keys[i].substr(0,10)<=version){return selectedVersion}}throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+version+"'")},api:{},defaultRetryCount:3,makeRequest:function makeRequest(operation,params,callback){if(typeof params==="function"){callback=params;params=null}params=params||{};if(this.config.params){var rules=this.api.operations[operation];if(rules){params=AWS.util.copy(params);AWS.util.each(this.config.params,function(key,value){if(rules.input.members[key]){if(params[key]===undefined||params[key]===null){params[key]=value}}})}}var request=new AWS.Request(this,operation,params);this.addAllRequestListeners(request);if(callback)request.send(callback);return request},makeUnauthenticatedRequest:function makeUnauthenticatedRequest(operation,params,callback){if(typeof params==="function"){callback=params;params={}}var request=this.makeRequest(operation,params).toUnauthenticated();return callback?request.send(callback):request},waitFor:function waitFor(state,params,callback){var waiter=new AWS.ResourceWaiter(this,state);return waiter.wait(params,callback)},addAllRequestListeners:function addAllRequestListeners(request){var list=[AWS.events,AWS.EventListeners.Core,this.serviceInterface(),AWS.EventListeners.CorePost];for(var i=0;i=500)return true;return false},networkingError:function networkingError(error){return error.code==="NetworkingError"},expiredCredentialsError:function expiredCredentialsError(error){return error.code==="ExpiredTokenException"},throttledError:function throttledError(error){switch(error.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":return true;default:return false}},endpointFromTemplate:function endpointFromTemplate(endpoint){if(typeof endpoint!=="string")return endpoint;var e=endpoint;e=e.replace(/\{service\}/g,this.api.endpointPrefix);e=e.replace(/\{region\}/g,this.config.region);e=e.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http");return e},setEndpoint:function setEndpoint(endpoint){this.endpoint=new AWS.Endpoint(endpoint,this.config)},paginationConfig:function paginationConfig(operation,throwException){var paginator=this.api.operations[operation].paginator;if(!paginator){if(throwException){var e=new Error;throw AWS.util.error(e,"No pagination configuration for "+operation)}return null}return paginator}});AWS.util.update(AWS.Service,{defineMethods:function defineMethods(svc){AWS.util.each(svc.prototype.api.operations,function iterator(method){if(svc.prototype[method])return;svc.prototype[method]=function(params,callback){return this.makeRequest(method,params,callback)}})},defineService:function defineService(serviceIdentifier,versions,features){AWS.Service._serviceMap[serviceIdentifier]=true;if(!Array.isArray(versions)){features=versions;versions=[]}var svc=inherit(AWS.Service,features||{});if(typeof serviceIdentifier==="string"){AWS.Service.addVersions(svc,versions);var identifier=svc.serviceIdentifier||serviceIdentifier;svc.serviceIdentifier=identifier}else{svc.prototype.api=serviceIdentifier;AWS.Service.defineMethods(svc)}return svc},addVersions:function addVersions(svc,versions){if(!Array.isArray(versions))versions=[versions];svc.services=svc.services||{};for(var i=0;i=1024*1024){req.httpRequest.headers["Expect"]="100-continue"}},addContentType:function addContentType(req){var httpRequest=req.httpRequest;if(httpRequest.method==="GET"||httpRequest.method==="HEAD"){delete httpRequest.headers["Content-Type"];return}if(!httpRequest.headers["Content-Type"]){httpRequest.headers["Content-Type"]="application/octet-stream"}var contentType=httpRequest.headers["Content-Type"];if(AWS.util.isBrowser()){if(typeof httpRequest.body==="string"&&!contentType.match(/;\s*charset=/)){var charset="; charset=UTF-8";httpRequest.headers["Content-Type"]+=charset}else{var replaceFn=function(_,prefix,charsetName){return prefix+charsetName.toUpperCase()};httpRequest.headers["Content-Type"]=contentType.replace(/(;\s*charset=)(.+)$/,replaceFn)}}},computableChecksumOperations:{putBucketCors:true,putBucketLifecycle:true,putBucketTagging:true,deleteObjects:true},willComputeChecksums:function willComputeChecksums(req){if(this.computableChecksumOperations[req.operation])return true;if(!this.config.computeChecksums)return false;if(!AWS.util.Buffer.isBuffer(req.httpRequest.body)&&typeof req.httpRequest.body!=="string"){return false}var rules=req.service.api.operations[req.operation].input.members;if(req.service.getSignerClass(req)===AWS.Signers.V4){if(rules.ContentMD5&&!rules.ContentMD5.required)return false}if(rules.ContentMD5&&!req.params.ContentMD5)return true},computeContentMd5:function computeContentMd5(req){if(req.service.willComputeChecksums(req)){var md5=AWS.util.crypto.md5(req.httpRequest.body,"base64");req.httpRequest.headers["Content-MD5"]=md5}},computeSseCustomerKeyMd5:function computeSseCustomerKeyMd5(req){var keys={SSECustomerKey:"x-amz-server-side-encryption-customer-key-MD5",CopySourceSSECustomerKey:"x-amz-copy-source-server-side-encryption-customer-key-MD5"};AWS.util.each(keys,function(key,header){if(req.params[key]){var value=AWS.util.crypto.md5(req.params[key],"base64");req.httpRequest.headers[header]=value}})},pathStyleBucketName:function pathStyleBucketName(bucketName){if(this.config.s3ForcePathStyle)return true;if(this.config.s3BucketEndpoint)return false;if(this.dnsCompatibleBucketName(bucketName)){return this.config.sslEnabled&&bucketName.match(/\./)?true:false}else{return true}},dnsCompatibleBucketName:function dnsCompatibleBucketName(bucketName){var b=bucketName;var domain=new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/);var ipAddress=new RegExp(/(\d+\.){3}\d+/);var dots=new RegExp(/\.\./);return b.match(domain)&&!b.match(ipAddress)&&!b.match(dots)?true:false},successfulResponse:function successfulResponse(resp){var req=resp.request;var httpResponse=resp.httpResponse;if(req.operation==="completeMultipartUpload"&&httpResponse.body.toString().match("")){return false}else{return httpResponse.statusCode<300}},retryableError:function retryableError(error,request){if(request.operation==="completeMultipartUpload"&&error.statusCode===200){return true}else if(error&&error.code==="RequestTimeout"){return true}else{var _super=AWS.Service.prototype.retryableError;return _super.call(this,error,request)}},extractData:function extractData(resp){var req=resp.request;if(req.operation==="getBucketLocation"){var match=resp.httpResponse.body.toString().match(/>(.+)<\/Location/);delete resp.data["_"];if(match){resp.data.LocationConstraint=match[1]}else{resp.data.LocationConstraint=""}}},extractError:function extractError(resp){var codes={304:"NotModified",403:"Forbidden",400:"BadRequest",404:"NotFound"};var code=resp.httpResponse.statusCode;var body=resp.httpResponse.body||"";if(codes[code]&&body.length===0){resp.error=AWS.util.error(new Error,{code:codes[resp.httpResponse.statusCode],message:null})}else{var data=(new AWS.XML.Parser).parse(body.toString());resp.error=AWS.util.error(new Error,{code:data.Code||code,message:data.Message||null})}},getSignedUrl:function getSignedUrl(operation,params,callback){params=AWS.util.copy(params||{});var expires=params.Expires||900;delete params.Expires;var request=this.makeRequest(operation,params);return request.presign(expires,callback)},prepareSignedUrl:function prepareSignedUrl(request){ -request.addListener("validate",request.service.noPresignedContentLength);request.removeListener("build",request.service.addContentType);if(!request.params.Body){request.removeListener("build",request.service.computeContentMd5)}else{request.addListener("afterBuild",AWS.EventListeners.Core.COMPUTE_SHA256)}},noPresignedContentLength:function noPresignedContentLength(request){if(request.params.ContentLength!==undefined){throw AWS.util.error(new Error,{code:"UnexpectedParameter",message:"ContentLength is not supported in pre-signed URLs."})}},createBucket:function createBucket(params,callback){if(!params)params={};var hostname=this.endpoint.hostname;if(hostname!==this.api.globalEndpoint&&!params.CreateBucketConfiguration){params.CreateBucketConfiguration={LocationConstraint:this.config.region}}return this.makeRequest("createBucket",params,callback)},upload:function upload(params,options,callback){if(typeof options==="function"&&callback===undefined){callback=options;options=null}options=options||{};options=AWS.util.merge(options||{},{service:this,params:params});var uploader=new AWS.S3.ManagedUpload(options);if(typeof callback==="function")uploader.send(callback);return uploader}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/services/s3.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/services")},{"../core":336,"../s3/managed_upload":366,_process:1069,buffer:919}],374:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.util.update(AWS.SQS.prototype,{setupRequestListeners:function setupRequestListeners(request){request.addListener("build",this.buildEndpoint);if(request.service.config.computeChecksums){if(request.operation==="sendMessage"){request.addListener("extractData",this.verifySendMessageChecksum)}else if(request.operation==="sendMessageBatch"){request.addListener("extractData",this.verifySendMessageBatchChecksum)}else if(request.operation==="receiveMessage"){request.addListener("extractData",this.verifyReceiveMessageChecksum)}}},verifySendMessageChecksum:function verifySendMessageChecksum(response){if(!response.data)return;var md5=response.data.MD5OfMessageBody;var body=this.params.MessageBody;var calculatedMd5=this.service.calculateChecksum(body);if(calculatedMd5!==md5){var msg='Got "'+response.data.MD5OfMessageBody+'", expecting "'+calculatedMd5+'".';this.service.throwInvalidChecksumError(response,[response.data.MessageId],msg)}},verifySendMessageBatchChecksum:function verifySendMessageBatchChecksum(response){if(!response.data)return;var service=this.service;var entries={};var errors=[];var messageIds=[];AWS.util.arrayEach(response.data.Successful,function(entry){entries[entry.Id]=entry});AWS.util.arrayEach(this.params.Entries,function(entry){if(entries[entry.Id]){var md5=entries[entry.Id].MD5OfMessageBody;var body=entry.MessageBody;if(!service.isChecksumValid(md5,body)){errors.push(entry.Id);messageIds.push(entries[entry.Id].MessageId)}}});if(errors.length>0){service.throwInvalidChecksumError(response,messageIds,"Invalid messages: "+errors.join(", "))}},verifyReceiveMessageChecksum:function verifyReceiveMessageChecksum(response){if(!response.data)return;var service=this.service;var messageIds=[];AWS.util.arrayEach(response.data.Messages,function(message){var md5=message.MD5OfBody;var body=message.Body;if(!service.isChecksumValid(md5,body)){messageIds.push(message.MessageId)}});if(messageIds.length>0){service.throwInvalidChecksumError(response,messageIds,"Invalid messages: "+messageIds.join(", "))}},throwInvalidChecksumError:function throwInvalidChecksumError(response,ids,message){response.error=AWS.util.error(new Error,{retryable:true,code:"InvalidChecksum",messageIds:ids,message:response.request.operation+" returned an invalid MD5 response. "+message})},isChecksumValid:function isChecksumValid(checksum,data){return this.calculateChecksum(data)===checksum},calculateChecksum:function calculateChecksum(data){return AWS.util.crypto.md5(data,"hex")},buildEndpoint:function buildEndpoint(request){var url=request.httpRequest.params.QueueUrl;if(url){request.httpRequest.endpoint=new AWS.Endpoint(url);var matches=request.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./);if(matches)request.httpRequest.region=matches[1]}}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/services/sqs.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/services")},{"../core":336,_process:1069,buffer:919}],375:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");AWS.util.update(AWS.STS.prototype,{credentialsFrom:function credentialsFrom(data,credentials){if(!data)return null;if(!credentials)credentials=new AWS.TemporaryCredentials;credentials.expired=false;credentials.accessKeyId=data.Credentials.AccessKeyId;credentials.secretAccessKey=data.Credentials.SecretAccessKey;credentials.sessionToken=data.Credentials.SessionToken;credentials.expireTime=data.Credentials.Expiration;return credentials},assumeRoleWithWebIdentity:function assumeRoleWithWebIdentity(params,callback){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",params,callback)},assumeRoleWithSAML:function assumeRoleWithSAML(params,callback){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",params,callback)}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/services/sts.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/services")},{"../core":336,_process:1069,buffer:919}],376:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;var expiresHeader="presigned-expires";function signedUrlBuilder(request){var expires=request.httpRequest.headers[expiresHeader];delete request.httpRequest.headers["User-Agent"];delete request.httpRequest.headers["X-Amz-User-Agent"];if(request.service.getSignerClass()===AWS.Signers.V4){if(expires>604800){var message="Presigning does not support expiry time greater "+"than a week with SigV4 signing.";throw AWS.util.error(new Error,{code:"InvalidExpiryTime",message:message,retryable:false})}request.httpRequest.headers[expiresHeader]=expires}else if(request.service.getSignerClass()===AWS.Signers.S3){request.httpRequest.headers[expiresHeader]=parseInt(AWS.util.date.unixTimestamp()+expires,10).toString()}else{throw AWS.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:false})}}function signedUrlSigner(request){var endpoint=request.httpRequest.endpoint;var parsedUrl=AWS.util.urlParse(request.httpRequest.path);var queryParams={};if(parsedUrl.search){queryParams=AWS.util.queryStringParse(parsedUrl.search.substr(1))}AWS.util.each(request.httpRequest.headers,function(key,value){if(key===expiresHeader)key="Expires";queryParams[key]=value});delete request.httpRequest.headers[expiresHeader];var auth=queryParams["Authorization"].split(" ");if(auth[0]==="AWS"){auth=auth[1].split(":");queryParams["AWSAccessKeyId"]=auth[0];queryParams["Signature"]=auth[1]}else if(auth[0]==="AWS4-HMAC-SHA256"){auth.shift();var rest=auth.join(" ");var signature=rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];queryParams["X-Amz-Signature"]=signature;delete queryParams["Expires"]}delete queryParams["Authorization"];delete queryParams["Host"];endpoint.pathname=parsedUrl.pathname;endpoint.search=AWS.util.queryParamsToString(queryParams)}AWS.Signers.Presign=inherit({sign:function sign(request,expireTime,callback){request.httpRequest.headers[expiresHeader]=expireTime||3600;request.on("build",signedUrlBuilder);request.on("sign",signedUrlSigner);request.removeListener("afterBuild",AWS.EventListeners.Core.SET_CONTENT_LENGTH);request.removeListener("afterBuild",AWS.EventListeners.Core.COMPUTE_SHA256);request.emit("beforePresign",[request]);if(callback){request.build(function(){if(this.response.error)callback(this.response.error);else{callback(null,AWS.util.urlFormat(request.httpRequest.endpoint))}})}else{request.build();if(request.response.error)throw request.response.error;return AWS.util.urlFormat(request.httpRequest.endpoint)}}});module.exports=AWS.Signers.Presign}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/signers/presign.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/signers")},{"../core":336,_process:1069,buffer:919}],377:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;AWS.Signers.RequestSigner=inherit({constructor:function RequestSigner(request){this.request=request}});AWS.Signers.RequestSigner.getVersion=function getVersion(version){switch(version){case"v2":return AWS.Signers.V2;case"v3":return AWS.Signers.V3;case"v4":return AWS.Signers.V4;case"s3":return AWS.Signers.S3;case"v3https":return AWS.Signers.V3Https}throw new Error("Unknown signing version "+version)};require("./v2");require("./v3");require("./v3https");require("./v4");require("./s3");require("./presign")}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/signers/request_signer.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/signers")},{"../core":336,"./presign":376,"./s3":378,"./v2":379,"./v3":380,"./v3https":381,"./v4":382,_process:1069,buffer:919}],378:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var AWS=require("../core");var inherit=AWS.util.inherit;AWS.Signers.S3=inherit(AWS.Signers.RequestSigner,{subResources:{acl:1,cors:1,lifecycle:1,"delete":1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:function addAuthorization(credentials,date){if(!this.request.headers["presigned-expires"]){this.request.headers["X-Amz-Date"]=AWS.util.date.rfc822(date)}if(credentials.sessionToken){this.request.headers["x-amz-security-token"]=credentials.sessionToken}var signature=this.sign(credentials.secretAccessKey,this.stringToSign());var auth="AWS "+credentials.accessKeyId+":"+signature;this.request.headers["Authorization"]=auth},stringToSign:function stringToSign(){var r=this.request;var parts=[];parts.push(r.method);parts.push(r.headers["Content-MD5"]||"");parts.push(r.headers["Content-Type"]||"");parts.push(r.headers["presigned-expires"]||"");var headers=this.canonicalizedAmzHeaders();if(headers)parts.push(headers);parts.push(this.canonicalizedResource());return parts.join("\n")},canonicalizedAmzHeaders:function canonicalizedAmzHeaders(){var amzHeaders=[];AWS.util.each(this.request.headers,function(name){if(name.match(/^x-amz-/i))amzHeaders.push(name)});amzHeaders.sort(function(a,b){return a.toLowerCase()=0?"&":"?";this.request.path+=sep+AWS.util.queryParamsToString(qs)},authorization:function authorization(credentials,datetime){var parts=[];var credString=this.credentialString(datetime);parts.push(this.algorithm+" Credential="+credentials.accessKeyId+"/"+credString);parts.push("SignedHeaders="+this.signedHeaders());parts.push("Signature="+this.signature(credentials,datetime));return parts.join(", ")},signature:function signature(credentials,datetime){var cache=cachedSecret[this.serviceName];var date=datetime.substr(0,8);if(!cache||cache.akid!==credentials.accessKeyId||cache.region!==this.request.region||cache.date!==date){var kSecret=credentials.secretAccessKey;var kDate=AWS.util.crypto.hmac("AWS4"+kSecret,date,"buffer");var kRegion=AWS.util.crypto.hmac(kDate,this.request.region,"buffer");var kService=AWS.util.crypto.hmac(kRegion,this.serviceName,"buffer");var kCredentials=AWS.util.crypto.hmac(kService,"aws4_request","buffer");cachedSecret[this.serviceName]={region:this.request.region,date:date,key:kCredentials,akid:credentials.accessKeyId}}var key=cachedSecret[this.serviceName].key;return AWS.util.crypto.hmac(key,this.stringToSign(datetime),"hex")},stringToSign:function stringToSign(datetime){var parts=[];parts.push("AWS4-HMAC-SHA256");parts.push(datetime);parts.push(this.credentialString(datetime));parts.push(this.hexEncodedHash(this.canonicalString()));return parts.join("\n")},canonicalString:function canonicalString(){var parts=[],pathname=this.request.pathname();if(this.serviceName!=="s3")pathname=AWS.util.uriEscapePath(pathname);parts.push(this.request.method);parts.push(pathname);parts.push(this.request.search());parts.push(this.canonicalHeaders()+"\n");parts.push(this.signedHeaders());parts.push(this.hexEncodedBodyHash());return parts.join("\n")},canonicalHeaders:function canonicalHeaders(){var headers=[];AWS.util.each.call(this,this.request.headers,function(key,item){headers.push([key,item])});headers.sort(function(a,b){return a[0].toLowerCase()=buffer.length)return readable.push(null);var end=pos+size;if(end>buffer.length)end=buffer.length;readable.push(buffer.slice(pos,end));pos=end};return readable},concat:function(buffers){var length=0,offset=0,buffer=null,i;for(i=0;i0){results=objects;return util.abort}});return results},find:function find(expression,data){return util.jamespath.query(expression,data)[0]; -}},date:{getDate:function getDate(){if(!AWS)AWS=require("./core");if(AWS.config.systemClockOffset){return new Date((new Date).getTime()+AWS.config.systemClockOffset)}else{return new Date}},iso8601:function iso8601(date){if(date===undefined){date=util.date.getDate()}return date.toISOString().replace(/\.\d{3}Z$/,"Z")},rfc822:function rfc822(date){if(date===undefined){date=util.date.getDate()}return date.toUTCString()},unixTimestamp:function unixTimestamp(date){if(date===undefined){date=util.date.getDate()}return date.getTime()/1e3},from:function format(date){if(typeof date==="number"){return new Date(date*1e3)}else{return new Date(date)}},format:function format(date,formatter){if(!formatter)formatter="iso8601";return util.date[formatter](util.date.from(date))},parseTimestamp:function parseTimestamp(value){if(typeof value==="number"){return new Date(value*1e3)}else if(value.match(/^\d+$/)){return new Date(value*1e3)}else if(value.match(/^\d{4}/)){return new Date(value)}else if(value.match(/^\w{3},/)){return new Date(value)}else{throw util.error(new Error("unhandled timestamp format: "+value),{code:"TimestampParserError"})}}},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:function crc32(data){var tbl=util.crypto.crc32Table;var crc=0^-1;if(typeof data==="string"){data=new Buffer(data)}for(var i=0;i>>8^tbl[(crc^code)&255]}return(crc^-1)>>>0},hmac:function hmac(key,string,digest,fn){if(!digest)digest="binary";if(digest==="buffer"){digest=undefined}if(!fn)fn="sha256";if(typeof string==="string")string=new Buffer(string);return cryptoLib.createHmac(fn,key).update(string).digest(digest)},md5:function md5(data,digest,callback){return util.crypto.hash("md5",data,digest,callback)},sha256:function sha256(data,digest,callback){return util.crypto.hash("sha256",data,digest,callback)},hash:function(algorithm,data,digest,callback){var hash=util.crypto.createHash(algorithm);if(!digest){digest="binary"}if(digest==="buffer"){digest=undefined}if(typeof data==="string")data=new Buffer(data);var sliceFn=util.arraySliceFn(data);var isBuffer=Buffer.isBuffer(data);if(callback&&typeof data==="object"&&typeof data.on==="function"&&!isBuffer){data.on("data",function(chunk){hash.update(chunk)});data.on("error",function(err){callback(err)});data.on("end",function(){callback(null,hash.digest(digest))})}else if(callback&&sliceFn&&!isBuffer&&typeof FileReader!=="undefined"){var index=0,size=1024*512;var reader=new FileReader;reader.onerror=function(){callback(new Error("Failed to read data."))};reader.onload=function(){var buf=new Buffer(new Uint8Array(reader.result));hash.update(buf);index+=buf.length;reader._continueReading()};reader._continueReading=function(){if(index>=data.size){callback(null,hash.digest(digest));return}var back=index+size;if(back>data.size)back=data.size;reader.readAsArrayBuffer(sliceFn.call(data,index,back))};reader._continueReading()}else{if(util.isBrowser()&&typeof data==="object"&&!isBuffer){data=new Buffer(new Uint8Array(data))}var out=hash.update(data).digest(digest);if(callback)callback(null,out);return out}},toHex:function toHex(data){var out=[];for(var i=0;i0||noEmpty?xml.root().toString():""};function serialize(xml,value,shape){switch(shape.type){case"structure":return serializeStructure(xml,value,shape);case"map":return serializeMap(xml,value,shape);case"list":return serializeList(xml,value,shape);default:return serializeScalar(xml,value,shape)}}function serializeStructure(xml,params,shape){util.arrayEach(shape.memberNames,function(memberName){var memberShape=shape.members[memberName];if(memberShape.location!=="body")return;var value=params[memberName];var name=memberShape.name;if(value!==undefined&&value!==null){if(memberShape.isXmlAttribute){xml.att(name,value)}else if(memberShape.flattened){serialize(xml,value,memberShape)}else{var element=xml.ele(name);applyNamespaces(element,memberShape);serialize(element,value,memberShape)}}})}function serializeMap(xml,map,shape){var xmlKey=shape.key.name||"key";var xmlValue=shape.value.name||"value";util.each(map,function(key,value){var entry=xml.ele(shape.flattened?shape.name:"entry");serialize(entry.ele(xmlKey),key,shape.key);serialize(entry.ele(xmlValue),value,shape.value)})}function serializeList(xml,list,shape){if(shape.flattened){util.arrayEach(list,function(value){var name=shape.member.name||shape.name;var element=xml.ele(name);serialize(element,value,shape.member)})}else{util.arrayEach(list,function(value){var name=shape.member.name||"member";var element=xml.ele(name);serialize(element,value,shape.member)})}}function serializeScalar(xml,value,shape){xml.txt(shape.toWireFormat(value))}function applyNamespaces(xml,shape){var uri,prefix="xmlns";if(shape.xmlNamespaceUri){uri=shape.xmlNamespaceUri;if(shape.xmlNamespacePrefix)prefix+=":"+shape.xmlNamespacePrefix}else if(xml.isRoot&&shape.api.xmlNamespaceUri){uri=shape.api.xmlNamespaceUri}if(uri)xml.att(prefix,uri)}module.exports=XmlBuilder}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/xml/builder.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/lib/xml")},{"../util":384,_process:1069,buffer:919,xmlbuilder:"xmlbuilder"}],387:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){(function(){var XMLBuilder,XMLFragment;XMLFragment=require("./XMLFragment");XMLBuilder=function(){function XMLBuilder(name,xmldec,doctype){var att,child,_ref;this.children=[];this.rootObject=null;if(this.is(name,"Object")){_ref=[name,xmldec],xmldec=_ref[0],doctype=_ref[1];name=null}if(name!=null){name=""+name||"";if(xmldec==null){xmldec={version:"1.0"}}}if(xmldec!=null&&!(xmldec.version!=null)){throw new Error("Version number is required")}if(xmldec!=null){xmldec.version=""+xmldec.version||"";if(!xmldec.version.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+xmldec.version)}att={version:xmldec.version};if(xmldec.encoding!=null){xmldec.encoding=""+xmldec.encoding||"";if(!xmldec.encoding.match(/[A-Za-z](?:[A-Za-z0-9._-]|-)*/)){throw new Error("Invalid encoding: "+xmldec.encoding)}att.encoding=xmldec.encoding}if(xmldec.standalone!=null){att.standalone=xmldec.standalone?"yes":"no"}child=new XMLFragment(this,"?xml",att);this.children.push(child)}if(doctype!=null){att={};if(name!=null){att.name=name}if(doctype.ext!=null){doctype.ext=""+doctype.ext||"";att.ext=doctype.ext}child=new XMLFragment(this,"!DOCTYPE",att);this.children.push(child)}if(name!=null){this.begin(name)}}XMLBuilder.prototype.begin=function(name,xmldec,doctype){var doc,root;if(!(name!=null)){throw new Error("Root element needs a name")}if(this.rootObject){this.children=[];this.rootObject=null}if(xmldec!=null){doc=new XMLBuilder(name,xmldec,doctype);return doc.root()}name=""+name||"";root=new XMLFragment(this,name,{});root.isRoot=true;root.documentObject=this;this.children.push(root);this.rootObject=root;return root};XMLBuilder.prototype.root=function(){return this.rootObject};XMLBuilder.prototype.end=function(options){return toString(options)};XMLBuilder.prototype.toString=function(options){var child,r,_i,_len,_ref;r="";_ref=this.children;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];r+=child.toString(options)}return r};XMLBuilder.prototype.is=function(obj,type){var clas;clas=Object.prototype.toString.call(obj).slice(8,-1);return obj!=null&&clas===type};return XMLBuilder}();module.exports=XMLBuilder}).call(this)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/node_modules/xmlbuilder/lib/XMLBuilder.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/node_modules/xmlbuilder/lib")},{"./XMLFragment":388,_process:1069,buffer:919}],388:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){(function(){var XMLFragment,__hasProp={}.hasOwnProperty;XMLFragment=function(){function XMLFragment(parent,name,attributes,text){this.isRoot=false;this.documentObject=null;this.parent=parent;this.name=name;this.attributes=attributes;this.value=text;this.children=[]}XMLFragment.prototype.element=function(name,attributes,text){var child,key,val,_ref,_ref1;if(!(name!=null)){throw new Error("Missing element name")}name=""+name||"";this.assertLegalChar(name);if(attributes==null){attributes={}}if(this.is(attributes,"String")&&this.is(text,"Object")){_ref=[text,attributes],attributes=_ref[0],text=_ref[1]}else if(this.is(attributes,"String")){_ref1=[{},attributes],attributes=_ref1[0],text=_ref1[1]}for(key in attributes){if(!__hasProp.call(attributes,key))continue;val=attributes[key];val=""+val||"";attributes[key]=this.escape(val)}child=new XMLFragment(this,name,attributes);if(text!=null){text=""+text||"";text=this.escape(text);this.assertLegalChar(text);child.raw(text)}this.children.push(child);return child};XMLFragment.prototype.insertBefore=function(name,attributes,text){var child,i,key,val,_ref,_ref1;if(this.isRoot){throw new Error("Cannot insert elements at root level")}if(!(name!=null)){throw new Error("Missing element name")}name=""+name||"";this.assertLegalChar(name);if(attributes==null){attributes={}}if(this.is(attributes,"String")&&this.is(text,"Object")){_ref=[text,attributes],attributes=_ref[0],text=_ref[1]}else if(this.is(attributes,"String")){_ref1=[{},attributes],attributes=_ref1[0],text=_ref1[1]}for(key in attributes){if(!__hasProp.call(attributes,key))continue;val=attributes[key];val=""+val||"";attributes[key]=this.escape(val)}child=new XMLFragment(this.parent,name,attributes);if(text!=null){text=""+text||"";text=this.escape(text);this.assertLegalChar(text);child.raw(text)}i=this.parent.children.indexOf(this);this.parent.children.splice(i,0,child);return child};XMLFragment.prototype.insertAfter=function(name,attributes,text){var child,i,key,val,_ref,_ref1;if(this.isRoot){throw new Error("Cannot insert elements at root level")}if(!(name!=null)){throw new Error("Missing element name")}name=""+name||"";this.assertLegalChar(name);if(attributes==null){attributes={}}if(this.is(attributes,"String")&&this.is(text,"Object")){_ref=[text,attributes],attributes=_ref[0],text=_ref[1]}else if(this.is(attributes,"String")){_ref1=[{},attributes],attributes=_ref1[0],text=_ref1[1]}for(key in attributes){if(!__hasProp.call(attributes,key))continue;val=attributes[key];val=""+val||"";attributes[key]=this.escape(val)}child=new XMLFragment(this.parent,name,attributes);if(text!=null){text=""+text||"";text=this.escape(text);this.assertLegalChar(text);child.raw(text)}i=this.parent.children.indexOf(this);this.parent.children.splice(i+1,0,child);return child};XMLFragment.prototype.remove=function(){var i,_ref;if(this.isRoot){throw new Error("Cannot remove the root element")}i=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[i,i-i+1].concat(_ref=[])),_ref;return this.parent};XMLFragment.prototype.text=function(value){var child;if(!(value!=null)){throw new Error("Missing element text")}value=""+value||"";value=this.escape(value);this.assertLegalChar(value);child=new XMLFragment(this,"",{},value);this.children.push(child);return this};XMLFragment.prototype.cdata=function(value){var child;if(!(value!=null)){throw new Error("Missing CDATA text")}value=""+value||"";this.assertLegalChar(value);if(value.match(/]]>/)){throw new Error("Invalid CDATA text: "+value)}child=new XMLFragment(this,"",{},"");this.children.push(child);return this};XMLFragment.prototype.comment=function(value){var child;if(!(value!=null)){throw new Error("Missing comment text")}value=""+value||"";value=this.escape(value);this.assertLegalChar(value);if(value.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+value)}child=new XMLFragment(this,"",{},"");this.children.push(child);return this};XMLFragment.prototype.raw=function(value){var child;if(!(value!=null)){throw new Error("Missing raw text")}value=""+value||"";child=new XMLFragment(this,"",{},value);this.children.push(child);return this};XMLFragment.prototype.up=function(){if(this.isRoot){throw new Error("This node has no parent. Use doc() if you need to get the document object.")}return this.parent};XMLFragment.prototype.root=function(){var child;if(this.isRoot){return this}child=this.parent;while(!child.isRoot){child=child.parent}return child};XMLFragment.prototype.document=function(){return this.root().documentObject};XMLFragment.prototype.end=function(options){return this.document().toString(options)};XMLFragment.prototype.prev=function(){var i;if(this.isRoot){throw new Error("Root node has no siblings")}i=this.parent.children.indexOf(this);if(i<1){throw new Error("Already at the first node")}return this.parent.children[i-1]};XMLFragment.prototype.next=function(){var i;if(this.isRoot){throw new Error("Root node has no siblings")}i=this.parent.children.indexOf(this);if(i===-1||i===this.parent.children.length-1){throw new Error("Already at the last node")}return this.parent.children[i+1]};XMLFragment.prototype.clone=function(deep){var clonedSelf;clonedSelf=new XMLFragment(this.parent,this.name,this.attributes,this.value);if(deep){this.children.forEach(function(child){var clonedChild;clonedChild=child.clone(deep);clonedChild.parent=clonedSelf;return clonedSelf.children.push(clonedChild)})}return clonedSelf};XMLFragment.prototype.importXMLBuilder=function(xmlbuilder){var clonedRoot;clonedRoot=xmlbuilder.root().clone(true);clonedRoot.parent=this;this.children.push(clonedRoot);clonedRoot.isRoot=false;return this};XMLFragment.prototype.attribute=function(name,value){var _ref;if(!(name!=null)){throw new Error("Missing attribute name")}if(!(value!=null)){throw new Error("Missing attribute value")}name=""+name||"";value=""+value||"";if((_ref=this.attributes)==null){this.attributes={}}this.attributes[name]=this.escape(value);return this};XMLFragment.prototype.removeAttribute=function(name){if(!(name!=null)){throw new Error("Missing attribute name")}name=""+name||"";delete this.attributes[name];return this};XMLFragment.prototype.toString=function(options,level){var attName,attValue,child,indent,newline,pretty,r,space,_i,_len,_ref,_ref1;pretty=options!=null&&options.pretty||false;indent=options!=null&&options.indent||" ";newline=options!=null&&options.newline||"\n";level||(level=0);space=new Array(level+1).join(indent);r="";if(pretty){r+=space}if(!(this.value!=null)){r+="<"+this.name}else{r+=""+this.value}_ref=this.attributes;for(attName in _ref){attValue=_ref[attName];if(this.name==="!DOCTYPE"){r+=" "+attValue}else{r+=" "+attName+'="'+attValue+'"'}}if(this.children.length===0){if(!(this.value!=null)){r+=this.name==="?xml"?"?>":this.name==="!DOCTYPE"?">":"/>"}if(pretty){r+=newline}}else if(pretty&&this.children.length===1&&this.children[0].value){r+=">";r+=this.children[0].value;r+="";r+=newline}else{r+=">";if(pretty){r+=newline}_ref1=this.children;for(_i=0,_len=_ref1.length;_i<_len;_i++){child=_ref1[_i];r+=child.toString(options,level+1)}if(pretty){r+=space}r+="";if(pretty){r+=newline}}return r};XMLFragment.prototype.escape=function(str){return str.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")};XMLFragment.prototype.assertLegalChar=function(str){var chars,chr;chars=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/;chr=str.match(chars);if(chr){throw new Error("Invalid character ("+chr+") in string: "+str)}};XMLFragment.prototype.is=function(obj,type){var clas;clas=Object.prototype.toString.call(obj).slice(8,-1);return obj!=null&&clas===type};XMLFragment.prototype.ele=function(name,attributes,text){return this.element(name,attributes,text)};XMLFragment.prototype.txt=function(value){return this.text(value)};XMLFragment.prototype.dat=function(value){return this.cdata(value)};XMLFragment.prototype.att=function(name,value){return this.attribute(name,value)};XMLFragment.prototype.com=function(value){return this.comment(value)};XMLFragment.prototype.doc=function(){return this.document()};XMLFragment.prototype.e=function(name,attributes,text){return this.element(name,attributes,text)};XMLFragment.prototype.t=function(value){return this.text(value)};XMLFragment.prototype.d=function(value){return this.cdata(value)};XMLFragment.prototype.a=function(name,value){return this.attribute(name,value)};XMLFragment.prototype.c=function(value){return this.comment(value)};XMLFragment.prototype.r=function(value){return this.raw(value)};XMLFragment.prototype.u=function(){return this.up()};return XMLFragment}();module.exports=XMLFragment}).call(this)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/node_modules/xmlbuilder/lib/XMLFragment.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/aws-sdk/node_modules/xmlbuilder/lib")},{_process:1069,buffer:919}],389:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";function DynamoDBCondition(key,operator,val1,val2){var datatypes=typeof window==="undefined"?require("./datatypes").DynamoDBDatatype:window.DynamoDBDatatype;var t=new datatypes;var CondObj=function Condition(key,operator,val1,val2){this.key=key;this.operator=operator;this.val1=val1;this.val2=val2;this.format=function(){var formatted={};var attrValueList=[];if(this.val1!==undefined){attrValueList.push(t.formatDataType(this.val1))}if(this.val2!==undefined){attrValueList.push(t.formatDataType(this.val2))}if(attrValueList.length>0){formatted.AttributeValueList=attrValueList}formatted.ComparisonOperator=this.operator;return formatted}};var cond=new CondObj(key,operator,val1,val2);cond.prototype=Object.create(Object.prototype);cond.prototype.instanceOf="DynamoDBConditionObject";return cond}if(typeof module!=="undefined"){var exports=module.exports={};exports.DynamoDBCondition=DynamoDBCondition}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/dynamodb-doc/lib/condition.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/dynamodb-doc/lib")},{"./datatypes":390,_process:1069,buffer:919}],390:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";function DynamoDBDatatype(){var AWS=typeof window==="undefined"?require("aws-sdk"):window.AWS;var Uint8ArrayError="Uint8Array can only be used for Binary in Browser.";var ScalarDatatypeError="Unrecognized Scalar Datatype to be formatted.";var GeneralDatatypeError="Unrecognized Datatype to be formatted.";var BinConversionError="Need to pass in Buffer or Uint8Array. "; -var StrConversionError="Need to pass in string primitive to be converted to binary.";function isScalarType(dataType){var type=typeof dataType;return type==="number"||type==="string"||type==="boolean"||dataType instanceof Uint8Array&&AWS.util.isBrowser()||dataType instanceof AWS.util.Buffer||dataType===null}function isSetType(dataType){return dataType.datatype==="SS"||dataType.datatype==="NS"||dataType.datatype==="BS"}function isRecursiveType(dataType){return Array.isArray(dataType)||typeof dataType==="object"}function formatSetValues(datatype,values){if(datatype==="NS"){return values.map(function(n){return n.toString()})}else{return values}}function formatRecursiveType(dataType){var recursiveDoc={};var value={};var type="M";if(Array.isArray(dataType)){value=[];type="L"}for(var key in dataType){value[key]=this.formatDataType(dataType[key])}recursiveDoc[type]=value;return recursiveDoc}function formatScalarType(dataType){if(dataType==null){return{NULL:true}}var type=typeof dataType;if(type==="string"){return{S:dataType}}else if(type==="number"){return{N:String(dataType)}}else if(type==="boolean"){return{BOOL:dataType}}else if(dataType instanceof AWS.util.Buffer){return{B:dataType}}else if(dataType instanceof Uint8Array){if(AWS.util.isBrowser()){return{B:dataType}}else{throw new Error(Uint8ArrayError)}}else{throw new Error(ScalarDatatypeError)}}this.formatDataType=function(dataType){if(isScalarType(dataType)){return formatScalarType(dataType)}else if(isSetType(dataType)){return dataType.format()}else if(isRecursiveType(dataType)){return formatRecursiveType.call(this,dataType)}else{throw new Error(GeneralDatatypeError)}};function str2Bin(value){if(typeof value!=="string"){throw new Error(StrConversionError)}if(AWS.util.isBrowser()){var len=value.length;var bin=new Uint8Array(new ArrayBuffer(len));for(var i=0;i=0,"limit must be a positive integer"); -return this._test("min",limit,function(value,state,options){if(value.length>=limit){return null}return Errors.create("array.min",{limit:limit},state,options)})};internals.Array.prototype.max=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("max",limit,function(value,state,options){if(value.length<=limit){return null}return Errors.create("array.max",{limit:limit},state,options)})};internals.Array.prototype.length=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("length",limit,function(value,state,options){if(value.length===limit){return null}return Errors.create("array.length",{limit:limit},state,options)})};internals.Array.prototype.unique=function(){return this._test("unique",undefined,function(value,state,options){var found={string:{},number:{},undefined:{},"boolean":{},object:[],"function":[]};for(var i=0,il=value.length;i=0,"limit must be a positive integer");return this._test("min",limit,function(value,state,options){if(value.length>=limit){return null}return Errors.create("binary.min",{limit:limit},state,options)})};internals.Binary.prototype.max=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("max",limit,function(value,state,options){if(value.length<=limit){return null}return Errors.create("binary.max",{limit:limit},state,options)})};internals.Binary.prototype.length=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("length",limit,function(value,state,options){if(value.length===limit){return null}return Errors.create("binary.length",{limit:limit},state,options)})};module.exports=new internals.Binary}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib/binary.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib")},{"./any":393,"./errors":399,_process:1069,buffer:919,hoek:"hoek"}],396:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Any=require("./any");var Errors=require("./errors");var Hoek=require("hoek");var internals={};internals.Boolean=function(){Any.call(this);this._type="boolean"};Hoek.inherits(internals.Boolean,Any);internals.Boolean.prototype._base=function(value,state,options){var result={value:value};if(typeof value==="string"&&options.convert){var lower=value.toLowerCase();result.value=lower==="true"||lower==="yes"||lower==="on"?true:lower==="false"||lower==="no"||lower==="off"?false:value}result.errors=typeof result.value==="boolean"?null:Errors.create("boolean.base",null,state,options);return result};module.exports=new internals.Boolean}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib/boolean.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib")},{"./any":393,"./errors":399,_process:1069,buffer:919,hoek:"hoek"}],397:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Hoek=require("hoek");var Ref=require("./ref");var internals={any:null,date:require("./date"),string:require("./string"),number:require("./number"),"boolean":require("./boolean"),alt:null,object:null};exports.schema=function(config){internals.any=internals.any||new(require("./any"));internals.alt=internals.alt||require("./alternatives");internals.object=internals.object||require("./object");if(config&&typeof config==="object"){if(config.isJoi){return config}if(Array.isArray(config)){return internals.alt.try(config)}if(config instanceof RegExp){return internals.string.regex(config)}if(config instanceof Date){return internals.date.valid(config)}return internals.object.keys(config)}if(typeof config==="string"){return internals.string.valid(config)}if(typeof config==="number"){return internals.number.valid(config)}if(typeof config==="boolean"){return internals.boolean.valid(config)}if(Ref.isRef(config)){return internals.any.valid(config)}Hoek.assert(config===null,"Invalid schema content:",config);return internals.any.valid(null)};exports.ref=function(id){return Ref.isRef(id)?id:Ref.create(id)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib/cast.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib")},{"./alternatives":392,"./any":393,"./boolean":396,"./date":398,"./number":403,"./object":404,"./ref":405,"./string":406,_process:1069,buffer:919,hoek:"hoek"}],398:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Any=require("./any");var Errors=require("./errors");var Ref=require("./ref");var Hoek=require("hoek");var Moment=require("moment");var internals={};internals.isoDate=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\d))$/;internals.invalidDate=new Date("");internals.isIsoDate=function(){var isoString=internals.isoDate.toString();return function(date){return date&&date.toString()===isoString}}();internals.Date=function(){Any.call(this);this._type="date"};Hoek.inherits(internals.Date,Any);internals.Date.prototype._base=function(value,state,options){var result={value:options.convert&&internals.toDate(value,this._flags.format)||value};if(result.value instanceof Date&&!isNaN(result.value.getTime())){result.errors=null}else{result.errors=Errors.create(internals.isIsoDate(this._flags.format)?"date.isoDate":"date.base",null,state,options)}return result};internals.toDate=function(value,format){if(value instanceof Date){return value}if(typeof value==="string"||Hoek.isInteger(value)){if(typeof value==="string"&&/^[+-]?\d+$/.test(value)){value=parseInt(value,10)}var date;if(format){if(internals.isIsoDate(format)){date=format.test(value)?new Date(value):internals.invalidDate}else{date=Moment(value,format,true);date=date.isValid()?date.toDate():internals.invalidDate}}else{date=new Date(value)}if(!isNaN(date.getTime())){return date}}return null};internals.compare=function(type,compare){return function(date){var isNow=date==="now";var isRef=Ref.isRef(date);if(!isNow&&!isRef){date=internals.toDate(date)}Hoek.assert(date,"Invalid date format");return this._test(type,date,function(value,state,options){var compareTo;if(isNow){compareTo=Date.now()}else if(isRef){compareTo=internals.toDate(date(state.parent));if(!compareTo){return Errors.create("date.ref",{ref:date.key},state,options)}compareTo=compareTo.getTime()}else{compareTo=date.getTime()}if(compare(value.getTime(),compareTo)){return null}return Errors.create("date."+type,{limit:new Date(compareTo)},state,options)})}};internals.Date.prototype.min=internals.compare("min",function(value,date){return value>=date});internals.Date.prototype.max=internals.compare("max",function(value,date){return value<=date});internals.Date.prototype.format=function(format){Hoek.assert(typeof format==="string"||Array.isArray(format)&&format.every(function(f){return typeof f==="string"}),"Invalid format.");var obj=this.clone();obj._flags.format=format;return obj};internals.Date.prototype.iso=function(){var obj=this.clone();obj._flags.format=internals.isoDate;return obj};internals.Date.prototype._isIsoDate=function(value){return internals.isoDate.test(value)};module.exports=new internals.Date}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib/date.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib")},{"./any":393,"./errors":399,"./ref":405,_process:1069,buffer:919,hoek:"hoek",moment:"moment"}],399:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Hoek=require("hoek");var Language=require("./language");var internals={};internals.Err=function(type,context,state,options){this.type=type;this.context=context||{};this.context.key=state.key;this.path=state.path;this.options=options};internals.Err.prototype.toString=function(){var self=this;var localized=this.options.language;this.context.key=localized.label||this.context.key||localized.root||Language.errors.root;var format=Hoek.reach(localized,this.type)||Hoek.reach(Language.errors,this.type);var hasKey=/\{\{\!?key\}\}/.test(format);format=hasKey?format:"{{!key}} "+format;var message=format.replace(/\{\{(\!?)([^}]+)\}\}/g,function($0,isSecure,name){var value=Hoek.reach(self.context,name);var normalized=Array.isArray(value)?value.join(", "):value.toString();return isSecure?Hoek.escapeHtml(normalized):normalized});return message};exports.create=function(type,context,state,options){return new internals.Err(type,context,state,options)};exports.process=function(errors,object){if(!errors||!errors.length){return null}var details=[];for(var i=0,il=errors.length;i=0;--e){var pos=el-e;var error=this.details[e];var path=error.path.split(".");var ref=obj;for(var i=0,il=path.length;i=limit){return null}return Errors.create("number.min",{limit:limit},state,options)})};internals.Number.prototype.max=function(limit){Hoek.assert(Hoek.isInteger(limit),"limit must be an integer");return this._test("max",limit,function(value,state,options){if(value<=limit){return null}return Errors.create("number.max",{limit:limit},state,options)})};internals.Number.prototype.greater=function(limit){Hoek.assert(Hoek.isInteger(limit),"limit must be an integer");return this._test("greater",limit,function(value,state,options){if(value>limit){return null}return Errors.create("number.greater",{limit:limit},state,options)})};internals.Number.prototype.less=function(limit){Hoek.assert(Hoek.isInteger(limit),"limit must be an integer");return this._test("less",limit,function(value,state,options){if(value0){return null}return Errors.create("number.positive",null,state,options)})};internals.precisionRx=/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/;internals.Number.prototype.precision=function(limit){Hoek.assert(Hoek.isInteger(limit),"limit must be an integer");Hoek.assert(!("precision"in this._flags),"precision already set");var obj=this._test("precision",limit,function(value,state,options){var places=value.toString().match(internals.precisionRx);var decimals=Math.max((places[1]?places[1].length:0)-(places[2]?parseInt(places[2],10):0),0);if(decimals<=limit){return null}return Errors.create("number.precision",{limit:limit},state,options)});obj._flags.precision=limit;return obj};module.exports=new internals.Number}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib/number.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib")},{"./any":393,"./errors":399,_process:1069,buffer:919,hoek:"hoek"}],404:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Hoek=require("hoek");var Topo=require("topo");var Any=require("./any");var Cast=require("./cast");var Errors=require("./errors");var internals={};internals.Object=function(){Any.call(this);this._type="object";this._inner.children=null;this._inner.renames=[];this._inner.dependencies=[];this._inner.patterns=[]};Hoek.inherits(internals.Object,Any);internals.Object.prototype._base=function(value,state,options){var target=value;var errors=[];var finish=function(){return{value:target,errors:errors.length?errors:null}};if(typeof value==="string"&&options.convert){try{value=JSON.parse(value)}catch(err){}}if(!value||typeof value!=="object"||Array.isArray(value)){errors.push(Errors.create("object.base",null,state,options));return finish()}if(!this._inner.renames.length&&!this._inner.dependencies.length&&!this._inner.children&&!this._inner.patterns.length){target=value;return finish()}if(target===value){target=Object.create(Object.getPrototypeOf(value));var valueKeys=Object.keys(value);for(var t=0,tl=valueKeys.length;t=0,"limit must be a positive integer");return this._test("length",limit,function(value,state,options){if(Object.keys(value).length===limit){return null}return Errors.create("object.length",{limit:limit},state,options)})};internals.Object.prototype.min=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("min",limit,function(value,state,options){if(Object.keys(value).length>=limit){return null}return Errors.create("object.min",{limit:limit},state,options)})};internals.Object.prototype.max=function(limit){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");return this._test("max",limit,function(value,state,options){if(Object.keys(value).length<=limit){return null}return Errors.create("object.max",{limit:limit},state,options)})};internals.Object.prototype.pattern=function(pattern,schema){Hoek.assert(pattern instanceof RegExp,"Invalid regular expression");Hoek.assert(schema!==undefined,"Invalid rule");pattern=new RegExp(pattern.source,pattern.ignoreCase?"i":undefined);var obj=this.clone(); -obj._inner.patterns.push({regex:pattern,rule:Cast.schema(schema)});return obj};internals.Object.prototype.with=function(key,peers){return this._dependency("with",key,peers)};internals.Object.prototype.without=function(key,peers){return this._dependency("without",key,peers)};internals.Object.prototype.xor=function(){var peers=Hoek.flatten(Array.prototype.slice.call(arguments));return this._dependency("xor",null,peers)};internals.Object.prototype.or=function(){var peers=Hoek.flatten(Array.prototype.slice.call(arguments));return this._dependency("or",null,peers)};internals.Object.prototype.and=function(){var peers=Hoek.flatten(Array.prototype.slice.call(arguments));return this._dependency("and",null,peers)};internals.Object.prototype.nand=function(){var peers=Hoek.flatten(Array.prototype.slice.call(arguments));return this._dependency("nand",null,peers)};internals.Object.prototype.requiredKeys=function(children){children=Hoek.flatten(Array.prototype.slice.call(arguments));return this.applyFunctionToChildren(children,"required")};internals.Object.prototype.optionalKeys=function(children){children=Hoek.flatten(Array.prototype.slice.call(arguments));return this.applyFunctionToChildren(children,"optional")};internals.renameDefaults={alias:false,multiple:false,override:false};internals.Object.prototype.rename=function(from,to,options){Hoek.assert(typeof from==="string","Rename missing the from argument");Hoek.assert(typeof to==="string","Rename missing the to argument");Hoek.assert(to!==from,"Cannot rename key to same name:",from);for(var i=0,il=this._inner.renames.length;i0,"expected at least one children");var groupedChildren=internals.groupChildren(children);var obj;if(""in groupedChildren){obj=this[fn].apply(this,args);delete groupedChildren[""]}else{obj=this.clone()}if(obj._inner.children){root=root?root+".":"";for(var i=0,il=obj._inner.children.length;i1,"Cannot use assertions for root level references - use direct key rules instead");message=message||"pass the assertion test";var cast=Cast.schema(schema);return this._test("assert",{cast:cast,ref:ref},function(value,state,options){var result=cast._validate(ref(value),null,options,value);if(!result.errors){return null}return Errors.create("object.assert",{ref:ref.path.join("."),message:message},state,options)})};internals.Object.prototype.type=function(constructor,name){Hoek.assert(typeof constructor==="function","type must be a constructor function");name=name||constructor.name;return this._test("type",name,function(value,state,options){if(value instanceof constructor){return null}return Errors.create("object.type",{type:name},state,options)})};module.exports=new internals.Object}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib/object.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib")},{"./any":393,"./cast":397,"./errors":399,_process:1069,buffer:919,hoek:"hoek",topo:"topo"}],405:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Hoek=require("hoek");var internals={};exports.create=function(key,options){Hoek.assert(typeof key==="string","Invalid reference key:",key);var settings=Hoek.clone(options);var ref=function(value,validationOptions){return Hoek.reach(ref.isContext?validationOptions.context:value,ref.key,settings)};ref.isContext=key[0]===(settings&&settings.contextPrefix||"$");ref.key=ref.isContext?key.slice(1):key;ref.path=ref.key.split(settings&&settings.separator||".");ref.depth=ref.path.length;ref.root=ref.path[0];ref.isJoi=true;ref.toString=function(){return(ref.isContext?"context:":"ref:")+ref.key};return ref};exports.isRef=function(ref){return typeof ref==="function"&&ref.isJoi};exports.push=function(array,ref){if(exports.isRef(ref)&&!ref.isContext){array.push(ref.root)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib/ref.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib")},{_process:1069,buffer:919,hoek:"hoek"}],406:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Net=require("net");var Hoek=require("hoek");var Isemail=require("isemail");var Any=require("./any");var JoiDate=require("./date");var Errors=require("./errors");var internals={};internals.String=function(){Any.call(this);this._type="string";this._invalids.add("")};Hoek.inherits(internals.String,Any);internals.String.prototype._base=function(value,state,options){if(typeof value==="string"&&options.convert){if(this._flags.case){value=this._flags.case==="upper"?value.toLocaleUpperCase():value.toLocaleLowerCase()}if(this._flags.trim){value=value.trim()}}return{value:value,errors:typeof value==="string"?null:Errors.create("string.base",null,state,options)}};internals.String.prototype.insensitive=function(){var obj=this.clone();obj._flags.insensitive=true;return obj};internals.String.prototype.min=function(limit,encoding){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");Hoek.assert(!encoding||Buffer.isEncoding(encoding),"Invalid encoding:",encoding);return this._test("min",limit,function(value,state,options){var length=encoding?Buffer.byteLength(value,encoding):value.length;if(length>=limit){return null}return Errors.create("string.min",{limit:limit},state,options)})};internals.String.prototype.max=function(limit,encoding){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");Hoek.assert(!encoding||Buffer.isEncoding(encoding),"Invalid encoding:",encoding);return this._test("max",limit,function(value,state,options){var length=encoding?Buffer.byteLength(value,encoding):value.length;if(length<=limit){return null}return Errors.create("string.max",{limit:limit},state,options)})};internals.String.prototype.creditCard=function(){return this._test("creditCard",undefined,function(value,state,options){var i=value.length;var sum=0;var mul=1;var char;while(i--){char=value.charAt(i)*mul;sum+=char-(char>9)*9;mul^=3}var check=sum%10===0&&sum>0;return check?null:Errors.create("string.creditCard",null,state,options)})};internals.String.prototype.length=function(limit,encoding){Hoek.assert(Hoek.isInteger(limit)&&limit>=0,"limit must be a positive integer");Hoek.assert(!encoding||Buffer.isEncoding(encoding),"Invalid encoding:",encoding);return this._test("length",limit,function(value,state,options){var length=encoding?Buffer.byteLength(value,encoding):value.length;if(length===limit){return null}return Errors.create("string.length",{limit:limit},state,options)})};internals.String.prototype.regex=function(pattern,name){Hoek.assert(pattern instanceof RegExp,"pattern must be a RegExp");pattern=new RegExp(pattern.source,pattern.ignoreCase?"i":undefined);return this._test("regex",pattern,function(value,state,options){if(pattern.test(value)){return null}return Errors.create(name?"string.regex.name":"string.regex.base",{name:name},state,options)})};internals.String.prototype.alphanum=function(){return this._test("alphanum",undefined,function(value,state,options){if(/^[a-zA-Z0-9]+$/.test(value)){return null}return Errors.create("string.alphanum",null,state,options)})};internals.String.prototype.token=function(){return this._test("token",undefined,function(value,state,options){if(/^\w+$/.test(value)){return null}return Errors.create("string.token",null,state,options)})};internals.String.prototype.email=function(){return this._test("email",undefined,function(value,state,options){if(Isemail(value)){return null}return Errors.create("string.email",null,state,options)})};internals.String.prototype.isoDate=function(){return this._test("isoDate",undefined,function(value,state,options){if(JoiDate._isIsoDate(value)){return null}return Errors.create("string.isoDate",null,state,options)})};internals.String.prototype.guid=function(){var regex=/^[A-F0-9]{8}(?:-?[A-F0-9]{4}){3}-?[A-F0-9]{12}$/i;var regex2=/^\{[A-F0-9]{8}(?:-?[A-F0-9]{4}){3}-?[A-F0-9]{12}\}$/i;return this._test("guid",undefined,function(value,state,options){if(regex.test(value)||regex2.test(value)){return null}return Errors.create("string.guid",null,state,options)})};internals.String.prototype.hostname=function(){var regex=/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;return this._test("hostname",undefined,function(value,state,options){if(value.length<=255&®ex.test(value)||Net.isIPv6(value)){return null}return Errors.create("string.hostname",null,state,options)})};internals.String.prototype.lowercase=function(){var obj=this._test("lowercase",undefined,function(value,state,options){if(options.convert||value===value.toLocaleLowerCase()){return null}return Errors.create("string.lowercase",null,state,options)});obj._flags.case="lower";return obj};internals.String.prototype.uppercase=function(options){var obj=this._test("uppercase",undefined,function(value,state,options){if(options.convert||value===value.toLocaleUpperCase()){return null}return Errors.create("string.uppercase",null,state,options)});obj._flags.case="upper";return obj};internals.String.prototype.trim=function(){var obj=this._test("trim",undefined,function(value,state,options){if(options.convert||value===value.trim()){return null}return Errors.create("string.trim",null,state,options)});obj._flags.trim=true;return obj};module.exports=new internals.String}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib/string.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/lib")},{"./any":393,"./date":398,"./errors":399,_process:1069,buffer:919,hoek:"hoek",isemail:"isemail",net:916}],407:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var internals={};exports.escapeJavaScript=function(input){if(!input){return""}var escaped="";for(var i=0,il=input.length;i=256){return"\\u"+internals.padLeft(""+charCode,4)}var hexValue=new Buffer(String.fromCharCode(charCode),"ascii").toString("hex");return"\\x"+internals.padLeft(hexValue,2)};internals.escapeHtmlChar=function(charCode){var namedEscape=internals.namedHtml[charCode];if(typeof namedEscape!=="undefined"){return namedEscape}if(charCode>=256){return"&#"+charCode+";"}var hexValue=new Buffer(String.fromCharCode(charCode),"ascii").toString("hex");return"&#x"+internals.padLeft(hexValue,2)+";"};internals.padLeft=function(str,len){while(str.length=97||i>=65&&i<=90||i>=48&&i<=57||i===32||i===46||i===44||i===45||i===58||i===95){safe[i]=null}}return safe}()}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/node_modules/hoek/lib/escape.js","/node_modules/@mitocgroup/deep-validation/node_modules/vogels/node_modules/joi/node_modules/hoek/lib")},{_process:1069,buffer:919}],408:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var Crypto=require("crypto");var Path=require("path");var Util=require("util");var Escape=require("./escape");var internals={};exports.clone=function(obj,seen){if(typeof obj!=="object"||obj===null){return obj}seen=seen||{orig:[],copy:[]};var lookup=seen.orig.indexOf(obj);if(lookup!==-1){return seen.copy[lookup]}var newObj;var cloneDeep=false;if(!Array.isArray(obj)){if(Buffer.isBuffer(obj)){newObj=new Buffer(obj)}else if(obj instanceof Date){newObj=new Date(obj.getTime())}else if(obj instanceof RegExp){newObj=new RegExp(obj)}else{var proto=Object.getPrototypeOf(obj);if(proto&&proto.isImmutable){newObj=obj}else{newObj=Object.create(proto);cloneDeep=true}}}else{newObj=[];cloneDeep=true}seen.orig.push(obj);seen.copy.push(newObj);if(cloneDeep){var keys=Object.getOwnPropertyNames(obj);for(var i=0,il=keys.length;i=2,"Insufficient arguments");exports.assert(typeof ref==="string"||typeof ref==="object","Reference must be string or an object");exports.assert(values.length,"Values array cannot be empty");var compare,compareFlags;if(options.deep){compare=exports.deepEqual;var hasOnly=options.hasOwnProperty("only"),hasPart=options.hasOwnProperty("part");compareFlags={prototype:hasOnly?options.only:hasPart?!options.part:false,part:hasOnly?!options.only:hasPart?options.part:true}}else{compare=function(a,b){return a===b}}var misses=false;var matches=new Array(values.length);for(var i=0,il=matches.length;i1||!options.part&&!matches[i]){return false}}if(options.only&&misses){return false}return result};exports.flatten=function(array,target){var result=target||[];for(var i=0,il=array.length;i\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute),"Bad attribute value ("+attribute+")");return attribute.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')};exports.escapeHtml=function(string){return Escape.escapeHtml(string)};exports.escapeJavaScript=function(string){return Escape.escapeJavaScript(string)};exports.nextTick=function(callback){return function(){var args=arguments;process.nextTick(function(){callback.apply(null,args)})}};exports.once=function(method){if(method._hoekOnce){return method}var once=false;var wrapped=function(){if(!once){once=true;method.apply(null,arguments)}};wrapped._hoekOnce=true;return wrapped};exports.isAbsolutePath=function(path,platform){if(!path){return false}if(Path.isAbsolute){return Path.isAbsolute(path)}platform=platform||process.platform;if(platform!=="win32"){return path[0]==="/"}return!!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path)};exports.isInteger=function(value){return typeof value==="number"&&parseFloat(value)===parseInt(value,10)&&!isNaN(value)};exports.ignore=function(){};exports.inherits=Util.inherits;exports.format=Util.format;exports.transform=function(source,transform,options){exports.assert(source===null||source===undefined||typeof source==="object","Invalid source object: must be null, undefined, or an object");var result={};var keys=Object.keys(transform);for(var k=0,kl=keys.length;k1){segment=path.shift();if(!res[segment]){res[segment]={}}res=res[segment]}segment=path.shift();res[segment]=exports.reach(source,sourcePath,options)}return result};exports.uniqueFilename=function(path,extension){if(extension){extension=extension[0]!=="."?"."+extension:extension}else{extension=""}path=Path.resolve(path);var name=[Date.now(),process.pid,Crypto.randomBytes(8).toString("hex")].join("-")+extension;return Path.join(path,name)};exports.stringify=function(){try{return JSON.stringify.apply(null,arguments)}catch(err){return"[Cannot display object: "+err.message+"]"}};exports.shallow=function(source){var target={};var keys=Object.keys(source);for(var i=0,il=keys.length;i=0;i--){lookup[i]=false}for(var i=0;imax){max=chr}lookup[chr]=true}lookup.length=max;var body="var lookup = "+JSON.stringify(lookup)+";\n";body+="return function(code) {\n";body+=" if (code < "+min+" || code > "+max+") {\n";body+=" return false;\n";body+=" }\n";body+=" return lookup[code];\n";body+="}";return new Function(body)()}var specialsLookup=optimizeLookup(SPECIALS);var IPv4_REGEX=/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;var IPv6_REGEX=/^[a-fA-F\d]{0,4}$/;var IPv6_REGEX_TEST=IPv6_REGEX.test.bind(IPv6_REGEX);var hasOwn=Object.prototype.hasOwnProperty;function maxValue(array){var v=-Infinity,i=0,n=array.length;for(;iv){v=array[i]}}return v}function isEmail(email,options,callback){if(typeof options==="function"){callback=options;options={}}options||(options={});var threshold,diagnose;if(typeof options.errorLevel==="number"){diagnose=true;threshold=options.errorLevel}else{diagnose=!!options.errorLevel;threshold=ISEMAIL_VALID}if(options.tldWhitelist&&typeof options.tldWhitelist!=="object"){throw new TypeError("expected array or object tldWhitelist")}if(options.minDomainAtoms&&(options.minDomainAtoms!==(+options.minDomainAtoms|0)||options.minDomainAtoms<0)){throw new TypeError("expected positive integer minDomainAtoms")}var maxResult=ISEMAIL_VALID;function updateResult(value){if(value>maxResult){maxResult=value}}var context={now:COMPONENT_LOCALPART,prev:COMPONENT_LOCALPART,stack:[COMPONENT_LOCALPART]};var token="",prevToken="",charCode=0;var parseData={local:"",domain:""};var atomList={local:[""],domain:[""]};var elementCount=0,elementLength=0,crlfCount=0;var hyphenFlag=false,assertEnd=false;for(var i=0;i64){updateResult(ISEMAIL_RFC5322_LOCAL_TOOLONG)}else if(context.prev===CONTEXT_COMMENT||context.prev===CONTEXT_FWS){updateResult(ISEMAIL_DEPREC_CFWS_NEAR_AT)}context.now=COMPONENT_DOMAIN;context.stack[0]=COMPONENT_DOMAIN;elementCount=0;elementLength=0;assertEnd=false;break;default:if(assertEnd){switch(context.prev){case CONTEXT_COMMENT:case CONTEXT_FWS:updateResult(ISEMAIL_ERR_ATEXT_AFTER_CFWS);break;case CONTEXT_QUOTEDSTRING:updateResult(ISEMAIL_ERR_ATEXT_AFTER_QS);break;default:throw new Error("more atext found where none is allowed, "+"but unrecognized prev context: "+context.prev)}}else{context.prev=context.now;charCode=token.charCodeAt(0);if(charCode<33||charCode>126||charCode===10||specialsLookup(charCode)){updateResult(ISEMAIL_ERR_EXPECTING_ATEXT)}parseData.local+=token;atomList.local[elementCount]+=token;elementLength++}}break;case COMPONENT_DOMAIN:switch(token){case"(":if(elementLength===0){updateResult(elementCount===0?ISEMAIL_DEPREC_CFWS_NEAR_AT:ISEMAIL_DEPREC_COMMENT)}else{updateResult(ISEMAIL_CFWS_COMMENT);assertEnd=true}context.stack.push(context.now);context.now=CONTEXT_COMMENT;break;case".":if(elementLength===0){updateResult(elementCount===0?ISEMAIL_ERR_DOT_START:ISEMAIL_ERR_CONSECUTIVEDOTS)}else if(hyphenFlag){updateResult(ISEMAIL_ERR_DOMAINHYPHENEND)}else if(elementLength>63){updateResult(ISEMAIL_RFC5322_LABEL_TOOLONG)}assertEnd=false;elementLength=0;elementCount++;atomList.domain[elementCount]="";parseData.domain+=token;break;case"[":if(parseData.domain.length===0){assertEnd=true;elementLength++;context.stack.push(context.now);context.now=COMPONENT_LITERAL;parseData.domain+=token;atomList.domain[elementCount]+=token;parseData.literal=""}else{updateResult(ISEMAIL_ERR_EXPECTING_ATEXT)}break;case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF);break}case" ":case" ":if(elementLength===0){updateResult(elementCount===0?ISEMAIL_DEPREC_CFWS_NEAR_AT:ISEMAIL_DEPREC_FWS)}else{updateResult(ISEMAIL_CFWS_FWS);assertEnd=true}context.stack.push(context.now);context.now=CONTEXT_FWS;prevToken=token;break;default:if(assertEnd){switch(context.prev){case CONTEXT_COMMENT:case CONTEXT_FWS:updateResult(ISEMAIL_ERR_ATEXT_AFTER_CFWS);break;case COMPONENT_LITERAL:updateResult(ISEMAIL_ERR_ATEXT_AFTER_DOMLIT);break;default:throw new Error("more atext found where none is allowed, "+"but unrecognized prev context: "+context.prev)}}charCode=token.charCodeAt(0);hyphenFlag=false;if(charCode<33||charCode>126||specialsLookup(charCode)){updateResult(ISEMAIL_ERR_EXPECTING_ATEXT)}else if(token==="-"){if(elementLength===0){updateResult(ISEMAIL_ERR_DOMAINHYPHENSTART)}hyphenFlag=true}else if(!(charCode>47&&charCode<58||charCode>64&&charCode<91||charCode>96&&charCode<123)){updateResult(ISEMAIL_RFC5322_DOMAIN)}parseData.domain+=token;atomList.domain[elementCount]+=token;elementLength++}break;case COMPONENT_LITERAL:switch(token){case"]":if(maxResultmaxGroups){updateResult(ISEMAIL_RFC5322_IPV6_MAXGRPS)}else if(matchesIP.length===maxGroups){updateResult(ISEMAIL_RFC5321_IPV6DEPRECATED)}}if(match[0]===":"&&match[1]!==":"){updateResult(ISEMAIL_RFC5322_IPV6_COLONSTRT)}else if(match[match.length-1]===":"&&match[match.length-2]!==":"){updateResult(ISEMAIL_RFC5322_IPV6_COLONEND)}else if(matchesIP.every(IPv6_REGEX_TEST)){updateResult(ISEMAIL_RFC5321_ADDRESSLITERAL)}else{updateResult(ISEMAIL_RFC5322_IPV6_BADCHAR)}}}else{updateResult(ISEMAIL_RFC5322_DOMAINLITERAL)}parseData.domain+=token;atomList.domain[elementCount]+=token;elementLength++;context.prev=context.now;context.now=context.stack.pop();break;case"\\":updateResult(ISEMAIL_RFC5322_DOMLIT_OBSDTEXT);context.stack.push(context.now);context.now=CONTEXT_QUOTEDPAIR;break;case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF);break}case" ":case" ":updateResult(ISEMAIL_CFWS_FWS);context.stack.push(context.now);context.now=CONTEXT_FWS;prevToken=token;break;default:charCode=token.charCodeAt(0);if(charCode>127||charCode===0||token==="["){updateResult(ISEMAIL_ERR_EXPECTING_DTEXT);break}else if(charCode<33||charCode===127){updateResult(ISEMAIL_RFC5322_DOMLIT_OBSDTEXT)}parseData.literal+=token;parseData.domain+=token;atomList.domain[elementCount]+=token;elementLength++}break;case CONTEXT_QUOTEDSTRING:switch(token){case"\\":context.stack.push(context.now);context.now=CONTEXT_QUOTEDPAIR;break;case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF);break}case" ":parseData.local+=" ";atomList.local[elementCount]+=" ";elementLength++;updateResult(ISEMAIL_CFWS_FWS);context.stack.push(context.now);context.now=CONTEXT_FWS;prevToken=token;break;case'"':parseData.local+=token;atomList.local[elementCount]+=token;elementLength++;context.prev=context.now;context.now=context.stack.pop();break;default:charCode=token.charCodeAt(0);if(charCode>127||charCode===0||charCode===10){updateResult(ISEMAIL_ERR_EXPECTING_QTEXT)}else if(charCode<32||charCode===127){updateResult(ISEMAIL_DEPREC_QTEXT)}parseData.local+=token;atomList.local[elementCount]+=token;elementLength++}break;case CONTEXT_QUOTEDPAIR:charCode=token.charCodeAt(0);if(charCode>127){updateResult(ISEMAIL_ERR_EXPECTING_QPAIR)}else if(charCode<31&&charCode!==9||charCode===127){updateResult(ISEMAIL_DEPREC_QP)}context.prev=context.now;context.now=context.stack.pop();token="\\"+token;switch(context.now){case CONTEXT_COMMENT:break;case CONTEXT_QUOTEDSTRING:parseData.local+=token;atomList.local[elementCount]+=token;elementLength+=2;break;case COMPONENT_LITERAL:parseData.domain+=token;atomList.domain[elementCount]+=token;elementLength+=2;break;default:throw new Error("quoted pair logic invoked in an invalid context: "+context.now)}break;case CONTEXT_COMMENT:switch(token){case"(":context.stack.push(context.now);context.now=CONTEXT_COMMENT;break;case")":context.prev=context.now;context.now=context.stack.pop();break;case"\\":context.stack.push(context.now);context.now=CONTEXT_QUOTEDPAIR;break;case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF);break}case" ":case" ":updateResult(ISEMAIL_CFWS_FWS);context.stack.push(context.now);context.now=CONTEXT_FWS;prevToken=token;break;default:charCode=token.charCodeAt(0);if(charCode>127||charCode===0||charCode===10){updateResult(ISEMAIL_ERR_EXPECTING_CTEXT);break}else if(charCode<32||charCode===127){updateResult(ISEMAIL_DEPREC_CTEXT)}}break;case CONTEXT_FWS:if(prevToken==="\r"){if(token==="\r"){updateResult(ISEMAIL_ERR_FWS_CRLF_X2);break}if(++crlfCount>1){updateResult(ISEMAIL_DEPREC_FWS)}else{crlfCount=1}}switch(token){case"\r":if(++i===email.length||email[i]!=="\n"){updateResult(ISEMAIL_ERR_CR_NO_LF)}break;case" ":case" ":break;default:if(prevToken==="\r"){updateResult(ISEMAIL_ERR_FWS_CRLF_END)}crlfCount=0;context.prev=context.now;context.now=context.stack.pop();i--}prevToken=token;break;default:throw new Error("unknown context: "+context.now)}if(maxResult>ISEMAIL_RFC5322){break}}if(maxResult255){updateResult(ISEMAIL_RFC5322_DOMAIN_TOOLONG)}else if(parseData.local.length+parseData.domain.length+1>254){updateResult(ISEMAIL_RFC5322_TOOLONG)}else if(elementLength>63){updateResult(ISEMAIL_RFC5322_LABEL_TOOLONG)}else if(options.minDomainAtoms&&atomList.domain.length=48&&charCode<=57){updateResult(ISEMAIL_RFC5321_TLDNUMERIC)}}}if(maxResult")){node.params.push(this.flow_parseTypeAnnotatableIdentifier());if(!this.isRelational(">")){this.expect(tt.comma)}}this.expectRelational(">");return this.finishNode(node,"TypeParameterDeclaration")};pp.flow_parseTypeParameterInstantiation=function(){var node=this.startNode(),oldInType=this.inType;node.params=[];this.inType=true;this.expectRelational("<");while(!this.isRelational(">")){node.params.push(this.flow_parseType());if(!this.isRelational(">")){this.expect(tt.comma)}}this.expectRelational(">");this.inType=oldInType;return this.finishNode(node,"TypeParameterInstantiation")};pp.flow_parseObjectPropertyKey=function(){return this.type===tt.num||this.type===tt.string?this.parseExprAtom():this.parseIdent(true)};pp.flow_parseObjectTypeIndexer=function(node,isStatic){node["static"]=isStatic;this.expect(tt.bracketL);node.id=this.flow_parseObjectPropertyKey();this.expect(tt.colon);node.key=this.flow_parseType();this.expect(tt.bracketR);this.expect(tt.colon);node.value=this.flow_parseType();this.flow_objectTypeSemicolon();return this.finishNode(node,"ObjectTypeIndexer")};pp.flow_parseObjectTypeMethodish=function(node){node.params=[];node.rest=null;node.typeParameters=null;if(this.isRelational("<")){node.typeParameters=this.flow_parseTypeParameterDeclaration()}this.expect(tt.parenL);while(this.type===tt.name){node.params.push(this.flow_parseFunctionTypeParam());if(this.type!==tt.parenR){this.expect(tt.comma)}}if(this.eat(tt.ellipsis)){node.rest=this.flow_parseFunctionTypeParam()}this.expect(tt.parenR);this.expect(tt.colon);node.returnType=this.flow_parseType();return this.finishNode(node,"FunctionTypeAnnotation")};pp.flow_parseObjectTypeMethod=function(start,isStatic,key){var node=this.startNodeAt(start);node.value=this.flow_parseObjectTypeMethodish(this.startNodeAt(start));node["static"]=isStatic;node.key=key;node.optional=false;this.flow_objectTypeSemicolon();return this.finishNode(node,"ObjectTypeProperty")};pp.flow_parseObjectTypeCallProperty=function(node,isStatic){var valueNode=this.startNode();node["static"]=isStatic;node.value=this.flow_parseObjectTypeMethodish(valueNode);this.flow_objectTypeSemicolon();return this.finishNode(node,"ObjectTypeCallProperty")};pp.flow_parseObjectType=function(allowStatic){var nodeStart=this.startNode();var node;var optional=false;var property;var propertyKey;var propertyTypeAnnotation;var token;var isStatic;nodeStart.callProperties=[];nodeStart.properties=[];nodeStart.indexers=[];this.expect(tt.braceL);while(this.type!==tt.braceR){var start=this.markPosition();node=this.startNode();if(allowStatic&&this.isContextual("static")){this.next();isStatic=true}if(this.type===tt.bracketL){nodeStart.indexers.push(this.flow_parseObjectTypeIndexer(node,isStatic))}else if(this.type===tt.parenL||this.isRelational("<")){nodeStart.callProperties.push(this.flow_parseObjectTypeCallProperty(node,allowStatic))}else{if(isStatic&&this.type===tt.colon){propertyKey=this.parseIdent()}else{propertyKey=this.flow_parseObjectPropertyKey()}if(this.isRelational("<")||this.type===tt.parenL){nodeStart.properties.push(this.flow_parseObjectTypeMethod(start,isStatic,propertyKey))}else{if(this.eat(tt.question)){optional=true}this.expect(tt.colon);node.key=propertyKey;node.value=this.flow_parseType();node.optional=optional;node["static"]=isStatic;this.flow_objectTypeSemicolon();nodeStart.properties.push(this.finishNode(node,"ObjectTypeProperty"))}}}this.expect(tt.braceR);return this.finishNode(nodeStart,"ObjectTypeAnnotation")};pp.flow_objectTypeSemicolon=function(){if(!this.eat(tt.semi)&&!this.eat(tt.comma)&&this.type!==tt.braceR){this.unexpected()}};pp.flow_parseGenericType=function(start,id){var node=this.startNodeAt(start);node.typeParameters=null;node.id=id;while(this.eat(tt.dot)){var node2=this.startNodeAt(start);node2.qualification=node.id;node2.id=this.parseIdent();node.id=this.finishNode(node2,"QualifiedTypeIdentifier")}if(this.isRelational("<")){node.typeParameters=this.flow_parseTypeParameterInstantiation()}return this.finishNode(node,"GenericTypeAnnotation")};pp.flow_parseVoidType=function(){var node=this.startNode();this.expect(tt._void);return this.finishNode(node,"VoidTypeAnnotation")};pp.flow_parseTypeofType=function(){var node=this.startNode();this.expect(tt._typeof);node.argument=this.flow_parsePrimaryType();return this.finishNode(node,"TypeofTypeAnnotation")};pp.flow_parseTupleType=function(){var node=this.startNode();node.types=[];this.expect(tt.bracketL);while(this.pos. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType")}return type}tmp=this.flow_parseFunctionTypeParams();node.params=tmp.params;node.rest=tmp.rest;this.expect(tt.parenR);this.expect(tt.arrow);node.returnType=this.flow_parseType();node.typeParameters=null;return this.finishNode(node,"FunctionTypeAnnotation");case tt.string:node.value=this.value;node.raw=this.input.slice(this.start,this.end);this.next();return this.finishNode(node,"StringLiteralTypeAnnotation");default:if(this.type.keyword){switch(this.type.keyword){case"void":return this.flow_parseVoidType();case"typeof":return this.flow_parseTypeofType()}}}this.unexpected()};pp.flow_parsePostfixType=function(){var node=this.startNode();var type=node.elementType=this.flow_parsePrimaryType();if(this.type===tt.bracketL){this.expect(tt.bracketL);this.expect(tt.bracketR);return this.finishNode(node,"ArrayTypeAnnotation")}return type};pp.flow_parsePrefixType=function(){var node=this.startNode();if(this.eat(tt.question)){node.typeAnnotation=this.flow_parsePrefixType();return this.finishNode(node,"NullableTypeAnnotation")}return this.flow_parsePostfixType()};pp.flow_parseIntersectionType=function(){var node=this.startNode();var type=this.flow_parsePrefixType();node.types=[type];while(this.eat(tt.bitwiseAND)){node.types.push(this.flow_parsePrefixType())}return node.types.length===1?type:this.finishNode(node,"IntersectionTypeAnnotation")};pp.flow_parseUnionType=function(){var node=this.startNode();var type=this.flow_parseIntersectionType();node.types=[type];while(this.eat(tt.bitwiseOR)){node.types.push(this.flow_parseIntersectionType())}return node.types.length===1?type:this.finishNode(node,"UnionTypeAnnotation")};pp.flow_parseType=function(){var oldInType=this.inType;this.inType=true;var type=this.flow_parseUnionType();this.inType=oldInType;return type};pp.flow_parseTypeAnnotation=function(){var node=this.startNode();var oldInType=this.inType;this.inType=true;this.expect(tt.colon);node.typeAnnotation=this.flow_parseType();this.inType=oldInType;return this.finishNode(node,"TypeAnnotation")};pp.flow_parseTypeAnnotatableIdentifier=function(requireTypeAnnotation,canBeOptionalParam){var node=this.startNode();var ident=this.parseIdent();var isOptionalParam=false;if(canBeOptionalParam&&this.eat(tt.question)){this.expect(tt.question);isOptionalParam=true}if(requireTypeAnnotation||this.type===tt.colon){ident.typeAnnotation=this.flow_parseTypeAnnotation();this.finishNode(ident,ident.type)}if(isOptionalParam){ident.optional=true;this.finishNode(ident,ident.type)}return ident};acorn.plugins.flow=function(instance){instance.extend("parseFunctionBody",function(inner){return function(node,allowExpression){if(this.type===tt.colon){node.returnType=this.flow_parseTypeAnnotation()}return inner.call(this,node,allowExpression)}});instance.extend("parseStatement",function(inner){return function(declaration,topLevel){if(this.strict&&this.type===tt.name&&this.value==="interface"){var node=this.startNode();this.next();return this.flow_parseInterface(node)}else{return inner.call(this,declaration,topLevel)}}});instance.extend("parseExpressionStatement",function(inner){return function(node,expr){if(expr.type==="Identifier"){if(expr.name==="declare"){if(this.type===tt._class||this.type===tt.name||this.type===tt._function||this.type===tt._var){return this.flow_parseDeclare(node)}}else if(this.type===tt.name){if(expr.name==="interface"){return this.flow_parseInterface(node); -}else if(expr.name==="type"){return this.flow_parseTypeAlias(node)}}}return inner.call(this,node,expr)}});instance.extend("shouldParseExportDeclaration",function(inner){return function(){return this.isContextual("type")||inner.call(this)}});instance.extend("parseParenItem",function(inner){return function(node,start){if(this.type===tt.colon){var typeCastNode=this.startNodeAt(start);typeCastNode.expression=node;typeCastNode.typeAnnotation=this.flow_parseTypeAnnotation();return this.finishNode(typeCastNode,"TypeCastExpression")}else{return node}}});instance.extend("parseClassId",function(inner){return function(node,isStatement){inner.call(this,node,isStatement);if(this.isRelational("<")){node.typeParameters=this.flow_parseTypeParameterDeclaration()}}});instance.extend("readToken",function(inner){return function(code){if(this.inType&&(code===62||code===60)){return this.finishOp(tt.relational,1)}else{return inner.call(this,code)}}});instance.extend("jsx_readToken",function(inner){return function(){if(!this.inType)return inner.call(this)}});instance.extend("parseParenArrowList",function(inner){return function(start,exprList,isAsync){for(var i=0;i=6)return;var key=prop.key,name=undefined;switch(key.type){case"Identifier":name=key.name;break;case"Literal":name=String(key.value);break;default:return}var kind=prop.kind||"init",other=undefined;if((0,_util.has)(propHash,name)){other=propHash[name];var isGetSet=kind!=="init";if((this.strict||isGetSet)&&other[kind]||!(isGetSet^other.init))this.raise(key.start,"Redefinition of property")}else{other=propHash[name]={init:false,get:false,set:false}}other[kind]=true};pp.parseExpression=function(noIn,refShorthandDefaultPos){var start=this.markPosition();var expr=this.parseMaybeAssign(noIn,refShorthandDefaultPos);if(this.type===_tokentype.types.comma){var node=this.startNodeAt(start);node.expressions=[expr];while(this.eat(_tokentype.types.comma))node.expressions.push(this.parseMaybeAssign(noIn,refShorthandDefaultPos));return this.finishNode(node,"SequenceExpression")}return expr};pp.parseMaybeAssign=function(noIn,refShorthandDefaultPos,afterLeftParse){if(this.type==_tokentype.types._yield&&this.inGenerator)return this.parseYield();var failOnShorthandAssign=undefined;if(!refShorthandDefaultPos){refShorthandDefaultPos={start:0};failOnShorthandAssign=true}else{failOnShorthandAssign=false}var start=this.markPosition();if(this.type==_tokentype.types.parenL||this.type==_tokentype.types.name)this.potentialArrowAt=this.start;var left=this.parseMaybeConditional(noIn,refShorthandDefaultPos);if(afterLeftParse)left=afterLeftParse.call(this,left,start);if(this.type.isAssign){var node=this.startNodeAt(start);node.operator=this.value;node.left=this.type===_tokentype.types.eq?this.toAssignable(left):left;refShorthandDefaultPos.start=0;this.checkLVal(left);if(left.parenthesizedExpression){var errorMsg=undefined;if(left.type==="ObjectPattern"){errorMsg="`({a}) = 0` use `({a} = 0)`"}else if(left.type==="ArrayPattern"){errorMsg="`([a]) = 0` use `([a] = 0)`"}if(errorMsg){this.raise(left.start,"You're trying to assign to a parenthesized expression, eg. instead of "+errorMsg)}}this.next();node.right=this.parseMaybeAssign(noIn);return this.finishNode(node,"AssignmentExpression")}else if(failOnShorthandAssign&&refShorthandDefaultPos.start){this.unexpected(refShorthandDefaultPos.start)}return left};pp.parseMaybeConditional=function(noIn,refShorthandDefaultPos){var start=this.markPosition();var expr=this.parseExprOps(noIn,refShorthandDefaultPos);if(refShorthandDefaultPos&&refShorthandDefaultPos.start)return expr;if(this.eat(_tokentype.types.question)){var node=this.startNodeAt(start);node.test=expr;node.consequent=this.parseMaybeAssign();this.expect(_tokentype.types.colon);node.alternate=this.parseMaybeAssign(noIn);return this.finishNode(node,"ConditionalExpression")}return expr};pp.parseExprOps=function(noIn,refShorthandDefaultPos){var start=this.markPosition();var expr=this.parseMaybeUnary(refShorthandDefaultPos);if(refShorthandDefaultPos&&refShorthandDefaultPos.start)return expr;return this.parseExprOp(expr,start,-1,noIn)};pp.parseExprOp=function(left,leftStart,minPrec,noIn){var prec=this.type.binop;if(prec!=null&&(!noIn||this.type!==_tokentype.types._in)){if(prec>minPrec){var node=this.startNodeAt(leftStart);node.left=left;node.operator=this.value;var op=this.type;this.next();var _start=this.markPosition();node.right=this.parseExprOp(this.parseMaybeUnary(),_start,op.rightAssociative?prec-1:prec,noIn);this.finishNode(node,op===_tokentype.types.logicalOR||op===_tokentype.types.logicalAND?"LogicalExpression":"BinaryExpression");return this.parseExprOp(node,leftStart,minPrec,noIn)}}return left};pp.parseMaybeUnary=function(refShorthandDefaultPos){if(this.type.prefix){var node=this.startNode(),update=this.type===_tokentype.types.incDec;node.operator=this.value;node.prefix=true;this.next();node.argument=this.parseMaybeUnary();if(refShorthandDefaultPos&&refShorthandDefaultPos.start)this.unexpected(refShorthandDefaultPos.start);if(update)this.checkLVal(node.argument);else if(this.strict&&node.operator==="delete"&&node.argument.type==="Identifier")this.raise(node.start,"Deleting local variable in strict mode");return this.finishNode(node,update?"UpdateExpression":"UnaryExpression")}var start=this.markPosition();var expr=this.parseExprSubscripts(refShorthandDefaultPos);if(refShorthandDefaultPos&&refShorthandDefaultPos.start)return expr;while(this.type.postfix&&!this.canInsertSemicolon()){var node=this.startNodeAt(start);node.operator=this.value;node.prefix=false;node.argument=expr;this.checkLVal(expr);this.next();expr=this.finishNode(node,"UpdateExpression")}return expr};pp.parseExprSubscripts=function(refShorthandDefaultPos){var start=this.markPosition();var expr=this.parseExprAtom(refShorthandDefaultPos);if(refShorthandDefaultPos&&refShorthandDefaultPos.start)return expr;return this.parseSubscripts(expr,start)};pp.parseSubscripts=function(base,start,noCalls){if(!noCalls&&this.eat(_tokentype.types.doubleColon)){var node=this.startNodeAt(start);node.object=base;node.callee=this.parseNoCallExpr();return this.parseSubscripts(this.finishNode(node,"BindExpression"),start,noCalls)}else if(this.eat(_tokentype.types.dot)){var node=this.startNodeAt(start);node.object=base;node.property=this.parseIdent(true);node.computed=false;return this.parseSubscripts(this.finishNode(node,"MemberExpression"),start,noCalls)}else if(this.eat(_tokentype.types.bracketL)){var node=this.startNodeAt(start);node.object=base;node.property=this.parseExpression();node.computed=true;this.expect(_tokentype.types.bracketR);return this.parseSubscripts(this.finishNode(node,"MemberExpression"),start,noCalls)}else if(!noCalls&&this.eat(_tokentype.types.parenL)){var node=this.startNodeAt(start);node.callee=base;node.arguments=this.parseExprList(_tokentype.types.parenR,this.options.features["es7.trailingFunctionCommas"]);return this.parseSubscripts(this.finishNode(node,"CallExpression"),start,noCalls)}else if(this.type===_tokentype.types.backQuote){var node=this.startNodeAt(start);node.tag=base;node.quasi=this.parseTemplate();return this.parseSubscripts(this.finishNode(node,"TaggedTemplateExpression"),start,noCalls)}return base};pp.parseNoCallExpr=function(){var start=this.markPosition();return this.parseSubscripts(this.parseExprAtom(),start,true)};pp.parseExprAtom=function(refShorthandDefaultPos){var node=undefined,canBeArrow=this.potentialArrowAt==this.start;switch(this.type){case _tokentype.types._this:case _tokentype.types._super:var type=this.type===_tokentype.types._this?"ThisExpression":"Super";node=this.startNode();this.next();return this.finishNode(node,type);case _tokentype.types._yield:if(this.inGenerator)this.unexpected();case _tokentype.types._do:if(this.options.features["es7.doExpressions"]){var _node=this.startNode();this.next();var oldInFunction=this.inFunction;var oldLabels=this.labels;this.labels=[];this.inFunction=false;_node.body=this.parseBlock();this.inFunction=oldInFunction;this.labels=oldLabels;return this.finishNode(_node,"DoExpression")}case _tokentype.types.name:var start=this.markPosition();node=this.startNode();var id=this.parseIdent(this.type!==_tokentype.types.name);if(this.options.features["es7.asyncFunctions"]){if(id.name==="async"&&!this.canInsertSemicolon()){if(this.type===_tokentype.types.parenL){var expr=this.parseParenAndDistinguishExpression(start,true,true);if(expr&&expr.type==="ArrowFunctionExpression"){return expr}else{node.callee=id;if(!expr){node.arguments=[]}else if(expr.type==="SequenceExpression"){node.arguments=expr.expressions}else{node.arguments=[expr]}return this.parseSubscripts(this.finishNode(node,"CallExpression"),start)}}else if(this.type===_tokentype.types.name){id=this.parseIdent();this.expect(_tokentype.types.arrow);return this.parseArrowExpression(node,[id],true)}if(this.type===_tokentype.types._function&&!this.canInsertSemicolon()){this.next();return this.parseFunction(node,false,false,true)}}else if(id.name==="await"){if(this.inAsync)return this.parseAwait(node)}}if(canBeArrow&&!this.canInsertSemicolon()&&this.eat(_tokentype.types.arrow))return this.parseArrowExpression(this.startNodeAt(start),[id]);return id;case _tokentype.types.regexp:var value=this.value;node=this.parseLiteral(value.value);node.regex={pattern:value.pattern,flags:value.flags};return node;case _tokentype.types.num:case _tokentype.types.string:return this.parseLiteral(this.value);case _tokentype.types._null:case _tokentype.types._true:case _tokentype.types._false:node=this.startNode();node.value=this.type===_tokentype.types._null?null:this.type===_tokentype.types._true;node.raw=this.type.keyword;this.next();return this.finishNode(node,"Literal");case _tokentype.types.parenL:return this.parseParenAndDistinguishExpression(null,null,canBeArrow);case _tokentype.types.bracketL:node=this.startNode();this.next();if((this.options.ecmaVersion>=7||this.options.features["es7.comprehensions"])&&this.type===_tokentype.types._for){return this.parseComprehension(node,false)}node.elements=this.parseExprList(_tokentype.types.bracketR,true,true,refShorthandDefaultPos);return this.finishNode(node,"ArrayExpression");case _tokentype.types.braceL:return this.parseObj(false,refShorthandDefaultPos);case _tokentype.types._function:node=this.startNode();this.next();return this.parseFunction(node,false);case _tokentype.types.at:this.parseDecorators();case _tokentype.types._class:node=this.startNode();this.takeDecorators(node);return this.parseClass(node,false);case _tokentype.types._new:return this.parseNew();case _tokentype.types.backQuote:return this.parseTemplate();case _tokentype.types.doubleColon:node=this.startNode();this.next();node.object=null;var callee=node.callee=this.parseNoCallExpr();if(callee.type!=="MemberExpression")this.raise(callee.start,"Binding should be performed on object property.");return this.finishNode(node,"BindExpression");default:this.unexpected()}};pp.parseLiteral=function(value){var node=this.startNode();node.value=value;node.raw=this.input.slice(this.start,this.end);this.next();return this.finishNode(node,"Literal")};pp.parseParenExpression=function(){this.expect(_tokentype.types.parenL);var val=this.parseExpression();this.expect(_tokentype.types.parenR);return val};pp.parseParenAndDistinguishExpression=function(start,isAsync,canBeArrow){start=start||this.markPosition();var val=undefined;if(this.options.ecmaVersion>=6){this.next();if((this.options.features["es7.comprehensions"]||this.options.ecmaVersion>=7)&&this.type===_tokentype.types._for){return this.parseComprehension(this.startNodeAt(start),true)}var innerStart=this.markPosition(),exprList=[],first=true;var refShorthandDefaultPos={start:0},spreadStart=undefined,innerParenStart=undefined;while(this.type!==_tokentype.types.parenR){first?first=false:this.expect(_tokentype.types.comma);if(this.type===_tokentype.types.ellipsis){var spreadNodeStart=this.markPosition();spreadStart=this.start;exprList.push(this.parseParenItem(this.parseRest(),spreadNodeStart));break}else{if(this.type===_tokentype.types.parenL&&!innerParenStart){innerParenStart=this.start}exprList.push(this.parseMaybeAssign(false,refShorthandDefaultPos,this.parseParenItem))}}var innerEnd=this.markPosition();this.expect(_tokentype.types.parenR);if(canBeArrow&&!this.canInsertSemicolon()&&this.eat(_tokentype.types.arrow)){if(innerParenStart)this.unexpected(innerParenStart);return this.parseParenArrowList(start,exprList,isAsync)}if(!exprList.length){if(isAsync){return}else{this.unexpected(this.lastTokStart)}}if(spreadStart)this.unexpected(spreadStart);if(refShorthandDefaultPos.start)this.unexpected(refShorthandDefaultPos.start);if(exprList.length>1){val=this.startNodeAt(innerStart);val.expressions=exprList;this.finishNodeAt(val,"SequenceExpression",innerEnd)}else{val=exprList[0]}}else{val=this.parseParenExpression()}if(this.options.preserveParens){var par=this.startNodeAt(start);par.expression=val;return this.finishNode(par,"ParenthesizedExpression")}else{val.parenthesizedExpression=true;return val}};pp.parseParenArrowList=function(start,exprList,isAsync){return this.parseArrowExpression(this.startNodeAt(start),exprList,isAsync)};pp.parseParenItem=function(node,start){return node};var empty=[];pp.parseNew=function(){var node=this.startNode();var meta=this.parseIdent(true);if(this.options.ecmaVersion>=6&&this.eat(_tokentype.types.dot)){node.meta=meta;node.property=this.parseIdent(true);if(node.property.name!=="target")this.raise(node.property.start,"The only valid meta property for new is new.target");return this.finishNode(node,"MetaProperty")}node.callee=this.parseNoCallExpr();if(this.eat(_tokentype.types.parenL))node.arguments=this.parseExprList(_tokentype.types.parenR,this.options.features["es7.trailingFunctionCommas"]);else node.arguments=empty;return this.finishNode(node,"NewExpression")};pp.parseTemplateElement=function(){var elem=this.startNode();elem.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value};this.next();elem.tail=this.type===_tokentype.types.backQuote;return this.finishNode(elem,"TemplateElement")};pp.parseTemplate=function(){var node=this.startNode();this.next();node.expressions=[];var curElt=this.parseTemplateElement();node.quasis=[curElt];while(!curElt.tail){this.expect(_tokentype.types.dollarBraceL);node.expressions.push(this.parseExpression());this.expect(_tokentype.types.braceR);node.quasis.push(curElt=this.parseTemplateElement())}this.next();return this.finishNode(node,"TemplateLiteral")};pp.parseObj=function(isPattern,refShorthandDefaultPos){var node=this.startNode(),first=true,propHash={};node.properties=[];var decorators=[];this.next();while(!this.eat(_tokentype.types.braceR)){if(!first){this.expect(_tokentype.types.comma);if(this.afterTrailingComma(_tokentype.types.braceR))break}else first=false;while(this.type===_tokentype.types.at){decorators.push(this.parseDecorator())}var prop=this.startNode(),isGenerator=false,isAsync=false,_start2=undefined;if(decorators.length){prop.decorators=decorators;decorators=[]}if(this.options.features["es7.objectRestSpread"]&&this.type===_tokentype.types.ellipsis){prop=this.parseSpread();prop.type="SpreadProperty";node.properties.push(prop);continue}if(this.options.ecmaVersion>=6){prop.method=false;prop.shorthand=false;if(isPattern||refShorthandDefaultPos)_start2=this.markPosition();if(!isPattern)isGenerator=this.eat(_tokentype.types.star)}if(this.options.features["es7.asyncFunctions"]&&this.isContextual("async")){if(isGenerator||isPattern)this.unexpected();var asyncId=this.parseIdent();if(this.type===_tokentype.types.colon||this.type===_tokentype.types.parenL){prop.key=asyncId}else{isAsync=true;this.parsePropertyName(prop)}}else{this.parsePropertyName(prop)}this.parseObjPropValue(prop,_start2,isGenerator,isAsync,isPattern,refShorthandDefaultPos);this.checkPropClash(prop,propHash);node.properties.push(this.finishNode(prop,"Property"))}if(decorators.length){this.raise(this.start,"You have trailing decorators with no property")}return this.finishNode(node,isPattern?"ObjectPattern":"ObjectExpression")};pp.parseObjPropValue=function(prop,start,isGenerator,isAsync,isPattern,refShorthandDefaultPos){if(this.eat(_tokentype.types.colon)){prop.value=isPattern?this.parseMaybeDefault():this.parseMaybeAssign(false,refShorthandDefaultPos);prop.kind="init"}else if(this.options.ecmaVersion>=6&&this.type===_tokentype.types.parenL){if(isPattern)this.unexpected();prop.kind="init";prop.method=true;prop.value=this.parseMethod(isGenerator,isAsync)}else if(this.options.ecmaVersion>=5&&!prop.computed&&prop.key.type==="Identifier"&&(prop.key.name==="get"||prop.key.name==="set")&&(this.type!=_tokentype.types.comma&&this.type!=_tokentype.types.braceR)){if(isGenerator||isAsync||isPattern)this.unexpected();prop.kind=prop.key.name;this.parsePropertyName(prop);prop.value=this.parseMethod(false)}else if(this.options.ecmaVersion>=6&&!prop.computed&&prop.key.type==="Identifier"){prop.kind="init";if(isPattern){if(this.isKeyword(prop.key.name)||this.strict&&(_identifier.reservedWords.strictBind(prop.key.name)||_identifier.reservedWords.strict(prop.key.name))||!this.options.allowReserved&&this.isReservedWord(prop.key.name))this.raise(prop.key.start,"Binding "+prop.key.name);prop.value=this.parseMaybeDefault(start,prop.key)}else if(this.type===_tokentype.types.eq&&refShorthandDefaultPos){if(!refShorthandDefaultPos.start)refShorthandDefaultPos.start=this.start;prop.value=this.parseMaybeDefault(start,prop.key)}else{prop.value=prop.key}prop.shorthand=true}else this.unexpected()};pp.parsePropertyName=function(prop){if(this.options.ecmaVersion>=6){if(this.eat(_tokentype.types.bracketL)){prop.computed=true;prop.key=this.parseMaybeAssign();this.expect(_tokentype.types.bracketR);return}else{prop.computed=false}}prop.key=this.type===_tokentype.types.num||this.type===_tokentype.types.string?this.parseExprAtom():this.parseIdent(true)};pp.initFunction=function(node,isAsync){node.id=null;if(this.options.ecmaVersion>=6){node.generator=false;node.expression=false}if(this.options.features["es7.asyncFunctions"]){node.async=!!isAsync}};pp.parseMethod=function(isGenerator,isAsync){var node=this.startNode();this.initFunction(node,isAsync);this.expect(_tokentype.types.parenL);node.params=this.parseBindingList(_tokentype.types.parenR,false,this.options.features["es7.trailingFunctionCommas"]);if(this.options.ecmaVersion>=6){node.generator=isGenerator}this.parseFunctionBody(node);return this.finishNode(node,"FunctionExpression")};pp.parseArrowExpression=function(node,params,isAsync){this.initFunction(node,isAsync);node.params=this.toAssignableList(params,true);this.parseFunctionBody(node,true);return this.finishNode(node,"ArrowFunctionExpression")};pp.parseFunctionBody=function(node,allowExpression){var isExpression=allowExpression&&this.type!==_tokentype.types.braceL;var oldInAsync=this.inAsync;this.inAsync=node.async;if(isExpression){node.body=this.parseMaybeAssign();node.expression=true}else{var oldInFunc=this.inFunction,oldInGen=this.inGenerator,oldLabels=this.labels;this.inFunction=true;this.inGenerator=node.generator;this.labels=[];node.body=this.parseBlock(true);node.expression=false;this.inFunction=oldInFunc;this.inGenerator=oldInGen;this.labels=oldLabels}this.inAsync=oldInAsync;if(this.strict||!isExpression&&node.body.body.length&&this.isUseStrict(node.body.body[0])){var nameHash={},oldStrict=this.strict;this.strict=true;if(node.id)this.checkLVal(node.id,true);for(var i=0;i=6||this.input.slice(this.start,this.end).indexOf("\\")==-1)))this.raise(this.start,"The keyword '"+this.value+"' is reserved");node.name=this.value}else if(liberal&&this.type.keyword){node.name=this.type.keyword}else{this.unexpected()}this.next();return this.finishNode(node,"Identifier")};pp.parseAwait=function(node){if(this.eat(_tokentype.types.semi)||this.canInsertSemicolon()){this.unexpected()}node.all=this.eat(_tokentype.types.star);node.argument=this.parseMaybeUnary();return this.finishNode(node,"AwaitExpression")};pp.parseYield=function(){var node=this.startNode();this.next();if(this.type==_tokentype.types.semi||this.canInsertSemicolon()||this.type!=_tokentype.types.star&&!this.type.startsExpr){node.delegate=false;node.argument=null}else{node.delegate=this.eat(_tokentype.types.star);node.argument=this.parseMaybeAssign()}return this.finishNode(node,"YieldExpression")};pp.parseComprehension=function(node,isGenerator){node.blocks=[];while(this.type===_tokentype.types._for){var block=this.startNode();this.next();this.expect(_tokentype.types.parenL);block.left=this.parseBindingAtom();this.checkLVal(block.left,true);this.expectContextual("of");block.right=this.parseExpression();this.expect(_tokentype.types.parenR);node.blocks.push(this.finishNode(block,"ComprehensionBlock"))}node.filter=this.eat(_tokentype.types._if)?this.parseParenExpression():null;node.body=this.parseExpression();this.expect(isGenerator?_tokentype.types.parenR:_tokentype.types.bracketR);node.generator=isGenerator;return this.finishNode(node,"ComprehensionExpression")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/expression.js","/node_modules/babel-core/lib/acorn/src")},{"./identifier":413,"./state":421,"./tokentype":425,"./util":426,_process:1069,buffer:919}],413:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.isIdentifierStart=isIdentifierStart;exports.isIdentifierChar=isIdentifierChar;function makePredicate(words){words=words.split(" ");return function(str){return words.indexOf(str)>=0}}var reservedWords={3:makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"),5:makePredicate("class enum extends super const export import"),6:makePredicate("enum await"),strict:makePredicate("implements interface let package private protected public static yield"),strictBind:makePredicate("eval arguments")};exports.reservedWords=reservedWords;var ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var keywords={5:makePredicate(ecma5AndLessKeywords),6:makePredicate(ecma5AndLessKeywords+" let const class extends export import yield super")};exports.keywords=keywords;var nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var nonASCIIidentifierChars="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_";var nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]");var nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");nonASCIIidentifierStartChars=nonASCIIidentifierChars=null;var astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,99,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,98,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,955,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,38,17,2,24,133,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,32,4,287,47,21,1,2,0,185,46,82,47,21,0,60,42,502,63,32,0,449,56,1288,920,104,110,2962,1070,13266,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,16481,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,1340,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,16355,541];var astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,16,9,83,11,168,11,6,9,8,2,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,316,19,13,9,214,6,3,8,112,16,16,9,82,12,9,9,535,9,20855,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,4305,6,792618,239];function isInAstralSet(code,set){var pos=65536;for(var i=0;icode)return false;pos+=set[i+1];if(pos>=code)return true}}function isIdentifierStart(code,astral){if(code<65)return code===36;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;if(code<=65535)return code>=170&&nonASCIIidentifierStart.test(String.fromCharCode(code));if(astral===false)return false;return isInAstralSet(code,astralIdentifierStartCodes)}function isIdentifierChar(code,astral){if(code<48)return code===36;if(code<58)return true;if(code<65)return false;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;if(code<=65535)return code>=170&&nonASCIIidentifier.test(String.fromCharCode(code));if(astral===false)return false;return isInAstralSet(code,astralIdentifierStartCodes)||isInAstralSet(code,astralIdentifierCodes)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/identifier.js","/node_modules/babel-core/lib/acorn/src")},{_process:1069,buffer:919}],414:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.parse=parse;exports.parseExpressionAt=parseExpressionAt;exports.tokenizer=tokenizer;var _state=require("./state");var _options=require("./options");require("./parseutil");require("./statement");require("./lval");require("./expression");require("./lookahead");exports.Parser=_state.Parser;exports.plugins=_state.plugins; -exports.defaultOptions=_options.defaultOptions;var _location=require("./location");exports.SourceLocation=_location.SourceLocation;exports.getLineInfo=_location.getLineInfo;var _node=require("./node");exports.Node=_node.Node;var _tokentype=require("./tokentype");exports.TokenType=_tokentype.TokenType;exports.tokTypes=_tokentype.types;var _tokencontext=require("./tokencontext");exports.TokContext=_tokencontext.TokContext;exports.tokContexts=_tokencontext.types;var _identifier=require("./identifier");exports.isIdentifierChar=_identifier.isIdentifierChar;exports.isIdentifierStart=_identifier.isIdentifierStart;var _tokenize=require("./tokenize");exports.Token=_tokenize.Token;var _whitespace=require("./whitespace");exports.isNewLine=_whitespace.isNewLine;exports.lineBreak=_whitespace.lineBreak;exports.lineBreakG=_whitespace.lineBreakG;var version="1.0.0";exports.version=version;function parse(input,options){var p=parser(options,input);var startPos=p.options.locations?[p.pos,p.curPosition()]:p.pos;p.nextToken();return p.parseTopLevel(p.options.program||p.startNodeAt(startPos))}function parseExpressionAt(input,pos,options){var p=parser(options,input,pos);p.nextToken();return p.parseExpression()}function tokenizer(input,options){return parser(options,input)}function parser(options,input){return new _state.Parser((0,_options.getOptions)(options),String(input))}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/index.js","/node_modules/babel-core/lib/acorn/src")},{"./expression":412,"./identifier":413,"./location":415,"./lookahead":416,"./lval":417,"./node":418,"./options":419,"./parseutil":420,"./state":421,"./statement":422,"./tokencontext":423,"./tokenize":424,"./tokentype":425,"./whitespace":427,_process:1069,buffer:919}],415:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.getLineInfo=getLineInfo;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _state=require("./state");var _whitespace=require("./whitespace");var Position=function(){function Position(line,col){_classCallCheck(this,Position);this.line=line;this.column=col}Position.prototype.offset=function offset(n){return new Position(this.line,this.column+n)};return Position}();exports.Position=Position;var SourceLocation=function SourceLocation(p,start,end){_classCallCheck(this,SourceLocation);this.start=start;this.end=end;if(p.sourceFile!==null)this.source=p.sourceFile};exports.SourceLocation=SourceLocation;function getLineInfo(input,offset){for(var line=1,cur=0;;){_whitespace.lineBreakG.lastIndex=cur;var match=_whitespace.lineBreakG.exec(input);if(match&&match.index=6&&node){switch(node.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":node.type="ObjectPattern";for(var i=0;i=6){node.sourceType=this.options.sourceType}return this.finishNode(node,"Program")};var loopLabel={kind:"loop"},switchLabel={kind:"switch"};pp.parseStatement=function(declaration,topLevel){if(this.type===_tokentype.types.at){this.parseDecorators(true)}var starttype=this.type,node=this.startNode();switch(starttype){case _tokentype.types._break:case _tokentype.types._continue:return this.parseBreakContinueStatement(node,starttype.keyword);case _tokentype.types._debugger:return this.parseDebuggerStatement(node);case _tokentype.types._do:return this.parseDoStatement(node);case _tokentype.types._for:return this.parseForStatement(node);case _tokentype.types._function:if(!declaration&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(node);case _tokentype.types._class:if(!declaration)this.unexpected();this.takeDecorators(node);return this.parseClass(node,true);case _tokentype.types._if:return this.parseIfStatement(node);case _tokentype.types._return:return this.parseReturnStatement(node);case _tokentype.types._switch:return this.parseSwitchStatement(node);case _tokentype.types._throw:return this.parseThrowStatement(node);case _tokentype.types._try:return this.parseTryStatement(node);case _tokentype.types._let:case _tokentype.types._const:if(!declaration)this.unexpected();case _tokentype.types._var:return this.parseVarStatement(node,starttype);case _tokentype.types._while:return this.parseWhileStatement(node);case _tokentype.types._with:return this.parseWithStatement(node);case _tokentype.types.braceL:return this.parseBlock();case _tokentype.types.semi:return this.parseEmptyStatement(node);case _tokentype.types._export:case _tokentype.types._import:if(!this.options.allowImportExportEverywhere){if(!topLevel)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return starttype===_tokentype.types._import?this.parseImport(node):this.parseExport(node);case _tokentype.types.name:if(this.options.features["es7.asyncFunctions"]&&this.value==="async"){var lookahead=this.lookahead();if(lookahead.type===_tokentype.types._function&&!this.canInsertSemicolon.call(lookahead)){this.next();this.expect(_tokentype.types._function);return this.parseFunction(node,true,false,true)}}default:var maybeName=this.value,expr=this.parseExpression();if(starttype===_tokentype.types.name&&expr.type==="Identifier"&&this.eat(_tokentype.types.colon))return this.parseLabeledStatement(node,maybeName,expr);else return this.parseExpressionStatement(node,expr)}};pp.takeDecorators=function(node){if(this.decorators.length){node.decorators=this.decorators;this.decorators=[]}};pp.parseDecorators=function(allowExport){while(this.type===_tokentype.types.at){this.decorators.push(this.parseDecorator())}if(allowExport&&this.type===_tokentype.types._export){return}if(this.type!==_tokentype.types._class){this.raise(this.start,"Leading decorators must be attached to a class declaration")}};pp.parseDecorator=function(allowExport){if(!this.options.features["es7.decorators"]){this.unexpected()}var node=this.startNode();this.next();node.expression=this.parseMaybeAssign();return this.finishNode(node,"Decorator")};pp.parseBreakContinueStatement=function(node,keyword){var isBreak=keyword=="break";this.next();if(this.eat(_tokentype.types.semi)||this.insertSemicolon())node.label=null;else if(this.type!==_tokentype.types.name)this.unexpected();else{node.label=this.parseIdent();this.semicolon()}for(var i=0;i=6)this.eat(_tokentype.types.semi);else this.semicolon();return this.finishNode(node,"DoWhileStatement")};pp.parseForStatement=function(node){this.next();this.labels.push(loopLabel);this.expect(_tokentype.types.parenL);if(this.type===_tokentype.types.semi)return this.parseFor(node,null);if(this.type===_tokentype.types._var||this.type===_tokentype.types._let||this.type===_tokentype.types._const){var _init=this.startNode(),varKind=this.type;this.next();this.parseVar(_init,true,varKind);this.finishNode(_init,"VariableDeclaration");if((this.type===_tokentype.types._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&_init.declarations.length===1&&!(varKind!==_tokentype.types._var&&_init.declarations[0].init))return this.parseForIn(node,_init);return this.parseFor(node,_init)}var refShorthandDefaultPos={start:0};var init=this.parseExpression(true,refShorthandDefaultPos);if(this.type===_tokentype.types._in||this.options.ecmaVersion>=6&&this.isContextual("of")){this.toAssignable(init);this.checkLVal(init);return this.parseForIn(node,init)}else if(refShorthandDefaultPos.start){this.unexpected(refShorthandDefaultPos.start)}return this.parseFor(node,init)};pp.parseFunctionStatement=function(node){this.next();return this.parseFunction(node,true)};pp.parseIfStatement=function(node){this.next();node.test=this.parseParenExpression();node.consequent=this.parseStatement(false);node.alternate=this.eat(_tokentype.types._else)?this.parseStatement(false):null;return this.finishNode(node,"IfStatement")};pp.parseReturnStatement=function(node){if(!this.inFunction&&!this.options.allowReturnOutsideFunction)this.raise(this.start,"'return' outside of function");this.next();if(this.eat(_tokentype.types.semi)||this.insertSemicolon())node.argument=null;else{node.argument=this.parseExpression();this.semicolon()}return this.finishNode(node,"ReturnStatement")};pp.parseSwitchStatement=function(node){this.next();node.discriminant=this.parseParenExpression();node.cases=[];this.expect(_tokentype.types.braceL);this.labels.push(switchLabel);for(var cur,sawDefault;this.type!=_tokentype.types.braceR;){if(this.type===_tokentype.types._case||this.type===_tokentype.types._default){var isCase=this.type===_tokentype.types._case;if(cur)this.finishNode(cur,"SwitchCase");node.cases.push(cur=this.startNode());cur.consequent=[];this.next();if(isCase){cur.test=this.parseExpression()}else{if(sawDefault)this.raise(this.lastTokStart,"Multiple default clauses");sawDefault=true;cur.test=null}this.expect(_tokentype.types.colon)}else{if(!cur)this.unexpected();cur.consequent.push(this.parseStatement(true))}}if(cur)this.finishNode(cur,"SwitchCase");this.next();this.labels.pop();return this.finishNode(node,"SwitchStatement")};pp.parseThrowStatement=function(node){this.next();if(_whitespace.lineBreak.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");node.argument=this.parseExpression();this.semicolon();return this.finishNode(node,"ThrowStatement")};var empty=[];pp.parseTryStatement=function(node){this.next();node.block=this.parseBlock();node.handler=null;if(this.type===_tokentype.types._catch){var clause=this.startNode();this.next();this.expect(_tokentype.types.parenL);clause.param=this.parseBindingAtom();this.checkLVal(clause.param,true);this.expect(_tokentype.types.parenR);clause.guard=null;clause.body=this.parseBlock();node.handler=this.finishNode(clause,"CatchClause")}node.guardedHandlers=empty;node.finalizer=this.eat(_tokentype.types._finally)?this.parseBlock():null;if(!node.handler&&!node.finalizer)this.raise(node.start,"Missing catch or finally clause");return this.finishNode(node,"TryStatement")};pp.parseVarStatement=function(node,kind){this.next();this.parseVar(node,false,kind);this.semicolon();return this.finishNode(node,"VariableDeclaration")};pp.parseWhileStatement=function(node){this.next();node.test=this.parseParenExpression();this.labels.push(loopLabel);node.body=this.parseStatement(false);this.labels.pop();return this.finishNode(node,"WhileStatement")};pp.parseWithStatement=function(node){if(this.strict)this.raise(this.start,"'with' in strict mode");this.next();node.object=this.parseParenExpression();node.body=this.parseStatement(false);return this.finishNode(node,"WithStatement")};pp.parseEmptyStatement=function(node){this.next();return this.finishNode(node,"EmptyStatement")};pp.parseLabeledStatement=function(node,maybeName,expr){for(var i=0;i=6&&this.isContextual("of"))){this.unexpected()}else if(decl.id.type!="Identifier"&&!(isFor&&(this.type===_tokentype.types._in||this.isContextual("of")))){this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value")}else{decl.init=null}node.declarations.push(this.finishNode(decl,"VariableDeclarator"));if(!this.eat(_tokentype.types.comma))break}return node};pp.parseVarHead=function(decl){decl.id=this.parseBindingAtom();this.checkLVal(decl.id,true)};pp.parseFunction=function(node,isStatement,allowExpressionBody,isAsync){this.initFunction(node,isAsync);if(this.options.ecmaVersion>=6)node.generator=this.eat(_tokentype.types.star);if(isStatement||this.type===_tokentype.types.name)node.id=this.parseIdent();this.parseFunctionParams(node);this.parseFunctionBody(node,allowExpressionBody);return this.finishNode(node,isStatement?"FunctionDeclaration":"FunctionExpression")};pp.parseFunctionParams=function(node){this.expect(_tokentype.types.parenL);node.params=this.parseBindingList(_tokentype.types.parenR,false,this.options.features["es7.trailingFunctionCommas"])};pp.parseClass=function(node,isStatement){this.next();this.parseClassId(node,isStatement);this.parseClassSuper(node);var classBody=this.startNode();classBody.body=[];this.expect(_tokentype.types.braceL);var decorators=[];while(!this.eat(_tokentype.types.braceR)){if(this.eat(_tokentype.types.semi))continue;if(this.type===_tokentype.types.at){decorators.push(this.parseDecorator());continue}var method=this.startNode();if(decorators.length){method.decorators=decorators;decorators=[]}var isGenerator=this.eat(_tokentype.types.star),isAsync=false;this.parsePropertyName(method);if(this.type!==_tokentype.types.parenL&&!method.computed&&method.key.type==="Identifier"&&method.key.name==="static"){if(isGenerator)this.unexpected();method["static"]=true;isGenerator=this.eat(_tokentype.types.star);this.parsePropertyName(method)}else{method["static"]=false}if(!isGenerator&&method.key.type==="Identifier"&&!method.computed&&this.isClassProperty()){classBody.body.push(this.parseClassProperty(method));continue}if(this.options.features["es7.asyncFunctions"]&&this.type!==_tokentype.types.parenL&&!method.computed&&method.key.type==="Identifier"&&method.key.name==="async"){isAsync=true;this.parsePropertyName(method)}method.kind="method";if(!method.computed&&!isGenerator&&!isAsync){if(method.key.type==="Identifier"){if(this.type!==_tokentype.types.parenL&&(method.key.name==="get"||method.key.name==="set")){method.kind=method.key.name;this.parsePropertyName(method)}else if(!method["static"]&&method.key.name==="constructor"){method.kind="constructor"}}else if(!method["static"]&&method.key.type==="Literal"&&method.key.value==="constructor"){method.kind="constructor"}}if(method.kind==="constructor"&&method.decorators){this.raise(method.start,"You can't attach decorators to a class constructor")}this.parseClassMethod(classBody,method,isGenerator,isAsync)}if(decorators.length){this.raise(this.start,"You have trailing decorators with no method")}node.body=this.finishNode(classBody,"ClassBody"); -return this.finishNode(node,isStatement?"ClassDeclaration":"ClassExpression")};pp.isClassProperty=function(){return this.type===_tokentype.types.eq||(this.type===_tokentype.types.semi||this.canInsertSemicolon())};pp.parseClassProperty=function(node){if(this.type===_tokentype.types.eq){if(!this.options.features["es7.classProperties"])this.unexpected();this.next();node.value=this.parseMaybeAssign()}else{node.value=null}this.semicolon();return this.finishNode(node,"ClassProperty")};pp.parseClassMethod=function(classBody,method,isGenerator,isAsync){method.value=this.parseMethod(isGenerator,isAsync);classBody.body.push(this.finishNode(method,"MethodDefinition"))};pp.parseClassId=function(node,isStatement){node.id=this.type===_tokentype.types.name?this.parseIdent():isStatement?this.unexpected():null};pp.parseClassSuper=function(node){node.superClass=this.eat(_tokentype.types._extends)?this.parseExprSubscripts():null};pp.parseExport=function(node){this.next();if(this.type===_tokentype.types.star){var specifier=this.startNode();this.next();if(this.options.features["es7.exportExtensions"]&&this.eatContextual("as")){specifier.exported=this.parseIdent();node.specifiers=[this.finishNode(specifier,"ExportNamespaceSpecifier")];this.parseExportSpecifiersMaybe(node);this.parseExportFrom(node)}else{this.parseExportFrom(node);return this.finishNode(node,"ExportAllDeclaration")}}else if(this.options.features["es7.exportExtensions"]&&this.isExportDefaultSpecifier()){var specifier=this.startNode();specifier.exported=this.parseIdent(true);node.specifiers=[this.finishNode(specifier,"ExportDefaultSpecifier")];if(this.type===_tokentype.types.comma&&this.lookahead().type===_tokentype.types.star){this.expect(_tokentype.types.comma);var _specifier=this.startNode();this.expect(_tokentype.types.star);this.expectContextual("as");_specifier.exported=this.parseIdent();node.specifiers.push(this.finishNode(_specifier,"ExportNamespaceSpecifier"))}else{this.parseExportSpecifiersMaybe(node)}this.parseExportFrom(node)}else if(this.eat(_tokentype.types._default)){var _expr=this.parseMaybeAssign();var needsSemi=true;if(_expr.type=="FunctionExpression"||_expr.type=="ClassExpression"){needsSemi=false;if(_expr.id){_expr.type=_expr.type=="FunctionExpression"?"FunctionDeclaration":"ClassDeclaration"}}node.declaration=_expr;if(needsSemi)this.semicolon();this.checkExport(node);return this.finishNode(node,"ExportDefaultDeclaration")}else if(this.type.keyword||this.shouldParseExportDeclaration()){node.declaration=this.parseStatement(true);node.specifiers=[];node.source=null}else{node.declaration=null;node.specifiers=this.parseExportSpecifiers();if(this.eatContextual("from")){node.source=this.type===_tokentype.types.string?this.parseExprAtom():this.unexpected()}else{node.source=null}this.semicolon()}this.checkExport(node);return this.finishNode(node,"ExportNamedDeclaration")};pp.isExportDefaultSpecifier=function(){if(this.type===_tokentype.types.name){return this.value!=="type"&&this.value!=="async"}if(this.type!==_tokentype.types._default){return false}var lookahead=this.lookahead();return lookahead.type===_tokentype.types.comma||lookahead.type===_tokentype.types.name&&lookahead.value==="from"};pp.parseExportSpecifiersMaybe=function(node){if(this.eat(_tokentype.types.comma)){node.specifiers=node.specifiers.concat(this.parseExportSpecifiers())}};pp.parseExportFrom=function(node){this.expectContextual("from");node.source=this.type===_tokentype.types.string?this.parseExprAtom():this.unexpected();this.semicolon();this.checkExport(node)};pp.shouldParseExportDeclaration=function(){return this.options.features["es7.asyncFunctions"]&&this.isContextual("async")};pp.checkExport=function(node){if(this.decorators.length){var isClass=node.declaration&&(node.declaration.type==="ClassDeclaration"||node.declaration.type==="ClassExpression");if(!node.declaration||!isClass){this.raise(node.start,"You can only use decorators on an export when exporting a class")}this.takeDecorators(node.declaration)}};pp.parseExportSpecifiers=function(){var nodes=[],first=true;this.expect(_tokentype.types.braceL);while(!this.eat(_tokentype.types.braceR)){if(!first){this.expect(_tokentype.types.comma);if(this.afterTrailingComma(_tokentype.types.braceR))break}else first=false;var node=this.startNode();node.local=this.parseIdent(this.type===_tokentype.types._default);node.exported=this.eatContextual("as")?this.parseIdent(true):node.local;nodes.push(this.finishNode(node,"ExportSpecifier"))}return nodes};pp.parseImport=function(node){this.next();if(this.type===_tokentype.types.string){node.specifiers=empty;node.source=this.parseExprAtom()}else{node.specifiers=[];this.parseImportSpecifiers(node);this.expectContextual("from");node.source=this.type===_tokentype.types.string?this.parseExprAtom():this.unexpected()}this.semicolon();return this.finishNode(node,"ImportDeclaration")};pp.parseImportSpecifiers=function(node){var first=true;if(this.type===_tokentype.types.name){var start=this.markPosition();node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdent(),start));if(!this.eat(_tokentype.types.comma))return}if(this.type===_tokentype.types.star){var specifier=this.startNode();this.next();this.expectContextual("as");specifier.local=this.parseIdent();this.checkLVal(specifier.local,true);node.specifiers.push(this.finishNode(specifier,"ImportNamespaceSpecifier"));return}this.expect(_tokentype.types.braceL);while(!this.eat(_tokentype.types.braceR)){if(!first){this.expect(_tokentype.types.comma);if(this.afterTrailingComma(_tokentype.types.braceR))break}else first=false;var specifier=this.startNode();specifier.imported=this.parseIdent(true);specifier.local=this.eatContextual("as")?this.parseIdent():specifier.imported;this.checkLVal(specifier.local,true);node.specifiers.push(this.finishNode(specifier,"ImportSpecifier"))}};pp.parseImportSpecifierDefault=function(id,start){var node=this.startNodeAt(start);node.local=id;this.checkLVal(node.local,true);return this.finishNode(node,"ImportDefaultSpecifier")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/statement.js","/node_modules/babel-core/lib/acorn/src")},{"./state":421,"./tokentype":425,"./whitespace":427,_process:1069,buffer:919}],423:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _state=require("./state");var _tokentype=require("./tokentype");var _whitespace=require("./whitespace");var TokContext=function TokContext(token,isExpr,preserveSpace,override){_classCallCheck(this,TokContext);this.token=token;this.isExpr=isExpr;this.preserveSpace=preserveSpace;this.override=override};exports.TokContext=TokContext;var types={b_stat:new TokContext("{",false),b_expr:new TokContext("{",true),b_tmpl:new TokContext("${",true),p_stat:new TokContext("(",false),p_expr:new TokContext("(",true),q_tmpl:new TokContext("`",true,true,function(p){return p.readTmplToken()}),f_expr:new TokContext("function",true)};exports.types=types;var pp=_state.Parser.prototype;pp.initialContext=function(){return[types.b_stat]};pp.braceIsBlock=function(prevType){var parent=undefined;if(prevType===_tokentype.types.colon&&(parent=this.curContext()).token=="{")return!parent.isExpr;if(prevType===_tokentype.types._return)return _whitespace.lineBreak.test(this.input.slice(this.lastTokEnd,this.start));if(prevType===_tokentype.types._else||prevType===_tokentype.types.semi||prevType===_tokentype.types.eof)return true;if(prevType==_tokentype.types.braceL)return this.curContext()===types.b_stat;return!this.exprAllowed};pp.updateContext=function(prevType){var update=undefined,type=this.type;if(type.keyword&&prevType==_tokentype.types.dot)this.exprAllowed=false;else if(update=type.updateContext)update.call(this,prevType);else this.exprAllowed=type.beforeExpr};_tokentype.types.parenR.updateContext=_tokentype.types.braceR.updateContext=function(){if(this.context.length==1){this.exprAllowed=true;return}var out=this.context.pop();if(out===types.b_stat&&this.curContext()===types.f_expr){this.context.pop();this.exprAllowed=false}else if(out===types.b_tmpl){this.exprAllowed=true}else{this.exprAllowed=!out.isExpr}};_tokentype.types.braceL.updateContext=function(prevType){this.context.push(this.braceIsBlock(prevType)?types.b_stat:types.b_expr);this.exprAllowed=true};_tokentype.types.dollarBraceL.updateContext=function(){this.context.push(types.b_tmpl);this.exprAllowed=true};_tokentype.types.parenL.updateContext=function(prevType){var statementParens=prevType===_tokentype.types._if||prevType===_tokentype.types._for||prevType===_tokentype.types._with||prevType===_tokentype.types._while;this.context.push(statementParens?types.p_stat:types.p_expr);this.exprAllowed=true};_tokentype.types.incDec.updateContext=function(){};_tokentype.types._function.updateContext=function(){if(this.curContext()!==types.b_stat)this.context.push(types.f_expr);this.exprAllowed=false};_tokentype.types.backQuote.updateContext=function(){if(this.curContext()===types.q_tmpl)this.context.pop();else this.context.push(types.q_tmpl);this.exprAllowed=false}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/tokencontext.js","/node_modules/babel-core/lib/acorn/src")},{"./state":421,"./tokentype":425,"./whitespace":427,_process:1069,buffer:919}],424:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _identifier=require("./identifier");var _tokentype=require("./tokentype");var _state=require("./state");var _location=require("./location");var _whitespace=require("./whitespace");var Token=function Token(p){_classCallCheck(this,Token);this.type=p.type;this.value=p.value;this.start=p.start;this.end=p.end;if(p.options.locations)this.loc=new _location.SourceLocation(p,p.startLoc,p.endLoc);if(p.options.ranges)this.range=[p.start,p.end]};exports.Token=Token;var pp=_state.Parser.prototype;pp.next=function(){if(this.options.onToken&&!this.isLookahead)this.options.onToken(new Token(this));this.lastTokEnd=this.end;this.lastTokStart=this.start;this.lastTokEndLoc=this.endLoc;this.lastTokStartLoc=this.startLoc;this.nextToken()};pp.getToken=function(){this.next();return new Token(this)};if(typeof Symbol!=="undefined")pp[Symbol.iterator]=function(){var self=this;return{next:function next(){var token=self.getToken();return{done:token.type===_tokentype.types.eof,value:token}}}};pp.setStrict=function(strict){this.strict=strict;if(this.type!==_tokentype.types.num&&this.type!==_tokentype.types.string)return;this.pos=this.start;if(this.options.locations){while(this.pos=this.input.length)return this.finishToken(_tokentype.types.eof);if(curContext.override)return curContext.override(this);else this.readToken(this.fullCharCodeAtPos())};pp.readToken=function(code){if((0,_identifier.isIdentifierStart)(code,this.options.ecmaVersion>=6)||code===92)return this.readWord();return this.getTokenFromCode(code)};pp.fullCharCodeAtPos=function(){var code=this.input.charCodeAt(this.pos);if(code<=55295||code>=57344)return code;var next=this.input.charCodeAt(this.pos+1);return(code<<10)+next-56613888};pp.skipBlockComment=function(){var startLoc=this.options.onComment&&this.options.locations&&this.curPosition();var start=this.pos,end=this.input.indexOf("*/",this.pos+=2);if(end===-1)this.raise(this.pos-2,"Unterminated comment");this.pos=end+2;if(this.options.locations){_whitespace.lineBreakG.lastIndex=start;var match=undefined;while((match=_whitespace.lineBreakG.exec(this.input))&&match.index8&&ch<14){++this.pos}else if(ch===47){var _next2=this.input.charCodeAt(this.pos+1);if(_next2===42){this.skipBlockComment()}else if(_next2===47){this.skipLineComment(2)}else break}else if(ch===160){++this.pos}else if(ch>=5760&&_whitespace.nonASCIIwhitespace.test(String.fromCharCode(ch))){++this.pos}else{break}}};pp.finishToken=function(type,val){this.end=this.pos;if(this.options.locations)this.endLoc=this.curPosition();var prevType=this.type;this.type=type;this.value=val;this.updateContext(prevType)};pp.readToken_dot=function(){var next=this.input.charCodeAt(this.pos+1);if(next>=48&&next<=57)return this.readNumber(true);var next2=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&next===46&&next2===46){this.pos+=3;return this.finishToken(_tokentype.types.ellipsis)}else{++this.pos;return this.finishToken(_tokentype.types.dot)}};pp.readToken_slash=function(){var next=this.input.charCodeAt(this.pos+1);if(this.exprAllowed){++this.pos;return this.readRegexp()}if(next===61)return this.finishOp(_tokentype.types.assign,2);return this.finishOp(_tokentype.types.slash,1)};pp.readToken_mult_modulo=function(code){var type=code===42?_tokentype.types.star:_tokentype.types.modulo;var width=1;var next=this.input.charCodeAt(this.pos+1);if(next===42){width++;next=this.input.charCodeAt(this.pos+2);type=_tokentype.types.exponent}if(next===61){width++;type=_tokentype.types.assign}return this.finishOp(type,width)};pp.readToken_pipe_amp=function(code){var next=this.input.charCodeAt(this.pos+1);if(next===code)return this.finishOp(code===124?_tokentype.types.logicalOR:_tokentype.types.logicalAND,2);if(next===61)return this.finishOp(_tokentype.types.assign,2);return this.finishOp(code===124?_tokentype.types.bitwiseOR:_tokentype.types.bitwiseAND,1)};pp.readToken_caret=function(){var next=this.input.charCodeAt(this.pos+1);if(next===61)return this.finishOp(_tokentype.types.assign,2);return this.finishOp(_tokentype.types.bitwiseXOR,1)};pp.readToken_plus_min=function(code){var next=this.input.charCodeAt(this.pos+1);if(next===code){if(next==45&&this.input.charCodeAt(this.pos+2)==62&&_whitespace.lineBreak.test(this.input.slice(this.lastTokEnd,this.pos))){this.skipLineComment(3);this.skipSpace();return this.nextToken()}return this.finishOp(_tokentype.types.incDec,2)}if(next===61)return this.finishOp(_tokentype.types.assign,2);return this.finishOp(_tokentype.types.plusMin,1)};pp.readToken_lt_gt=function(code){var next=this.input.charCodeAt(this.pos+1);var size=1;if(next===code){size=code===62&&this.input.charCodeAt(this.pos+2)===62?3:2;if(this.input.charCodeAt(this.pos+size)===61)return this.finishOp(_tokentype.types.assign,size+1);return this.finishOp(_tokentype.types.bitShift,size)}if(next==33&&code==60&&this.input.charCodeAt(this.pos+2)==45&&this.input.charCodeAt(this.pos+3)==45){if(this.inModule)this.unexpected();this.skipLineComment(4);this.skipSpace();return this.nextToken()}if(next===61)size=this.input.charCodeAt(this.pos+2)===61?3:2;return this.finishOp(_tokentype.types.relational,size)};pp.readToken_eq_excl=function(code){var next=this.input.charCodeAt(this.pos+1);if(next===61)return this.finishOp(_tokentype.types.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(code===61&&next===62&&this.options.ecmaVersion>=6){this.pos+=2;return this.finishToken(_tokentype.types.arrow)}return this.finishOp(code===61?_tokentype.types.eq:_tokentype.types.prefix,1)};pp.getTokenFromCode=function(code){switch(code){case 46:return this.readToken_dot();case 40:++this.pos;return this.finishToken(_tokentype.types.parenL);case 41:++this.pos;return this.finishToken(_tokentype.types.parenR);case 59:++this.pos;return this.finishToken(_tokentype.types.semi);case 44:++this.pos;return this.finishToken(_tokentype.types.comma);case 91:++this.pos;return this.finishToken(_tokentype.types.bracketL);case 93:++this.pos;return this.finishToken(_tokentype.types.bracketR);case 123:++this.pos;return this.finishToken(_tokentype.types.braceL);case 125:++this.pos;return this.finishToken(_tokentype.types.braceR);case 58:if(this.options.features["es7.functionBind"]&&this.input.charCodeAt(this.pos+1)===58)return this.finishOp(_tokentype.types.doubleColon,2);++this.pos;return this.finishToken(_tokentype.types.colon);case 63:++this.pos;return this.finishToken(_tokentype.types.question);case 64:++this.pos;return this.finishToken(_tokentype.types.at);case 96:if(this.options.ecmaVersion<6)break;++this.pos;return this.finishToken(_tokentype.types.backQuote);case 48:var next=this.input.charCodeAt(this.pos+1);if(next===120||next===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(next===111||next===79)return this.readRadixNumber(8);if(next===98||next===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(code);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo(code);case 124:case 38:return this.readToken_pipe_amp(code);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(code);case 60:case 62:return this.readToken_lt_gt(code);case 61:case 33:return this.readToken_eq_excl(code);case 126:return this.finishOp(_tokentype.types.prefix,1)}this.raise(this.pos,"Unexpected character '"+codePointToString(code)+"'")};pp.finishOp=function(type,size){var str=this.input.slice(this.pos,this.pos+size);this.pos+=size;return this.finishToken(type,str)};var regexpUnicodeSupport=false;try{new RegExp("￿","u");regexpUnicodeSupport=true}catch(e){}pp.readRegexp=function(){var escaped=undefined,inClass=undefined,start=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(start,"Unterminated regular expression");var ch=this.input.charAt(this.pos);if(_whitespace.lineBreak.test(ch))this.raise(start,"Unterminated regular expression");if(!escaped){if(ch==="[")inClass=true;else if(ch==="]"&&inClass)inClass=false;else if(ch==="/"&&!inClass)break;escaped=ch==="\\"}else escaped=false;++this.pos}var content=this.input.slice(start,this.pos);++this.pos;var mods=this.readWord1();var tmp=content;if(mods){var validFlags=/^[gmsiy]*$/;if(this.options.ecmaVersion>=6)validFlags=/^[gmsiyu]*$/;if(!validFlags.test(mods))this.raise(start,"Invalid regular expression flag");if(mods.indexOf("u")>=0&&!regexpUnicodeSupport){tmp=tmp.replace(/\\u([a-fA-F0-9]{4})|\\u\{([0-9a-fA-F]+)\}|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}}try{new RegExp(tmp)}catch(e){if(e instanceof SyntaxError)this.raise(start,"Error parsing regular expression: "+e.message);this.raise(e)}var value=undefined;try{value=new RegExp(content,mods)}catch(err){value=null}return this.finishToken(_tokentype.types.regexp,{pattern:content,flags:mods,value:value})};pp.readInt=function(radix,len){var start=this.pos,total=0;for(var i=0,e=len==null?Infinity:len;i=97)val=code-97+10;else if(code>=65)val=code-65+10;else if(code>=48&&code<=57)val=code-48;else val=Infinity;if(val>=radix)break;++this.pos;total=total*radix+val}if(this.pos===start||len!=null&&this.pos-start!==len)return null;return total};pp.readRadixNumber=function(radix){this.pos+=2;var val=this.readInt(radix);if(val==null)this.raise(this.start+2,"Expected number in radix "+radix);if((0,_identifier.isIdentifierStart)(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(_tokentype.types.num,val)};pp.readNumber=function(startsWithDot){var start=this.pos,isFloat=false,octal=this.input.charCodeAt(this.pos)===48;if(!startsWithDot&&this.readInt(10)===null)this.raise(start,"Invalid number");if(this.input.charCodeAt(this.pos)===46){++this.pos;this.readInt(10);isFloat=true}var next=this.input.charCodeAt(this.pos);if(next===69||next===101){next=this.input.charCodeAt(++this.pos);if(next===43||next===45)++this.pos;if(this.readInt(10)===null)this.raise(start,"Invalid number");isFloat=true}if((0,_identifier.isIdentifierStart)(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var str=this.input.slice(start,this.pos),val=undefined;if(isFloat)val=parseFloat(str);else if(!octal||str.length===1)val=parseInt(str,10);else if(/[89]/.test(str)||this.strict)this.raise(start,"Invalid number");else val=parseInt(str,8);return this.finishToken(_tokentype.types.num,val)};pp.readCodePoint=function(){var ch=this.input.charCodeAt(this.pos),code=undefined;if(ch===123){if(this.options.ecmaVersion<6)this.unexpected();++this.pos;code=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos);++this.pos;if(code>1114111)this.unexpected()}else{code=this.readHexChar(4)}return code};function codePointToString(code){if(code<=65535)return String.fromCharCode(code);return String.fromCharCode((code-65536>>10)+55296,(code-65536&1023)+56320)}pp.readString=function(quote){var out="",chunkStart=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var ch=this.input.charCodeAt(this.pos);if(ch===quote)break;if(ch===92){out+=this.input.slice(chunkStart,this.pos);out+=this.readEscapedChar();chunkStart=this.pos}else{if((0,_whitespace.isNewLine)(ch))this.raise(this.start,"Unterminated string constant");++this.pos}}out+=this.input.slice(chunkStart,this.pos++);return this.finishToken(_tokentype.types.string,out)};pp.readTmplToken=function(){var out="",chunkStart=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var ch=this.input.charCodeAt(this.pos);if(ch===96||ch===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&this.type===_tokentype.types.template){if(ch===36){this.pos+=2;return this.finishToken(_tokentype.types.dollarBraceL)}else{++this.pos;return this.finishToken(_tokentype.types.backQuote)}}out+=this.input.slice(chunkStart,this.pos);return this.finishToken(_tokentype.types.template,out)}if(ch===92){out+=this.input.slice(chunkStart,this.pos);out+=this.readEscapedChar();chunkStart=this.pos}else if((0,_whitespace.isNewLine)(ch)){out+=this.input.slice(chunkStart,this.pos);++this.pos;switch(ch){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:out+="\n";break;default:out+=String.fromCharCode(ch);break}if(this.options.locations){++this.curLine;this.lineStart=this.pos}chunkStart=this.pos}else{++this.pos}}};pp.readEscapedChar=function(){var ch=this.input.charCodeAt(++this.pos);var octal=/^[0-7]+/.exec(this.input.slice(this.pos,this.pos+3));if(octal)octal=octal[0];while(octal&&parseInt(octal,8)>255)octal=octal.slice(0,-1);if(octal==="0")octal=null;++this.pos;if(octal){if(this.strict)this.raise(this.pos-2,"Octal literal in strict mode");this.pos+=octal.length-1;return String.fromCharCode(parseInt(octal,8))}else{switch(ch){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return" ";case 102:return"\f";case 48:return"\x00";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations){this.lineStart=this.pos;++this.curLine}return"";default:return String.fromCharCode(ch)}}};pp.readHexChar=function(len){var n=this.readInt(16,len);if(n===null)this.raise(this.start,"Bad character escape sequence");return n};var containsEsc;pp.readWord1=function(){containsEsc=false;var word="",first=true,chunkStart=this.pos;var astral=this.options.ecmaVersion>=6;while(this.pos=6||!containsEsc)&&this.isKeyword(word))type=_tokentype.keywords[word];return this.finishToken(type,word)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/tokenize.js","/node_modules/babel-core/lib/acorn/src")},{"./identifier":413,"./location":415,"./state":421,"./tokentype":425,"./whitespace":427,_process:1069,buffer:919}],425:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var TokenType=function TokenType(label){var conf=arguments[1]===undefined?{}:arguments[1];_classCallCheck(this,TokenType);this.label=label;this.keyword=conf.keyword;this.beforeExpr=!!conf.beforeExpr;this.startsExpr=!!conf.startsExpr;this.rightAssociative=!!conf.rightAssociative;this.isLoop=!!conf.isLoop;this.isAssign=!!conf.isAssign;this.prefix=!!conf.prefix;this.postfix=!!conf.postfix;this.binop=conf.binop||null;this.updateContext=null};exports.TokenType=TokenType;function binop(name,prec){return new TokenType(name,{beforeExpr:true,binop:prec})}var beforeExpr={beforeExpr:true},startsExpr={startsExpr:true};var types={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:true,startsExpr:true}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:true,startsExpr:true}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:true,startsExpr:true}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),doubleColon:new TokenType("::",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:true,startsExpr:true}),at:new TokenType("@"),eq:new TokenType("=",{beforeExpr:true,isAssign:true}),assign:new TokenType("_=",{beforeExpr:true,isAssign:true}),incDec:new TokenType("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new TokenType("prefix",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=",6),relational:binop("",7),bitShift:binop("<>",8),plusMin:new TokenType("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),exponent:new TokenType("**",{beforeExpr:true,binop:11,rightAssociative:true})};exports.types=types;var keywords={};exports.keywords=keywords;function kw(name){var options=arguments[1]===undefined?{}:arguments[1];options.keyword=name;keywords[name]=types["_"+name]=new TokenType(name,options)}kw("break");kw("case",beforeExpr);kw("catch");kw("continue");kw("debugger");kw("default");kw("do",{isLoop:true});kw("else",beforeExpr);kw("finally");kw("for",{isLoop:true});kw("function",startsExpr);kw("if");kw("return",beforeExpr);kw("switch");kw("throw",beforeExpr);kw("try");kw("var");kw("let");kw("const");kw("while",{isLoop:true});kw("with");kw("new",{beforeExpr:true,startsExpr:true});kw("this",startsExpr);kw("super",startsExpr);kw("class");kw("extends",beforeExpr);kw("export");kw("import");kw("yield",{beforeExpr:true,startsExpr:true});kw("null",startsExpr);kw("true",startsExpr);kw("false",startsExpr);kw("in",{beforeExpr:true,binop:7});kw("instanceof",{beforeExpr:true,binop:7});kw("typeof",{beforeExpr:true,prefix:true,startsExpr:true});kw("void",{beforeExpr:true,prefix:true,startsExpr:true});kw("delete",{beforeExpr:true,prefix:true,startsExpr:true})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/tokentype.js","/node_modules/babel-core/lib/acorn/src")},{_process:1069,buffer:919}],426:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.isArray=isArray;exports.has=has;function isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"}function has(obj,propName){return Object.prototype.hasOwnProperty.call(obj,propName)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/util.js","/node_modules/babel-core/lib/acorn/src")},{_process:1069,buffer:919}],427:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.isNewLine=isNewLine;var lineBreak=/\r\n?|\n|\u2028|\u2029/;exports.lineBreak=lineBreak;var lineBreakG=new RegExp(lineBreak.source,"g");exports.lineBreakG=lineBreakG;function isNewLine(code){return code===10||code===13||code===8232||code==8233}var nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;exports.nonASCIIwhitespace=nonASCIIwhitespace}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/acorn/src/whitespace.js","/node_modules/babel-core/lib/acorn/src"); -},{_process:1069,buffer:919}],428:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;require("../../polyfill");exports["default"]=function(){};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/api/register/browser.js","/node_modules/babel-core/lib/babel/api/register")},{"../../polyfill":457,_process:1069,buffer:919}],429:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequire(obj){return obj&&obj.__esModule?obj["default"]:obj}require("../../polyfill");var _node=require("./node");exports["default"]=_interopRequire(_node);module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/api/register/node-polyfill.js","/node_modules/babel-core/lib/babel/api/register")},{"../../polyfill":457,"./node":428,_process:1069,buffer:919}],430:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _repeating=require("repeating");var _repeating2=_interopRequireDefault(_repeating);var _trimRight=require("trim-right");var _trimRight2=_interopRequireDefault(_trimRight);var _lodashLangIsBoolean=require("lodash/lang/isBoolean");var _lodashLangIsBoolean2=_interopRequireDefault(_lodashLangIsBoolean);var _lodashCollectionIncludes=require("lodash/collection/includes");var _lodashCollectionIncludes2=_interopRequireDefault(_lodashCollectionIncludes);var _lodashLangIsNumber=require("lodash/lang/isNumber");var _lodashLangIsNumber2=_interopRequireDefault(_lodashLangIsNumber);var Buffer=function(){function Buffer(position,format){_classCallCheck(this,Buffer);this.position=position;this._indent=format.indent.base;this.format=format;this.buf=""}Buffer.prototype.get=function get(){return(0,_trimRight2["default"])(this.buf)};Buffer.prototype.getIndent=function getIndent(){if(this.format.compact||this.format.concise){return""}else{return(0,_repeating2["default"])(this.format.indent.style,this._indent)}};Buffer.prototype.indentSize=function indentSize(){return this.getIndent().length};Buffer.prototype.indent=function indent(){this._indent++};Buffer.prototype.dedent=function dedent(){this._indent--};Buffer.prototype.semicolon=function semicolon(){this.push(";")};Buffer.prototype.ensureSemicolon=function ensureSemicolon(){if(!this.isLast(";"))this.semicolon()};Buffer.prototype.rightBrace=function rightBrace(){this.newline(true);this.push("}")};Buffer.prototype.keyword=function keyword(name){this.push(name);this.space()};Buffer.prototype.space=function space(){if(this.format.compact)return;if(this.buf&&!this.isLast(" ")&&!this.isLast("\n")){this.push(" ")}};Buffer.prototype.removeLast=function removeLast(cha){if(this.format.compact)return;if(!this.isLast(cha))return;this.buf=this.buf.substr(0,this.buf.length-1);this.position.unshift(cha)};Buffer.prototype.newline=function newline(i,removeLast){if(this.format.compact||this.format.retainLines)return;if(this.format.concise){this.space();return}removeLast=removeLast||false;if((0,_lodashLangIsNumber2["default"])(i)){i=Math.min(2,i);if(this.endsWith("{\n")||this.endsWith(":\n"))i--;if(i<=0)return;while(i>0){this._newline(removeLast);i--}return}if((0,_lodashLangIsBoolean2["default"])(i)){removeLast=i}this._newline(removeLast)};Buffer.prototype._newline=function _newline(removeLast){if(this.endsWith("\n\n"))return;if(removeLast&&this.isLast("\n"))this.removeLast("\n");this.removeLast(" ");this._removeSpacesAfterLastNewline();this._push("\n")};Buffer.prototype._removeSpacesAfterLastNewline=function _removeSpacesAfterLastNewline(){var lastNewlineIndex=this.buf.lastIndexOf("\n");if(lastNewlineIndex===-1){return}var index=this.buf.length-1;while(index>lastNewlineIndex){if(this.buf[index]!==" "){break}index--}if(index===lastNewlineIndex){this.buf=this.buf.substring(0,index+1)}};Buffer.prototype.push=function push(str,noIndent){if(!this.format.compact&&this._indent&&!noIndent&&str!=="\n"){var indent=this.getIndent();str=str.replace(/\n/g,"\n"+indent);if(this.isLast("\n"))this._push(indent)}this._push(str)};Buffer.prototype._push=function _push(str){this.position.push(str);this.buf+=str};Buffer.prototype.endsWith=function endsWith(str){return this.buf.slice(-str.length)===str};Buffer.prototype.isLast=function isLast(cha){if(this.format.compact)return false;var buf=this.buf;var last=buf[buf.length-1];if(Array.isArray(cha)){return(0,_lodashCollectionIncludes2["default"])(cha,last)}else{return cha===last}};return Buffer}();exports["default"]=Buffer;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/buffer.js","/node_modules/babel-core/lib/babel/generation")},{_process:1069,buffer:919,"lodash/collection/includes":736,"lodash/lang/isBoolean":820,"lodash/lang/isNumber":824,repeating:894,"trim-right":912}],431:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.File=File;exports.Program=Program;exports.BlockStatement=BlockStatement;exports.Noop=Noop;function File(node,print){print.plain(node.program)}function Program(node,print){print.sequence(node.body)}function BlockStatement(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();print.sequence(node.body,{indent:true});if(!this.format.retainLines)this.removeLast("\n");this.rightBrace()}}function Noop(){}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/base.js","/node_modules/babel-core/lib/babel/generation/generators")},{_process:1069,buffer:919}],432:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ClassDeclaration=ClassDeclaration;exports.ClassBody=ClassBody;exports.ClassProperty=ClassProperty;exports.MethodDefinition=MethodDefinition;function ClassDeclaration(node,print){print.list(node.decorators);this.push("class");if(node.id){this.push(" ");print.plain(node.id)}print.plain(node.typeParameters);if(node.superClass){this.push(" extends ");print.plain(node.superClass);print.plain(node.superTypeParameters)}if(node["implements"]){this.push(" implements ");print.join(node["implements"],{separator:", "})}this.space();print.plain(node.body)}exports.ClassExpression=ClassDeclaration;function ClassBody(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();this.indent();print.sequence(node.body);this.dedent();this.rightBrace()}}function ClassProperty(node,print){print.list(node.decorators);if(node["static"])this.push("static ");print.plain(node.key);print.plain(node.typeAnnotation);if(node.value){this.space();this.push("=");this.space();print.plain(node.value)}this.semicolon()}function MethodDefinition(node,print){print.list(node.decorators);if(node["static"]){this.push("static ")}this._method(node,print)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/classes.js","/node_modules/babel-core/lib/babel/generation/generators")},{_process:1069,buffer:919}],433:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ComprehensionBlock=ComprehensionBlock;exports.ComprehensionExpression=ComprehensionExpression;function ComprehensionBlock(node,print){this.keyword("for");this.push("(");print.plain(node.left);this.push(" of ");print.plain(node.right);this.push(")")}function ComprehensionExpression(node,print){this.push(node.generator?"(":"[");print.join(node.blocks,{separator:" "});this.space();if(node.filter){this.keyword("if");this.push("(");print.plain(node.filter);this.push(")");this.space()}print.plain(node.body);this.push(node.generator?")":"]")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/comprehensions.js","/node_modules/babel-core/lib/babel/generation/generators")},{_process:1069,buffer:919}],434:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.UnaryExpression=UnaryExpression;exports.DoExpression=DoExpression;exports.UpdateExpression=UpdateExpression;exports.ConditionalExpression=ConditionalExpression;exports.NewExpression=NewExpression;exports.SequenceExpression=SequenceExpression;exports.ThisExpression=ThisExpression;exports.Super=Super;exports.Decorator=Decorator;exports.CallExpression=CallExpression;exports.EmptyStatement=EmptyStatement;exports.ExpressionStatement=ExpressionStatement;exports.AssignmentExpression=AssignmentExpression;exports.BindExpression=BindExpression;exports.MemberExpression=MemberExpression;exports.MetaProperty=MetaProperty;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _isInteger=require("is-integer");var _isInteger2=_interopRequireDefault(_isInteger);var _lodashLangIsNumber=require("lodash/lang/isNumber");var _lodashLangIsNumber2=_interopRequireDefault(_lodashLangIsNumber);var _types=require("../../types");var t=_interopRequireWildcard(_types);function UnaryExpression(node,print){var hasSpace=/[a-z]$/.test(node.operator);var arg=node.argument;if(t.isUpdateExpression(arg)||t.isUnaryExpression(arg)){hasSpace=true}if(t.isUnaryExpression(arg)&&arg.operator==="!"){hasSpace=false}this.push(node.operator);if(hasSpace)this.push(" ");print.plain(node.argument)}function DoExpression(node,print){this.push("do");this.space();print.plain(node.body)}function UpdateExpression(node,print){if(node.prefix){this.push(node.operator);print.plain(node.argument)}else{print.plain(node.argument);this.push(node.operator)}}function ConditionalExpression(node,print){print.plain(node.test);this.space();this.push("?");this.space();print.plain(node.consequent);this.space();this.push(":");this.space();print.plain(node.alternate)}function NewExpression(node,print){this.push("new ");print.plain(node.callee);this.push("(");print.list(node.arguments);this.push(")")}function SequenceExpression(node,print){print.list(node.expressions)}function ThisExpression(){this.push("this")}function Super(){this.push("super")}function Decorator(node,print){this.push("@");print.plain(node.expression)}function CallExpression(node,print){print.plain(node.callee);this.push("(");var separator=",";var isPrettyCall=node._prettyCall&&!this.format.retainLines;if(isPrettyCall){separator+="\n";this.newline();this.indent()}else{separator+=" "}print.list(node.arguments,{separator:separator});if(isPrettyCall){this.newline();this.dedent()}this.push(")")}var buildYieldAwait=function buildYieldAwait(keyword){return function(node,print){this.push(keyword);if(node.delegate||node.all){this.push("*")}if(node.argument){this.push(" ");print.plain(node.argument)}}};var YieldExpression=buildYieldAwait("yield");exports.YieldExpression=YieldExpression;var AwaitExpression=buildYieldAwait("await");exports.AwaitExpression=AwaitExpression;function EmptyStatement(){this.semicolon()}function ExpressionStatement(node,print){print.plain(node.expression);this.semicolon()}function AssignmentExpression(node,print){print.plain(node.left);this.push(" ");this.push(node.operator);this.push(" ");print.plain(node.right)}function BindExpression(node,print){print.plain(node.object);this.push("::");print.plain(node.callee)}exports.BinaryExpression=AssignmentExpression;exports.LogicalExpression=AssignmentExpression;exports.AssignmentPattern=AssignmentExpression;var SCIENTIFIC_NOTATION=/e/i;function MemberExpression(node,print){var obj=node.object;print.plain(obj);if(!node.computed&&t.isMemberExpression(node.property)){throw new TypeError("Got a MemberExpression for MemberExpression property")}var computed=node.computed;if(t.isLiteral(node.property)&&(0,_lodashLangIsNumber2["default"])(node.property.value)){computed=true}if(computed){this.push("[");print.plain(node.property);this.push("]")}else{if(t.isLiteral(obj)&&(0,_isInteger2["default"])(obj.value)&&!SCIENTIFIC_NOTATION.test(obj.value.toString())){this.push(".")}this.push(".");print.plain(node.property)}}function MetaProperty(node,print){print.plain(node.meta);this.push(".");print.plain(node.property)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/expressions.js","/node_modules/babel-core/lib/babel/generation/generators")},{"../../types":589,_process:1069,buffer:919,"is-integer":720,"lodash/lang/isNumber":824}],435:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.AnyTypeAnnotation=AnyTypeAnnotation;exports.ArrayTypeAnnotation=ArrayTypeAnnotation;exports.BooleanTypeAnnotation=BooleanTypeAnnotation;exports.DeclareClass=DeclareClass;exports.DeclareFunction=DeclareFunction;exports.DeclareModule=DeclareModule;exports.DeclareVariable=DeclareVariable;exports.FunctionTypeAnnotation=FunctionTypeAnnotation;exports.FunctionTypeParam=FunctionTypeParam;exports.InterfaceExtends=InterfaceExtends;exports._interfaceish=_interfaceish;exports.InterfaceDeclaration=InterfaceDeclaration;exports.IntersectionTypeAnnotation=IntersectionTypeAnnotation;exports.MixedTypeAnnotation=MixedTypeAnnotation;exports.NullableTypeAnnotation=NullableTypeAnnotation;exports.NumberTypeAnnotation=NumberTypeAnnotation;exports.StringLiteralTypeAnnotation=StringLiteralTypeAnnotation;exports.StringTypeAnnotation=StringTypeAnnotation;exports.TupleTypeAnnotation=TupleTypeAnnotation;exports.TypeofTypeAnnotation=TypeofTypeAnnotation;exports.TypeAlias=TypeAlias;exports.TypeAnnotation=TypeAnnotation;exports.TypeParameterInstantiation=TypeParameterInstantiation;exports.ObjectTypeAnnotation=ObjectTypeAnnotation;exports.ObjectTypeCallProperty=ObjectTypeCallProperty;exports.ObjectTypeIndexer=ObjectTypeIndexer;exports.ObjectTypeProperty=ObjectTypeProperty;exports.QualifiedTypeIdentifier=QualifiedTypeIdentifier;exports.UnionTypeAnnotation=UnionTypeAnnotation;exports.TypeCastExpression=TypeCastExpression;exports.VoidTypeAnnotation=VoidTypeAnnotation;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);function AnyTypeAnnotation(){this.push("any")}function ArrayTypeAnnotation(node,print){print.plain(node.elementType);this.push("[");this.push("]")}function BooleanTypeAnnotation(node){this.push("bool")}function DeclareClass(node,print){this.push("declare class ");this._interfaceish(node,print)}function DeclareFunction(node,print){this.push("declare function ");print.plain(node.id);print.plain(node.id.typeAnnotation.typeAnnotation);this.semicolon()}function DeclareModule(node,print){this.push("declare module ");print.plain(node.id);this.space();print.plain(node.body)}function DeclareVariable(node,print){this.push("declare var ");print.plain(node.id);print.plain(node.id.typeAnnotation);this.semicolon()}function FunctionTypeAnnotation(node,print,parent){print.plain(node.typeParameters);this.push("(");print.list(node.params);if(node.rest){if(node.params.length){this.push(",");this.space()}this.push("...");print.plain(node.rest)}this.push(")");if(parent.type==="ObjectTypeProperty"||parent.type==="ObjectTypeCallProperty"||parent.type==="DeclareFunction"){this.push(":")}else{this.space();this.push("=>")}this.space();print.plain(node.returnType)}function FunctionTypeParam(node,print){print.plain(node.name);if(node.optional)this.push("?");this.push(":");this.space();print.plain(node.typeAnnotation)}function InterfaceExtends(node,print){print.plain(node.id);print.plain(node.typeParameters)}exports.ClassImplements=InterfaceExtends;exports.GenericTypeAnnotation=InterfaceExtends;function _interfaceish(node,print){print.plain(node.id);print.plain(node.typeParameters);if(node["extends"].length){this.push(" extends ");print.join(node["extends"],{separator:", "})}this.space();print.plain(node.body)}function InterfaceDeclaration(node,print){this.push("interface ");this._interfaceish(node,print)}function IntersectionTypeAnnotation(node,print){print.join(node.types,{separator:" & "})}function MixedTypeAnnotation(){this.push("mixed")}function NullableTypeAnnotation(node,print){this.push("?");print.plain(node.typeAnnotation)}function NumberTypeAnnotation(){this.push("number")}function StringLiteralTypeAnnotation(node){this._stringLiteral(node.value)}function StringTypeAnnotation(){this.push("string")}function TupleTypeAnnotation(node,print){this.push("[");print.join(node.types,{separator:", "});this.push("]")}function TypeofTypeAnnotation(node,print){this.push("typeof ");print.plain(node.argument)}function TypeAlias(node,print){this.push("type ");print.plain(node.id);print.plain(node.typeParameters);this.space();this.push("=");this.space();print.plain(node.right);this.semicolon()}function TypeAnnotation(node,print){this.push(":");this.space();if(node.optional)this.push("?");print.plain(node.typeAnnotation)}function TypeParameterInstantiation(node,print){this.push("<");print.join(node.params,{separator:", "});this.push(">")}exports.TypeParameterDeclaration=TypeParameterInstantiation;function ObjectTypeAnnotation(node,print){var _this=this;this.push("{");var props=node.properties.concat(node.callProperties,node.indexers);if(props.length){this.space();print.list(props,{separator:false,indent:true,iterator:function iterator(){if(props.length!==1){_this.semicolon();_this.space()}}});this.space()}this.push("}")}function ObjectTypeCallProperty(node,print){if(node["static"])this.push("static ");print.plain(node.value)}function ObjectTypeIndexer(node,print){if(node["static"])this.push("static ");this.push("[");print.plain(node.id);this.push(":");this.space();print.plain(node.key);this.push("]");this.push(":");this.space();print.plain(node.value)}function ObjectTypeProperty(node,print){if(node["static"])this.push("static ");print.plain(node.key);if(node.optional)this.push("?");if(!t.isFunctionTypeAnnotation(node.value)){this.push(":");this.space()}print.plain(node.value)}function QualifiedTypeIdentifier(node,print){print.plain(node.qualification);this.push(".");print.plain(node.id)}function UnionTypeAnnotation(node,print){print.join(node.types,{separator:" | "})}function TypeCastExpression(node,print){this.push("(");print.plain(node.expression);print.plain(node.typeAnnotation);this.push(")")}function VoidTypeAnnotation(node){this.push("void")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/flow.js","/node_modules/babel-core/lib/babel/generation/generators")},{"../../types":589,_process:1069,buffer:919}],436:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.JSXAttribute=JSXAttribute;exports.JSXIdentifier=JSXIdentifier;exports.JSXNamespacedName=JSXNamespacedName;exports.JSXMemberExpression=JSXMemberExpression;exports.JSXSpreadAttribute=JSXSpreadAttribute;exports.JSXExpressionContainer=JSXExpressionContainer;exports.JSXElement=JSXElement;exports.JSXOpeningElement=JSXOpeningElement;exports.JSXClosingElement=JSXClosingElement;exports.JSXEmptyExpression=JSXEmptyExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);function JSXAttribute(node,print){print.plain(node.name);if(node.value){this.push("=");print.plain(node.value)}}function JSXIdentifier(node){this.push(node.name)}function JSXNamespacedName(node,print){print.plain(node.namespace);this.push(":");print.plain(node.name)}function JSXMemberExpression(node,print){print.plain(node.object);this.push(".");print.plain(node.property)}function JSXSpreadAttribute(node,print){this.push("{...");print.plain(node.argument);this.push("}")}function JSXExpressionContainer(node,print){this.push("{");print.plain(node.expression);this.push("}")}function JSXElement(node,print){var open=node.openingElement;print.plain(open);if(open.selfClosing)return;this.indent();var _arr=node.children;for(var _i=0;_i<_arr.length;_i++){var child=_arr[_i];if(t.isLiteral(child)){this.push(child.value,true)}else{print.plain(child)}}this.dedent();print.plain(node.closingElement)}function JSXOpeningElement(node,print){this.push("<");print.plain(node.name);if(node.attributes.length>0){this.push(" ");print.join(node.attributes,{separator:" "})}this.push(node.selfClosing?" />":">")}function JSXClosingElement(node,print){this.push("")}function JSXEmptyExpression(){}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/jsx.js","/node_modules/babel-core/lib/babel/generation/generators")},{"../../types":589,_process:1069,buffer:919}],437:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports._params=_params;exports._method=_method;exports.FunctionExpression=FunctionExpression;exports.ArrowFunctionExpression=ArrowFunctionExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);function _params(node,print){var _this=this;print.plain(node.typeParameters);this.push("(");print.list(node.params,{iterator:function iterator(node){if(node.optional)_this.push("?");print.plain(node.typeAnnotation)}});this.push(")");if(node.returnType){print.plain(node.returnType)}}function _method(node,print){var value=node.value;var kind=node.kind;var key=node.key;if(kind==="method"||kind==="init"){if(value.generator){this.push("*")}}if(kind==="get"||kind==="set"){this.push(kind+" ")}if(value.async)this.push("async ");if(node.computed){this.push("[");print.plain(key);this.push("]")}else{print.plain(key)}this._params(value,print);this.push(" ");print.plain(value.body)}function FunctionExpression(node,print){if(node.async)this.push("async ");this.push("function");if(node.generator)this.push("*");if(node.id){this.push(" ");print.plain(node.id)}else{this.space()}this._params(node,print);this.space();print.plain(node.body)}exports.FunctionDeclaration=FunctionExpression;function ArrowFunctionExpression(node,print){if(node.async)this.push("async ");if(node.params.length===1&&t.isIdentifier(node.params[0])){print.plain(node.params[0])}else{this._params(node,print)}this.push(" => ");var bodyNeedsParens=t.isObjectExpression(node.body);if(bodyNeedsParens){this.push("(")}print.plain(node.body);if(bodyNeedsParens){this.push(")")}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/methods.js","/node_modules/babel-core/lib/babel/generation/generators")},{"../../types":589,_process:1069,buffer:919}],438:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ImportSpecifier=ImportSpecifier;exports.ImportDefaultSpecifier=ImportDefaultSpecifier;exports.ExportDefaultSpecifier=ExportDefaultSpecifier;exports.ExportSpecifier=ExportSpecifier;exports.ExportNamespaceSpecifier=ExportNamespaceSpecifier;exports.ExportAllDeclaration=ExportAllDeclaration;exports.ExportNamedDeclaration=ExportNamedDeclaration;exports.ExportDefaultDeclaration=ExportDefaultDeclaration;exports.ImportDeclaration=ImportDeclaration;exports.ImportNamespaceSpecifier=ImportNamespaceSpecifier;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);function ImportSpecifier(node,print){print.plain(node.imported);if(node.local&&node.local.name!==node.imported.name){this.push(" as ");print.plain(node.local)}}function ImportDefaultSpecifier(node,print){print.plain(node.local)}function ExportDefaultSpecifier(node,print){print.plain(node.exported)}function ExportSpecifier(node,print){print.plain(node.local);if(node.exported&&node.local.name!==node.exported.name){this.push(" as ");print.plain(node.exported)}}function ExportNamespaceSpecifier(node,print){this.push("* as ");print.plain(node.exported)}function ExportAllDeclaration(node,print){this.push("export *");if(node.exported){this.push(" as ");print.plain(node.exported)}this.push(" from ");print.plain(node.source);this.semicolon()}function ExportNamedDeclaration(node,print){this.push("export ");ExportDeclaration.call(this,node,print)}function ExportDefaultDeclaration(node,print){this.push("export default ");ExportDeclaration.call(this,node,print)}function ExportDeclaration(node,print){var specifiers=node.specifiers;if(node.declaration){var declar=node.declaration;print.plain(declar);if(t.isStatement(declar)||t.isFunction(declar)||t.isClass(declar))return}else{var first=specifiers[0];var hasSpecial=false;if(t.isExportDefaultSpecifier(first)||t.isExportNamespaceSpecifier(first)){hasSpecial=true;print.plain(specifiers.shift());if(specifiers.length){this.push(", ")}}if(specifiers.length||!specifiers.length&&!hasSpecial){this.push("{");if(specifiers.length){this.space();print.join(specifiers,{separator:", "});this.space()}this.push("}")}if(node.source){this.push(" from ");print.plain(node.source)}}this.ensureSemicolon()}function ImportDeclaration(node,print){this.push("import ");if(node.isType){this.push("type ")}var specfiers=node.specifiers;if(specfiers&&specfiers.length){var first=node.specifiers[0];if(t.isImportDefaultSpecifier(first)||t.isImportNamespaceSpecifier(first)){print.plain(node.specifiers.shift());if(node.specifiers.length){this.push(", ")}}if(node.specifiers.length){this.push("{");this.space();print.join(node.specifiers,{separator:", "});this.space();this.push("}")}this.push(" from ")}print.plain(node.source);this.semicolon()}function ImportNamespaceSpecifier(node,print){this.push("* as ");print.plain(node.local)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/modules.js","/node_modules/babel-core/lib/babel/generation/generators")},{"../../types":589,_process:1069,buffer:919}],439:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.WithStatement=WithStatement;exports.IfStatement=IfStatement;exports.ForStatement=ForStatement;exports.WhileStatement=WhileStatement;exports.DoWhileStatement=DoWhileStatement;exports.LabeledStatement=LabeledStatement;exports.TryStatement=TryStatement;exports.CatchClause=CatchClause;exports.ThrowStatement=ThrowStatement;exports.SwitchStatement=SwitchStatement;exports.SwitchCase=SwitchCase;exports.DebuggerStatement=DebuggerStatement;exports.VariableDeclaration=VariableDeclaration;exports.VariableDeclarator=VariableDeclarator;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _repeating=require("repeating");var _repeating2=_interopRequireDefault(_repeating);var _types=require("../../types");var t=_interopRequireWildcard(_types);function WithStatement(node,print){this.keyword("with");this.push("(");print.plain(node.object);this.push(")");print.block(node.body)}function IfStatement(node,print){this.keyword("if");this.push("(");print.plain(node.test);this.push(")");this.space();print.indentOnComments(node.consequent);if(node.alternate){if(this.isLast("}"))this.space();this.push("else ");print.indentOnComments(node.alternate)}}function ForStatement(node,print){this.keyword("for");this.push("(");print.plain(node.init);this.push(";");if(node.test){this.push(" ");print.plain(node.test)}this.push(";");if(node.update){this.push(" ");print.plain(node.update)}this.push(")");print.block(node.body)}function WhileStatement(node,print){this.keyword("while");this.push("(");print.plain(node.test);this.push(")");print.block(node.body)}var buildForXStatement=function buildForXStatement(op){return function(node,print){this.keyword("for");this.push("(");print.plain(node.left);this.push(" "+op+" ");print.plain(node.right);this.push(")");print.block(node.body)}};var ForInStatement=buildForXStatement("in");exports.ForInStatement=ForInStatement;var ForOfStatement=buildForXStatement("of"); -exports.ForOfStatement=ForOfStatement;function DoWhileStatement(node,print){this.push("do ");print.plain(node.body);this.space();this.keyword("while");this.push("(");print.plain(node.test);this.push(");")}var buildLabelStatement=function buildLabelStatement(prefix,key){return function(node,print){this.push(prefix);var label=node[key||"label"];if(label){this.push(" ");print.plain(label)}this.semicolon()}};var ContinueStatement=buildLabelStatement("continue");exports.ContinueStatement=ContinueStatement;var ReturnStatement=buildLabelStatement("return","argument");exports.ReturnStatement=ReturnStatement;var BreakStatement=buildLabelStatement("break");exports.BreakStatement=BreakStatement;function LabeledStatement(node,print){print.plain(node.label);this.push(": ");print.plain(node.body)}function TryStatement(node,print){this.keyword("try");print.plain(node.block);this.space();if(node.handlers){print.plain(node.handlers[0])}else{print.plain(node.handler)}if(node.finalizer){this.space();this.push("finally ");print.plain(node.finalizer)}}function CatchClause(node,print){this.keyword("catch");this.push("(");print.plain(node.param);this.push(") ");print.plain(node.body)}function ThrowStatement(node,print){this.push("throw ");print.plain(node.argument);this.semicolon()}function SwitchStatement(node,print){this.keyword("switch");this.push("(");print.plain(node.discriminant);this.push(")");this.space();this.push("{");print.sequence(node.cases,{indent:true,addNewlines:function addNewlines(leading,cas){if(!leading&&node.cases[node.cases.length-1]===cas)return-1}});this.push("}")}function SwitchCase(node,print){if(node.test){this.push("case ");print.plain(node.test);this.push(":")}else{this.push("default:")}if(node.consequent.length){this.newline();print.sequence(node.consequent,{indent:true})}}function DebuggerStatement(){this.push("debugger;")}function VariableDeclaration(node,print,parent){this.push(node.kind+" ");var hasInits=false;if(!t.isFor(parent)){var _arr=node.declarations;for(var _i=0;_i<_arr.length;_i++){var declar=_arr[_i];if(declar.init){hasInits=true}}}var sep=",";if(!this.format.compact&&!this.format.concise&&hasInits&&!this.format.retainLines){sep+="\n"+(0,_repeating2["default"])(" ",node.kind.length+1)}else{sep+=" "}print.list(node.declarations,{separator:sep});if(t.isFor(parent)){if(parent.left===node||parent.init===node)return}this.semicolon()}function VariableDeclarator(node,print){print.plain(node.id);print.plain(node.id.typeAnnotation);if(node.init){this.space();this.push("=");this.space();print.plain(node.init)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/generators/statements.js","/node_modules/babel-core/lib/babel/generation/generators")},{"../../types":589,_process:1069,buffer:919,repeating:894}],440:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.TaggedTemplateExpression=TaggedTemplateExpression;exports.TemplateElement=TemplateElement;exports.TemplateLiteral=TemplateLiteral;function TaggedTemplateExpression(node,print){print.plain(node.tag);print.plain(node.quasi)}function TemplateElement(node){this._push(node.value.raw)}function TemplateLiteral(node,print){this.push("`");var quasis=node.quasis;var len=quasis.length;for(var i=0;i0)this.push(" ");print.plain(elem);if(i1e5;if(format.compact){console.error("[BABEL] "+messages.get("codeGeneratorDeopt",opts.filename,"100KB"))}}return format};CodeGenerator.findCommonStringDelimiter=function findCommonStringDelimiter(code,tokens){var occurences={single:0,"double":0};var checked=0;for(var i=0;i=3)break}if(occurences.single>occurences.double){return"single"}else{return"double"}};CodeGenerator.prototype.generate=function generate(){var ast=this.ast;this.print(ast);if(ast.comments){var comments=[];var _arr=ast.comments;for(var _i=0;_i<_arr.length;_i++){var comment=_arr[_i];if(!comment._displayed)comments.push(comment)}this._printComments(comments)}return{map:this.map.get(),code:this.buffer.get()}};CodeGenerator.prototype.buildPrint=function buildPrint(parent){return new _nodePrinter2["default"](this,parent)};CodeGenerator.prototype.catchUp=function catchUp(node,parent,leftParenPrinted){if(node.loc&&this.format.retainLines&&this.buffer.buf){var needsParens=false;if(!leftParenPrinted&&parent&&this.position.line","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],function(tier,i){(0,_lodashCollectionEach2["default"])(tier,function(op){PRECEDENCE[op]=i})});function NullableTypeAnnotation(node,parent){return t.isArrayTypeAnnotation(parent)}exports.FunctionTypeAnnotation=NullableTypeAnnotation;function UpdateExpression(node,parent){if(t.isMemberExpression(parent)&&parent.object===node){return true}}function ObjectExpression(node,parent){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}return false}function Binary(node,parent){if((t.isCallExpression(parent)||t.isNewExpression(parent))&&parent.callee===node){return true}if(t.isUnaryLike(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isBinary(parent)){var parentOp=parent.operator;var parentPos=PRECEDENCE[parentOp];var nodeOp=node.operator;var nodePos=PRECEDENCE[nodeOp];if(parentPos>nodePos){return true}if(parentPos===nodePos&&parent.right===node){return true}}}function BinaryExpression(node,parent){if(node.operator==="in"){if(t.isVariableDeclarator(parent)){return true}if(t.isFor(parent)){return true}}}function SequenceExpression(node,parent){if(t.isForStatement(parent)){return false}if(t.isExpressionStatement(parent)&&parent.expression===node){return false}return true}function YieldExpression(node,parent){return t.isBinary(parent)||t.isUnaryLike(parent)||t.isCallExpression(parent)||t.isMemberExpression(parent)||t.isNewExpression(parent)||t.isConditionalExpression(parent)||t.isYieldExpression(parent)}function ClassExpression(node,parent){return t.isExpressionStatement(parent)}function UnaryLike(node,parent){return t.isMemberExpression(parent)&&parent.object===node}function FunctionExpression(node,parent){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}}function ConditionalExpression(node,parent){if(t.isUnaryLike(parent)){return true}if(t.isBinary(parent)){return true}if(t.isCallExpression(parent)||t.isNewExpression(parent)){if(parent.callee===node){return true}}if(t.isConditionalExpression(parent)&&parent.test===node){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}return false}function AssignmentExpression(node){if(t.isObjectPattern(node.left)){return true}else{return ConditionalExpression.apply(undefined,arguments)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/node/parentheses.js","/node_modules/babel-core/lib/babel/generation/node")},{"../../types":589,_process:1069,buffer:919,"lodash/collection/each":734}],445:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var NodePrinter=function(){function NodePrinter(generator,parent){_classCallCheck(this,NodePrinter);this.generator=generator;this.parent=parent}NodePrinter.prototype.plain=function plain(node,opts){return this.generator.print(node,this.parent,opts)};NodePrinter.prototype.sequence=function sequence(nodes){var opts=arguments[1]===undefined?{}:arguments[1];opts.statement=true;return this.generator.printJoin(this,nodes,opts)};NodePrinter.prototype.join=function join(nodes,opts){return this.generator.printJoin(this,nodes,opts)};NodePrinter.prototype.list=function list(items){var opts=arguments[1]===undefined?{}:arguments[1];if(opts.separator==null)opts.separator=", ";return this.join(items,opts)};NodePrinter.prototype.block=function block(node){return this.generator.printBlock(this,node)};NodePrinter.prototype.indentOnComments=function indentOnComments(node){return this.generator.printAndIndentOnComments(this,node)};return NodePrinter}();exports["default"]=NodePrinter;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/generation/node/printer.js","/node_modules/babel-core/lib/babel/generation/node")},{_process:1069,buffer:919}],446:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashLangIsBoolean=require("lodash/lang/isBoolean");var _lodashLangIsBoolean2=_interopRequireDefault(_lodashLangIsBoolean);var _lodashCollectionEach=require("lodash/collection/each");var _lodashCollectionEach2=_interopRequireDefault(_lodashCollectionEach);var _lodashCollectionMap=require("lodash/collection/map");var _lodashCollectionMap2=_interopRequireDefault(_lodashCollectionMap);var _types=require("../../types");var t=_interopRequireWildcard(_types);function crawl(node){var state=arguments[1]===undefined?{}:arguments[1];if(t.isMemberExpression(node)){crawl(node.object,state);if(node.computed)crawl(node.property,state)}else if(t.isBinary(node)||t.isAssignmentExpression(node)){crawl(node.left,state);crawl(node.right,state)}else if(t.isCallExpression(node)){state.hasCall=true;crawl(node.callee,state)}else if(t.isFunction(node)){state.hasFunction=true}else if(t.isIdentifier(node)){state.hasHelper=state.hasHelper||isHelper(node.callee)}return state}function isHelper(node){if(t.isMemberExpression(node)){return isHelper(node.object)||isHelper(node.property)}else if(t.isIdentifier(node)){return node.name==="require"||node.name[0]==="_"}else if(t.isCallExpression(node)){return isHelper(node.callee)}else if(t.isBinary(node)||t.isAssignmentExpression(node)){return t.isIdentifier(node.left)&&isHelper(node.left)||isHelper(node.right)}else{return false}}function isType(node){return t.isLiteral(node)||t.isObjectExpression(node)||t.isArrayExpression(node)||t.isIdentifier(node)||t.isMemberExpression(node)}exports.nodes={AssignmentExpression:function AssignmentExpression(node){var state=crawl(node.right);if(state.hasCall&&state.hasHelper||state.hasFunction){return{before:state.hasFunction,after:true}}},SwitchCase:function SwitchCase(node,parent){return{before:node.consequent.length||parent.cases[0]===node}},LogicalExpression:function LogicalExpression(node){if(t.isFunction(node.left)||t.isFunction(node.right)){return{after:true}}},Literal:function Literal(node){if(node.value==="use strict"){return{after:true}}},CallExpression:function CallExpression(node){if(t.isFunction(node.callee)||isHelper(node)){return{before:true,after:true}}},VariableDeclaration:function VariableDeclaration(node){for(var i=0;i=max){i-=max}return i}var Whitespace=function(){function Whitespace(tokens){_classCallCheck(this,Whitespace);this.tokens=tokens;this.used={};this._lastFoundIndex=0}Whitespace.prototype.getNewlinesBefore=function getNewlinesBefore(node){var startToken;var endToken;var tokens=this.tokens;for(var j=0;j")}}).join("\n")};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/helpers/code-frame.js","/node_modules/babel-core/lib/babel/helpers")},{_process:1069,buffer:919,chalk:609,esutils:717,"js-tokens":724,"line-numbers":726,repeating:894}],451:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashObjectMerge=require("lodash/object/merge");var _lodashObjectMerge2=_interopRequireDefault(_lodashObjectMerge);exports["default"]=function(dest,src){if(!dest||!src)return;return(0,_lodashObjectMerge2["default"])(dest,src,function(a,b){if(Array.isArray(a)){var c=a.slice(0);for(var _iterator=b,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{_i=_iterator.next();if(_i.done)break;_ref=_i.value}var v=_ref;if(a.indexOf(v)<0){c.push(v)}}return c}})};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/helpers/merge.js","/node_modules/babel-core/lib/babel/helpers")},{_process:1069,buffer:919,"lodash/object/merge":837}],452:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../types");var t=_interopRequireWildcard(_types);exports["default"]=function(ast,comments,tokens){if(ast&&ast.type==="Program"){return t.file(ast,comments||[],tokens||[])}else{throw new Error("Not a valid ast?")}};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/helpers/normalize-ast.js","/node_modules/babel-core/lib/babel/helpers")},{"../types":589,_process:1069,buffer:919}],453:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports["default"]=function(){return Object.create(null)};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/helpers/object.js","/node_modules/babel-core/lib/babel/helpers")},{_process:1069,buffer:919}],454:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _normalizeAst=require("./normalize-ast");var _normalizeAst2=_interopRequireDefault(_normalizeAst);var _estraverse=require("estraverse");var _estraverse2=_interopRequireDefault(_estraverse);var _acorn=require("../../acorn");var acorn=_interopRequireWildcard(_acorn);exports["default"]=function(code){var opts=arguments[1]===undefined?{}:arguments[1];var commentsAndTokens=[];var comments=[];var tokens=[];var parseOpts={allowImportExportEverywhere:opts.looseModules,allowReturnOutsideFunction:opts.looseModules,allowHashBang:true,ecmaVersion:6,strictMode:opts.strictMode,sourceType:opts.sourceType,locations:true,features:opts.features||{},plugins:opts.plugins||{},onToken:tokens,ranges:true};parseOpts.onToken=function(token){tokens.push(token);commentsAndTokens.push(token)};parseOpts.onComment=function(block,text,start,end,startLoc,endLoc){var comment={type:block?"CommentBlock":"CommentLine",value:text,start:start,end:end,loc:new acorn.SourceLocation(this,startLoc,endLoc),range:[start,end]};commentsAndTokens.push(comment);comments.push(comment)};if(opts.nonStandard){parseOpts.plugins.jsx=true;parseOpts.plugins.flow=true}var ast=acorn.parse(code,parseOpts);_estraverse2["default"].attachComments(ast,comments,tokens);ast=(0,_normalizeAst2["default"])(ast,comments,commentsAndTokens);return ast};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/helpers/parse.js","/node_modules/babel-core/lib/babel/helpers")},{"../../acorn":410,"./normalize-ast":452,_process:1069,buffer:919,estraverse:712}],455:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.get=get;exports.parseArgs=parseArgs;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _util=require("util");var util=_interopRequireWildcard(_util);var MESSAGES={tailCallReassignmentDeopt:"Function reference has been reassigned so it's probably be dereferenced so we can't optimise this with confidence",JSXNamespacedTags:"Namespace tags are not supported. ReactJSX is not XML.",classesIllegalBareSuper:"Illegal use of bare super",classesIllegalSuperCall:"Direct super call is illegal in non-constructor, use super.$1() instead",classesIllegalConstructorKind:"Illegal kind for constructor method",scopeDuplicateDeclaration:"Duplicate declaration $1",settersInvalidParamLength:"Setters must have exactly one parameter",settersNoRest:"Setters aren't allowed to have a rest",noAssignmentsInForHead:"No assignments allowed in for-in/of head",expectedMemberExpressionOrIdentifier:"Expected type MemeberExpression or Identifier",invalidParentForThisNode:"We don't know how to handle this node within the current parent - please open an issue",readOnly:"$1 is read-only",modulesIllegalExportName:"Illegal export $1",unknownForHead:"Unknown node type $1 in ForStatement",didYouMean:"Did you mean $1?",codeGeneratorDeopt:"Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",missingTemplatesDirectory:"no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues",unsupportedOutputType:"Unsupported output type $1",illegalMethodName:"Illegal method name $1",lostTrackNodePath:"We lost track of this nodes position, likely because the AST was directly manipulated",undeclaredVariable:"Reference to undeclared variable $1",undeclaredVariableType:"Referencing a type alias outside of a type annotation",undeclaredVariableSuggestion:"Reference to undeclared variable $1 - did you mean $2?",traverseNeedsParent:"Must pass a scope and parentPath unless traversing a Program/File got a $1 node",traverseVerifyRootFunction:"You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?",traverseVerifyVisitorProperty:"You passed `traverse()` a visitor object with the property $1 that has the invalid property $2",traverseVerifyNodeType:"You gave us a visitor for the node type $1 but it's not a valid type",pluginIllegalKind:"Illegal kind $1 for plugin $2",pluginIllegalPosition:"Illegal position $1 for plugin $2",pluginKeyCollision:"The plugin $1 collides with another of the same name",pluginNotTransformer:"The plugin $1 didn't export a Transformer instance",pluginUnknown:"Unknown plugin $1",transformerNotFile:"Transformer $1 is resolving to a different Babel version to what is doing the actual transformation..."};exports.MESSAGES=MESSAGES;function get(key){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}var msg=MESSAGES[key];if(!msg)throw new ReferenceError("Unknown message "+JSON.stringify(key));args=parseArgs(args);return msg.replace(/\$(\d+)/g,function(str,i){return args[--i]})}function parseArgs(args){return args.map(function(val){if(val!=null&&val.inspect){return val.inspect()}else{try{return JSON.stringify(val)||val+""}catch(e){return util.inspect(val)}}})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/messages.js","/node_modules/babel-core/lib/babel")},{_process:1069,buffer:919,util:1089}],456:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _estraverse=require("estraverse");var _estraverse2=_interopRequireDefault(_estraverse);var _lodashObjectExtend=require("lodash/object/extend");var _lodashObjectExtend2=_interopRequireDefault(_lodashObjectExtend);var _astTypes=require("ast-types");var _astTypes2=_interopRequireDefault(_astTypes);var _types=require("./types");var t=_interopRequireWildcard(_types);(0,_lodashObjectExtend2["default"])(_estraverse2["default"].VisitorKeys,t.VISITOR_KEYS);var def=_astTypes2["default"].Type.def;var or=_astTypes2["default"].Type.or;def("Noop");def("AssignmentPattern").bases("Pattern").build("left","right").field("left",def("Pattern")).field("right",def("Expression"));def("RestElement").bases("Pattern").build("argument").field("argument",def("expression"));def("DoExpression").bases("Expression").build("body").field("body",[def("Statement")]);def("Super").bases("Expression");def("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",or(def("Declaration"),def("Expression"),null));def("ExportNamedDeclaration").bases("Declaration").build("declaration").field("declaration",or(def("Declaration"),def("Expression"),null)).field("specifiers",[or(def("ExportSpecifier"))]).field("source",or(def("ModuleSpecifier"),null));def("ExportNamespaceSpecifier").bases("Specifier").field("exported",def("Identifier"));def("ExportDefaultSpecifier").bases("Specifier").field("exported",def("Identifier"));def("ExportAllDeclaration").bases("Declaration").build("exported","source").field("exported",def("Identifier")).field("source",def("Literal"));def("BindExpression").bases("Expression").build("object","callee").field("object",or(def("Expression"),null)).field("callee",def("Expression"));_astTypes2["default"].finalize()}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/patch.js","/node_modules/babel-core/lib/babel")},{"./types":589,_process:1069,"ast-types":608,buffer:919,estraverse:712,"lodash/object/extend":833}],457:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";require("core-js/shim");require("regenerator/runtime");if(global._babelPolyfill){throw new Error("only one instance of babel/polyfill is allowed")}global._babelPolyfill=true}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/polyfill.js","/node_modules/babel-core/lib/babel")},{_process:1069,buffer:919,"core-js/shim":706,"regenerator/runtime":887}],458:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _generation=require("../generation");var _generation2=_interopRequireDefault(_generation);var _messages=require("../messages");var messages=_interopRequireWildcard(_messages);var _util=require("../util");var util=_interopRequireWildcard(_util);var _transformationFile=require("../transformation/file");var _transformationFile2=_interopRequireDefault(_transformationFile);var _lodashCollectionEach=require("lodash/collection/each");var _lodashCollectionEach2=_interopRequireDefault(_lodashCollectionEach);var _types=require("../types");var t=_interopRequireWildcard(_types);function buildGlobal(namespace,builder){var body=[];var container=t.functionExpression(null,[t.identifier("global")],t.blockStatement(body));var tree=t.program([t.expressionStatement(t.callExpression(container,[util.template("helper-self-global")]))]);body.push(t.variableDeclaration("var",[t.variableDeclarator(namespace,t.assignmentExpression("=",t.memberExpression(t.identifier("global"),namespace),t.objectExpression([])))]));builder(body);return tree}function buildUmd(namespace,builder){var body=[];body.push(t.variableDeclaration("var",[t.variableDeclarator(namespace,t.identifier("global"))]));builder(body);var container=util.template("umd-commonjs-strict",{FACTORY_PARAMETERS:t.identifier("global"),BROWSER_ARGUMENTS:t.assignmentExpression("=",t.memberExpression(t.identifier("root"),namespace),t.objectExpression({})),COMMON_ARGUMENTS:t.identifier("exports"),AMD_ARGUMENTS:t.arrayExpression([t.literal("exports")]),FACTORY_BODY:body,UMD_ROOT:t.identifier("this")});return t.program([container])}function buildVar(namespace,builder){var body=[];body.push(t.variableDeclaration("var",[t.variableDeclarator(namespace,t.objectExpression({}))]));builder(body);return t.program(body)}function buildHelpers(body,namespace,whitelist){(0,_lodashCollectionEach2["default"])(_transformationFile2["default"].helpers,function(name){if(whitelist&&whitelist.indexOf(name)===-1)return;var key=t.identifier(t.toIdentifier(name));body.push(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(namespace,key),util.template("helper-"+name))))})}exports["default"]=function(whitelist){var outputType=arguments[1]===undefined?"global":arguments[1];var namespace=t.identifier("babelHelpers");var builder=function builder(body){return buildHelpers(body,namespace,whitelist)};var tree;var build={global:buildGlobal,umd:buildUmd,"var":buildVar}[outputType];if(build){tree=build(namespace,builder)}else{throw new Error(messages.get("unsupportedOutputType",outputType))}return(0,_generation2["default"])(tree).code};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/tools/build-external-helpers.js","/node_modules/babel-core/lib/babel/tools")},{"../generation":442,"../messages":455,"../transformation/file":460,"../types":589,"../util":593,_process:1069,buffer:919,"lodash/collection/each":734}],459:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _stripJsonComments=require("strip-json-comments");var _stripJsonComments2=_interopRequireDefault(_stripJsonComments);var _helpersMerge=require("../helpers/merge");var _helpersMerge2=_interopRequireDefault(_helpersMerge);var _path=require("path");var _path2=_interopRequireDefault(_path);var _fs=require("fs");var _fs2=_interopRequireDefault(_fs);var cache={};var jsons={};function exists(filename){if(!_fs2["default"].existsSync)return false;var cached=cache[filename];if(cached!=null)return cached;return cache[filename]=_fs2["default"].existsSync(filename)}exports["default"]=function(loc){var opts=arguments[1]===undefined?{}:arguments[1];var rel=".babelrc";if(!opts.babelrc){opts.babelrc=[]}function find(start,rel){var file=_path2["default"].join(start,rel);if(opts.babelrc.indexOf(file)>=0){return}if(exists(file)){var content=_fs2["default"].readFileSync(file,"utf8");var json;try{json=jsons[content]=jsons[content]||JSON.parse((0,_stripJsonComments2["default"])(content))}catch(err){err.message=""+file+": "+err.message;throw err}opts.babelrc.push(file);if(json.breakConfig)return;(0,_helpersMerge2["default"])(opts,json)}var up=_path2["default"].dirname(start);if(up!==start){find(up,rel)}}if(opts.babelrc.indexOf(loc)<0&&opts.breakConfig!==true){find(loc,rel)}return opts};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/tools/resolve-rc.js","/node_modules/babel-core/lib/babel/tools")},{"../helpers/merge":451,_process:1069,buffer:919,fs:916,path:1068,"strip-json-comments":910}],460:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0)continue;var group=pass.transformer.metadata.group;if(!pass.canTransform()||!group){stack.push(pass);continue}var mergeStack=[];var _arr4=_stack;for(var _i4=0;_i4<_arr4.length;_i4++){var _pass=_arr4[_i4];if(_pass.transformer.metadata.group===group){mergeStack.push(_pass);ignore.push(_pass)}}var visitors=[];var _arr5=mergeStack;for(var _i5=0;_i5<_arr5.length;_i5++){var _pass2=_arr5[_i5];visitors.push(_pass2.handlers)}var visitor=_traversal2["default"].visitors.merge(visitors);var mergeTransformer=new _transformer2["default"](group,visitor);stack.push(mergeTransformer.buildPass(this))}return stack};File.prototype.set=function set(key,val){return this.data[key]=val};File.prototype.setDynamic=function setDynamic(key,fn){this.dynamicData[key]=fn};File.prototype.get=function get(key){var data=this.data[key];if(data){return data}else{var dynamic=this.dynamicData[key];if(dynamic){return this.set(key,dynamic())}}};File.prototype.resolveModuleSource=function resolveModuleSource(source){var resolveModuleSource=this.opts.resolveModuleSource;if(resolveModuleSource)source=resolveModuleSource(source,this.opts.filename);return source};File.prototype.addImport=function addImport(source,name,type){name=name||source;var id=this.dynamicImportIds[name];if(!id){source=this.resolveModuleSource(source);id=this.dynamicImportIds[name]=this.scope.generateUidIdentifier(name);var specifiers=[t.importDefaultSpecifier(id)];var declar=t.importDeclaration(specifiers,t.literal(source));declar._blockHoist=3;if(type){var modules=this.dynamicImportTypes[type]=this.dynamicImportTypes[type]||[];modules.push(declar)}if(this.transformers["es6.modules"].canTransform()){this.moduleFormatter.importSpecifier(specifiers[0],declar,this.dynamicImports);this.moduleFormatter.hasLocalImports=true}else{this.dynamicImports.push(declar)}}return id};File.prototype.attachAuxiliaryComment=function attachAuxiliaryComment(node){var comment=this.opts.auxiliaryComment;if(comment){node.leadingComments=node.leadingComments||[];node.leadingComments.push({type:"CommentLine",value:" "+comment})}return node};File.prototype.addHelper=function addHelper(name){var isSolo=(0,_lodashCollectionIncludes2["default"])(File.soloHelpers,name);if(!isSolo&&!(0,_lodashCollectionIncludes2["default"])(File.helpers,name)){throw new ReferenceError("Unknown helper "+name)}var declar=this.declarations[name];if(declar)return declar;this.usedHelpers[name]=true;if(!isSolo){var generator=this.get("helperGenerator");var runtime=this.get("helpersNamespace");if(generator){return generator(name)}else if(runtime){var id=t.identifier(t.toIdentifier(name));return t.memberExpression(runtime,id)}}var ref=util.template("helper-"+name);var uid=this.declarations[name]=this.scope.generateUidIdentifier(name);if(t.isFunctionExpression(ref)&&!ref.id){ref.body._compact=true;ref._generated=true;ref.id=uid;ref.type="FunctionDeclaration";this.attachAuxiliaryComment(ref);this.path.unshiftContainer("body",ref)}else{ref._compact=true;this.scope.push({id:uid,init:ref,unique:true})}return uid};File.prototype.errorWithNode=function errorWithNode(node,msg){var Error=arguments[2]===undefined?SyntaxError:arguments[2];var err;if(node.loc){var loc=node.loc.start;err=new Error("Line "+loc.line+": "+msg);err.loc=loc}else{err=new Error("There's been an error on a dynamic node. This is almost certainly an internal error. Please report it.")}return err};File.prototype.mergeSourceMap=function mergeSourceMap(map){var opts=this.opts;var inputMap=opts.inputSourceMap;if(inputMap){map.sources[0]=inputMap.file;var inputMapConsumer=new _sourceMap2["default"].SourceMapConsumer(inputMap);var outputMapConsumer=new _sourceMap2["default"].SourceMapConsumer(map);var outputMapGenerator=_sourceMap2["default"].SourceMapGenerator.fromSourceMap(outputMapConsumer);outputMapGenerator.applySourceMap(inputMapConsumer);var mergedMap=outputMapGenerator.toJSON();mergedMap.sources=inputMap.sources;mergedMap.file=inputMap.file;return mergedMap}return map};File.prototype.getModuleFormatter=function getModuleFormatter(type){if((0,_lodashLangIsFunction2["default"])(type)||!_modules2["default"][type]){this.log.deprecate("Custom module formatters are deprecated and will be removed in the next major. Please use Babel plugins instead.")}var ModuleFormatter=(0,_lodashLangIsFunction2["default"])(type)?type:_modules2["default"][type];if(!ModuleFormatter){var loc=util.resolveRelative(type);if(loc)ModuleFormatter=require(loc)}if(!ModuleFormatter){throw new ReferenceError("Unknown module formatter type "+JSON.stringify(type))}return new ModuleFormatter(this)};File.prototype.parse=function parse(code){var opts=this.opts;var parseOpts={highlightCode:opts.highlightCode,nonStandard:opts.nonStandard,filename:opts.filename,plugins:{}};var features=parseOpts.features={};for(var key in this.transformers){var transformer=this.transformers[key];features[key]=transformer.canTransform()}parseOpts.looseModules=this.isLoose("es6.modules");parseOpts.strictMode=features.strict;parseOpts.sourceType="module";this.log.debug("Parse start");var tree=(0,_helpersParse2["default"])(code,parseOpts);this.log.debug("Parse stop");return tree};File.prototype._addAst=function _addAst(ast){this.path=_traversalPath2["default"].get({hub:this.hub,parentPath:null,parent:ast,container:ast,key:"program"}).setContext();this.scope=this.path.scope;this.ast=ast};File.prototype.addAst=function addAst(ast){this.log.debug("Start set AST");this._addAst(ast);this.log.debug("End set AST");this.log.debug("Start module formatter init");var modFormatter=this.moduleFormatter=this.getModuleFormatter(this.opts.modules);if(modFormatter.init&&this.transformers["es6.modules"].canTransform()){modFormatter.init()}this.log.debug("End module formatter init")};File.prototype.transform=function transform(){this.call("pre");var _arr6=this.transformerStack;for(var _i6=0;_i6<_arr6.length;_i6++){var pass=_arr6[_i6];pass.transform()}this.call("post");return this.generate()};File.prototype.wrap=function wrap(code,callback){code=code+"";try{if(this.shouldIgnore()){return this.makeResult({code:code,ignored:true})}else{return callback()}}catch(err){if(err._babel){throw err}else{err._babel=true}var message=err.message=""+this.opts.filename+": "+err.message;var loc=err.loc;if(loc){err.codeFrame=(0,_helpersCodeFrame2["default"])(code,loc.line,loc.column+1,this.opts);message+="\n"+err.codeFrame}if(err.stack){var newStack=err.stack.replace(err.message,message);try{err.stack=newStack}catch(e){}}throw err}};File.prototype.addCode=function addCode(code){code=(code||"")+"";code=this.parseInputSourceMap(code);this.code=code};File.prototype.parseCode=function parseCode(){this.parseShebang();this.addAst(this.parse(this.code))};File.prototype.shouldIgnore=function shouldIgnore(){var opts=this.opts;return util.shouldIgnore(opts.filename,opts.ignore,opts.only)};File.prototype.call=function call(key){var _arr7=this.uncollapsedTransformerStack;for(var _i7=0;_i7<_arr7.length;_i7++){var pass=_arr7[_i7];var fn=pass.transformer[key];if(fn)fn(this)}};File.prototype.parseInputSourceMap=function parseInputSourceMap(code){var opts=this.opts;if(opts.inputSourceMap!==false){var inputMap=_convertSourceMap2["default"].fromSource(code);if(inputMap){opts.inputSourceMap=inputMap.toObject();code=_convertSourceMap2["default"].removeComments(code)}}return code};File.prototype.parseShebang=function parseShebang(){var shebangMatch=_shebangRegex2["default"].exec(this.code);if(shebangMatch){this.shebang=shebangMatch[0];this.code=this.code.replace(_shebangRegex2["default"],"")}};File.prototype.makeResult=function makeResult(_ref){var code=_ref.code;var _ref$map=_ref.map;var map=_ref$map===undefined?null:_ref$map;var ast=_ref.ast;var ignored=_ref.ignored;var result={metadata:null,ignored:!!ignored,code:null,ast:null,map:map};if(this.opts.code){result.code=code}if(this.opts.ast){result.ast=ast}if(this.opts.metadata){result.metadata=this.metadata;result.metadata.usedHelpers=Object.keys(this.usedHelpers)}return result};File.prototype.generate=function generate(){var opts=this.opts;var ast=this.ast;var result={ast:ast};if(!opts.code)return this.makeResult(result);this.log.debug("Generation start");var _result=(0,_generation2["default"])(ast,opts,this.code);result.code=_result.code;result.map=_result.map;this.log.debug("Generation end");if(this.shebang){result.code=""+this.shebang+"\n"+result.code}if(result.map){result.map=this.mergeSourceMap(result.map)}if(opts.sourceMaps==="inline"||opts.sourceMaps==="both"){result.code+="\n"+_convertSourceMap2["default"].fromObject(result.map).toComment()}if(opts.sourceMaps==="inline"){result.map=null}return this.makeResult(result)};_createClass(File,null,[{key:"helpers",value:["inherits","defaults","create-class","create-decorated-class","create-decorated-object","define-decorated-property-descriptor","tagged-template-literal","tagged-template-literal-loose","to-array","to-consumable-array","sliced-to-array","sliced-to-array-loose","object-without-properties","has-own","slice","bind","define-property","async-to-generator","interop-require-wildcard","interop-require-default","typeof","extends","get","set","class-call-check","object-destructuring-empty","temporal-undefined","temporal-assert-defined","self-global","default-props","instanceof","interop-require"],enumerable:true},{key:"soloHelpers",value:[],enumerable:true},{key:"options",value:require("./options"),enumerable:true}]);return File}();exports["default"]=File;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/file/index.js","/node_modules/babel-core/lib/babel/transformation/file")},{"../../generation":442,"../../helpers/code-frame":450,"../../helpers/merge":451,"../../helpers/parse":454,"../../tools/resolve-rc":459,"../../traversal":566,"../../traversal/hub":565,"../../traversal/path":573,"../../types":589,"../../util":593,"../modules":486,"../transformer":492,"./logger":461,"./option-parsers":462,"./options":463,"./plugin-manager":464,_process:1069,buffer:919,"convert-source-map":617,"lodash/collection/includes":736,"lodash/lang/clone":816,"lodash/lang/isFunction":822,"lodash/object/assign":831,"lodash/object/defaults":832,path:1068,"path-is-absolute":849,"shebang-regex":897,slash:898,"source-map":899}],461:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _debugNode=require("debug/node");var _debugNode2=_interopRequireDefault(_debugNode);var verboseDebug=(0,_debugNode2["default"])("babel:verbose");var generalDebug=(0,_debugNode2["default"])("babel");var Logger=function(){function Logger(file,filename){_classCallCheck(this,Logger);this.filename=filename;this.file=file}Logger.prototype._buildMessage=function _buildMessage(msg){var parts="[BABEL] "+this.filename;if(msg)parts+=": "+msg;return parts};Logger.prototype.warn=function warn(msg){console.warn(this._buildMessage(msg))};Logger.prototype.error=function error(msg){var Constructor=arguments[1]===undefined?Error:arguments[1];throw new Constructor(this._buildMessage(msg))};Logger.prototype.deprecate=function deprecate(msg){if(!this.file.opts.suppressDeprecationMessages){console.error(this._buildMessage(msg))}};Logger.prototype.verbose=function verbose(msg){if(verboseDebug.enabled)verboseDebug(this._buildMessage(msg))};Logger.prototype.debug=function debug(msg){if(generalDebug.enabled)generalDebug(this._buildMessage(msg))};Logger.prototype.deopt=function deopt(node,msg){this.debug(msg)};return Logger}();exports["default"]=Logger;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/file/logger.js","/node_modules/babel-core/lib/babel/transformation/file")},{_process:1069,buffer:919,"debug/node":708}],462:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.transformerList=transformerList;exports.number=number;exports.boolean=boolean;exports.booleanString=booleanString;exports.list=list;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _util=require("../../util");var util=_interopRequireWildcard(_util);function transformerList(key,val,pipeline){val=util.arrayify(val);if(val.indexOf("all")>=0||val.indexOf(true)>=0){val=Object.keys(pipeline.transformers)}return pipeline._ensureTransformerNames(key,val)}function number(key,val){return+val}function boolean(key,val){return!!val}function booleanString(key,val){return util.booleanify(val)}function list(key,val){return util.list(val)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/file/option-parsers.js","/node_modules/babel-core/lib/babel/transformation/file")},{"../../util":593,_process:1069,buffer:919}],463:[function(require,module,exports){module.exports={filename:{type:"string",description:"filename to use when reading from stdin - this will be used in source-maps, errors etc","default":"unknown",shorthand:"f"},filenameRelative:{hidden:true,type:"string"},inputSourceMap:{hidden:true},extra:{hidden:true,"default":{}},env:{hidden:true,"default":{}},moduleId:{description:"specify a custom name for module ids",type:"string"},getModuleId:{hidden:true},retainLines:{type:"boolean","default":false,description:"retain line numbers - will result in really ugly code"},nonStandard:{type:"boolean","default":true,description:"enable/disable support for JSX and Flow (on by default)"},experimental:{type:"boolean",description:"allow use of experimental transformers","default":false},highlightCode:{description:"enable/disable ANSI syntax highlighting of code frames (on by default)",type:"boolean","default":true},suppressDeprecationMessages:{type:"boolean","default":false,hidden:true},resolveModuleSource:{hidden:true},stage:{description:"ECMAScript proposal stage version to allow [0-4]",shorthand:"e",type:"number","default":2},blacklist:{type:"transformerList",description:"blacklist of transformers to NOT use",shorthand:"b"},whitelist:{type:"transformerList",optional:true,description:"whitelist of transformers to ONLY use",shorthand:"l"},optional:{type:"transformerList",description:"list of optional transformers to enable"},modules:{type:"string",description:"module formatter type to use [common]","default":"common",shorthand:"m"},moduleIds:{type:"boolean","default":false,shorthand:"M",description:"insert an explicit id for modules"},loose:{type:"transformerList",description:"list of transformers to enable loose mode ON",shorthand:"L"},jsxPragma:{type:"string",description:"custom pragma to use with JSX (same functionality as @jsx comments)","default":"React.createElement",shorthand:"P"},plugins:{type:"list",description:""},ignore:{type:"list",description:"list of glob paths to **not** compile"},only:{type:"list",description:"list of glob paths to **only** compile"},code:{hidden:true,"default":true,type:"boolean"},metadata:{hidden:true,"default":true,type:"boolean"},ast:{hidden:true,"default":true,type:"boolean"},comments:{type:"boolean","default":true,description:"strip/output comments in generated output (on by default)"},compact:{type:"booleanString","default":"auto",description:"do not include superfluous whitespace characters and line terminators [true|false|auto]"},keepModuleIdExtensions:{type:"boolean",description:"keep extensions when generating module ids","default":false,shorthand:"k"},auxiliaryComment:{type:"string","default":"",shorthand:"a",description:"attach a comment before all helper declarations and auxiliary code"},externalHelpers:{type:"boolean","default":false,shorthand:"r",description:"uses a reference to `babelHelpers` instead of placing helpers at the top of your code."},metadataUsedHelpers:{deprecated:"Not required anymore as this is enabled by default",type:"boolean","default":false,hidden:true},sourceMap:{alias:"sourceMaps",hidden:true},sourceMaps:{type:"booleanString",description:"[true|false|inline]","default":false,shorthand:"s"},sourceMapName:{alias:"sourceMapTarget",description:"DEPRECATED - Please use sourceMapTarget"},sourceMapTarget:{type:"string",description:"set `file` on returned source map"},sourceFileName:{type:"string",description:"set `sources[0]` on returned source map"},sourceRoot:{type:"string",description:"the root from which all sources are relative"},moduleRoot:{type:"string",description:"optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"},breakConfig:{type:"boolean","default":false,hidden:true,description:"stop trying to load .babelrc files"},babelrc:{hidden:true,description:"do not load the same .babelrc file twice"}}},{}],464:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;var _createClass=function(){function defineProperties(target,props){for(var i=0;i=3){callExpr._prettyCall=true}return t.inherits(callExpr,node)}};var addDisplayName=function addDisplayName(id,call){var props=call.arguments[0].properties;var safe=true;for(var i=0;i=0}function pullFlag(node,flag){var flags=node.regex.flags.split("");if(node.regex.flags.indexOf(flag)<0)return;(0,_lodashArrayPull2["default"])(flags,flag);node.regex.flags=flags.join("")}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/helpers/regex.js","/node_modules/babel-core/lib/babel/transformation/helpers")},{"../../types":589,_process:1069,buffer:919,"lodash/array/pull":731}],476:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);var awaitVisitor={Function:function Function(){this.skip()},AwaitExpression:function AwaitExpression(node){node.type="YieldExpression";if(node.all){node.all=false;node.argument=t.callExpression(t.memberExpression(t.identifier("Promise"),t.identifier("all")),[node.argument])}}};var referenceVisitor={ReferencedIdentifier:function ReferencedIdentifier(node,parent,scope,state){var name=state.id.name;if(node.name===name&&scope.bindingIdentifierEquals(name,state.id)){return state.ref=state.ref||scope.generateUidIdentifier(name)}}};exports["default"]=function(path,callId){var node=path.node;node.async=false;node.generator=true;path.traverse(awaitVisitor,state);var call=t.callExpression(callId,[node]);var id=node.id;node.id=null;if(t.isFunctionDeclaration(node)){var declar=t.variableDeclaration("let",[t.variableDeclarator(id,call)]);declar._blockHoist=true;return declar}else{if(id){var state={id:id};path.traverse(referenceVisitor,state);if(state.ref){path.scope.parent.push({id:state.ref});return t.assignmentExpression("=",state.ref,call)}}return call}};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/helpers/remap-async-to-generator.js","/node_modules/babel-core/lib/babel/transformation/helpers")},{"../../types":589,_process:1069,buffer:919}],477:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _messages=require("../../messages");var messages=_interopRequireWildcard(_messages);var _types=require("../../types");var t=_interopRequireWildcard(_types);function isIllegalBareSuper(node,parent){if(!t.isSuper(node))return false;if(t.isMemberExpression(parent,{computed:false}))return false;if(t.isCallExpression(parent,{callee:node}))return false;return true}function isMemberExpressionSuper(node){return t.isMemberExpression(node)&&t.isSuper(node.object)}var visitor={enter:function enter(node,parent,scope,state){var topLevel=state.topLevel;var self=state.self;if(t.isFunction(node)&&!t.isArrowFunctionExpression(node)){self.traverseLevel(this,false);return this.skip()}if(t.isProperty(node,{method:true})||t.isMethodDefinition(node)){return this.skip()}var getThisReference=topLevel?t.thisExpression:self.getThisReference.bind(self);var callback=self.specHandle;if(self.isLoose)callback=self.looseHandle;var result=callback.call(self,this,getThisReference);if(result)this.hasSuper=true;if(result===true)return;return result}};var ReplaceSupers=function(){function ReplaceSupers(opts){var inClass=arguments[1]===undefined?false:arguments[1];_classCallCheck(this,ReplaceSupers);this.topLevelThisReference=opts.topLevelThisReference;this.methodPath=opts.methodPath;this.methodNode=opts.methodNode;this.superRef=opts.superRef;this.isStatic=opts.isStatic;this.hasSuper=false;this.inClass=inClass;this.isLoose=opts.isLoose;this.scope=opts.scope;this.file=opts.file;this.opts=opts}ReplaceSupers.prototype.getObjectRef=function getObjectRef(){return this.opts.objectRef||this.opts.getObjectRef()};ReplaceSupers.prototype.setSuperProperty=function setSuperProperty(property,value,isComputed,thisExpression){return t.callExpression(this.file.addHelper("set"),[t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("getPrototypeOf")),[this.isStatic?this.getObjectRef():t.memberExpression(this.getObjectRef(),t.identifier("prototype"))]),isComputed?property:t.literal(property.name),value,thisExpression])};ReplaceSupers.prototype.getSuperProperty=function getSuperProperty(property,isComputed,thisExpression){return t.callExpression(this.file.addHelper("get"),[t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("getPrototypeOf")),[this.isStatic?this.getObjectRef():t.memberExpression(this.getObjectRef(),t.identifier("prototype"))]),isComputed?property:t.literal(property.name),thisExpression])};ReplaceSupers.prototype.replace=function replace(){this.traverseLevel(this.methodPath.get("value"),true)};ReplaceSupers.prototype.traverseLevel=function traverseLevel(path,topLevel){var state={self:this,topLevel:topLevel};path.traverse(visitor,state)};ReplaceSupers.prototype.getThisReference=function getThisReference(){if(this.topLevelThisReference){return this.topLevelThisReference}else{var ref=this.topLevelThisReference=this.scope.generateUidIdentifier("this");this.methodNode.value.body.body.unshift(t.variableDeclaration("var",[t.variableDeclarator(this.topLevelThisReference,t.thisExpression())]));return ref}};ReplaceSupers.prototype.getLooseSuperProperty=function getLooseSuperProperty(id,parent){var methodNode=this.methodNode;var methodName=methodNode.key;var superRef=this.superRef||t.identifier("Function");if(parent.property===id){return}else if(t.isCallExpression(parent,{callee:id})){parent.arguments.unshift(t.thisExpression());if(methodName.name==="constructor"){return t.memberExpression(superRef,t.identifier("call"))}else{id=superRef;if(!methodNode["static"]){id=t.memberExpression(id,t.identifier("prototype"))}id=t.memberExpression(id,methodName,methodNode.computed);return t.memberExpression(id,t.identifier("call"))}}else if(t.isMemberExpression(parent)&&!methodNode["static"]){return t.memberExpression(superRef,t.identifier("prototype"))}else{return superRef}};ReplaceSupers.prototype.looseHandle=function looseHandle(path,getThisReference){var node=path.node;if(path.isSuper()){return this.getLooseSuperProperty(node,path.parent)}else if(path.isCallExpression()){var callee=node.callee;if(!t.isMemberExpression(callee))return;if(!t.isSuper(callee.object))return;t.appendToMemberExpression(callee,t.identifier("call"));node.arguments.unshift(getThisReference());return true}};ReplaceSupers.prototype.specHandleAssignmentExpression=function specHandleAssignmentExpression(ref,path,node,getThisReference){if(node.operator==="="){return this.setSuperProperty(node.left.property,node.right,node.left.computed,getThisReference())}else{ref=ref||path.scope.generateUidIdentifier("ref");return[t.variableDeclaration("var",[t.variableDeclarator(ref,node.left)]),t.expressionStatement(t.assignmentExpression("=",node.left,t.binaryExpression(node.operator[0],ref,node.right)))]}};ReplaceSupers.prototype.specHandle=function specHandle(path,getThisReference){var methodNode=this.methodNode;var property;var computed;var args;var thisReference;var parent=path.parent;var node=path.node;if(isIllegalBareSuper(node,parent)){throw path.errorWithNode(messages.get("classesIllegalBareSuper"))}if(t.isCallExpression(node)){var callee=node.callee;if(t.isSuper(callee)){property=methodNode.key;computed=methodNode.computed;args=node.arguments;if(methodNode.key.name!=="constructor"||!this.inClass){var methodName=methodNode.key.name||"METHOD_NAME";throw this.file.errorWithNode(node,messages.get("classesIllegalSuperCall",methodName))}}else if(isMemberExpressionSuper(callee)){property=callee.property;computed=callee.computed;args=node.arguments}}else if(t.isMemberExpression(node)&&t.isSuper(node.object)){property=node.property;computed=node.computed}else if(t.isUpdateExpression(node)&&isMemberExpressionSuper(node.argument)){var binary=t.binaryExpression(node.operator[0],node.argument,t.literal(1));if(node.prefix){return this.specHandleAssignmentExpression(null,path,binary,getThisReference)}else{var ref=path.scope.generateUidIdentifier("ref");return this.specHandleAssignmentExpression(ref,path,binary,getThisReference).concat(t.expressionStatement(ref))}}else if(t.isAssignmentExpression(node)&&isMemberExpressionSuper(node.left)){return this.specHandleAssignmentExpression(null,path,node,getThisReference)}if(!property)return;thisReference=getThisReference();var superProperty=this.getSuperProperty(property,computed,thisReference);if(args){if(args.length===1&&t.isSpreadElement(args[0])){return t.callExpression(t.memberExpression(superProperty,t.identifier("apply")),[thisReference,args[0].argument])}else{return t.callExpression(t.memberExpression(superProperty,t.identifier("call")),[thisReference].concat(args))}}else{return superProperty}};return ReplaceSupers}();exports["default"]=ReplaceSupers;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/helpers/replace-supers.js","/node_modules/babel-core/lib/babel/transformation/helpers")},{"../../messages":455,"../../types":589,_process:1069,buffer:919}],478:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _transformerPipeline=require("./transformer-pipeline");var _transformerPipeline2=_interopRequireDefault(_transformerPipeline);var _transformers=require("./transformers");var _transformers2=_interopRequireDefault(_transformers);var _transformersDeprecated=require("./transformers/deprecated");var _transformersDeprecated2=_interopRequireDefault(_transformersDeprecated);var _transformersAliases=require("./transformers/aliases");var _transformersAliases2=_interopRequireDefault(_transformersAliases);var _transformersFilters=require("./transformers/filters");var filters=_interopRequireWildcard(_transformersFilters);var pipeline=new _transformerPipeline2["default"];for(var key in _transformers2["default"]){var transformer=_transformers2["default"][key];var metadata=transformer.metadata=transformer.metadata||{};metadata.group=metadata.group||"builtin-basic"}pipeline.addTransformers(_transformers2["default"]);pipeline.addDeprecated(_transformersDeprecated2["default"]);pipeline.addAliases(_transformersAliases2["default"]);pipeline.addFilter(filters.internal);pipeline.addFilter(filters.blacklist);pipeline.addFilter(filters.whitelist);pipeline.addFilter(filters.stage);pipeline.addFilter(filters.optional);var transform=pipeline.transform.bind(pipeline);transform.fromAst=pipeline.transformFromAst.bind(pipeline);transform.pipeline=pipeline;exports["default"]=transform;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/index.js","/node_modules/babel-core/lib/babel/transformation")},{"./transformer-pipeline":491,"./transformers":529,"./transformers/aliases":493,"./transformers/deprecated":494,"./transformers/filters":528,_process:1069,buffer:919}],479:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _messages=require("../../messages");var messages=_interopRequireWildcard(_messages);var _lodashObjectExtend=require("lodash/object/extend");var _lodashObjectExtend2=_interopRequireDefault(_lodashObjectExtend);var _helpersObject=require("../../helpers/object");var _helpersObject2=_interopRequireDefault(_helpersObject);var _util=require("../../util");var util=_interopRequireWildcard(_util);var _types=require("../../types");var t=_interopRequireWildcard(_types);var remapVisitor={enter:function enter(node){if(node._skipModulesRemap){return this.skip()}},ReferencedIdentifier:function ReferencedIdentifier(node,parent,scope,formatter){var remap=formatter.internalRemap[node.name];if(remap&&node!==remap){if(!scope.hasBinding(node.name)||scope.bindingIdentifierEquals(node.name,formatter.localImports[node.name])){if(this.key==="callee"&&this.parentPath.isCallExpression()){return t.sequenceExpression([t.literal(0),remap])}else{return remap}}}},AssignmentExpression:{exit:function exit(node,parent,scope,formatter){if(!node._ignoreModulesRemap){var exported=formatter.getExport(node.left,scope);if(exported){return formatter.remapExportAssignment(node,exported); -}}}},UpdateExpression:function UpdateExpression(node,parent,scope,formatter){var exported=formatter.getExport(node.argument,scope);if(!exported)return;this.skip();var assign=t.assignmentExpression(node.operator[0]+"=",node.argument,t.literal(1));var remapped=formatter.remapExportAssignment(assign,exported);if(t.isExpressionStatement(parent)||node.prefix){return remapped}var nodes=[];nodes.push(remapped);var operator;if(node.operator==="--"){operator="+"}else{operator="-"}nodes.push(t.binaryExpression(operator,node.argument,t.literal(1)));return t.sequenceExpression(nodes)}};var metadataVisitor={ModuleDeclaration:function ModuleDeclaration(node,parent,scope,formatter){if(node.source){node.source.value=formatter.file.resolveModuleSource(node.source.value)}},ImportDeclaration:function ImportDeclaration(node,parent,scope,formatter){formatter.hasLocalImports=true;var specifiers=[];var imported=[];formatter.metadata.imports.push({source:node.source.value,imported:imported,specifiers:specifiers});var _arr=this.get("specifiers");for(var _i=0;_i<_arr.length;_i++){var specifier=_arr[_i];var ids=specifier.getBindingIdentifiers();(0,_lodashObjectExtend2["default"])(formatter.localImports,ids);var local=specifier.node.local.name;if(specifier.isImportDefaultSpecifier()){imported.push("default");specifiers.push({kind:"named",imported:"default",local:local})}if(specifier.isImportSpecifier()){var importedName=specifier.node.imported.name;imported.push(importedName);specifiers.push({kind:"named",imported:importedName,local:local})}if(specifier.isImportNamespaceSpecifier()){imported.push("*");specifiers.push({kind:"namespace",local:local})}}},ExportDeclaration:function ExportDeclaration(node,parent,scope,formatter){formatter.hasLocalExports=true;var source=node.source?node.source.value:null;var exports=formatter.metadata.exports;var declar=this.get("declaration");if(declar.isStatement()){var bindings=declar.getBindingIdentifiers();for(var name in bindings){var binding=bindings[name];formatter._addExport(name,binding);exports.exported.push(name);exports.specifiers.push({kind:"local",local:name,exported:this.isExportDefaultDeclaration()?"default":name})}}if(this.isExportNamedDeclaration()&&node.specifiers){var _arr2=node.specifiers;for(var _i2=0;_i2<_arr2.length;_i2++){var specifier=_arr2[_i2];var exported=specifier.exported.name;exports.exported.push(exported);if(t.isExportDefaultSpecifier(specifier)){exports.specifiers.push({kind:"external",local:exported,exported:exported,source:source})}if(t.isExportNamespaceSpecifier(specifier)){exports.specifiers.push({kind:"external-namespace",exported:exported,source:source})}var local=specifier.local;if(!local)continue;formatter._addExport(local.name,specifier.exported);if(source){exports.specifiers.push({kind:"external",local:local.name,exported:exported,source:source})}if(!source){exports.specifiers.push({kind:"local",local:local.name,exported:exported})}}}if(this.isExportAllDeclaration()){exports.specifiers.push({kind:"external-all",source:source})}if(!t.isExportDefaultDeclaration(node)&&!declar.isTypeAlias()){var onlyDefault=node.specifiers&&node.specifiers.length===1&&t.isSpecifierDefault(node.specifiers[0]);if(!onlyDefault){formatter.hasNonDefaultExports=true}}},Scope:function Scope(){this.skip()}};var DefaultFormatter=function(){function DefaultFormatter(file){_classCallCheck(this,DefaultFormatter);this.internalRemap=(0,_helpersObject2["default"])();this.defaultIds=(0,_helpersObject2["default"])();this.scope=file.scope;this.file=file;this.ids=(0,_helpersObject2["default"])();this.hasNonDefaultExports=false;this.hasLocalExports=false;this.hasLocalImports=false;this.localExports=(0,_helpersObject2["default"])();this.localImports=(0,_helpersObject2["default"])();this.metadata=file.metadata.modules;this.getMetadata()}DefaultFormatter.prototype.isModuleType=function isModuleType(node,type){var modules=this.file.dynamicImportTypes[type];return modules&&modules.indexOf(node)>=0};DefaultFormatter.prototype.transform=function transform(){this.remapAssignments()};DefaultFormatter.prototype.doDefaultExportInterop=function doDefaultExportInterop(node){return(t.isExportDefaultDeclaration(node)||t.isSpecifierDefault(node))&&!this.noInteropRequireExport&&!this.hasNonDefaultExports};DefaultFormatter.prototype.getMetadata=function getMetadata(){var has=false;var _arr3=this.file.ast.program.body;for(var _i3=0;_i3<_arr3.length;_i3++){var node=_arr3[_i3];if(t.isModuleDeclaration(node)){has=true;break}}if(has)this.file.path.traverse(metadataVisitor,this)};DefaultFormatter.prototype.remapAssignments=function remapAssignments(){if(this.hasLocalExports||this.hasLocalImports){this.file.path.traverse(remapVisitor,this)}};DefaultFormatter.prototype.remapExportAssignment=function remapExportAssignment(node,exported){var assign=node;for(var i=0;i=0){return}loopText=""+loopText+"|"+node.label.name}else{if(state.ignoreLabeless)return;if(state.inSwitchCase)return;if(t.isBreakStatement(node)&&t.isSwitchCase(parent))return}state.hasBreakContinue=true;state.map[loopText]=node;replace=t.literal(loopText)}if(this.isReturnStatement()){state.hasReturn=true;replace=t.objectExpression([t.property("init",t.identifier("v"),node.argument||t.identifier("undefined"))])}if(replace){replace=t.returnStatement(replace);this.skip();return t.inherits(replace,node)}}};var BlockScoping=function(){function BlockScoping(loopPath,blockPath,parent,scope,file){_classCallCheck(this,BlockScoping);this.parent=parent;this.scope=scope;this.file=file;this.blockPath=blockPath;this.block=blockPath.node;this.outsideLetReferences=(0,_helpersObject2["default"])();this.hasLetReferences=false;this.letReferences=this.block._letReferences=(0,_helpersObject2["default"])();this.body=[];if(loopPath){this.loopParent=loopPath.parent;this.loopLabel=t.isLabeledStatement(this.loopParent)&&this.loopParent.label;this.loopPath=loopPath;this.loop=loopPath.node}}BlockScoping.prototype.run=function run(){var block=this.block;if(block._letDone)return;block._letDone=true;var needsClosure=this.getLetReferences();if(t.isFunction(this.parent)||t.isProgram(this.block))return;if(!this.hasLetReferences)return;if(needsClosure){this.wrapClosure()}else{this.remap()}if(this.loopLabel&&!t.isLabeledStatement(this.loopParent)){return t.labeledStatement(this.loopLabel,this.loop)}};BlockScoping.prototype.remap=function remap(){var hasRemaps=false;var letRefs=this.letReferences;var scope=this.scope;var remaps=(0,_helpersObject2["default"])();for(var key in letRefs){var ref=letRefs[key];if(scope.parentHasBinding(key)||scope.hasGlobal(key)){var uid=scope.generateUidIdentifier(ref.name).name;ref.name=uid;hasRemaps=true;remaps[key]=remaps[uid]={binding:ref,uid:uid}}}if(!hasRemaps)return;var loop=this.loop;if(loop){traverseReplace(loop.right,loop,scope,remaps);traverseReplace(loop.test,loop,scope,remaps);traverseReplace(loop.update,loop,scope,remaps)}this.blockPath.traverse(replaceVisitor,remaps)};BlockScoping.prototype.wrapClosure=function wrapClosure(){var block=this.block;var outsideRefs=this.outsideLetReferences;if(this.loop){for(var name in outsideRefs){var id=outsideRefs[name];if(this.scope.hasGlobal(id.name)||this.scope.parentHasBinding(id.name)){delete outsideRefs[id.name];delete this.letReferences[id.name];this.scope.rename(id.name);this.letReferences[id.name]=id;outsideRefs[id.name]=id}}}this.has=this.checkLoop();this.hoistVarDeclarations();var params=(0,_lodashObjectValues2["default"])(outsideRefs);var args=(0,_lodashObjectValues2["default"])(outsideRefs);var fn=t.functionExpression(null,params,t.blockStatement(block.body));fn.shadow=true;this.addContinuations(fn);block.body=this.body;var ref=fn;if(this.loop){ref=this.scope.generateUidIdentifier("loop");this.loopPath.insertBefore(t.variableDeclaration("var",[t.variableDeclarator(ref,fn)]))}var call=t.callExpression(ref,args);var ret=this.scope.generateUidIdentifier("ret");var hasYield=_traversal2["default"].hasType(fn.body,this.scope,"YieldExpression",t.FUNCTION_TYPES);if(hasYield){fn.generator=true;call=t.yieldExpression(call,true)}var hasAsync=_traversal2["default"].hasType(fn.body,this.scope,"AwaitExpression",t.FUNCTION_TYPES);if(hasAsync){fn.async=true;call=t.awaitExpression(call)}this.buildClosure(ret,call)};BlockScoping.prototype.buildClosure=function buildClosure(ret,call){var has=this.has;if(has.hasReturn||has.hasBreakContinue){this.buildHas(ret,call)}else{this.body.push(t.expressionStatement(call))}};BlockScoping.prototype.addContinuations=function addContinuations(fn){var state={reassignments:{},outsideReferences:this.outsideLetReferences};this.scope.traverse(fn,continuationVisitor,state);for(var i=0;i=spreadPropIndex)break;if(t.isSpreadProperty(prop))continue;var key=prop.key;if(t.isIdentifier(key)&&!prop.computed)key=t.literal(prop.key.name);keys.push(key)}keys=t.arrayExpression(keys);var value=t.callExpression(this.file.addHelper("object-without-properties"),[objRef,keys]);this.nodes.push(this.buildVariableAssignment(spreadProp.argument,value))};DestructuringTransformer.prototype.pushObjectProperty=function pushObjectProperty(prop,propRef){if(t.isLiteral(prop.key))prop.computed=true;var pattern=prop.value;var objRef=t.memberExpression(propRef,prop.key,prop.computed);if(t.isPattern(pattern)){this.push(pattern,objRef)}else{this.nodes.push(this.buildVariableAssignment(pattern,objRef))}};DestructuringTransformer.prototype.pushObjectPattern=function pushObjectPattern(pattern,objRef){if(!pattern.properties.length){this.nodes.push(t.expressionStatement(t.callExpression(this.file.addHelper("object-destructuring-empty"),[objRef])))}if(pattern.properties.length>1&&t.isMemberExpression(objRef)){var temp=this.scope.generateUidIdentifierBasedOnNode(objRef,this.file);this.nodes.push(this.buildVariableDeclaration(temp,objRef));objRef=temp}for(var i=0;iarr.elements.length)return;if(pattern.elements.length0){elemRef=t.callExpression(t.memberExpression(elemRef,t.identifier("slice")),[t.literal(i)])}elem=elem.argument}else{elemRef=t.memberExpression(arrayRef,t.literal(i),true)}this.push(elem,elemRef)}};DestructuringTransformer.prototype.init=function init(pattern,ref){if(!t.isArrayExpression(ref)&&!t.isMemberExpression(ref)){var memo=this.scope.maybeGenerateMemoised(ref,true);if(memo){this.nodes.push(this.buildVariableDeclaration(memo,ref));ref=memo}}this.push(pattern,ref);return this.nodes};return DestructuringTransformer}()}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es6/destructuring.js","/node_modules/babel-core/lib/babel/transformation/transformers/es6")},{"../../../messages":455,"../../../types":589,_process:1069,buffer:919}],503:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ForOfStatement=ForOfStatement;exports._ForOfStatementArray=_ForOfStatementArray;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _messages=require("../../../messages");var messages=_interopRequireWildcard(_messages);var _util=require("../../../util");var util=_interopRequireWildcard(_util);var _types=require("../../../types");var t=_interopRequireWildcard(_types);function ForOfStatement(node,parent,scope,file){if(this.get("right").isArrayExpression()){return _ForOfStatementArray.call(this,node,scope,file)}var callback=spec;if(file.isLoose("es6.forOf"))callback=loose;var build=callback(node,parent,scope,file);var declar=build.declar;var loop=build.loop;var block=loop.body;t.ensureBlock(node);if(declar){block.body.push(declar)}block.body=block.body.concat(node.body.body);t.inherits(loop,node);t.inherits(loop.body,node.body);if(build.replaceParent){this.parentPath.replaceWithMultiple(build.node);this.dangerouslyRemove()}else{return build.node}}function _ForOfStatementArray(node,scope,file){var nodes=[];var right=node.right;if(!t.isIdentifier(right)||!scope.hasBinding(right.name)){var uid=scope.generateUidIdentifier("arr");nodes.push(t.variableDeclaration("var",[t.variableDeclarator(uid,right)]));right=uid}var iterationKey=scope.generateUidIdentifier("i");var loop=util.template("for-of-array",{BODY:node.body,KEY:iterationKey,ARR:right});t.inherits(loop,node);t.ensureBlock(loop);var iterationValue=t.memberExpression(right,iterationKey,true);var left=node.left;if(t.isVariableDeclaration(left)){left.declarations[0].init=iterationValue;loop.body.body.unshift(left)}else{loop.body.body.unshift(t.expressionStatement(t.assignmentExpression("=",left,iterationValue)))}if(this.parentPath.isLabeledStatement()){loop=t.labeledStatement(this.parentPath.node.label,loop)}nodes.push(loop);return nodes}var loose=function loose(node,parent,scope,file){var left=node.left;var declar,id;if(t.isIdentifier(left)||t.isPattern(left)||t.isMemberExpression(left)){id=left}else if(t.isVariableDeclaration(left)){id=scope.generateUidIdentifier("ref");declar=t.variableDeclaration(left.kind,[t.variableDeclarator(left.declarations[0].id,id)])}else{throw file.errorWithNode(left,messages.get("unknownForHead",left.type))}var iteratorKey=scope.generateUidIdentifier("iterator");var isArrayKey=scope.generateUidIdentifier("isArray");var loop=util.template("for-of-loose",{LOOP_OBJECT:iteratorKey,IS_ARRAY:isArrayKey,OBJECT:node.right,INDEX:scope.generateUidIdentifier("i"),ID:id});if(!declar){loop.body.body.shift()}return{declar:declar,node:loop,loop:loop}};var spec=function spec(node,parent,scope,file){var left=node.left;var declar;var stepKey=scope.generateUidIdentifier("step");var stepValue=t.memberExpression(stepKey,t.identifier("value"));if(t.isIdentifier(left)||t.isPattern(left)||t.isMemberExpression(left)){ -declar=t.expressionStatement(t.assignmentExpression("=",left,stepValue))}else if(t.isVariableDeclaration(left)){declar=t.variableDeclaration(left.kind,[t.variableDeclarator(left.declarations[0].id,stepValue)])}else{throw file.errorWithNode(left,messages.get("unknownForHead",left.type))}var iteratorKey=scope.generateUidIdentifier("iterator");var template=util.template("for-of",{ITERATOR_HAD_ERROR_KEY:scope.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:scope.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:scope.generateUidIdentifier("iteratorError"),ITERATOR_KEY:iteratorKey,STEP_KEY:stepKey,OBJECT:node.right,BODY:null});var isLabeledParent=t.isLabeledStatement(parent);var tryBody=template[3].block.body;var loop=tryBody[0];if(isLabeledParent){tryBody[0]=t.labeledStatement(parent.label,loop)}return{replaceParent:isLabeledParent,declar:declar,loop:loop,node:template}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es6/for-of.js","/node_modules/babel-core/lib/babel/transformation/transformers/es6")},{"../../../messages":455,"../../../types":589,"../../../util":593,_process:1069,buffer:919}],504:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ImportDeclaration=ImportDeclaration;exports.ExportAllDeclaration=ExportAllDeclaration;exports.ExportDefaultDeclaration=ExportDefaultDeclaration;exports.ExportNamedDeclaration=ExportNamedDeclaration;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);function keepBlockHoist(node,nodes){if(node._blockHoist){for(var i=0;ilastNonDefaultParam}var lastNonDefaultParam=(0,_helpersGetFunctionArity2["default"])(node);var params=this.get("params");for(var i=0;i",len,start),t.binaryExpression("-",len,start),t.literal(0))}var loop=util.template("rest",{ARRAY_TYPE:restParam.typeAnnotation,ARGUMENTS:argsId,ARRAY_KEY:arrKey,ARRAY_LEN:arrLen,START:start,ARRAY:rest,KEY:key,LEN:len});loop._blockHoist=node.params.length+1;node.body.body.unshift(loop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es6/parameters.rest.js","/node_modules/babel-core/lib/babel/transformation/transformers/es6")},{"../../../types":589,"../../../util":593,_process:1069,buffer:919}],508:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);function loose(node,body,objId){for(var i=0;i0){var declarations=(0,_lodashArrayFlatten2["default"])((0,_lodashCollectionMap2["default"])(this.vars,function(decl){return decl.declarations}));var assignment=(0,_lodashCollectionReduceRight2["default"])(declarations,function(expr,decl){return t.assignmentExpression("=",decl.id,expr)},t.identifier("undefined"));var statement=t.expressionStatement(assignment);statement._blockHoist=Infinity;body.unshift(statement)}var paramDecls=this.paramDecls;if(paramDecls.length>0){var paramDecl=t.variableDeclaration("var",paramDecls);paramDecl._blockHoist=Infinity;body.unshift(paramDecl)}body.unshift(t.expressionStatement(t.assignmentExpression("=",this.getAgainId(),t.literal(false))));node.body=util.template("tail-call-body",{FUNCTION_ID:this.getFunctionId(),AGAIN_ID:this.getAgainId(),BLOCK:node.body});var topVars=[];if(this.needsThis){var _arr=this.thisPaths;for(var _i=0;_i<_arr.length;_i++){var path=_arr[_i];path.replaceWith(this.getThisId())}topVars.push(t.variableDeclarator(this.getThisId(),t.thisExpression()))}if(this.needsArguments||this.setsArguments){var _arr2=this.argumentsPaths;for(var _i2=0;_i2<_arr2.length;_i2++){var _path=_arr2[_i2];_path.replaceWith(this.argumentsId)}var decl=t.variableDeclarator(this.argumentsId);if(this.argumentsId){decl.init=t.identifier("arguments");decl.init._shadowedFunctionLiteral=true}topVars.push(decl)}var leftId=this.leftId;if(leftId){topVars.push(t.variableDeclarator(leftId))}if(topVars.length>0){node.body.body.unshift(t.variableDeclaration("var",topVars))}};TailCallTransformer.prototype.subTransform=function subTransform(node){if(!node)return;var handler=this["subTransform"+node.type];if(handler)return handler.call(this,node)};TailCallTransformer.prototype.subTransformConditionalExpression=function subTransformConditionalExpression(node){var callConsequent=this.subTransform(node.consequent);var callAlternate=this.subTransform(node.alternate);if(!callConsequent&&!callAlternate){return}node.type="IfStatement";node.consequent=callConsequent?t.toBlock(callConsequent):returnBlock(node.consequent);if(callAlternate){node.alternate=t.isIfStatement(callAlternate)?callAlternate:t.toBlock(callAlternate)}else{node.alternate=returnBlock(node.alternate)}return[node]};TailCallTransformer.prototype.subTransformLogicalExpression=function subTransformLogicalExpression(node){var callRight=this.subTransform(node.right);if(!callRight)return;var leftId=this.getLeftId();var testExpr=t.assignmentExpression("=",leftId,node.left);if(node.operator==="&&"){testExpr=t.unaryExpression("!",testExpr)}return[t.ifStatement(testExpr,returnBlock(leftId))].concat(callRight)};TailCallTransformer.prototype.subTransformSequenceExpression=function subTransformSequenceExpression(node){var seq=node.expressions;var lastCall=this.subTransform(seq[seq.length-1]);if(!lastCall){return}if(--seq.length===1){node=seq[0]}return[t.expressionStatement(node)].concat(lastCall)};TailCallTransformer.prototype.subTransformCallExpression=function subTransformCallExpression(node){var callee=node.callee;var thisBinding,args;if(t.isMemberExpression(callee,{computed:false})&&t.isIdentifier(callee.property)){switch(callee.property.name){case"call":args=t.arrayExpression(node.arguments.slice(1));break;case"apply":args=node.arguments[1]||t.identifier("undefined");this.needsArguments=true;break;default:return}thisBinding=node.arguments[0];callee=callee.object}if(!t.isIdentifier(callee)||!this.scope.bindingIdentifierEquals(callee.name,this.ownerId)){return}this.hasTailRecursion=true;if(this.hasDeopt())return;var body=[];if(this.needsThis&&!t.isThisExpression(thisBinding)){body.push(t.expressionStatement(t.assignmentExpression("=",this.getThisId(),thisBinding||t.identifier("undefined"))))}if(!args){args=t.arrayExpression(node.arguments)}if(t.isArrayExpression(args)&&args.elements.length>this.node.params.length){this.needsArguments=true}var argumentsId=this.getArgumentsId();var params=this.getParams();if(this.needsArguments){body.push(t.expressionStatement(t.assignmentExpression("=",argumentsId,args)))}if(t.isArrayExpression(args)){var elems=args.elements;for(var i=0;i1){var last=nodes[nodes.length-1];if(t.isLiteral(last,{value:""}))nodes.pop();var root=buildBinaryExpression(nodes.shift(),nodes.shift());var _arr3=nodes;for(var _i3=0;_i3<_arr3.length;_i3++){var _node=_arr3[_i3];root=buildBinaryExpression(root,_node)}this.replaceWith(root)}else{return nodes[0]}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es6/template-literals.js","/node_modules/babel-core/lib/babel/transformation/transformers/es6")},{"../../../types":589,_process:1069,buffer:919}],518:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;var metadata={stage:1};exports.metadata=metadata}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es7/async-functions.js","/node_modules/babel-core/lib/babel/transformation/transformers/es7")},{_process:1069,buffer:919}],519:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;var metadata={stage:0,dependencies:["es6.classes"]};exports.metadata=metadata}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es7/class-properties.js","/node_modules/babel-core/lib/babel/transformation/transformers/es7")},{_process:1069,buffer:919}],520:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ComprehensionExpression=ComprehensionExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _helpersBuildComprehension=require("../../helpers/build-comprehension");var _helpersBuildComprehension2=_interopRequireDefault(_helpersBuildComprehension);var _traversal=require("../../../traversal");var _traversal2=_interopRequireDefault(_traversal);var _util=require("../../../util");var util=_interopRequireWildcard(_util);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={stage:0};exports.metadata=metadata;function ComprehensionExpression(node,parent,scope,file){var callback=array;if(node.generator)callback=generator;return callback(node,parent,scope)}function generator(node){var body=[];var container=t.functionExpression(null,[],t.blockStatement(body),true);container.shadow=true;body.push((0,_helpersBuildComprehension2["default"])(node,function(){return t.expressionStatement(t.yieldExpression(node.body))}));return t.callExpression(container,[])}function array(node,parent,scope){var uid=scope.generateUidIdentifierBasedOnNode(parent);var container=util.template("array-comprehension-container",{KEY:uid});container.callee.shadow=true;var block=container.callee.body;var body=block.body;if(_traversal2["default"].hasType(node,scope,"YieldExpression",t.FUNCTION_TYPES)){container.callee.generator=true;container=t.yieldExpression(container,true)}var returnStatement=body.pop();body.push((0,_helpersBuildComprehension2["default"])(node,function(){return util.template("array-push",{STATEMENT:node.body,KEY:uid},true)}));body.push(returnStatement);return container}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es7/comprehensions.js","/node_modules/babel-core/lib/babel/transformation/transformers/es7")},{"../../../traversal":566,"../../../types":589,"../../../util":593,"../../helpers/build-comprehension":466,_process:1069,buffer:919}],521:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ObjectExpression=ObjectExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _helpersMemoiseDecorators=require("../../helpers/memoise-decorators");var _helpersMemoiseDecorators2=_interopRequireDefault(_helpersMemoiseDecorators);var _helpersDefineMap=require("../../helpers/define-map");var defineMap=_interopRequireWildcard(_helpersDefineMap);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={dependencies:["es6.classes"],optional:true,stage:1};exports.metadata=metadata;function ObjectExpression(node,parent,scope,file){var hasDecorators=false;for(var i=0;i=1){nodes.push(node)}return nodes}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es7/export-extensions.js","/node_modules/babel-core/lib/babel/transformation/transformers/es7")},{"../../../types":589,_process:1069,buffer:919}],525:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.CallExpression=CallExpression;exports.BindExpression=BindExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={optional:true,stage:0};exports.metadata=metadata;function getTempId(scope){var id=scope.path.getData("functionBind");if(id)return id;id=scope.generateDeclaredUidIdentifier("context");return scope.path.setData("functionBind",id)}function getStaticContext(bind,scope){var object=bind.object||bind.callee.object;return scope.isStatic(object)&&object}function inferBindContext(bind,scope){var staticContext=getStaticContext(bind,scope);if(staticContext)return staticContext;var tempId=getTempId(scope);if(bind.object){bind.callee=t.sequenceExpression([t.assignmentExpression("=",tempId,bind.object),bind.callee])}else{bind.callee.object=t.assignmentExpression("=",tempId,bind.callee.object)}return tempId}function CallExpression(node,parent,scope,file){var bind=node.callee;if(!t.isBindExpression(bind))return;var context=inferBindContext(bind,scope);node.callee=t.memberExpression(bind.callee,t.identifier("call"));node.arguments.unshift(context)}function BindExpression(node,parent,scope,file){var context=inferBindContext(node,scope);return t.callExpression(t.memberExpression(node.callee,t.identifier("bind")),[context])}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/es7/function-bind.js","/node_modules/babel-core/lib/babel/transformation/transformers/es7")},{"../../../types":589,_process:1069,buffer:919}],526:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ObjectExpression=ObjectExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={stage:1,dependencies:["es6.destructuring"]};exports.metadata=metadata;var hasSpread=function hasSpread(node){for(var i=0;i=opts.stage)return true}function optional(transformer,opts){if(transformer.metadata.optional&&!(0,_lodashCollectionIncludes2["default"])(opts.optional,transformer.key))return false}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/filters.js","/node_modules/babel-core/lib/babel/transformation/transformers")},{_process:1069,buffer:919,"lodash/collection/includes":736}],529:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports["default"]={"minification.constantFolding":require("./minification/constant-folding"),strict:require("./other/strict"),eval:require("./other/eval"),_explode:require("./internal/explode"),_validation:require("./internal/validation"),_hoistDirectives:require("./internal/hoist-directives"),"minification.removeDebugger":require("./minification/remove-debugger"),"minification.removeConsole":require("./minification/remove-console"),"utility.inlineEnvironmentVariables":require("./utility/inline-environment-variables"),"minification.deadCodeElimination":require("./minification/dead-code-elimination"),_modules:require("./internal/modules"),"spec.functionName":require("./spec/function-name"),"es6.spec.templateLiterals":require("./es6/spec.template-literals"),"es6.templateLiterals":require("./es6/template-literals"),"es7.classProperties":require("./es7/class-properties"),"es7.trailingFunctionCommas":require("./es7/trailing-function-commas"),"es7.asyncFunctions":require("./es7/async-functions"),"es7.decorators":require("./es7/decorators"),"validation.undeclaredVariableCheck":require("./validation/undeclared-variable-check"),"validation.react":require("./validation/react"),"es6.arrowFunctions":require("./es6/arrow-functions"),"spec.blockScopedFunctions":require("./spec/block-scoped-functions"),"optimisation.react.constantElements":require("./optimisation/react.constant-elements"),"optimisation.react.inlineElements":require("./optimisation/react.inline-elements"),"es7.comprehensions":require("./es7/comprehensions"),"es6.classes":require("./es6/classes"),asyncToGenerator:require("./other/async-to-generator"),bluebirdCoroutines:require("./other/bluebird-coroutines"),"es6.objectSuper":require("./es6/object-super"),"es7.objectRestSpread":require("./es7/object-rest-spread"),"es7.exponentiationOperator":require("./es7/exponentiation-operator"),"es5.properties.mutators":require("./es5/properties.mutators"),"es6.properties.shorthand":require("./es6/properties.shorthand"),"es6.properties.computed":require("./es6/properties.computed"),"optimisation.flow.forOf":require("./optimisation/flow.for-of"),"es6.forOf":require("./es6/for-of"),"es6.regex.sticky":require("./es6/regex.sticky"),"es6.regex.unicode":require("./es6/regex.unicode"),"es6.constants":require("./es6/constants"),"es6.parameters.rest":require("./es6/parameters.rest"),"es6.spread":require("./es6/spread"),"es6.parameters.default":require("./es6/parameters.default"),"es7.exportExtensions":require("./es7/export-extensions"),"spec.protoToAssign":require("./spec/proto-to-assign"),"es7.doExpressions":require("./es7/do-expressions"),"es6.spec.symbols":require("./es6/spec.symbols"),"es7.functionBind":require("./es7/function-bind"),"spec.undefinedToVoid":require("./spec/undefined-to-void"),"es6.destructuring":require("./es6/destructuring"),"es6.blockScoping":require("./es6/block-scoping"),"es6.spec.blockScoping":require("./es6/spec.block-scoping"),reactCompat:require("./other/react-compat"),react:require("./other/react"),regenerator:require("./other/regenerator"),runtime:require("./other/runtime"),"es6.modules":require("./es6/modules"),_moduleFormatter:require("./internal/module-formatter"),"es6.tailCall":require("./es6/tail-call"),_shadowFunctions:require("./internal/shadow-functions"),"es3.propertyLiterals":require("./es3/property-literals"),"es3.memberExpressionLiterals":require("./es3/member-expression-literals"),"minification.memberExpressionLiterals":require("./minification/member-expression-literals"),"minification.propertyLiterals":require("./minification/property-literals"),_blockHoist:require("./internal/block-hoist"),jscript:require("./other/jscript"),flow:require("./other/flow")};module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/index.js","/node_modules/babel-core/lib/babel/transformation/transformers")},{"./es3/member-expression-literals":495,"./es3/property-literals":496,"./es5/properties.mutators":497,"./es6/arrow-functions":498,"./es6/block-scoping":499,"./es6/classes":500,"./es6/constants":501,"./es6/destructuring":502,"./es6/for-of":503,"./es6/modules":504,"./es6/object-super":505,"./es6/parameters.default":506,"./es6/parameters.rest":507,"./es6/properties.computed":508,"./es6/properties.shorthand":509,"./es6/regex.sticky":510,"./es6/regex.unicode":511,"./es6/spec.block-scoping":512,"./es6/spec.symbols":513,"./es6/spec.template-literals":514,"./es6/spread":515,"./es6/tail-call":516,"./es6/template-literals":517,"./es7/async-functions":518,"./es7/class-properties":519,"./es7/comprehensions":520,"./es7/decorators":521,"./es7/do-expressions":522,"./es7/exponentiation-operator":523,"./es7/export-extensions":524,"./es7/function-bind":525,"./es7/object-rest-spread":526,"./es7/trailing-function-commas":527,"./internal/block-hoist":530,"./internal/explode":531,"./internal/hoist-directives":532,"./internal/module-formatter":533,"./internal/modules":534,"./internal/shadow-functions":535,"./internal/validation":536,"./minification/constant-folding":537,"./minification/dead-code-elimination":538,"./minification/member-expression-literals":539,"./minification/property-literals":540,"./minification/remove-console":541,"./minification/remove-debugger":542,"./optimisation/flow.for-of":543,"./optimisation/react.constant-elements":544,"./optimisation/react.inline-elements":545,"./other/async-to-generator":546,"./other/bluebird-coroutines":547,"./other/eval":548,"./other/flow":549,"./other/jscript":550,"./other/react":552,"./other/react-compat":551,"./other/regenerator":553,"./other/runtime":555,"./other/strict":556,"./spec/block-scoped-functions":557,"./spec/function-name":558,"./spec/proto-to-assign":559,"./spec/undefined-to-void":560,"./utility/inline-environment-variables":561,"./validation/react":562,"./validation/undeclared-variable-check":563,_process:1069,buffer:919}],530:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashCollectionSortBy=require("lodash/collection/sortBy");var _lodashCollectionSortBy2=_interopRequireDefault(_lodashCollectionSortBy);var metadata={group:"builtin-trailing"};exports.metadata=metadata;var BlockStatement={exit:function exit(node){var hasChange=false;for(var i=0;i1||!binding.constant)return;if(binding.kind==="param"||binding.kind==="module")return;var replacement=binding.path.node;if(t.isVariableDeclarator(replacement)){replacement=replacement.init}if(!replacement)return;if(!scope.isPure(replacement,true))return;if(t.isClass(replacement)||t.isFunction(replacement)){if(binding.path.scope.parent!==scope)return}if(this.findParent(function(path){return path.node===replacement})){return}t.toExpression(replacement);scope.removeBinding(node.name);binding.path.dangerouslyRemove();return replacement}function FunctionDeclaration(node,parent,scope){var bindingInfo=scope.getBinding(node.id.name);if(bindingInfo&&!bindingInfo.referenced){this.dangerouslyRemove()}}exports.ClassDeclaration=FunctionDeclaration;function VariableDeclarator(node,parent,scope){if(!t.isIdentifier(node.id)||!scope.isPure(node.init,true))return;FunctionDeclaration.apply(this,arguments)}function ConditionalExpression(node,parent,scope){var evaluateTest=this.get("test").evaluateTruthy();if(evaluateTest===true){return node.consequent}else if(evaluateTest===false){return node.alternate}}function BlockStatement(node){var paths=this.get("body");var purge=false;for(var i=0;i0){nodePath=nodePath.get(keysAlongPath.pop())}return nodePath}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/other/regenerator.js","/node_modules/babel-core/lib/babel/transformation/transformers/other")},{"../../../types":589,_process:1069,"ast-types":608,buffer:919,regenerator:857}],554:[function(require,module,exports){module.exports={builtins:{Symbol:"symbol",Promise:"promise",Map:"map",WeakMap:"weak-map",Set:"set",WeakSet:"weak-set"},methods:{Array:{concat:"array/concat",copyWithin:"array/copy-within",entries:"array/entries",every:"array/every",fill:"array/fill",filter:"array/filter",findIndex:"array/find-index",find:"array/find",forEach:"array/for-each",from:"array/from",includes:"array/includes",indexOf:"array/index-of",join:"array/join",keys:"array/keys",lastIndexOf:"array/last-index-of",map:"array/map",of:"array/of",pop:"array/pop",push:"array/push",reduceRight:"array/reduce-right",reduce:"array/reduce",reverse:"array/reverse",shift:"array/shift",slice:"array/slice",some:"array/some",sort:"array/sort",splice:"array/splice",turn:"array/turn",unshift:"array/unshift",values:"array/values"},Object:{assign:"object/assign",classof:"object/classof",create:"object/create",define:"object/define",defineProperties:"object/define-properties",defineProperty:"object/define-property",entries:"object/entries",freeze:"object/freeze",getOwnPropertyDescriptor:"object/get-own-property-descriptor",getOwnPropertyDescriptors:"object/get-own-property-descriptors",getOwnPropertyNames:"object/get-own-property-names",getOwnPropertySymbols:"object/get-own-property-symbols",getPrototypePf:"object/get-prototype-of",index:"object/index",isExtensible:"object/is-extensible",isFrozen:"object/is-frozen",isObject:"object/is-object",isSealed:"object/is-sealed",is:"object/is",keys:"object/keys",make:"object/make",preventExtensions:"object/prevent-extensions",seal:"object/seal",setPrototypeOf:"object/set-prototype-of",values:"object/values"},RegExp:{escape:"regexp/escape"},Function:{only:"function/only",part:"function/part"},Math:{acosh:"math/acosh",asinh:"math/asinh",atanh:"math/atanh",cbrt:"math/cbrt",clz32:"math/clz32",cosh:"math/cosh",expm1:"math/expm1",fround:"math/fround",hypot:"math/hypot",pot:"math/pot",imul:"math/imul",log10:"math/log10",log1p:"math/log1p",log2:"math/log2",sign:"math/sign",sinh:"math/sinh",tanh:"math/tanh",trunc:"math/trunc"},Date:{addLocale:"date/add-locale",formatUTC:"date/format-utc",format:"date/format"},Symbol:{"for":"symbol/for",hasInstance:"symbol/for-instance","is-concat-spreadable":"symbol/is-concat-spreadable",iterator:"symbol/iterator",keyFor:"symbol/key-for",match:"symbol/match",replace:"symbol/replace",search:"symbol/search",species:"symbol/species",split:"symbol/split",toPrimitive:"symbol/to-primitive",toStringTag:"symbol/to-string-tag",unscopables:"symbol/unscopables"},String:{at:"string/at",codePointAt:"string/code-point-at",endsWith:"string/ends-with",escapeHTML:"string/escape-html",fromCodePoint:"string/from-code-point",includes:"string/includes",raw:"string/raw",repeat:"string/repeat",startsWith:"string/starts-with",unescapeHTML:"string/unescape-html"},Number:{EPSILON:"number/epsilon",isFinite:"number/is-finite",isInteger:"number/is-integer",isNaN:"number/is-nan",isSafeInteger:"number/is-safe-integer",MAX_SAFE_INTEGER:"number/max-safe-integer",MIN_SAFE_INTEGER:"number/min-safe-integer",parseFloat:"number/parse-float",parseInt:"number/parse-int",random:"number/random"},Reflect:{apply:"reflect/apply",construct:"reflect/construct",defineProperty:"reflect/define-property",deleteProperty:"reflect/delete-property",enumerate:"reflect/enumerate",getOwnPropertyDescriptor:"reflect/get-own-property-descriptor",getPrototypeOf:"reflect/get-prototype-of",get:"reflect/get",has:"reflect/has",isExtensible:"reflect/is-extensible",ownKeys:"reflect/own-keys",preventExtensions:"reflect/prevent-extensions",setPrototypeOf:"reflect/set-prototype-of",set:"reflect/set"}}}},{}],555:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.pre=pre;exports.ReferencedIdentifier=ReferencedIdentifier;exports.CallExpression=CallExpression;exports.BinaryExpression=BinaryExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashObjectHas=require("lodash/object/has");var _lodashObjectHas2=_interopRequireDefault(_lodashObjectHas);var _types=require("../../../../types");var t=_interopRequireWildcard(_types);var _definitions=require("./definitions");var _definitions2=_interopRequireDefault(_definitions);var RUNTIME_MODULE_NAME="babel-runtime";var metadata={optional:true,group:"builtin-post-modules"};exports.metadata=metadata;function pre(file){file.set("helperGenerator",function(name){return file.addImport(""+RUNTIME_MODULE_NAME+"/helpers/"+name,name,"absoluteDefault")});file.setDynamic("regeneratorIdentifier",function(){return file.addImport(""+RUNTIME_MODULE_NAME+"/regenerator","regeneratorRuntime","absoluteDefault")})}function ReferencedIdentifier(node,parent,scope,file){if(node.name==="regeneratorRuntime"){return file.get("regeneratorIdentifier")}if(t.isMemberExpression(parent))return;if(!(0,_lodashObjectHas2["default"])(_definitions2["default"].builtins,node.name))return;if(scope.getBindingIdentifier(node.name))return;var modulePath=_definitions2["default"].builtins[node.name];return file.addImport(""+RUNTIME_MODULE_NAME+"/core-js/"+modulePath,node.name,"absoluteDefault")}function CallExpression(node,parent,scope,file){if(node.arguments.length)return;var callee=node.callee;if(!t.isMemberExpression(callee))return;if(!callee.computed)return;if(!this.get("callee.property").matchesPattern("Symbol.iterator"))return;return t.callExpression(file.addImport(""+RUNTIME_MODULE_NAME+"/core-js/get-iterator","getIterator","absoluteDefault"),[callee.object])}function BinaryExpression(node,parent,scope,file){if(node.operator!=="in")return;if(!this.get("left").matchesPattern("Symbol.iterator"))return;return t.callExpression(file.addImport(""+RUNTIME_MODULE_NAME+"/core-js/is-iterable","isIterable","absoluteDefault"),[node.right])}var MemberExpression={enter:function enter(node,parent,scope,file){if(!this.isReferenced())return;var obj=node.object;var prop=node.property;if(!t.isReferenced(obj,node))return;if(node.computed)return;if(!(0,_lodashObjectHas2["default"])(_definitions2["default"].methods,obj.name))return;var methods=_definitions2["default"].methods[obj.name];if(!(0,_lodashObjectHas2["default"])(methods,prop.name))return;if(scope.getBindingIdentifier(obj.name))return;var modulePath=methods[prop.name];return file.addImport(""+RUNTIME_MODULE_NAME+"/core-js/"+modulePath,""+obj.name+"$"+prop.name,"absoluteDefault")},exit:function exit(node,parent,scope,file){if(!this.isReferenced())return;var prop=node.property;var obj=node.object;if(!(0,_lodashObjectHas2["default"])(_definitions2["default"].builtins,obj.name))return;if(scope.getBindingIdentifier(obj.name))return;var modulePath=_definitions2["default"].builtins[obj.name];return t.memberExpression(file.addImport(""+RUNTIME_MODULE_NAME+"/core-js/"+modulePath,""+obj.name,"absoluteDefault"),prop)}};exports.MemberExpression=MemberExpression}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/other/runtime/index.js","/node_modules/babel-core/lib/babel/transformation/transformers/other/runtime")},{"../../../../types":589,"./definitions":554,_process:1069,buffer:919,"lodash/object/has":834}],556:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.ThisExpression=ThisExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={group:"builtin-pre"};exports.metadata=metadata;var THIS_BREAK_KEYS=["FunctionExpression","FunctionDeclaration","ClassExpression","ClassDeclaration"];var Program={enter:function enter(program){var first=program.body[0];var directive;if(t.isExpressionStatement(first)&&t.isLiteral(first.expression,{value:"use strict"})){directive=first}else{directive=t.expressionStatement(t.literal("use strict"));this.unshiftContainer("body",directive);if(first){directive.leadingComments=first.leadingComments;first.leadingComments=[]}}directive._blockHoist=Infinity}};exports.Program=Program;function ThisExpression(){if(!this.findParent(function(path){return!path.is("shadow")&&THIS_BREAK_KEYS.indexOf(path.type)>=0})){return t.identifier("undefined")}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/other/strict.js","/node_modules/babel-core/lib/babel/transformation/transformers/other")},{"../../../types":589,_process:1069,buffer:919}],557:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.BlockStatement=BlockStatement;exports.SwitchCase=SwitchCase;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);function statementList(key,path){var paths=path.get(key);for(var i=0;i3)continue;if(distance<=shortest)continue;closest=name;shortest=distance}var msg;if(closest){msg=messages.get("undeclaredVariableSuggestion",node.name,closest)}else{msg=messages.get("undeclaredVariable",node.name)}throw this.errorWithNode(msg,ReferenceError)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/transformation/transformers/validation/undeclared-variable-check.js","/node_modules/babel-core/lib/babel/transformation/transformers/validation")},{"../../../messages":455,_process:1069,buffer:919,leven:725}],564:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _path=require("./path");var _path2=_interopRequireDefault(_path);var _types=require("../types");var t=_interopRequireWildcard(_types);var TraversalContext=function(){function TraversalContext(scope,opts,state,parentPath){_classCallCheck(this,TraversalContext);this.parentPath=parentPath;this.scope=scope;this.state=state;this.opts=opts}TraversalContext.prototype.shouldVisit=function shouldVisit(node){var opts=this.opts;if(opts.enter||opts.exit)return true;if(opts[node.type])return true;var keys=t.VISITOR_KEYS[node.type];if(!keys||!keys.length)return false;var _arr=keys;for(var _i=0;_i<_arr.length;_i++){var key=_arr[_i];if(node[key])return true}return false};TraversalContext.prototype.create=function create(node,obj,key,containerKey){var path=_path2["default"].get({parentPath:this.parentPath,parent:node,container:obj,key:key,containerKey:containerKey});path.unshiftContext(this);return path};TraversalContext.prototype.visitMultiple=function visitMultiple(container,parent,containerKey){if(container.length===0)return false;var visited=[];var queue=this.queue=[];var stop=false;for(var key=0;key=0)continue;visited.push(path.node);if(path.visit()){stop=true;break}}var _arr3=queue;for(var _i3=0;_i3<_arr3.length;_i3++){var path=_arr3[_i3];path.shiftContext()}this.queue=null;return stop};TraversalContext.prototype.visitSingle=function visitSingle(node,key){if(this.shouldVisit(node[key])){var path=this.create(node,node,key);path.visit();path.shiftContext()}};TraversalContext.prototype.visit=function visit(node,key){var nodes=node[key];if(!nodes)return;if(Array.isArray(nodes)){return this.visitMultiple(nodes,node,key)}else{return this.visitSingle(node,key)}};return TraversalContext}();exports["default"]=TraversalContext;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/context.js","/node_modules/babel-core/lib/babel/traversal")},{"../types":589,"./path":573,_process:1069,buffer:919}],565:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var Hub=function Hub(file){_classCallCheck(this,Hub);this.file=file};exports["default"]=Hub;module.exports=exports["default"]; -}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/hub.js","/node_modules/babel-core/lib/babel/traversal")},{_process:1069,buffer:919}],566:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports["default"]=traverse;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _context=require("./context");var _context2=_interopRequireDefault(_context);var _visitors=require("./visitors");var visitors=_interopRequireWildcard(_visitors);var _messages=require("../messages");var messages=_interopRequireWildcard(_messages);var _lodashCollectionIncludes=require("lodash/collection/includes");var _lodashCollectionIncludes2=_interopRequireDefault(_lodashCollectionIncludes);var _types=require("../types");var t=_interopRequireWildcard(_types);function traverse(parent,opts,scope,state,parentPath){if(!parent)return;if(!opts.noScope&&!scope){if(parent.type!=="Program"&&parent.type!=="File"){throw new Error(messages.get("traverseNeedsParent",parent.type))}}if(!opts)opts={};visitors.verify(opts);visitors.explode(opts);if(Array.isArray(parent)){for(var i=0;i-1}function visit(){if(this.isBlacklisted())return false;if(this.opts.shouldSkip&&this.opts.shouldSkip(this))return false;this.call("enter");if(this.shouldSkip){return this.shouldStop}var node=this.node;var opts=this.opts;if(node){if(Array.isArray(node)){for(var i=0;i":return left>right;case"<=":return left<=right;case">=":return left>=right;case"==":return left==right;case"!=":return left!=right;case"===":return left===right;case"!==":return left!==right}}if(path.isCallExpression()){var callee=path.get("callee");var context;var func;if(callee.isIdentifier()&&!path.scope.getBinding(callee.node.name,true)&&VALID_CALLEES.indexOf(callee.node.name)>=0){func=global[node.callee.name]}if(callee.isMemberExpression()){var object=callee.get("object");var property=callee.get("property");if(object.isIdentifier()&&property.isIdentifier()&&VALID_CALLEES.indexOf(object.node.name)>=0){context=global[object.node.name];func=context[property.node.name]}if(object.isLiteral()&&property.isIdentifier()){var type=typeof object.node.value;if(type==="string"||type==="number"){context=object.node.value;func=context[property.node.name]}}}if(func){var args=path.get("arguments").map(evaluate);if(!confident)return;return func.apply(context,args)}}confident=false}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/path/evaluation.js","/node_modules/babel-core/lib/babel/traversal/path")},{_process:1069,buffer:919}],572:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.getStatementParent=getStatementParent;exports.getCompletionRecords=getCompletionRecords;exports.getSibling=getSibling;exports.get=get;exports._getKey=_getKey;exports._getPattern=_getPattern;exports.getBindingIdentifiers=getBindingIdentifiers;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _index=require("./index");var _index2=_interopRequireDefault(_index);var _types=require("../../types");var t=_interopRequireWildcard(_types);function getStatementParent(){var path=this;do{if(!path.parentPath||Array.isArray(path.container)&&path.isStatement()){break}else{path=path.parentPath}}while(path);if(path&&(path.isProgram()||path.isFile())){throw new Error("File/Program node, we can't possibly find a statement parent to this")}return path}function getCompletionRecords(){var paths=[];var add=function add(path){if(path)paths=paths.concat(path.getCompletionRecords())};if(this.isIfStatement()){add(this.get("consequent"));add(this.get("alternate"))}else if(this.isDoExpression()||this.isFor()||this.isWhile()){add(this.get("body"))}else if(this.isProgram()||this.isBlockStatement()){add(this.get("body").pop())}else if(this.isFunction()){return this.get("body").getCompletionRecords()}else{paths.push(this)}return paths}function getSibling(key){return _index2["default"].get({parentPath:this.parentPath,parent:this.parent,container:this.container,containerKey:this.containerKey,key:key})}function get(key){var parts=key.split(".");if(parts.length===1){return this._getKey(key)}else{return this._getPattern(parts)}}function _getKey(key){var _this=this;var node=this.node;var container=node[key];if(Array.isArray(container)){return container.map(function(_,i){return _index2["default"].get({containerKey:key,parentPath:_this,parent:node,container:container,key:i}).setContext()})}else{return _index2["default"].get({parentPath:this,parent:node,container:node,key:key}).setContext()}}function _getPattern(parts){var path=this;var _arr=parts;for(var _i=0;_i<_arr.length;_i++){var part=_arr[_i];if(part==="."){path=path.parentPath}else{if(Array.isArray(path)){path=path[part]}else{path=path.get(part)}}}return path}function getBindingIdentifiers(){return t.getBindingIdentifiers(this.node)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/path/family.js","/node_modules/babel-core/lib/babel/traversal/path")},{"../../types":589,"./index":573,_process:1069,buffer:919}],573:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _libVirtualTypes=require("./lib/virtual-types");var virtualTypes=_interopRequireWildcard(_libVirtualTypes);var _index=require("../index");var _index2=_interopRequireDefault(_index);var _lodashObjectAssign=require("lodash/object/assign");var _lodashObjectAssign2=_interopRequireDefault(_lodashObjectAssign);var _scope=require("../scope");var _scope2=_interopRequireDefault(_scope);var _types=require("../../types");var t=_interopRequireWildcard(_types);var NodePath=function(){function NodePath(hub,parent){_classCallCheck(this,NodePath);this.contexts=[];this.parent=parent;this.data={};this.hub=hub}NodePath.get=function get(_ref){var hub=_ref.hub;var parentPath=_ref.parentPath;var parent=_ref.parent;var container=_ref.container;var containerKey=_ref.containerKey;var key=_ref.key;if(!hub&&parentPath){hub=parentPath.hub}var targetNode=container[key];var paths=parent._paths=parent._paths||[];var path;for(var i=0;iparts.length){return false}}return true}function has(key){var val=this.node[key];if(val&&Array.isArray(val)){return!!val.length}else{return!!val}}var is=has;exports.is=is;function isnt(key){return!this.has(key)}function equals(key,value){return this.node[key]===value}function isNodeType(type){return t.isType(this.type,type)}function canHaveVariableDeclarationOrExpression(){return(this.key==="init"||this.key==="left")&&this.parentPath.isFor()}function isCompletionRecord(allowInsideFunction){var path=this;var first=true;do{var container=path.container;if(path.isFunction()&&!first){return!!allowInsideFunction}first=false;if(Array.isArray(container)&&path.key!==container.length-1){return false}}while((path=path.parentPath)&&!path.isProgram());return true}function isStatementOrBlock(){if(this.parentPath.isLabeledStatement()||t.isBlockStatement(this.container)){return false}else{return(0,_lodashCollectionIncludes2["default"])(t.STATEMENT_OR_BLOCK_KEYS,this.key)}}function isUser(){return this.node&&!!this.node.loc}function isGenerated(){return!this.isUser()}function referencesImport(moduleSource,importName){if(!this.isReferencedIdentifier())return false;var binding=this.scope.getBinding(this.node.name);if(!binding||binding.kind!=="module")return false;var path=binding.path;if(!path.isImportDeclaration())return false;if(path.node.source.value===moduleSource){if(!importName)return true}else{return false}var _arr=path.node.specifiers;for(var _i=0;_i<_arr.length;_i++){var specifier=_arr[_i];if(t.isSpecifierDefault(specifier)&&importName==="default"){return true}if(t.isImportNamespaceSpecifier(specifier)&&importName==="*"){return true}if(t.isImportSpecifier(specifier)&&specifier.imported.name===importName){return true}}return false}function getSource(){var node=this.node;if(node.end){return this.hub.file.code.slice(node.start,node.end)}else{return""}}function willIMaybeExecutesBefore(target){return this._guessExecutionStatusRelativeTo(target)!=="after"}function _guessExecutionStatusRelativeTo(target){var self=this.getStatementParent();target=target.getStatementParent();var targetFuncParent=target.scope.getFunctionParent();var selfFuncParent=self.scope.getFunctionParent();if(targetFuncParent!==selfFuncParent){return"function"}do{if(target.container===self.container){return target.key>self.key?"before":"after"}}while(self=self.parentPath);return"before"}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/path/introspection.js","/node_modules/babel-core/lib/babel/traversal/path")},{"../../types":589,_process:1069,buffer:919,"lodash/collection/includes":736}],575:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _transformationHelpersReact=require("../../../transformation/helpers/react");var react=_interopRequireWildcard(_transformationHelpersReact);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var referenceVisitor={ReferencedIdentifier:function ReferencedIdentifier(node,parent,scope,state){if(this.isJSXIdentifier()&&react.isCompatTag(node.name)){return}var bindingInfo=scope.getBinding(node.name);if(!bindingInfo)return;if(bindingInfo!==state.scope.getBinding(node.name))return;if(bindingInfo.constant){state.bindings[node.name]=bindingInfo}else{var _arr=bindingInfo.constantViolations;for(var _i=0;_i<_arr.length;_i++){var violationPath=_arr[_i];state.breakOnScopePaths.push(violationPath.scope.path)}}}};var PathHoister=function(){function PathHoister(path,scope){_classCallCheck(this,PathHoister);this.breakOnScopePaths=[];this.bindings={};this.scopes=[];this.scope=scope;this.path=path}PathHoister.prototype.isCompatibleScope=function isCompatibleScope(scope){for(var key in this.bindings){var binding=this.bindings[key];if(!scope.bindingIdentifierEquals(key,binding.identifier)){return false}}return true};PathHoister.prototype.getCompatibleScopes=function getCompatibleScopes(){var scope=this.path.scope;do{if(this.isCompatibleScope(scope)){this.scopes.push(scope)}else{break}if(this.breakOnScopePaths.indexOf(scope.path)>=0){break}}while(scope=scope.parent)};PathHoister.prototype.getAttachmentPath=function getAttachmentPath(){var scopes=this.scopes;var scope=scopes.pop();if(!scope)return;if(scope.path.isFunction()){if(this.hasOwnParamBindings(scope)){if(this.scope===scope)return;return scope.path.get("body").get("body")[0]}else{return this.getNextScopeStatementParent()}}else if(scope.path.isProgram()){return this.getNextScopeStatementParent()}};PathHoister.prototype.getNextScopeStatementParent=function getNextScopeStatementParent(){var scope=this.scopes.pop();if(scope)return scope.path.getStatementParent()};PathHoister.prototype.hasOwnParamBindings=function hasOwnParamBindings(scope){for(var name in this.bindings){if(!scope.hasOwnBinding(name))continue;var binding=this.bindings[name];if(binding.kind==="param")return true}return false};PathHoister.prototype.run=function run(){var node=this.path.node;if(node._hoisted)return;node._hoisted=true;this.path.traverse(referenceVisitor,this);this.getCompatibleScopes();var path=this.getAttachmentPath();if(!path)return;var uid=path.scope.generateUidIdentifier("ref");path.insertBefore([t.variableDeclaration("var",[t.variableDeclarator(uid,this.path.node)])]);var parent=this.path.parentPath;if(parent.isJSXElement()&&this.path.container===parent.node.children){uid=t.jSXExpressionContainer(uid)}this.path.replaceWith(uid)};return PathHoister}();exports["default"]=PathHoister;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/path/lib/hoister.js","/node_modules/babel-core/lib/babel/traversal/path/lib")},{"../../../transformation/helpers/react":474,"../../../types":589,_process:1069,buffer:919}],576:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){ -if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var pre=[function(self){if(self.key==="body"&&(self.isBlockStatement()||self.isClassBody())){self.node.body=[];return true}},function(self,parent){var replace=false;replace=replace||self.key==="body"&&parent.isArrowFunctionExpression();replace=replace||self.key==="argument"&&parent.isThrowStatement();if(replace){self.replaceWith(t.identifier("undefined"));return true}}];exports.pre=pre;var post=[function(self,parent){var removeParent=false;removeParent=removeParent||self.key==="test"&&(parent.isWhile()||parent.isSwitchCase());removeParent=removeParent||self.key==="declaration"&&parent.isExportDeclaration();removeParent=removeParent||self.key==="body"&&parent.isLabeledStatement();removeParent=removeParent||self.containerKey==="declarations"&&parent.isVariableDeclaration()&&parent.node.declarations.length===0;removeParent=removeParent||self.key==="expression"&&parent.isExpressionStatement();removeParent=removeParent||self.key==="test"&&parent.isIfStatement();if(removeParent){parent.dangerouslyRemove();return true}},function(self,parent){if(parent.isSequenceExpression()&&parent.node.expressions.length===1){parent.replaceWith(parent.node.expressions[0]);return true}},function(self,parent){if(parent.isBinary()){if(self.key==="left"){parent.replaceWith(parent.node.right)}else{parent.replaceWith(parent.node.left)}return true}}];exports.post=post}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/path/lib/removal-hooks.js","/node_modules/babel-core/lib/babel/traversal/path/lib")},{"../../../types":589,_process:1069,buffer:919}],577:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _transformationHelpersReact=require("../../../transformation/helpers/react");var react=_interopRequireWildcard(_transformationHelpersReact);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var ReferencedIdentifier={types:["Identifier","JSXIdentifier"],checkPath:function checkPath(_ref,opts){var node=_ref.node;var parent=_ref.parent;if(!t.isIdentifier(node,opts)){if(t.isJSXIdentifier(node,opts)){if(react.isCompatTag(node.name))return false}else{return false}}return t.isReferenced(node,parent)}};exports.ReferencedIdentifier=ReferencedIdentifier;var Expression={types:["Expression"],checkPath:function checkPath(path){if(path.isIdentifier()){return path.isReferencedIdentifier()}else{return t.isExpression(path.node)}}};exports.Expression=Expression;var Scope={types:["Scopable"],checkPath:function checkPath(path){return t.isScope(path.node,path.parent)}};exports.Scope=Scope;var Referenced={checkPath:function checkPath(path){return t.isReferenced(path.node,path.parent)}};exports.Referenced=Referenced;var BlockScoped={checkPath:function checkPath(path){return t.isBlockScoped(path.node)}};exports.BlockScoped=BlockScoped;var Var={types:["VariableDeclaration"],checkPath:function checkPath(path){return t.isVar(path.node)}};exports.Var=Var}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/path/lib/virtual-types.js","/node_modules/babel-core/lib/babel/traversal/path/lib")},{"../../../transformation/helpers/react":474,"../../../types":589,_process:1069,buffer:919}],578:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.insertBefore=insertBefore;exports._containerInsert=_containerInsert;exports._containerInsertBefore=_containerInsertBefore;exports._containerInsertAfter=_containerInsertAfter;exports._maybePopFromStatements=_maybePopFromStatements;exports.insertAfter=insertAfter;exports.updateSiblingKeys=updateSiblingKeys;exports._verifyNodeList=_verifyNodeList;exports.unshiftContainer=unshiftContainer;exports.pushContainer=pushContainer;exports.hoist=hoist;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _libHoister=require("./lib/hoister");var _libHoister2=_interopRequireDefault(_libHoister);var _index=require("./index");var _index2=_interopRequireDefault(_index);var _types=require("../../types");var t=_interopRequireWildcard(_types);function insertBefore(nodes){this._assertUnremoved();nodes=this._verifyNodeList(nodes);if(this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement()){return this.parentPath.insertBefore(nodes)}else if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&this.key==="init"){if(this.node)nodes.push(this.node);this.replaceExpressionWithStatements(nodes)}else if(this.isNodeType("Statement")||!this.type){this._maybePopFromStatements(nodes);if(Array.isArray(this.container)){return this._containerInsertBefore(nodes)}else if(this.isStatementOrBlock()){if(this.node)nodes.push(this.node);this.node=this.container[this.key]=t.blockStatement(nodes)}else{throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?")}}else{throw new Error("No clue what to do with this node type.")}return[this]}function _containerInsert(from,nodes){this.updateSiblingKeys(from,nodes.length);var paths=[];for(var i=0;i=fromIndex){path.key+=incrementBy}}}function _verifyNodeList(nodes){if(nodes.constructor!==Array){nodes=[nodes]}for(var i=0;i=0)return;resolved=resolved||[];resolved.push(this);if(this.isVariableDeclarator()){if(this.get("id").isIdentifier()){return this.get("init").resolve(dangerous,resolved)}else{}}else if(this.isReferencedIdentifier()){var binding=this.scope.getBinding(this.node.name);if(!binding)return;if(!binding.constant)return;if(binding.kind==="module")return;if(binding.path!==this){return binding.path.resolve(dangerous,resolved)}}else if(this.isTypeCastExpression()){return this.get("expression").resolve(dangerous,resolved)}else if(dangerous&&this.isMemberExpression()){var targetKey=this.toComputedKey();if(!t.isLiteral(targetKey))return;var targetName=targetKey.value;var target=this.get("object").resolve(dangerous,resolved);if(target.isObjectExpression()){var props=target.get("properties");var _arr=props;for(var _i=0;_i<_arr.length;_i++){var prop=_arr[_i];if(!prop.isProperty())continue;var key=prop.get("key");var match=prop.isnt("computed")&&key.isIdentifier({name:targetName});match=match||key.isLiteral({value:targetName});if(match)return prop.get("value").resolve(dangerous,resolved)}}else if(target.isArrayExpression()&&!isNaN(+targetName)){var elems=target.get("elements");var elem=elems[targetName];if(elem)return elem.resolve(dangerous,resolved)}}}function getTypeAnnotation(force){if(this.typeAnnotation)return this.typeAnnotation;var type=this._getTypeAnnotation(force)||t.anyTypeAnnotation();if(t.isTypeAnnotation(type))type=type.typeAnnotation;return this.typeAnnotation=type}function _getTypeAnnotationBindingConstantViolations(path,name){var binding=this.scope.getBinding(name);var types=[];this.typeAnnotation=t.unionTypeAnnotation(types);var functionConstantViolations=[];var constantViolations=getConstantViolationsBefore(binding,path,functionConstantViolations);var testType=getTypeAnnotationBasedOnConditional(path,name);if(testType){var testConstantViolations=getConstantViolationsBefore(binding,testType.ifStatement);constantViolations=constantViolations.filter(function(path){return testConstantViolations.indexOf(path)<0});types.push(testType.typeAnnotation)}if(constantViolations.length){var rawConstantViolations=constantViolations.reverse();var visitedScopes=[];constantViolations=[];var _arr2=rawConstantViolations;for(var _i2=0;_i2<_arr2.length;_i2++){var violation=_arr2[_i2];if(visitedScopes.indexOf(violation.scope)>=0)continue;visitedScopes.push(violation.scope);constantViolations.push(violation)}constantViolations=constantViolations.concat(functionConstantViolations);var _arr3=constantViolations;for(var _i3=0;_i3<_arr3.length;_i3++){var violation=_arr3[_i3];types.push(violation.getTypeAnnotation())}}if(types.length){return t.createUnionTypeAnnotation(types)}}function getConstantViolationsBefore(binding,path,functions){var violations=binding.constantViolations.slice();violations.unshift(binding.path);return violations.filter(function(violation){violation=violation.resolve();var status=violation._guessExecutionStatusRelativeTo(path);if(functions&&status==="function")functions.push(violation);return status==="before"})}function checkBinary(name,path){var right=path.get("right").resolve();var left=path.get("left").resolve();if(left.isIdentifier({name:name})){return right.getTypeAnnotation()}else if(right.isIdentifier({name:name})){return left.getTypeAnnotation()}var typeofPath;var typePath;if(left.isUnaryExpression({operator:"typeof"})){typeofPath=left;typePath=right}else if(right.isUnaryExpression({operator:"typeof"})){typeofPath=right;typePath=left}if(!typePath&&!typeofPath)return;typePath=typePath.resolve();if(!typePath.isLiteral())return;var typeValue=typePath.node.value;if(typeof typeValue!=="string")return;if(!typeofPath.get("argument").isIdentifier({name:name}))return;return t.createTypeAnnotationBasedOnTypeof(typePath.node.value)}function getParentConditional(path){var parentPath;while(parentPath=path.parentPath){if(parentPath.isIfStatement()||parentPath.isConditionalExpression()){if(path.key==="test"){return}else{return parentPath}}else{path=parentPath}}}function getTypeAnnotationBasedOnConditional(path,name){var ifStatement=getParentConditional(path);if(!ifStatement)return;var test=ifStatement.get("test");var paths=[test];var types=[];do{var _path=paths.shift().resolve();if(_path.isLogicalExpression()){paths.push(_path.get("left"));paths.push(_path.get("right"))}if(_path.isBinaryExpression({operator:"==="})){var type=checkBinary(name,_path);if(type)types.push(type)}}while(paths.length);if(types.length){return{typeAnnotation:t.createUnionTypeAnnotation(types),ifStatement:ifStatement}}else{return getTypeAnnotationBasedOnConditional(ifStatement,name)}}function _getTypeAnnotation(force){var node=this.node;if(!node){if(this.key==="init"&&this.parentPath.isVariableDeclarator()){var declar=this.parentPath.parentPath;var declarParent=declar.parentPath;if(declar.key==="left"&&declarParent.isForInStatement()){return t.stringTypeAnnotation()}if(declar.key==="left"&&declarParent.isForOfStatement()){return t.anyTypeAnnotation()}return t.voidTypeAnnotation()}else{return}}if(node.typeAnnotation){return node.typeAnnotation}if(this.isVariableDeclarator()){var id=this.get("id");if(id.isIdentifier()){return this.get("init").getTypeAnnotation()}else{return}}if(this.parentPath.isTypeCastExpression()){return this.parentPath.getTypeAnnotation()}if(this.isTypeCastExpression()){return node.typeAnnotation}if(this.isRestElement()||this.parentPath.isRestElement()||this.isArrayExpression()){return t.genericTypeAnnotation(t.identifier("Array"))}if(!force&&this.parentPath.isReturnStatement()){return this.parentPath.getTypeAnnotation()}if(this.isReturnStatement()){var funcPath=this.findParent(function(path){return path.isFunction()});if(!funcPath)return;var returnType=funcPath.node.returnType;if(returnType){return returnType}else{return this.get("argument").getTypeAnnotation(true)}}if(this.isNewExpression()&&this.get("callee").isIdentifier()){return t.genericTypeAnnotation(node.callee)}if(this.isReferencedIdentifier()){var binding=this.scope.getBinding(node.name);if(binding){if(binding.identifier.typeAnnotation){return binding.identifier.typeAnnotation}else{return this._getTypeAnnotationBindingConstantViolations(this,node.name)}}if(node.name==="undefined"){return t.voidTypeAnnotation()}else if(node.name==="NaN"||node.name==="Infinity"){return t.numberTypeAnnotation()}else if(node.name==="arguments"){}}if(this.isObjectExpression()){return t.genericTypeAnnotation(t.identifier("Object"))}if(this.isFunction()||this.isClass()){return t.genericTypeAnnotation(t.identifier("Function"))}if(this.isTemplateLiteral()){return t.stringTypeAnnotation()}if(this.isUnaryExpression()){var operator=node.operator;if(operator==="void"){return t.voidTypeAnnotation()}else if(t.NUMBER_UNARY_OPERATORS.indexOf(operator)>=0){return t.numberTypeAnnotation()}else if(t.STRING_UNARY_OPERATORS.indexOf(operator)>=0){return t.stringTypeAnnotation()}else if(t.BOOLEAN_UNARY_OPERATORS.indexOf(operator)>=0){return t.booleanTypeAnnotation()}}if(this.isBinaryExpression()){var operator=node.operator;if(t.NUMBER_BINARY_OPERATORS.indexOf(operator)>=0){return t.numberTypeAnnotation()}else if(t.BOOLEAN_BINARY_OPERATORS.indexOf(operator)>=0){return t.booleanTypeAnnotation()}else if(operator==="+"){var right=this.get("right");var left=this.get("left");if(left.isGenericType("Number")&&right.isGenericType("Number")){return t.numberTypeAnnotation()}else if(left.isGenericType("String")||right.isGenericType("String")){return t.stringTypeAnnotation()}return t.unionTypeAnnotation([t.stringTypeAnnotation(),t.numberTypeAnnotation()])}}if(this.isLogicalExpression()){return t.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(),this.get("right").getTypeAnnotation()])}if(this.isConditionalExpression()){return t.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(),this.get("alternate").getTypeAnnotation()])}if(this.isSequenceExpression()){return this.get("expressions").pop().getTypeAnnotation(force)}if(this.isAssignmentExpression()){return this.get("right").getTypeAnnotation(force)}if(this.isUpdateExpression()){var operator=node.operator;if(operator==="++"||operator==="--"){return t.numberTypeAnnotation()}}if(this.isLiteral()){var value=node.value;if(typeof value==="string")return t.stringTypeAnnotation();if(typeof value==="number")return t.numberTypeAnnotation();if(typeof value==="boolean")return t.booleanTypeAnnotation();if(value===null)return t.voidTypeAnnotation();if(node.regex)return t.genericTypeAnnotation(t.identifier("RegExp"))}var callPath;if(this.isCallExpression())callPath=this.get("callee");if(this.isTaggedTemplateExpression())callPath=this.get("tag");if(callPath){var callee=callPath.resolve();if(callee.isFunction()){if(callee.is("async")){if(callee.is("generator")){return t.genericTypeAnnotation(t.identifier("AsyncIterator"))}else{return t.genericTypeAnnotation(t.identifier("Promise"))}}else{if(callee.node.returnType){return callee.node.returnType}else{}}}}}function isGenericType(genericName){var type=this.getTypeAnnotation();if(t.isGenericTypeAnnotation(type)&&t.isIdentifier(type.id,{name:genericName})){return true}if(genericName==="String"){return t.isStringTypeAnnotation(type)}else if(genericName==="Number"){return t.isNumberTypeAnnotation(type)}else if(genericName==="Boolean"){return t.isBooleanTypeAnnotation(type)}return false}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/path/resolution.js","/node_modules/babel-core/lib/babel/traversal/path")},{"../../types":589,_process:1069,buffer:919}],582:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var Binding=function(){function Binding(_ref){var existing=_ref.existing;var identifier=_ref.identifier;var scope=_ref.scope;var path=_ref.path;var kind=_ref.kind;_classCallCheck(this,Binding);this.constantViolations=[];this.constant=true;this.identifier=identifier;this.references=0;this.referenced=false;this.scope=scope;this.path=path;this.kind=kind;this.clearValue();if(existing){this.constantViolations=[].concat(existing.path,existing.constantViolations,this.constantViolations)}}Binding.prototype.deoptValue=function deoptValue(){this.clearValue();this.hasDeoptedValue=true};Binding.prototype.setValue=function setValue(value){if(this.hasDeoptedValue)return;this.hasValue=true;this.value=value};Binding.prototype.clearValue=function clearValue(){this.hasDeoptedValue=false;this.hasValue=false;this.value=null};Binding.prototype.reassign=function reassign(path){this.constant=false;this.constantViolations.push(path)};Binding.prototype.reference=function reference(){this.referenced=true;this.references++};Binding.prototype.dereference=function dereference(){this.references--;this.referenced=!!this.references};Binding.prototype.isCompatibleWithType=function isCompatibleWithType(){return false};return Binding}();exports["default"]=Binding;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/scope/binding.js","/node_modules/babel-core/lib/babel/traversal/scope")},{_process:1069,buffer:919}],583:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;var _createClass=function(){function defineProperties(target,props){for(var i=0;i1)id+=i;return"_"+id};Scope.prototype.generateUidIdentifierBasedOnNode=function generateUidIdentifierBasedOnNode(parent,defaultName){var node=parent;if(t.isAssignmentExpression(parent)){node=parent.left}else if(t.isVariableDeclarator(parent)){node=parent.id}else if(t.isProperty(node)){node=node.key}var parts=[];var add=function add(node){if(t.isModuleDeclaration(node)){if(node.source){add(node.source)}else if(node.specifiers&&node.specifiers.length){var _arr4=node.specifiers;for(var _i4=0;_i4<_arr4.length;_i4++){var specifier=_arr4[_i4];add(specifier)}}else if(node.declaration){add(node.declaration)}}else if(t.isModuleSpecifier(node)){add(node.local)}else if(t.isMemberExpression(node)){add(node.object);add(node.property)}else if(t.isIdentifier(node)){parts.push(node.name)}else if(t.isLiteral(node)){parts.push(node.value)}else if(t.isCallExpression(node)){add(node.callee)}else if(t.isObjectExpression(node)||t.isObjectPattern(node)){var _arr5=node.properties;for(var _i5=0;_i5<_arr5.length;_i5++){var prop=_arr5[_i5];add(prop.key||prop.argument)}}};add(node);var id=parts.join("$");id=id.replace(/^_/,"")||defaultName||"ref";return this.generateUidIdentifier(id)};Scope.prototype.isStatic=function isStatic(node){if(t.isThisExpression(node)||t.isSuper(node)){return true}if(t.isIdentifier(node)&&this.hasBinding(node.name)){return true}return false};Scope.prototype.maybeGenerateMemoised=function maybeGenerateMemoised(node,dontPush){if(this.isStatic(node)){return null}else{var id=this.generateUidIdentifierBasedOnNode(node);if(!dontPush)this.push({id:id});return id}};Scope.prototype.checkBlockScopedCollisions=function checkBlockScopedCollisions(local,kind,name,id){if(kind==="param")return;if(kind==="hoisted"&&local.kind==="let")return;var duplicate=false;if(!duplicate)duplicate=kind==="let"||local.kind==="let"||local.kind==="const"||local.kind==="module";if(!duplicate)duplicate=local.kind==="param"&&(kind==="let"||kind==="const");if(duplicate){throw this.hub.file.errorWithNode(id,messages.get("scopeDuplicateDeclaration",name),TypeError)}};Scope.prototype.rename=function rename(oldName,newName,block){newName=newName||this.generateUidIdentifier(oldName).name;var info=this.getBinding(oldName);if(!info)return;var state={newName:newName,oldName:oldName,binding:info.identifier,info:info};var scope=info.scope;scope.traverse(block||scope.block,renameVisitor,state);if(!block){scope.removeOwnBinding(oldName);scope.bindings[newName]=info;state.binding.name=newName}var file=this.hub.file;if(file){this._renameFromMap(file.moduleFormatter.localImports,oldName,newName,state.binding)}};Scope.prototype._renameFromMap=function _renameFromMap(map,oldName,newName,value){if(map[oldName]){map[newName]=value;map[oldName]=null}};Scope.prototype.dump=function dump(){var sep=(0,_repeating2["default"])("-",60);console.log(sep);var scope=this;do{console.log("#",scope.block.type);for(var name in scope.bindings){var binding=scope.bindings[name];console.log(" -",name,{constant:binding.constant,references:binding.references})}}while(scope=scope.parent);console.log(sep)};Scope.prototype.toArray=function toArray(node,i){var file=this.hub.file;if(t.isIdentifier(node)){var binding=this.getBinding(node.name);if(binding&&binding.constant&&binding.path.isGenericType("Array"))return node}if(t.isArrayExpression(node)){return node}if(t.isIdentifier(node,{name:"arguments"})){return t.callExpression(t.memberExpression(file.addHelper("slice"),t.identifier("call")),[node])}var helperName="to-array";var args=[node];if(i===true){helperName="to-consumable-array"}else if(i){args.push(t.literal(i));helperName="sliced-to-array";if(this.hub.file.isLoose("es6.forOf"))helperName+="-loose"}return t.callExpression(file.addHelper(helperName),args)};Scope.prototype.registerDeclaration=function registerDeclaration(path){if(path.isFunctionDeclaration()){this.registerBinding("hoisted",path)}else if(path.isVariableDeclaration()){var declarations=path.get("declarations");var _arr6=declarations;for(var _i6=0;_i6<_arr6.length;_i6++){var declar=_arr6[_i6];this.registerBinding(path.node.kind,declar)}}else if(path.isClassDeclaration()){this.registerBinding("let",path)}else if(path.isImportDeclaration()||path.isExportDeclaration()){this.registerBinding("module",path)}else if(path.isFlowDeclaration()){this.registerBinding("type",path)}else{this.registerBinding("unknown",path)}};Scope.prototype.registerConstantViolation=function registerConstantViolation(root,left,right){var ids=left.getBindingIdentifiers();for(var name in ids){var binding=this.getBinding(name);if(!binding)continue;if(right){var rightType=right.typeAnnotation;if(rightType&&binding.isCompatibleWithType(rightType))continue}binding.reassign(root,left,right)}};Scope.prototype.registerBinding=function registerBinding(kind,path){if(!kind)throw new ReferenceError("no `kind`");if(path.isVariableDeclaration()){var declarators=path.get("declarations");var _arr7=declarators;for(var _i7=0;_i7<_arr7.length;_i7++){var declar=_arr7[_i7];this.registerBinding(kind,declar)}return}var parent=this.getProgramParent();var ids=path.getBindingIdentifiers();for(var name in ids){var id=ids[name];var local=this.getOwnBindingInfo(name);if(local){if(kind==="type")continue;if(local.identifier===id)continue;this.checkBlockScopedCollisions(local,kind,name,id)}parent.references[name]=true;this.bindings[name]=new _binding2["default"]({identifier:id,existing:local,scope:this,path:path,kind:kind})}};Scope.prototype.addGlobal=function addGlobal(node){this.globals[node.name]=node};Scope.prototype.hasUid=function hasUid(name){var scope=this;do{if(scope.uids[name])return true}while(scope=scope.parent);return false};Scope.prototype.hasGlobal=function hasGlobal(name){var scope=this;do{if(scope.globals[name])return true}while(scope=scope.parent);return false};Scope.prototype.hasReference=function hasReference(name){var scope=this;do{if(scope.references[name])return true}while(scope=scope.parent);return false};Scope.prototype.isPure=function isPure(node,constantsOnly){if(t.isIdentifier(node)){var binding=this.getBinding(node.name);if(!binding)return false;if(constantsOnly)return binding.constant;return true}else if(t.isClass(node)){return!node.superClass||this.isPure(node.superClass,constantsOnly)}else if(t.isBinary(node)){return this.isPure(node.left,constantsOnly)&&this.isPure(node.right,constantsOnly)}else if(t.isArrayExpression(node)){var _arr8=node.elements;for(var _i8=0;_i8<_arr8.length;_i8++){var elem=_arr8[_i8];if(!this.isPure(elem,constantsOnly))return false}return true}else if(t.isObjectExpression(node)){var _arr9=node.properties;for(var _i9=0;_i9<_arr9.length;_i9++){var prop=_arr9[_i9];if(!this.isPure(prop,constantsOnly))return false}return true}else if(t.isProperty(node)){if(node.computed&&!this.isPure(node.key,constantsOnly))return false;return this.isPure(node.value,constantsOnly)}else{return t.isPure(node)}};Scope.prototype.init=function init(){if(!this.references)this.crawl()};Scope.prototype.crawl=function crawl(){var path=this.path;var info=this.block._scopeInfo;if(info)return(0,_lodashObjectExtend2["default"])(this,info);info=this.block._scopeInfo={references:(0,_helpersObject2["default"])(),bindings:(0,_helpersObject2["default"])(),globals:(0,_helpersObject2["default"])(),uids:(0,_helpersObject2["default"])()};(0,_lodashObjectExtend2["default"])(this,info);if(path.isLoop()){var _arr10=t.FOR_INIT_KEYS;for(var _i10=0;_i10<_arr10.length;_i10++){var key=_arr10[_i10];var node=path.get(key);if(node.isBlockScoped())this.registerBinding(node.node.kind,node)}}if(path.isFunctionExpression()&&path.has("id")){if(!t.isProperty(path.parent,{method:true})){this.registerBinding("var",path)}}if(path.isClassExpression()&&path.has("id")){this.registerBinding("var",path)}if(path.isFunction()){var params=path.get("params");var _arr11=params;for(var _i11=0;_i11<_arr11.length;_i11++){var param=_arr11[_i11];this.registerBinding("param",param)}}if(path.isCatchClause()){this.registerBinding("let",path)}if(path.isComprehensionExpression()){this.registerBinding("let",path)}var parent=this.getProgramParent();if(parent.crawling)return;this.crawling=true;path.traverse(collectorVisitor);this.crawling=false};Scope.prototype.push=function push(opts){var path=this.path;if(path.isSwitchStatement()){path=this.getFunctionParent().path}if(path.isLoop()||path.isCatchClause()||path.isFunction()){t.ensureBlock(path.node);path=path.get("body")}if(!path.isBlockStatement()&&!path.isProgram()){path=this.getBlockParent().path}var unique=opts.unique;var kind=opts.kind||"var";var dataKey="declaration:"+kind;var declar=!unique&&path.getData(dataKey);if(!declar){declar=t.variableDeclaration(kind,[]);declar._generated=true;declar._blockHoist=2;this.hub.file.attachAuxiliaryComment(declar);var _path$unshiftContainer=path.unshiftContainer("body",[declar]);var declarPath=_path$unshiftContainer[0];this.registerBinding(kind,declarPath);if(!unique)path.setData(dataKey,declar)}declar.declarations.push(t.variableDeclarator(opts.id,opts.init))};Scope.prototype.getProgramParent=function getProgramParent(){var scope=this;do{if(scope.path.isProgram()){return scope}}while(scope=scope.parent);throw new Error("We couldn't find a Function or Program...")};Scope.prototype.getFunctionParent=function getFunctionParent(){var scope=this;do{if(scope.path.isFunctionParent()){return scope}}while(scope=scope.parent);throw new Error("We couldn't find a Function or Program...")};Scope.prototype.getBlockParent=function getBlockParent(){var scope=this;do{if(scope.path.isBlockParent()){return scope}}while(scope=scope.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")};Scope.prototype.getAllBindings=function getAllBindings(){var ids=(0,_helpersObject2["default"])();var scope=this;do{(0,_lodashObjectDefaults2["default"])(ids,scope.bindings);scope=scope.parent}while(scope);return ids};Scope.prototype.getAllBindingsOfKind=function getAllBindingsOfKind(){var ids=(0,_helpersObject2["default"])();var _arr12=arguments;for(var _i12=0;_i12<_arr12.length;_i12++){var kind=_arr12[_i12];var scope=this;do{for(var name in scope.bindings){var binding=scope.bindings[name];if(binding.kind===kind)ids[name]=binding}scope=scope.parent}while(scope)}return ids};Scope.prototype.bindingIdentifierEquals=function bindingIdentifierEquals(name,node){return this.getBindingIdentifier(name)===node};Scope.prototype.getBinding=function getBinding(name){var scope=this;do{var binding=scope.getOwnBindingInfo(name);if(binding)return binding}while(scope=scope.parent)};Scope.prototype.getOwnBindingInfo=function getOwnBindingInfo(name){return this.bindings[name]};Scope.prototype.getBindingIdentifier=function getBindingIdentifier(name){var info=this.getBinding(name);return info&&info.identifier};Scope.prototype.getOwnBindingIdentifier=function getOwnBindingIdentifier(name){var binding=this.bindings[name];return binding&&binding.identifier};Scope.prototype.hasOwnBinding=function hasOwnBinding(name){return!!this.getOwnBindingInfo(name)};Scope.prototype.hasBinding=function hasBinding(name,noGlobals){if(!name)return false;if(this.hasOwnBinding(name))return true;if(this.parentHasBinding(name,noGlobals))return true;if(this.hasUid(name))return true;if(!noGlobals&&(0,_lodashCollectionIncludes2["default"])(Scope.globals,name))return true;if(!noGlobals&&(0,_lodashCollectionIncludes2["default"])(Scope.contextVariables,name))return true;return false};Scope.prototype.parentHasBinding=function parentHasBinding(name,noGlobals){return this.parent&&this.parent.hasBinding(name,noGlobals)};Scope.prototype.moveBindingTo=function moveBindingTo(name,scope){var info=this.getBinding(name);if(info){info.scope.removeOwnBinding(name);info.scope=scope;scope.bindings[name]=info}};Scope.prototype.removeOwnBinding=function removeOwnBinding(name){delete this.bindings[name]};Scope.prototype.removeBinding=function removeBinding(name){var info=this.getBinding(name);if(info)info.scope.removeOwnBinding(name)};_createClass(Scope,null,[{key:"globals",value:(0,_lodashArrayFlatten2["default"])([_globals2["default"].builtin,_globals2["default"].browser,_globals2["default"].node].map(Object.keys)),enumerable:true},{key:"contextVariables",value:["arguments","undefined","Infinity","NaN"],enumerable:true}]);return Scope}();exports["default"]=Scope;module.exports=exports["default"]}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/scope/index.js","/node_modules/babel-core/lib/babel/traversal/scope")},{"../../helpers/object":453,"../../messages":455,"../../types":589,"../index":566,"./binding":582,_process:1069,buffer:919,globals:719,"lodash/array/flatten":729,"lodash/collection/includes":736,"lodash/object/defaults":832,"lodash/object/extend":833,repeating:894}],584:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.explode=explode;exports.verify=verify;exports.merge=merge;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _pathLibVirtualTypes=require("./path/lib/virtual-types");var virtualTypes=_interopRequireWildcard(_pathLibVirtualTypes);var _messages=require("../messages");var messages=_interopRequireWildcard(_messages);var _types=require("../types");var t=_interopRequireWildcard(_types);var _lodashLangClone=require("lodash/lang/clone");var _lodashLangClone2=_interopRequireDefault(_lodashLangClone);var _esquery=require("esquery");var _esquery2=_interopRequireDefault(_esquery);function explode(visitor){if(visitor._exploded)return visitor;visitor._exploded=true;delete visitor.__esModule;if(visitor.queries){ensureEntranceObjects(visitor.queries);addQueries(visitor);delete visitor.queries}ensureEntranceObjects(visitor);for(var nodeType in visitor){if(shouldIgnoreKey(nodeType))continue;var wrapper=virtualTypes[nodeType];if(!wrapper)continue;var fns=visitor[nodeType];for(var type in fns){fns[type]=wrapCheck(wrapper,fns[type])}delete visitor[nodeType];if(wrapper.types){var _arr=wrapper.types;for(var _i=0;_i<_arr.length;_i++){var type=_arr[_i];if(visitor[type]){mergePair(visitor[type],fns)}else{visitor[type]=fns}}}else{mergePair(visitor,fns)}}for(var nodeType in visitor){if(shouldIgnoreKey(nodeType))continue;var fns=visitor[nodeType];var aliases=t.FLIPPED_ALIAS_KEYS[nodeType];if(!aliases)continue;delete visitor[nodeType];var _arr2=aliases;for(var _i2=0;_i2<_arr2.length;_i2++){var alias=_arr2[_i2];var existing=visitor[alias];if(existing){mergePair(existing,fns)}else{visitor[alias]=(0,_lodashLangClone2["default"])(fns)}}}return visitor}function verify(visitor){if(visitor._verified)return;if(typeof visitor==="function"){throw new Error(messages.get("traverseVerifyRootFunction"))}for(var nodeType in visitor){if(shouldIgnoreKey(nodeType))continue;if(t.TYPES.indexOf(nodeType)<0&&!virtualTypes[nodeType]){throw new Error(messages.get("traverseVerifyNodeType",nodeType))}var visitors=visitor[nodeType];if(typeof visitors==="object"){for(var visitorKey in visitors){if(visitorKey==="enter"||visitorKey==="exit")continue;throw new Error(messages.get("traverseVerifyVisitorProperty",nodeType,visitorKey))}}}visitor._verified=true}function merge(visitors){var rootVisitor={};var _arr3=visitors;for(var _i3=0;_i3<_arr3.length;_i3++){var visitor=_arr3[_i3];for(var type in visitor){var nodeVisitor=rootVisitor[type]=rootVisitor[type]||{};mergePair(nodeVisitor,visitor[type])}}return rootVisitor}function ensureEntranceObjects(obj){for(var key in obj){if(shouldIgnoreKey(key))continue;var fns=obj[key];if(typeof fns==="function"){obj[key]={enter:fns}}}}function addQueries(visitor){for(var selector in visitor.queries){var fns=visitor.queries[selector];addSelector(visitor,selector,fns)}}function addSelector(visitor,selector,fns){selector=_esquery2["default"].parse(selector);var _loop=function(){var fn=fns[key];fns[key]=function(node){if(_esquery2["default"].matches(node,selector,this.getAncestry())){return fn.apply(this,arguments)}}};for(var key in fns){_loop()}mergePair(visitor,fns)}function wrapCheck(wrapper,fn){return function(){if(wrapper.checkPath(this)){return fn.apply(this,arguments)}}}function shouldIgnoreKey(key){if(key[0]==="_")return true;if(key==="enter"||key==="exit"||key==="shouldSkip")return true;if(key==="blacklist"||key==="noScope"||key==="skipKeys")return true;return false}function mergePair(dest,src){for(var key in src){dest[key]=[].concat(dest[key]||[],src[key])}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/traversal/visitors.js","/node_modules/babel-core/lib/babel/traversal")},{"../messages":455,"../types":589,"./path/lib/virtual-types":577,_process:1069,buffer:919,esquery:710,"lodash/lang/clone":816}],585:[function(require,module,exports){module.exports={ExpressionStatement:["Statement"],DebuggerStatement:["Statement"],IfStatement:["Statement"],TryStatement:["Statement"],WithStatement:["Statement"],EmptyStatement:["Statement"],LabeledStatement:["Statement"],VariableDeclaration:["Statement","Declaration"],BreakStatement:["Statement","Terminatorless","CompletionStatement"],ContinueStatement:["Statement","Terminatorless","CompletionStatement"],ReturnStatement:["Statement","Terminatorless","CompletionStatement"],ThrowStatement:["Statement","Terminatorless","CompletionStatement"],DoWhileStatement:["Statement","BlockParent","Loop","While","Scopable"],WhileStatement:["Statement","BlockParent","Loop","While","Scopable"],SwitchStatement:["Statement","BlockParent","Scopable"],ImportSpecifier:["ModuleSpecifier"],ExportSpecifier:["ModuleSpecifier"],ImportDefaultSpecifier:["ModuleSpecifier"],ExportDefaultSpecifier:["ModuleSpecifier"],ExportNamespaceSpecifier:["ModuleSpecifier"],ExportDefaultFromSpecifier:["ModuleSpecifier"],ExportAllDeclaration:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],ExportDefaultDeclaration:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],ExportNamedDeclaration:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],ImportDeclaration:["Statement","Declaration","ModuleDeclaration"],ArrowFunctionExpression:["Scopable","Function","Func","BlockParent","FunctionParent","Expression","Pure"],FunctionDeclaration:["Scopable","Function","Func","BlockParent","FunctionParent","Statement","Pure","Declaration"],FunctionExpression:["Scopable","Function","Func","BlockParent","FunctionParent","Expression","Pure"],BlockStatement:["Scopable","BlockParent","Block","Statement"],Program:["Scopable","BlockParent","Block","FunctionParent"],CatchClause:["Scopable"],LogicalExpression:["Binary","Expression"],BinaryExpression:["Binary","Expression"],UnaryExpression:["UnaryLike","Expression"],SpreadProperty:["UnaryLike"],SpreadElement:["UnaryLike"],ClassDeclaration:["Scopable","Class","Statement","Declaration"],ClassExpression:["Scopable","Class","Expression"],ForOfStatement:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],ForInStatement:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],ForStatement:["Scopable","Statement","For","BlockParent","Loop"],ObjectPattern:["Pattern"],ArrayPattern:["Pattern"],AssignmentPattern:["Pattern"],Property:["UserWhitespacable"],AwaitExpression:["Expression","Terminatorless"],YieldExpression:["Expression","Terminatorless"],ArrayExpression:["Expression"],AssignmentExpression:["Expression"],CallExpression:["Expression"],ComprehensionExpression:["Expression","Scopable"],ConditionalExpression:["Expression"],DoExpression:["Expression"],Identifier:["Expression"],Literal:["Expression","Pure"],MemberExpression:["Expression"],MetaProperty:["Expression"],NewExpression:["Expression"],ObjectExpression:["Expression"],SequenceExpression:["Expression"],TaggedTemplateExpression:["Expression"],ThisExpression:["Expression"],Super:["Expression"],UpdateExpression:["Expression"],JSXEmptyExpression:["Expression"],JSXMemberExpression:["Expression"],AnyTypeAnnotation:["Flow","FlowBaseAnnotation"],ArrayTypeAnnotation:["Flow"],BooleanTypeAnnotation:["Flow","FlowBaseAnnotation"],ClassImplements:["Flow"],DeclareClass:["Flow","FlowDeclaration","Statement","Declaration"],DeclareFunction:["Flow","FlowDeclaration","Statement","Declaration"],DeclareModule:["Flow","FlowDeclaration","Statement"],DeclareVariable:["Flow","FlowDeclaration","Statement","Declaration"],FunctionTypeAnnotation:["Flow"],FunctionTypeParam:["Flow"],GenericTypeAnnotation:["Flow"],InterfaceExtends:["Flow"],InterfaceDeclaration:["Flow","FlowDeclaration","Statement","Declaration"],IntersectionTypeAnnotation:["Flow"],MixedTypeAnnotation:["Flow","FlowBaseAnnotation"],NullableTypeAnnotation:["Flow"],NumberTypeAnnotation:["Flow","FlowBaseAnnotation"],StringLiteralTypeAnnotation:["Flow"],StringTypeAnnotation:["Flow","FlowBaseAnnotation"],TupleTypeAnnotation:["Flow"],TypeofTypeAnnotation:["Flow"],TypeAlias:["Flow","FlowDeclaration","Statement","Declaration"],TypeAnnotation:["Flow"],TypeCastExpression:["Flow"],TypeParameterDeclaration:["Flow"],TypeParameterInstantiation:["Flow"],ObjectTypeAnnotation:["Flow"],ObjectTypeCallProperty:["Flow","UserWhitespacable"],ObjectTypeIndexer:["Flow","UserWhitespacable"],ObjectTypeProperty:["Flow","UserWhitespacable"],QualifiedTypeIdentifier:["Flow"],UnionTypeAnnotation:["Flow"],VoidTypeAnnotation:["Flow","FlowBaseAnnotation"],JSXAttribute:["JSX","Immutable"],JSXClosingElement:["JSX","Immutable"],JSXElement:["JSX","Immutable","Expression"],JSXEmptyExpression:["JSX","Immutable"],JSXExpressionContainer:["JSX","Immutable"],JSXIdentifier:["JSX"],JSXMemberExpression:["JSX"],JSXNamespacedName:["JSX"],JSXOpeningElement:["JSX","Immutable"],JSXSpreadAttribute:["JSX"]}},{}],586:[function(require,module,exports){module.exports={ArrayExpression:{elements:null},ArrowFunctionExpression:{params:null,body:null},AssignmentExpression:{operator:null,left:null,right:null},BinaryExpression:{operator:null,left:null,right:null},BindExpression:{object:null,callee:null},BlockStatement:{body:null},CallExpression:{callee:null,arguments:null},ConditionalExpression:{test:null,consequent:null,alternate:null},ExpressionStatement:{expression:null},File:{program:null,comments:null,tokens:null},FunctionExpression:{id:null,params:null,body:null,generator:false,async:false},FunctionDeclaration:{id:null,params:null,body:null,generator:false,async:false},GenericTypeAnnotation:{id:null,typeParameters:null},Identifier:{name:null},IfStatement:{test:null,consequent:null,alternate:null},ImportDeclaration:{specifiers:null,source:null},ImportSpecifier:{local:null,imported:null},LabeledStatement:{label:null,body:null},Literal:{value:null},LogicalExpression:{operator:null,left:null,right:null},MemberExpression:{object:null,property:null,computed:false},MethodDefinition:{key:null,value:null,kind:"method",computed:false,"static":false},NewExpression:{callee:null,arguments:null},ObjectExpression:{properties:null},Program:{body:null},Property:{kind:null,key:null,value:null,computed:false},ReturnStatement:{argument:null},SequenceExpression:{expressions:null},TemplateLiteral:{quasis:null,expressions:null},ThrowExpression:{argument:null},UnaryExpression:{operator:null,argument:null,prefix:null},VariableDeclaration:{kind:null,declarations:null},VariableDeclarator:{id:null,init:null},WithStatement:{object:null,body:null},YieldExpression:{argument:null,delegate:null}}},{}],587:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.toComputedKey=toComputedKey;exports.toSequenceExpression=toSequenceExpression;exports.toKeyAlias=toKeyAlias;exports.toIdentifier=toIdentifier;exports.toStatement=toStatement;exports.toExpression=toExpression;exports.toBlock=toBlock;exports.valueToNode=valueToNode;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashLangIsPlainObject=require("lodash/lang/isPlainObject");var _lodashLangIsPlainObject2=_interopRequireDefault(_lodashLangIsPlainObject);var _lodashLangIsNumber=require("lodash/lang/isNumber");var _lodashLangIsNumber2=_interopRequireDefault(_lodashLangIsNumber);var _lodashLangIsRegExp=require("lodash/lang/isRegExp");var _lodashLangIsRegExp2=_interopRequireDefault(_lodashLangIsRegExp);var _lodashLangIsString=require("lodash/lang/isString");var _lodashLangIsString2=_interopRequireDefault(_lodashLangIsString);var _traversal=require("../traversal");var _traversal2=_interopRequireDefault(_traversal);var _index=require("./index");var t=_interopRequireWildcard(_index);function toComputedKey(node){var key=arguments[1]===undefined?node.key||node.property:arguments[1];return function(){if(!node.computed){if(t.isIdentifier(key))key=t.literal(key.name)}return key}()}function toSequenceExpression(nodes,scope){var declars=[];var bailed=false;var result=convert(nodes);if(bailed)return;for(var i=0;i=0){continue}if(t.isAnyTypeAnnotation(node)){return[node]}if(t.isFlowBaseAnnotation(node)){bases[node.type]=node;continue}if(t.isUnionTypeAnnotation(node)){if(typeGroups.indexOf(node.types)<0){nodes=nodes.concat(node.types);typeGroups.push(node.types)}continue}if(t.isGenericTypeAnnotation(node)){var _name=node.id.name;if(generics[_name]){var existing=generics[_name];if(existing.typeParameters){if(node.typeParameters){existing.typeParameters.params=removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params))}}else{existing=node.typeParameters}}else{generics[_name]=node}continue}types.push(node)}for(var type in bases){types.push(bases[type])}for(var _name2 in generics){types.push(generics[_name2])}return types}function createTypeAnnotationBasedOnTypeof(type){if(type==="string"){return t.stringTypeAnnotation()}else if(type==="number"){return t.numberTypeAnnotation()}else if(type==="undefined"){return t.voidTypeAnnotation()}else if(type==="boolean"){return t.booleanTypeAnnotation()}else if(type==="function"){}else if(type==="object"){}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/types/flow.js","/node_modules/babel-core/lib/babel/types")},{"./index":589,_process:1069,buffer:919}],589:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.is=is;exports.isType=isType;exports.shallowEqual=shallowEqual;exports.appendToMemberExpression=appendToMemberExpression;exports.prependToMemberExpression=prependToMemberExpression;exports.ensureBlock=ensureBlock;exports.clone=clone;exports.cloneDeep=cloneDeep;exports.buildMatchMemberExpression=buildMatchMemberExpression;exports.removeComments=removeComments;exports.inheritsComments=inheritsComments;exports.inherits=inherits;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _toFastProperties=require("to-fast-properties");var _toFastProperties2=_interopRequireDefault(_toFastProperties);var _lodashArrayCompact=require("lodash/array/compact");var _lodashArrayCompact2=_interopRequireDefault(_lodashArrayCompact);var _lodashObjectAssign=require("lodash/object/assign");var _lodashObjectAssign2=_interopRequireDefault(_lodashObjectAssign);var _lodashCollectionEach=require("lodash/collection/each");var _lodashCollectionEach2=_interopRequireDefault(_lodashCollectionEach);var _lodashArrayUniq=require("lodash/array/uniq");var _lodashArrayUniq2=_interopRequireDefault(_lodashArrayUniq);var t=exports;function registerType(type,skipAliasCheck){var is=t["is"+type]=function(node,opts){return t.is(type,node,opts,skipAliasCheck)};t["assert"+type]=function(node,opts){opts=opts||{};if(!is(node,opts)){throw new Error("Expected type "+JSON.stringify(type)+" with option "+JSON.stringify(opts))}}}var STATEMENT_OR_BLOCK_KEYS=["consequent","body","alternate"];exports.STATEMENT_OR_BLOCK_KEYS=STATEMENT_OR_BLOCK_KEYS;var FLATTENABLE_KEYS=["body","expressions"];exports.FLATTENABLE_KEYS=FLATTENABLE_KEYS;var FOR_INIT_KEYS=["left","init"];exports.FOR_INIT_KEYS=FOR_INIT_KEYS;var COMMENT_KEYS=["leadingComments","trailingComments"];exports.COMMENT_KEYS=COMMENT_KEYS;var BOOLEAN_BINARY_OPERATORS=["==","===","!=","!==",">","<",">=","<=","in","instanceof"];exports.BOOLEAN_BINARY_OPERATORS=BOOLEAN_BINARY_OPERATORS;var NUMBER_BINARY_OPERATORS=["-","/","*","**","&","|",">>",">>>","<<","^"];exports.NUMBER_BINARY_OPERATORS=NUMBER_BINARY_OPERATORS;var BOOLEAN_UNARY_OPERATORS=["delete","!"];exports.BOOLEAN_UNARY_OPERATORS=BOOLEAN_UNARY_OPERATORS;var NUMBER_UNARY_OPERATORS=["+","-","++","--","~"];exports.NUMBER_UNARY_OPERATORS=NUMBER_UNARY_OPERATORS;var STRING_UNARY_OPERATORS=["typeof"];exports.STRING_UNARY_OPERATORS=STRING_UNARY_OPERATORS;var VISITOR_KEYS=require("./visitor-keys");exports.VISITOR_KEYS=VISITOR_KEYS;var BUILDER_KEYS=require("./builder-keys");exports.BUILDER_KEYS=BUILDER_KEYS;var ALIAS_KEYS=require("./alias-keys");exports.ALIAS_KEYS=ALIAS_KEYS;t.FLIPPED_ALIAS_KEYS={};(0,_lodashCollectionEach2["default"])(t.VISITOR_KEYS,function(keys,type){registerType(type,true)});(0,_lodashCollectionEach2["default"])(t.ALIAS_KEYS,function(aliases,type){(0,_lodashCollectionEach2["default"])(aliases,function(alias){var types=t.FLIPPED_ALIAS_KEYS[alias]=t.FLIPPED_ALIAS_KEYS[alias]||[];types.push(type)})});(0,_lodashCollectionEach2["default"])(t.FLIPPED_ALIAS_KEYS,function(types,type){t[type.toUpperCase()+"_TYPES"]=types;registerType(type,false)});var TYPES=Object.keys(t.VISITOR_KEYS).concat(Object.keys(t.FLIPPED_ALIAS_KEYS));exports.TYPES=TYPES;function is(type,node,opts,skipAliasCheck){if(!node)return false;var matches=isType(node.type,type);if(!matches)return false;if(typeof opts==="undefined"){return true}else{return t.shallowEqual(node,opts)}}function isType(nodeType,targetType){if(nodeType===targetType)return true;var aliases=t.FLIPPED_ALIAS_KEYS[targetType];if(aliases){if(aliases[0]===nodeType)return true;var _arr=aliases;for(var _i=0;_i<_arr.length;_i++){var alias=_arr[_i];if(nodeType===alias)return true}}return false}(0,_lodashCollectionEach2["default"])(t.VISITOR_KEYS,function(keys,type){if(t.BUILDER_KEYS[type])return;var defs={};(0,_lodashCollectionEach2["default"])(keys,function(key){defs[key]=null});t.BUILDER_KEYS[type]=defs});(0,_lodashCollectionEach2["default"])(t.BUILDER_KEYS,function(keys,type){t[type[0].toLowerCase()+type.slice(1)]=function(){var node={};node.start=null;node.type=type;var i=0;for(var key in keys){var arg=arguments[i++];if(arg===undefined)arg=keys[key];node[key]=arg}return node}});function shallowEqual(actual,expected){var keys=Object.keys(expected);var _arr2=keys;for(var _i2=0;_i2<_arr2.length;_i2++){var key=_arr2[_i2];if(actual[key]!==expected[key]){return false}}return true}function appendToMemberExpression(member,append,computed){member.object=t.memberExpression(member.object,member.property,member.computed);member.property=append;member.computed=!!computed;return member}function prependToMemberExpression(member,append){member.object=t.memberExpression(append,member.object);return member}function ensureBlock(node){var key=arguments[1]===undefined?"body":arguments[1];return node[key]=t.toBlock(node[key],node)}function clone(node){var newNode={};for(var key in node){if(key[0]==="_")continue;newNode[key]=node[key]}return newNode}function cloneDeep(node){var newNode={};for(var key in node){if(key[0]==="_")continue;var val=node[key];if(val){if(val.type){val=t.cloneDeep(val)}else if(Array.isArray(val)){val=val.map(t.cloneDeep)}}newNode[key]=val}return newNode}function buildMatchMemberExpression(match,allowPartial){var parts=match.split(".");return function(member){if(!t.isMemberExpression(member))return false;var search=[member];var i=0;while(search.length){var node=search.shift();if(allowPartial&&i===parts.length){return true}if(t.isIdentifier(node)){if(parts[i]!==node.name)return false}else if(t.isLiteral(node)){if(parts[i]!==node.value)return false}else if(t.isMemberExpression(node)){if(node.computed&&!t.isLiteral(node.property)){return false}else{search.push(node.object);search.push(node.property);continue}}else{return false}if(++i>parts.length){return false}}return true}}function removeComments(child){var _arr3=COMMENT_KEYS;for(var _i3=0;_i3<_arr3.length;_i3++){var key=_arr3[_i3];delete child[key]}return child}function inheritsComments(child,parent){if(child&&parent){var _arr4=COMMENT_KEYS;for(var _i4=0;_i4<_arr4.length;_i4++){var key=_arr4[_i4];child[key]=(0,_lodashArrayUniq2["default"])((0,_lodashArrayCompact2["default"])([].concat(child[key],parent[key])))}}return child}function inherits(child,parent){if(!child||!parent)return child;child._scopeInfo=parent._scopeInfo;child._paths=parent._paths;child.range=parent.range;child.start=parent.start;child.loc=parent.loc;child.end=parent.end;child.typeAnnotation=parent.typeAnnotation;child.returnType=parent.returnType;t.inheritsComments(child,parent);return child}(0,_toFastProperties2["default"])(t);(0,_toFastProperties2["default"])(t.VISITOR_KEYS);exports.__esModule=true;(0,_lodashObjectAssign2["default"])(t,require("./retrievers"));(0,_lodashObjectAssign2["default"])(t,require("./validators"));(0,_lodashObjectAssign2["default"])(t,require("./converters"));(0,_lodashObjectAssign2["default"])(t,require("./flow"))}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/types/index.js","/node_modules/babel-core/lib/babel/types")},{"./alias-keys":585,"./builder-keys":586,"./converters":587,"./flow":588,"./retrievers":590,"./validators":591,"./visitor-keys":592,_process:1069,buffer:919,"lodash/array/compact":728,"lodash/array/uniq":732,"lodash/collection/each":734,"lodash/object/assign":831,"to-fast-properties":911}],590:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.getBindingIdentifiers=getBindingIdentifiers;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _helpersObject=require("../helpers/object");var _helpersObject2=_interopRequireDefault(_helpersObject);var _index=require("./index");var t=_interopRequireWildcard(_index);function getBindingIdentifiers(node){var search=[].concat(node);var ids=(0,_helpersObject2["default"])();while(search.length){var id=search.shift();if(!id)continue;var key=t.getBindingIdentifiers.keys[id.type];if(t.isIdentifier(id)){ids[id.name]=id}else if(t.isExportDeclaration(id)){if(t.isDeclaration(node.declaration)){search.push(node.declaration)}}else if(key&&id[key]){search=search.concat(id[key])}}return ids}getBindingIdentifiers.keys={DeclareClass:"id",DeclareFunction:"id",DeclareModule:"id",DeclareVariable:"id",InterfaceDeclaration:"id",TypeAlias:"id",ComprehensionExpression:"blocks",ComprehensionBlock:"left",CatchClause:"param",UnaryExpression:"argument",AssignmentExpression:"left",ImportSpecifier:"local",ImportNamespaceSpecifier:"local",ImportDefaultSpecifier:"local",ImportDeclaration:"specifiers",FunctionDeclaration:"id",FunctionExpression:"id",ClassDeclaration:"id",ClassExpression:"id",SpreadElement:"argument",RestElement:"argument",UpdateExpression:"argument",SpreadProperty:"argument",Property:"value",AssignmentPattern:"left",ArrayPattern:"elements",ObjectPattern:"properties",VariableDeclaration:"declarations",VariableDeclarator:"id"}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/types/retrievers.js","/node_modules/babel-core/lib/babel/types")},{"../helpers/object":453,"./index":589,_process:1069,buffer:919}],591:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.isReferenced=isReferenced;exports.isValidIdentifier=isValidIdentifier;exports.isLet=isLet;exports.isBlockScoped=isBlockScoped;exports.isVar=isVar;exports.isSpecifierDefault=isSpecifierDefault;exports.isScope=isScope;exports.isImmutable=isImmutable;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _esutils=require("esutils");var _esutils2=_interopRequireDefault(_esutils);var _index=require("./index");var t=_interopRequireWildcard(_index);function isReferenced(node,parent){switch(parent.type){case"MemberExpression":if(parent.property===node&&parent.computed){return true}else if(parent.object===node){return true}else{return false}case"MetaProperty":return false;case"Property":if(parent.key===node){return parent.computed}case"VariableDeclarator":return parent.id!==node;case"ArrowFunctionExpression":case"FunctionDeclaration":case"FunctionExpression":var _arr=parent.params;for(var _i=0;_i<_arr.length;_i++){var param=_arr[_i];if(param===node)return false}return parent.id!==node;case"ExportSpecifier":if(parent.source){return false}else{return parent.local===node}case"ImportDefaultSpecifier":return false;case"ImportNamespaceSpecifier":return false;case"JSXAttribute":return parent.name!==node;case"ImportSpecifier":return false;case"ClassDeclaration":case"ClassExpression":return parent.id!==node;case"MethodDefinition":return parent.key===node&&parent.computed;case"LabeledStatement":return false;case"CatchClause":return parent.param!==node;case"RestElement":return false;case"AssignmentExpression":case"AssignmentPattern":return parent.right===node;case"ObjectPattern":case"ArrayPattern":return false}return true}function isValidIdentifier(name){if(typeof name!=="string"||_esutils2["default"].keyword.isReservedWordES6(name,true)){return false}else{return _esutils2["default"].keyword.isIdentifierNameES6(name)}}function isLet(node){return t.isVariableDeclaration(node)&&(node.kind!=="var"||node._let)}function isBlockScoped(node){return t.isFunctionDeclaration(node)||t.isClassDeclaration(node)||t.isLet(node)}function isVar(node){return t.isVariableDeclaration(node,{kind:"var"})&&!node._let}function isSpecifierDefault(specifier){return t.isImportDefaultSpecifier(specifier)||t.isIdentifier(specifier.imported||specifier.exported,{name:"default"})}function isScope(node,parent){if(t.isBlockStatement(node)&&t.isFunction(parent,{body:node})){return false}return t.isScopable(node)}function isImmutable(node){if(t.isType(node.type,"Immutable"))return true;if(t.isLiteral(node)){if(node.regex){return false}else{return true}}else if(t.isIdentifier(node)){if(node.name==="undefined"){return true}else{return false}}return false}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/types/validators.js","/node_modules/babel-core/lib/babel/types")},{"./index":589,_process:1069,buffer:919,esutils:717}],592:[function(require,module,exports){module.exports={ArrayExpression:["elements"],ArrayPattern:["elements","typeAnnotation"],ArrowFunctionExpression:["params","body","returnType"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BindExpression:["object","callee"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass","typeParameters","superTypeParameters","implements","decorators"],ClassExpression:["id","body","superClass","typeParameters","superTypeParameters","implements","decorators"],ComprehensionBlock:["left","right"],ComprehensionExpression:["filter","blocks","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],Decorator:["expression"],DebuggerStatement:[],DoWhileStatement:["body","test"],DoExpression:["body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation"],IfStatement:["test","consequent","alternate"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["imported","local"],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value","decorators"],NewExpression:["callee","arguments"],Noop:[],ObjectExpression:["properties"],ObjectPattern:["properties","typeAnnotation"],Program:["body"],Property:["key","value","decorators"],RestElement:["argument","typeAnnotation"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SpreadProperty:["argument"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"],ExportAllDeclaration:["source","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportDefaultSpecifier:["exported"],ExportNamespaceSpecifier:["exported"],ExportSpecifier:["local","exported"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],ClassImplements:["id","typeParameters"],ClassProperty:["key","value","typeAnnotation","decorators"],DeclareClass:["id","typeParameters","extends","body"],DeclareFunction:["id"],DeclareModule:["id","body"],DeclareVariable:["id"],FunctionTypeAnnotation:["typeParameters","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberTypeAnnotation:[],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],TupleTypeAnnotation:["types"],TypeofTypeAnnotation:["argument"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],ObjectTypeAnnotation:["properties","indexers","callProperties"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value"],ObjectTypeProperty:["key","value"],QualifiedTypeIdentifier:["id","qualification"],UnionTypeAnnotation:["types"],VoidTypeAnnotation:[],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","closingElement","children"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXSpreadAttribute:["argument"]}},{}],593:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";exports.__esModule=true;exports.canCompile=canCompile;exports.resolve=resolve;exports.resolveRelative=resolveRelative;exports.list=list;exports.regexify=regexify;exports.arrayify=arrayify;exports.booleanify=booleanify;exports.shouldIgnore=shouldIgnore;exports.template=template;exports.parseTemplate=parseTemplate;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}require("./patch");var _lodashStringEscapeRegExp=require("lodash/string/escapeRegExp");var _lodashStringEscapeRegExp2=_interopRequireDefault(_lodashStringEscapeRegExp);var _lodashStringStartsWith=require("lodash/string/startsWith");var _lodashStringStartsWith2=_interopRequireDefault(_lodashStringStartsWith);var _lodashLangCloneDeep=require("lodash/lang/cloneDeep");var _lodashLangCloneDeep2=_interopRequireDefault(_lodashLangCloneDeep);var _lodashLangIsBoolean=require("lodash/lang/isBoolean");var _lodashLangIsBoolean2=_interopRequireDefault(_lodashLangIsBoolean);var _messages=require("./messages");var messages=_interopRequireWildcard(_messages);var _minimatch=require("minimatch");var _minimatch2=_interopRequireDefault(_minimatch);var _lodashCollectionContains=require("lodash/collection/contains");var _lodashCollectionContains2=_interopRequireDefault(_lodashCollectionContains);var _traversal=require("./traversal");var _traversal2=_interopRequireDefault(_traversal);var _lodashLangIsString=require("lodash/lang/isString");var _lodashLangIsString2=_interopRequireDefault(_lodashLangIsString);var _lodashLangIsRegExp=require("lodash/lang/isRegExp");var _lodashLangIsRegExp2=_interopRequireDefault(_lodashLangIsRegExp);var _module2=require("module");var _module3=_interopRequireDefault(_module2);var _lodashLangIsEmpty=require("lodash/lang/isEmpty");var _lodashLangIsEmpty2=_interopRequireDefault(_lodashLangIsEmpty);var _helpersParse=require("./helpers/parse");var _helpersParse2=_interopRequireDefault(_helpersParse);var _path=require("path");var _path2=_interopRequireDefault(_path);var _lodashObjectHas=require("lodash/object/has");var _lodashObjectHas2=_interopRequireDefault(_lodashObjectHas);var _fs=require("fs");var _fs2=_interopRequireDefault(_fs);var _types=require("./types");var t=_interopRequireWildcard(_types);var _slash=require("slash");var _slash2=_interopRequireDefault(_slash);var _util=require("util");exports.inherits=_util.inherits;exports.inspect=_util.inspect;function canCompile(filename,altExts){var exts=altExts||canCompile.EXTENSIONS;var ext=_path2["default"].extname(filename);return(0,_lodashCollectionContains2["default"])(exts,ext)}canCompile.EXTENSIONS=[".js",".jsx",".es6",".es"];function resolve(loc){try{return require.resolve(loc)}catch(err){return null}}var relativeMod;function resolveRelative(loc){if(typeof _module3["default"]==="object")return null;if(!relativeMod){relativeMod=new _module3["default"];relativeMod.paths=_module3["default"]._nodeModulePaths(process.cwd())}try{return _module3["default"]._resolveFilename(loc,relativeMod)}catch(err){return null}}function list(val){if(!val){return[]}else if(Array.isArray(val)){return val}else if(typeof val==="string"){return val.split(",")}else{return[val]}}function regexify(val){if(!val)return new RegExp(/.^/);if(Array.isArray(val))val=new RegExp(val.map(_lodashStringEscapeRegExp2["default"]).join("|"),"i");if((0,_lodashLangIsString2["default"])(val)){val=(0,_slash2["default"])(val);if((0,_lodashStringStartsWith2["default"])(val,"./")||(0,_lodashStringStartsWith2["default"])(val,"*/"))val=val.slice(2);if((0,_lodashStringStartsWith2["default"])(val,"**/"))val=val.slice(3);var regex=_minimatch2["default"].makeRe(val,{nocase:true});return new RegExp(regex.source.slice(1,-1),"i")}if((0,_lodashLangIsRegExp2["default"])(val))return val;throw new TypeError("illegal type for regexify")}function arrayify(val,mapFn){if(!val)return[];if((0,_lodashLangIsBoolean2["default"])(val))return arrayify([val],mapFn);if((0,_lodashLangIsString2["default"])(val))return arrayify(list(val),mapFn);if(Array.isArray(val)){if(mapFn)val=val.map(mapFn);return val}return[val]}function booleanify(val){if(val==="true")return true;if(val==="false")return false;return val}function shouldIgnore(filename,ignore,only){filename=(0,_slash2["default"])(filename);if(only.length){var _arr=only;for(var _i=0;_i<_arr.length;_i++){var pattern=_arr[_i];if(pattern.test(filename))return false}return true}else if(ignore.length){var _arr2=ignore;for(var _i2=0;_i2<_arr2.length;_i2++){var pattern=_arr2[_i2];if(pattern.test(filename))return true}}return false}var templateVisitor={noScope:true,enter:function enter(node,parent,scope,nodes){if(t.isExpressionStatement(node)){node=node.expression}if(t.isIdentifier(node)&&(0,_lodashObjectHas2["default"])(nodes,node.name)){this.skip();this.replaceInline(nodes[node.name])}},exit:function exit(node){_traversal2["default"].clearNode(node)}};function template(name,nodes,keepExpression){var ast=exports.templates[name];if(!ast)throw new ReferenceError("unknown template "+name);if(nodes===true){keepExpression=true;nodes=null}ast=(0,_lodashLangCloneDeep2["default"])(ast);if(!(0,_lodashLangIsEmpty2["default"])(nodes)){(0,_traversal2["default"])(ast,templateVisitor,null,nodes)}if(ast.body.length>1)return ast.body;var node=ast.body[0];if(!keepExpression&&t.isExpressionStatement(node)){return node.expression}else{return node}}function parseTemplate(loc,code){var ast=(0,_helpersParse2["default"])(code,{filename:loc,looseModules:true}).program;ast=_traversal2["default"].removeProperties(ast);return ast}function loadTemplates(){var templates={};var templatesLoc=_path2["default"].join(__dirname,"transformation/templates");if(!_fs2["default"].existsSync(templatesLoc)){throw new ReferenceError(messages.get("missingTemplatesDirectory"))}var _arr3=_fs2["default"].readdirSync(templatesLoc);for(var _i3=0;_i3<_arr3.length;_i3++){var name=_arr3[_i3];if(name[0]===".")return;var key=_path2["default"].basename(name,_path2["default"].extname(name));var loc=_path2["default"].join(templatesLoc,name);var code=_fs2["default"].readFileSync(loc,"utf8");templates[key]=parseTemplate(loc,code)}return templates}try{exports.templates=require("../../templates.json")}catch(err){if(err.code!=="MODULE_NOT_FOUND")throw err;exports.templates=loadTemplates()}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/lib/babel/util.js","/node_modules/babel-core/lib/babel")},{"../../templates.json":915,"./helpers/parse":454,"./messages":455,"./patch":456,"./traversal":566,"./types":589,_process:1069,buffer:919,fs:916,"lodash/collection/contains":733,"lodash/lang/cloneDeep":817,"lodash/lang/isBoolean":820,"lodash/lang/isEmpty":821,"lodash/lang/isRegExp":827,"lodash/lang/isString":828,"lodash/object/has":834,"lodash/string/escapeRegExp":840,"lodash/string/startsWith":841,minimatch:845,module:916,path:1068,slash:898,util:1089}],594:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";module.exports=function(acorn){var tt=acorn.tokTypes;var tc=acorn.tokContexts;tc.j_oTag=new acorn.TokContext("...",true,true);tt.jsxName=new acorn.TokenType("jsxName");tt.jsxText=new acorn.TokenType("jsxText",{beforeExpr:true});tt.jsxTagStart=new acorn.TokenType("jsxTagStart");tt.jsxTagEnd=new acorn.TokenType("jsxTagEnd");tt.jsxTagStart.updateContext=function(){this.context.push(tc.j_expr);this.context.push(tc.j_oTag);this.exprAllowed=false};tt.jsxTagEnd.updateContext=function(prevType){var out=this.context.pop();if(out===tc.j_oTag&&prevType===tt.slash||out===tc.j_cTag){this.context.pop();this.exprAllowed=this.curContext()===tc.j_expr}else{this.exprAllowed=true}};var pp=acorn.Parser.prototype;pp.jsx_readToken=function(){var out="",chunkStart=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");var ch=this.input.charCodeAt(this.pos);switch(ch){case 60:case 123:if(this.pos===this.start){if(ch===60&&this.exprAllowed){++this.pos;return this.finishToken(tt.jsxTagStart)}return this.getTokenFromCode(ch)}out+=this.input.slice(chunkStart,this.pos);return this.finishToken(tt.jsxText,out);case 38:out+=this.input.slice(chunkStart,this.pos);out+=this.jsx_readEntity();chunkStart=this.pos;break;default:if(acorn.isNewLine(ch)){out+=this.input.slice(chunkStart,this.pos);out+=this.jsx_readNewLine(true);chunkStart=this.pos}else{++this.pos}}}};pp.jsx_readNewLine=function(normalizeCRLF){var ch=this.input.charCodeAt(this.pos);var out;++this.pos;if(ch===13&&this.input.charCodeAt(this.pos)===10){++this.pos;out=normalizeCRLF?"\n":"\r\n"}else{out=String.fromCharCode(ch)}if(this.options.locations){++this.curLine;this.lineStart=this.pos}return out};pp.jsx_readString=function(quote){ -var out="",chunkStart=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var ch=this.input.charCodeAt(this.pos);if(ch===quote)break;if(ch===38){out+=this.input.slice(chunkStart,this.pos);out+=this.jsx_readEntity();chunkStart=this.pos}else if(acorn.isNewLine(ch)){out+=this.input.slice(chunkStart,this.pos);out+=this.jsx_readNewLine(false);chunkStart=this.pos}else{++this.pos}}out+=this.input.slice(chunkStart,this.pos++);return this.finishToken(tt.string,out)};var XHTMLEntities={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};var hexNumber=/^[\da-fA-F]+$/;var decimalNumber=/^\d+$/;pp.jsx_readEntity=function(){var str="",count=0,entity;var ch=this.input[this.pos];if(ch!=="&")this.raise(this.pos,"Entity must start with an ampersand");var startPos=++this.pos;while(this.pos")}node.openingElement=openingElement;node.closingElement=closingElement;node.children=children;if(this.type===tt.relational&&this.value==="<"){this.raise(this.pos,"Adjacent JSX elements must be wrapped in an enclosing tag")}return this.finishNode(node,"JSXElement")};pp.jsx_parseElement=function(){var start=this.markPosition();this.next();return this.jsx_parseElementAt(start)};acorn.plugins.jsx=function(instance){instance.extend("parseExprAtom",function(inner){return function(refShortHandDefaultPos){if(this.type===tt.jsxText)return this.parseLiteral(this.value);else if(this.type===tt.jsxTagStart)return this.jsx_parseElement();else return inner.call(this,refShortHandDefaultPos)}});instance.extend("readToken",function(inner){return function(code){var context=this.curContext();if(context===tc.j_expr)return this.jsx_readToken();if(context===tc.j_oTag||context===tc.j_cTag){if(acorn.isIdentifierStart(code))return this.jsx_readWord();if(code==62){++this.pos;return this.finishToken(tt.jsxTagEnd)}if((code===34||code===39)&&context==tc.j_oTag)return this.jsx_readString(code)}if(code===60&&this.exprAllowed){++this.pos;return this.finishToken(tt.jsxTagStart)}return inner.call(this,code)}});instance.extend("updateContext",function(inner){return function(prevType){if(this.type==tt.braceL){var curContext=this.curContext();if(curContext==tc.j_oTag)this.context.push(tc.b_expr);else if(curContext==tc.j_expr)this.context.push(tc.b_tmpl);else inner.call(this,prevType);this.exprAllowed=true}else if(this.type===tt.slash&&prevType===tt.jsxTagStart){this.context.length-=2;this.context.push(tc.j_cTag);this.exprAllowed=false}else{return inner.call(this,prevType)}}})};return acorn}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/acorn-jsx/inject.js","/node_modules/babel-core/node_modules/acorn-jsx")},{_process:1069,buffer:919}],595:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var types=require("../lib/types");var Type=types.Type;var def=Type.def;var or=Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isNumber=builtin.number;var isBoolean=builtin.boolean;var isRegExp=builtin.RegExp;var shared=require("../lib/shared");var defaults=shared.defaults;var geq=shared.geq;def("Printable").field("loc",or(def("SourceLocation"),null),defaults["null"],true);def("Node").bases("Printable").field("type",isString).field("comments",or([def("Comment")],null),defaults["null"],true);def("SourceLocation").build("start","end","source").field("start",def("Position")).field("end",def("Position")).field("source",or(isString,null),defaults["null"]);def("Position").build("line","column").field("line",geq(1)).field("column",geq(0));def("Program").bases("Node").build("body").field("body",[def("Statement")]);def("Function").bases("Node").field("id",or(def("Identifier"),null),defaults["null"]).field("params",[def("Pattern")]).field("body",def("BlockStatement"));def("Statement").bases("Node");def("EmptyStatement").bases("Statement").build();def("BlockStatement").bases("Statement").build("body").field("body",[def("Statement")]);def("ExpressionStatement").bases("Statement").build("expression").field("expression",def("Expression"));def("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Statement")).field("alternate",or(def("Statement"),null),defaults["null"]);def("LabeledStatement").bases("Statement").build("label","body").field("label",def("Identifier")).field("body",def("Statement"));def("BreakStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("ContinueStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("WithStatement").bases("Statement").build("object","body").field("object",def("Expression")).field("body",def("Statement"));def("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",def("Expression")).field("cases",[def("SwitchCase")]).field("lexical",isBoolean,defaults["false"]);def("ReturnStatement").bases("Statement").build("argument").field("argument",or(def("Expression"),null));def("ThrowStatement").bases("Statement").build("argument").field("argument",def("Expression"));def("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",def("BlockStatement")).field("handler",or(def("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[def("CatchClause")],function(){return this.handler?[this.handler]:[]},true).field("guardedHandlers",[def("CatchClause")],defaults.emptyArray).field("finalizer",or(def("BlockStatement"),null),defaults["null"]);def("CatchClause").bases("Node").build("param","guard","body").field("param",def("Pattern")).field("guard",or(def("Expression"),null),defaults["null"]).field("body",def("BlockStatement"));def("WhileStatement").bases("Statement").build("test","body").field("test",def("Expression")).field("body",def("Statement"));def("DoWhileStatement").bases("Statement").build("body","test").field("body",def("Statement")).field("test",def("Expression"));def("ForStatement").bases("Statement").build("init","test","update","body").field("init",or(def("VariableDeclaration"),def("Expression"),null)).field("test",or(def("Expression"),null)).field("update",or(def("Expression"),null)).field("body",def("Statement"));def("ForInStatement").bases("Statement").build("left","right","body","each").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement")).field("each",isBoolean);def("DebuggerStatement").bases("Statement").build();def("Declaration").bases("Statement");def("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",def("Identifier"));def("FunctionExpression").bases("Function","Expression").build("id","params","body");def("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",or("var","let","const")).field("declarations",[or(def("VariableDeclarator"),def("Identifier"))]);def("VariableDeclarator").bases("Node").build("id","init").field("id",def("Pattern")).field("init",or(def("Expression"),null));def("Expression").bases("Node","Pattern");def("ThisExpression").bases("Expression").build();def("ArrayExpression").bases("Expression").build("elements").field("elements",[or(def("Expression"),null)]);def("ObjectExpression").bases("Expression").build("properties").field("properties",[def("Property")]);def("Property").bases("Node").build("kind","key","value").field("kind",or("init","get","set")).field("key",or(def("Literal"),def("Identifier"))).field("value",or(def("Expression"),def("Pattern")));def("SequenceExpression").bases("Expression").build("expressions").field("expressions",[def("Expression")]);var UnaryOperator=or("-","+","!","~","typeof","void","delete");def("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",UnaryOperator).field("argument",def("Expression")).field("prefix",isBoolean,defaults["true"]);var BinaryOperator=or("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");def("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",BinaryOperator).field("left",def("Expression")).field("right",def("Expression"));var AssignmentOperator=or("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");def("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",AssignmentOperator).field("left",def("Pattern")).field("right",def("Expression"));var UpdateOperator=or("++","--");def("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",UpdateOperator).field("argument",def("Expression")).field("prefix",isBoolean);var LogicalOperator=or("||","&&");def("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",LogicalOperator).field("left",def("Expression")).field("right",def("Expression"));def("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Expression")).field("alternate",def("Expression"));def("NewExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("CallExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("MemberExpression").bases("Expression").build("object","property","computed").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("Pattern").bases("Node");def("ObjectPattern").bases("Pattern").build("properties").field("properties",[or(def("PropertyPattern"),def("Property"))]);def("PropertyPattern").bases("Pattern").build("key","pattern").field("key",or(def("Literal"),def("Identifier"))).field("pattern",def("Pattern"));def("ArrayPattern").bases("Pattern").build("elements").field("elements",[or(def("Pattern"),null)]);def("SwitchCase").bases("Node").build("test","consequent").field("test",or(def("Expression"),null)).field("consequent",[def("Statement")]);def("Identifier").bases("Node","Expression","Pattern").build("name").field("name",isString);def("Literal").bases("Node","Expression").build("value").field("value",or(isString,isBoolean,null,isNumber,isRegExp)).field("regex",or({pattern:isString,flags:isString},null),function(){if(!isRegExp.check(this.value))return null;var flags="";if(this.value.ignoreCase)flags+="i";if(this.value.multiline)flags+="m";if(this.value.global)flags+="g";return{pattern:this.value.source,flags:flags}});def("Comment").bases("Printable").field("value",isString).field("leading",isBoolean,defaults["true"]).field("trailing",isBoolean,defaults["false"]);def("Block").bases("Comment").build("value","leading","trailing");def("Line").bases("Comment").build("value","leading","trailing")}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/ast-types/def/core.js","/node_modules/babel-core/node_modules/ast-types/def")},{"../lib/shared":606,"../lib/types":607,_process:1069,buffer:919}],596:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;def("XMLDefaultDeclaration").bases("Declaration").field("namespace",def("Expression"));def("XMLAnyName").bases("Expression");def("XMLQualifiedIdentifier").bases("Expression").field("left",or(def("Identifier"),def("XMLAnyName"))).field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLAttributeSelector").bases("Expression").field("attribute",def("Expression"));def("XMLFilterExpression").bases("Expression").field("left",def("Expression")).field("right",def("Expression"));def("XMLElement").bases("XML","Expression").field("contents",[def("XML")]);def("XMLList").bases("XML","Expression").field("contents",[def("XML")]);def("XML").bases("Node");def("XMLEscape").bases("XML").field("expression",def("Expression"));def("XMLText").bases("XML").field("text",isString);def("XMLStartTag").bases("XML").field("contents",[def("XML")]);def("XMLEndTag").bases("XML").field("contents",[def("XML")]);def("XMLPointTag").bases("XML").field("contents",[def("XML")]);def("XMLName").bases("XML").field("contents",or(isString,[def("XML")]));def("XMLAttribute").bases("XML").field("value",isString);def("XMLCdata").bases("XML").field("contents",isString);def("XMLComment").bases("XML").field("contents",isString);def("XMLProcessingInstruction").bases("XML").field("target",isString).field("contents",or(isString,null))}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/ast-types/def/e4x.js","/node_modules/babel-core/node_modules/ast-types/def")},{"../lib/types":607,"./core":595,_process:1069,buffer:919}],597:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var isObject=builtin.object;var isString=builtin.string;var defaults=require("../lib/shared").defaults;def("Function").field("generator",isBoolean,defaults["false"]).field("expression",isBoolean,defaults["false"]).field("defaults",[or(def("Expression"),null)],defaults.emptyArray).field("rest",or(def("Identifier"),null),defaults["null"]);def("FunctionDeclaration").build("id","params","body","generator","expression");def("FunctionExpression").build("id","params","body","generator","expression");def("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,defaults["null"]).field("body",or(def("BlockStatement"),def("Expression"))).field("generator",false,defaults["false"]);def("YieldExpression").bases("Expression").build("argument","delegate").field("argument",or(def("Expression"),null)).field("delegate",isBoolean,defaults["false"]);def("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionBlock").bases("Node").build("left","right","each").field("left",def("Pattern")).field("right",def("Expression")).field("each",isBoolean);def("ModuleSpecifier").bases("Literal").build("value").field("value",isString);def("Property").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("method",isBoolean,defaults["false"]).field("shorthand",isBoolean,defaults["false"]).field("computed",isBoolean,defaults["false"]);def("PropertyPattern").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",or("init","get","set","")).field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("value",def("Function")).field("computed",isBoolean,defaults["false"]).field("static",isBoolean,defaults["false"]);def("SpreadElement").bases("Node").build("argument").field("argument",def("Expression"));def("ArrayExpression").field("elements",[or(def("Expression"),def("SpreadElement"),null)]);def("NewExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("CallExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("SpreadElementPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));def("ArrayPattern").field("elements",[or(def("Pattern"),null,def("SpreadElement"))]);var ClassBodyElement=or(def("MethodDefinition"),def("VariableDeclarator"),def("ClassPropertyDefinition"),def("ClassProperty"));def("ClassProperty").bases("Declaration").build("key").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",ClassBodyElement);def("ClassBody").bases("Declaration").build("body").field("body",[ClassBodyElement]);def("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",or(def("Identifier"),null)).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]);def("ClassExpression").bases("Expression").build("id","body","superClass").field("id",or(def("Identifier"),null),defaults["null"]).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]).field("implements",[def("ClassImplements")],defaults.emptyArray);def("ClassImplements").bases("Node").build("id").field("id",def("Identifier")).field("superClass",or(def("Expression"),null),defaults["null"]);def("Specifier").bases("Node");def("NamedSpecifier").bases("Specifier").field("id",def("Identifier")).field("name",or(def("Identifier"),null),defaults["null"]);def("ExportSpecifier").bases("NamedSpecifier").build("id","name");def("ExportBatchSpecifier").bases("Specifier").build();def("ImportSpecifier").bases("NamedSpecifier").build("id","name");def("ImportNamespaceSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ImportDefaultSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",isBoolean).field("declaration",or(def("Declaration"),def("Expression"),null)).field("specifiers",[or(def("ExportSpecifier"),def("ExportBatchSpecifier"))],defaults.emptyArray).field("source",or(def("Literal"),def("ModuleSpecifier"),null),defaults["null"]);def("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[or(def("ImportSpecifier"),def("ImportNamespaceSpecifier"),def("ImportDefaultSpecifier"))],defaults.emptyArray).field("source",or(def("Literal"),def("ModuleSpecifier")));def("TaggedTemplateExpression").bases("Expression").field("tag",def("Expression")).field("quasi",def("TemplateLiteral"));def("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[def("TemplateElement")]).field("expressions",[def("Expression")]);def("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:isString,raw:isString}).field("tail",isBoolean)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/ast-types/def/es6.js","/node_modules/babel-core/node_modules/ast-types/def")},{"../lib/shared":606,"../lib/types":607,"./core":595,_process:1069,buffer:919}],598:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("Function").field("async",isBoolean,defaults["false"]);def("SpreadProperty").bases("Node").build("argument").field("argument",def("Expression"));def("ObjectExpression").field("properties",[or(def("Property"),def("SpreadProperty"))]);def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));def("ObjectPattern").field("properties",[or(def("PropertyPattern"),def("SpreadPropertyPattern"),def("Property"),def("SpreadProperty"))]);def("AwaitExpression").bases("Expression").build("argument","all").field("argument",or(def("Expression"),null)).field("all",isBoolean,defaults["false"])}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/ast-types/def/es7.js","/node_modules/babel-core/node_modules/ast-types/def")},{"../lib/shared":606,"../lib/types":607,"./core":595,_process:1069,buffer:919}],599:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("JSXAttribute").bases("Node").build("name","value").field("name",or(def("JSXIdentifier"),def("JSXNamespacedName"))).field("value",or(def("Literal"),def("JSXExpressionContainer"),null),defaults["null"]);def("JSXIdentifier").bases("Identifier").build("name").field("name",isString);def("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",def("JSXIdentifier")).field("name",def("JSXIdentifier"));def("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",or(def("JSXIdentifier"),def("JSXMemberExpression"))).field("property",def("JSXIdentifier")).field("computed",isBoolean,defaults.false);var JSXElementName=or(def("JSXIdentifier"),def("JSXNamespacedName"),def("JSXMemberExpression"));def("JSXSpreadAttribute").bases("Node").build("argument").field("argument",def("Expression"));var JSXAttributes=[or(def("JSXAttribute"),def("JSXSpreadAttribute"))];def("JSXExpressionContainer").bases("Expression").build("expression").field("expression",def("Expression"));def("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",def("JSXOpeningElement")).field("closingElement",or(def("JSXClosingElement"),null),defaults["null"]).field("children",[or(def("JSXElement"),def("JSXExpressionContainer"),def("JSXText"),def("Literal"))],defaults.emptyArray).field("name",JSXElementName,function(){return this.openingElement.name}).field("selfClosing",isBoolean,function(){return this.openingElement.selfClosing}).field("attributes",JSXAttributes,function(){return this.openingElement.attributes});def("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",JSXElementName).field("attributes",JSXAttributes,defaults.emptyArray).field("selfClosing",isBoolean,defaults["false"]);def("JSXClosingElement").bases("Node").build("name").field("name",JSXElementName);def("JSXText").bases("Literal").build("value").field("value",isString);def("JSXEmptyExpression").bases("Expression").build();def("Type").bases("Node");def("AnyTypeAnnotation").bases("Type");def("VoidTypeAnnotation").bases("Type");def("NumberTypeAnnotation").bases("Type");def("StringTypeAnnotation").bases("Type");def("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",isString).field("raw",isString);def("BooleanTypeAnnotation").bases("Type");def("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",def("Type"));def("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",def("Type"));def("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[def("FunctionTypeParam")]).field("returnType",def("Type")).field("rest",or(def("FunctionTypeParam"),null)).field("typeParameters",or(def("TypeParameterDeclaration"),null));def("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",def("Identifier")).field("typeAnnotation",def("Type")).field("optional",isBoolean);def("ArrayTypeAnnotation").bases("Type").build("elementType").field("elementType",def("Type"));def("ObjectTypeAnnotation").bases("Type").build("properties").field("properties",[def("ObjectTypeProperty")]).field("indexers",[def("ObjectTypeIndexer")],defaults.emptyArray).field("callProperties",[def("ObjectTypeCallProperty")],defaults.emptyArray);def("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",or(def("Literal"),def("Identifier"))).field("value",def("Type")).field("optional",isBoolean);def("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",def("Identifier")).field("key",def("Type")).field("value",def("Type")); -def("ObjectTypeCallProperty").bases("Node").build("value").field("value",def("FunctionTypeAnnotation")).field("static",isBoolean,false);def("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",or(def("Identifier"),def("QualifiedTypeIdentifier"))).field("id",def("Identifier"));def("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",or(def("Identifier"),def("QualifiedTypeIdentifier"))).field("typeParameters",or(def("TypeParameterInstantiation"),null));def("MemberTypeAnnotation").bases("Type").build("object","property").field("object",def("Identifier")).field("property",or(def("MemberTypeAnnotation"),def("GenericTypeAnnotation")));def("UnionTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",def("Type"));def("Identifier").field("typeAnnotation",or(def("TypeAnnotation"),null),defaults["null"]);def("TypeParameterDeclaration").bases("Node").build("params").field("params",[def("Identifier")]);def("TypeParameterInstantiation").bases("Node").build("params").field("params",[def("Type")]);def("Function").field("returnType",or(def("TypeAnnotation"),null),defaults["null"]).field("typeParameters",or(def("TypeParameterDeclaration"),null),defaults["null"]);def("ClassProperty").build("key","typeAnnotation").field("typeAnnotation",def("TypeAnnotation")).field("static",isBoolean,false);def("ClassImplements").field("typeParameters",or(def("TypeParameterInstantiation"),null),defaults["null"]);def("InterfaceDeclaration").bases("Statement").build("id","body","extends").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterDeclaration"),null),defaults["null"]).field("body",def("ObjectTypeAnnotation")).field("extends",[def("InterfaceExtends")]);def("InterfaceExtends").bases("Node").build("id").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterInstantiation"),null));def("TypeAlias").bases("Statement").build("id","typeParameters","right").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterDeclaration"),null)).field("right",def("Type"));def("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",def("Expression")).field("typeAnnotation",def("TypeAnnotation"));def("TupleTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("DeclareVariable").bases("Statement").build("id").field("id",def("Identifier"));def("DeclareFunction").bases("Statement").build("id").field("id",def("Identifier"));def("DeclareClass").bases("InterfaceDeclaration").build("id");def("DeclareModule").bases("Statement").build("id","body").field("id",or(def("Identifier"),def("Literal"))).field("body",def("BlockStatement"))}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/ast-types/def/fb-harmony.js","/node_modules/babel-core/node_modules/ast-types/def")},{"../lib/shared":606,"../lib/types":607,"./core":595,_process:1069,buffer:919}],600:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var geq=require("../lib/shared").geq;def("Function").field("body",or(def("BlockStatement"),def("Expression")));def("ForOfStatement").bases("Statement").build("left","right","body").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement"));def("LetStatement").bases("Statement").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Statement"));def("LetExpression").bases("Expression").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Expression"));def("GraphExpression").bases("Expression").build("index","expression").field("index",geq(0)).field("expression",def("Literal"));def("GraphIndexExpression").bases("Expression").build("index").field("index",geq(0))}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/ast-types/def/mozilla.js","/node_modules/babel-core/node_modules/ast-types/def")},{"../lib/shared":606,"../lib/types":607,"./core":595,_process:1069,buffer:919}],601:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var assert=require("assert");var types=require("../main");var getFieldNames=types.getFieldNames;var getFieldValue=types.getFieldValue;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isDate=types.builtInTypes.Date;var isRegExp=types.builtInTypes.RegExp;var hasOwn=Object.prototype.hasOwnProperty;function astNodesAreEquivalent(a,b,problemPath){if(isArray.check(problemPath)){problemPath.length=0}else{problemPath=null}return areEquivalent(a,b,problemPath)}astNodesAreEquivalent.assert=function(a,b){var problemPath=[];if(!astNodesAreEquivalent(a,b,problemPath)){if(problemPath.length===0){assert.strictEqual(a,b)}else{assert.ok(false,"Nodes differ in the following path: "+problemPath.map(subscriptForProperty).join(""))}}};function subscriptForProperty(property){if(/[_$a-z][_$a-z0-9]*/i.test(property)){return"."+property}return"["+JSON.stringify(property)+"]"}function areEquivalent(a,b,problemPath){if(a===b){return true}if(isArray.check(a)){return arraysAreEquivalent(a,b,problemPath)}if(isObject.check(a)){return objectsAreEquivalent(a,b,problemPath)}if(isDate.check(a)){return isDate.check(b)&&+a===+b}if(isRegExp.check(a)){return isRegExp.check(b)&&(a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.ignoreCase===b.ignoreCase)}return a==b}function arraysAreEquivalent(a,b,problemPath){isArray.assert(a);var aLength=a.length;if(!isArray.check(b)||b.length!==aLength){if(problemPath){problemPath.push("length")}return false}for(var i=0;inp){return true}if(pp===np&&this.name==="right"){assert.strictEqual(parent.right,node);return true}default:return false}case"SequenceExpression":switch(parent.type){case"ForStatement":return false;case"ExpressionStatement":return this.name!=="expression";default:return true}case"YieldExpression":switch(parent.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return true;default:return false}case"Literal":return parent.type==="MemberExpression"&&isNumber.check(node.value)&&this.name==="object"&&parent.object===node;case"AssignmentExpression":case"ConditionalExpression":switch(parent.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return true;case"CallExpression":return this.name==="callee"&&parent.callee===node;case"ConditionalExpression":return this.name==="test"&&parent.test===node;case"MemberExpression":return this.name==="object"&&parent.object===node;default:return false}default:if(parent.type==="NewExpression"&&this.name==="callee"&&parent.callee===node){return containsCallExpression(node)}}if(assumeExpressionContext!==true&&!this.canBeFirstInStatement()&&this.firstInStatement())return true;return false};function isBinary(node){return n.BinaryExpression.check(node)||n.LogicalExpression.check(node)}function isUnaryLike(node){return n.UnaryExpression.check(node)||n.SpreadElement&&n.SpreadElement.check(node)||n.SpreadProperty&&n.SpreadProperty.check(node)}var PRECEDENCE={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(tier,i){tier.forEach(function(op){PRECEDENCE[op]=i})});function containsCallExpression(node){if(n.CallExpression.check(node)){return true}if(isArray.check(node)){return node.some(containsCallExpression)}if(n.Node.check(node)){return types.someField(node,function(name,child){return containsCallExpression(child)})}return false}NPp.canBeFirstInStatement=function(){var node=this.node;return!n.FunctionExpression.check(node)&&!n.ObjectExpression.check(node)};NPp.firstInStatement=function(){return firstInStatement(this)};function firstInStatement(path){for(var node,parent;path.parent;path=path.parent){node=path.node;parent=path.parent.node;if(n.BlockStatement.check(parent)&&path.parent.name==="body"&&path.name===0){assert.strictEqual(parent.body[0],node);return true}if(n.ExpressionStatement.check(parent)&&path.name==="expression"){assert.strictEqual(parent.expression,node);return true}if(n.SequenceExpression.check(parent)&&path.parent.name==="expressions"&&path.name===0){assert.strictEqual(parent.expressions[0],node);continue}if(n.CallExpression.check(parent)&&path.name==="callee"){assert.strictEqual(parent.callee,node);continue}if(n.MemberExpression.check(parent)&&path.name==="object"){assert.strictEqual(parent.object,node);continue}if(n.ConditionalExpression.check(parent)&&path.name==="test"){assert.strictEqual(parent.test,node);continue}if(isBinary(parent)&&path.name==="left"){assert.strictEqual(parent.left,node);continue}if(n.UnaryExpression.check(parent)&&!parent.prefix&&path.name==="argument"){assert.strictEqual(parent.argument,node);continue}return false}return true}function cleanUpNodesAfterPrune(remainingNodePath){if(n.VariableDeclaration.check(remainingNodePath.node)){var declarations=remainingNodePath.get("declarations").value;if(!declarations||declarations.length===0){return remainingNodePath.prune()}}else if(n.ExpressionStatement.check(remainingNodePath.node)){if(!remainingNodePath.get("expression").value){return remainingNodePath.prune()}}else if(n.IfStatement.check(remainingNodePath.node)){cleanUpIfStatementAfterPrune(remainingNodePath)}return remainingNodePath}function cleanUpIfStatementAfterPrune(ifStatement){var testExpression=ifStatement.get("test").value;var alternate=ifStatement.get("alternate").value;var consequent=ifStatement.get("consequent").value;if(!consequent&&!alternate){var testExpressionStatement=b.expressionStatement(testExpression);ifStatement.replace(testExpressionStatement)}else if(!consequent&&alternate){var negatedTestExpression=b.unaryExpression("!",testExpression,true);if(n.UnaryExpression.check(testExpression)&&testExpression.operator==="!"){negatedTestExpression=testExpression.argument}ifStatement.get("test").replace(negatedTestExpression);ifStatement.get("consequent").replace(alternate);ifStatement.get("alternate").replace()}}module.exports=NodePath}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/ast-types/lib/node-path.js","/node_modules/babel-core/node_modules/ast-types/lib")},{"./path":604,"./scope":605,"./types":607,_process:1069,assert:917,buffer:919,util:1089}],603:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var assert=require("assert");var types=require("./types");var NodePath=require("./node-path");var Printable=types.namedTypes.Printable;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isFunction=types.builtInTypes.function;var hasOwn=Object.prototype.hasOwnProperty;var undefined;function PathVisitor(){assert.ok(this instanceof PathVisitor);this._reusableContextStack=[];this._methodNameTable=computeMethodNameTable(this);this._shouldVisitComments=hasOwn.call(this._methodNameTable,"Block")||hasOwn.call(this._methodNameTable,"Line");this.Context=makeContextConstructor(this);this._visiting=false;this._changeReported=false}function computeMethodNameTable(visitor){var typeNames=Object.create(null);for(var methodName in visitor){if(/^visit[A-Z]/.test(methodName)){typeNames[methodName.slice("visit".length)]=true}}var supertypeTable=types.computeSupertypeLookupTable(typeNames);var methodNameTable=Object.create(null);var typeNames=Object.keys(supertypeTable);var typeNameCount=typeNames.length;for(var i=0;i=0){parentCache[path.name=i]=path}}else{parentValue[path.name]=path.value;parentCache[path.name]=path}assert.strictEqual(parentValue[path.name],path.value);assert.strictEqual(path.parentPath.get(path.name),path);return path}Pp.replace=function replace(replacement){var results=[];var parentValue=this.parentPath.value;var parentCache=getChildCache(this.parentPath);var count=arguments.length;repairRelationshipWithParent(this);if(isArray.check(parentValue)){var originalLength=parentValue.length;var move=getMoves(this.parentPath,count-1,this.name+1);var spliceArgs=[this.name,1];for(var i=0;i=than},isNumber+" >= "+than)};exports.defaults={"null":function(){return null},emptyArray:function(){return[]},"false":function(){return false},"true":function(){return true},undefined:function(){}};var naiveIsPrimitive=Type.or(builtin.string,builtin.number,builtin.boolean,builtin.null,builtin.undefined);exports.isPrimitive=new Type(function(value){if(value===null)return true;var type=typeof value;return!(type==="object"||type==="function")},naiveIsPrimitive.toString())}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/ast-types/lib/shared.js","/node_modules/babel-core/node_modules/ast-types/lib")},{"../lib/types":607,_process:1069,buffer:919}],607:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var assert=require("assert");var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;var each=Ap.forEach;var Op=Object.prototype;var objToStr=Op.toString;var funObjStr=objToStr.call(function(){});var strObjStr=objToStr.call("");var hasOwn=Op.hasOwnProperty;function Type(check,name){var self=this;assert.ok(self instanceof Type,self);assert.strictEqual(objToStr.call(check),funObjStr,check+" is not a function");var nameObjStr=objToStr.call(name);assert.ok(nameObjStr===funObjStr||nameObjStr===strObjStr,name+" is neither a function nor a string");Object.defineProperties(self,{name:{value:name},check:{value:function(value,deep){var result=check.call(self,value,deep);if(!result&&deep&&objToStr.call(deep)===funObjStr)deep(self,value);return result}}})}var Tp=Type.prototype;exports.Type=Type;Tp.assert=function(value,deep){if(!this.check(value,deep)){var str=shallowStringify(value);assert.ok(false,str+" does not match type "+this);return false}return true};function shallowStringify(value){if(isObject.check(value))return"{"+Object.keys(value).map(function(key){return key+": "+value[key]}).join(", ")+"}";if(isArray.check(value))return"["+value.map(shallowStringify).join(", ")+"]";return JSON.stringify(value)}Tp.toString=function(){var name=this.name;if(isString.check(name))return name;if(isFunction.check(name))return name.call(this)+"";return name+" type"};var builtInTypes={};exports.builtInTypes=builtInTypes;function defBuiltInType(example,name){var objStr=objToStr.call(example);Object.defineProperty(builtInTypes,name,{enumerable:true,value:new Type(function(value){return objToStr.call(value)===objStr},name)});return builtInTypes[name]}var isString=defBuiltInType("","string");var isFunction=defBuiltInType(function(){},"function");var isArray=defBuiltInType([],"array");var isObject=defBuiltInType({},"object");var isRegExp=defBuiltInType(/./,"RegExp");var isDate=defBuiltInType(new Date,"Date");var isNumber=defBuiltInType(3,"number");var isBoolean=defBuiltInType(true,"boolean");var isNull=defBuiltInType(null,"null");var isUndefined=defBuiltInType(void 0,"undefined");function toType(from,name){if(from instanceof Type)return from;if(from instanceof Def)return from.type;if(isArray.check(from))return Type.fromArray(from);if(isObject.check(from))return Type.fromObject(from);if(isFunction.check(from))return new Type(from,name);return new Type(function(value){return value===from},isUndefined.check(name)?function(){return from+""}:name)}Type.or=function(){var types=[];var len=arguments.length;for(var i=0;i1){for(var a=1;a0;i--){line=lines[i];if(~line.indexOf("sourceMappingURL=data:"))return exports.fromComment(line)}}Converter.prototype.toJSON=function(space){return JSON.stringify(this.sourcemap,null,space)};Converter.prototype.toBase64=function(){var json=this.toJSON();return new Buffer(json).toString("base64")};Converter.prototype.toComment=function(options){var base64=this.toBase64();var data="sourceMappingURL=data:application/json;base64,"+base64;return options&&options.multiline?"/*# "+data+" */":"//# "+data};Converter.prototype.toObject=function(){return JSON.parse(this.toJSON())};Converter.prototype.addProperty=function(key,value){if(this.sourcemap.hasOwnProperty(key))throw new Error("property %s already exists on the sourcemap, use set property instead");return this.setProperty(key,value)};Converter.prototype.setProperty=function(key,value){this.sourcemap[key]=value;return this};Converter.prototype.getProperty=function(key){return this.sourcemap[key]};exports.fromObject=function(obj){return new Converter(obj)};exports.fromJSON=function(json){return new Converter(json,{isJSON:true})};exports.fromBase64=function(base64){return new Converter(base64,{isEncoded:true})};exports.fromComment=function(comment){comment=comment.replace(/^\/\*/g,"//").replace(/\*\/$/g,"");return new Converter(comment,{isEncoded:true,hasComment:true})};exports.fromMapFileComment=function(comment,dir){return new Converter(comment,{commentFileDir:dir,isFileComment:true,isJSON:true})};exports.fromSource=function(content,largeSource){if(largeSource)return convertFromLargeSource(content);var m=content.match(commentRx);commentRx.lastIndex=0;return m?exports.fromComment(m.pop()):null};exports.fromMapFileSource=function(content,dir){var m=content.match(mapFileCommentRx);mapFileCommentRx.lastIndex=0;return m?exports.fromMapFileComment(m.pop(),dir):null};exports.removeComments=function(src){commentRx.lastIndex=0;return src.replace(commentRx,"")};exports.removeMapFileComments=function(src){mapFileCommentRx.lastIndex=0;return src.replace(mapFileCommentRx,"")};Object.defineProperty(exports,"commentRegex",{get:function getCommentRegex(){commentRx.lastIndex=0;return commentRx}});Object.defineProperty(exports,"mapFileCommentRegex",{get:function getMapFileCommentRegex(){mapFileCommentRx.lastIndex=0;return mapFileCommentRx}})}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/convert-source-map/index.js","/node_modules/babel-core/node_modules/convert-source-map")},{_process:1069,buffer:919,fs:916,path:1068}],618:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$");module.exports=function(IS_INCLUDES){return function($this,el,fromIndex){var O=$.toObject($this),length=$.toLength(O.length),index=$.toIndex(fromIndex,length),value;if(IS_INCLUDES&&el!=el)while(length>index){value=O[index++];if(value!=value)return true}else for(;length>index;index++)if(IS_INCLUDES||index in O){if(O[index]===el)return IS_INCLUDES||index}return!IS_INCLUDES&&-1}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.array-includes.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],619:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),ctx=require("./$.ctx");module.exports=function(TYPE){var IS_MAP=TYPE==1,IS_FILTER=TYPE==2,IS_SOME=TYPE==3,IS_EVERY=TYPE==4,IS_FIND_INDEX=TYPE==6,NO_HOLES=TYPE==5||IS_FIND_INDEX;return function($this,callbackfn,that){var O=Object($.assertDefined($this)),self=$.ES5Object(O),f=ctx(callbackfn,that,3),length=$.toLength(self.length),index=0,result=IS_MAP?Array(length):IS_FILTER?[]:undefined,val,res;for(;length>index;index++)if(NO_HOLES||index in self){val=self[index];res=f(val,index,O);if(TYPE){if(IS_MAP)result[index]=res;else if(res)switch(TYPE){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(IS_EVERY)return false}}return IS_FIND_INDEX?-1:IS_SOME||IS_EVERY?IS_EVERY:result}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.array-methods.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.ctx":627,_process:1069,buffer:919}],620:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$");function assert(condition,msg1,msg2){if(!condition)throw TypeError(msg2?msg1+msg2:msg1); -}assert.def=$.assertDefined;assert.fn=function(it){if(!$.isFunction(it))throw TypeError(it+" is not a function!");return it};assert.obj=function(it){if(!$.isObject(it))throw TypeError(it+" is not an object!");return it};assert.inst=function(it,Constructor,name){if(!(it instanceof Constructor))throw TypeError(name+": use the 'new' operator!");return it};module.exports=assert}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.assert.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],621:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),enumKeys=require("./$.enum-keys");module.exports=Object.assign||function assign(target,source){var T=Object($.assertDefined(target)),l=arguments.length,i=1;while(l>i){var S=$.ES5Object(arguments[i++]),keys=enumKeys(S),length=keys.length,j=0,key;while(length>j)T[key=keys[j++]]=S[key]}return T}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.assign.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.enum-keys":630,_process:1069,buffer:919}],622:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),TAG=require("./$.wks")("toStringTag"),toString={}.toString;function cof(it){return toString.call(it).slice(8,-1)}cof.classof=function(it){var O,T;return it==undefined?it===undefined?"Undefined":"Null":typeof(T=(O=Object(it))[TAG])=="string"?T:cof(O)};cof.set=function(it,tag,stat){if(it&&!$.has(it=stat?it:it.prototype,TAG))$.hide(it,TAG,tag)};module.exports=cof}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.cof.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.wks":657,_process:1069,buffer:919}],623:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var $=require("./$"),ctx=require("./$.ctx"),safe=require("./$.uid").safe,assert=require("./$.assert"),forOf=require("./$.for-of"),step=require("./$.iter").step,$has=$.has,set=$.set,isObject=$.isObject,hide=$.hide,isExtensible=Object.isExtensible||isObject,ID=safe("id"),O1=safe("O1"),LAST=safe("last"),FIRST=safe("first"),ITER=safe("iter"),SIZE=$.DESC?safe("size"):"size",id=0;function fastKey(it,create){if(!isObject(it))return typeof it=="symbol"?it:(typeof it=="string"?"S":"P")+it;if(!$has(it,ID)){if(!isExtensible(it))return"F";if(!create)return"E";hide(it,ID,++id)}return"O"+it[ID]}function getEntry(that,key){var index=fastKey(key),entry;if(index!=="F")return that[O1][index];for(entry=that[FIRST];entry;entry=entry.n){if(entry.k==key)return entry}}module.exports={getConstructor:function(wrapper,NAME,IS_MAP,ADDER){var C=wrapper(function(that,iterable){assert.inst(that,C,NAME);set(that,O1,$.create(null));set(that,SIZE,0);set(that,LAST,undefined);set(that,FIRST,undefined);if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that)});require("./$.mix")(C.prototype,{clear:function clear(){for(var that=this,data=that[O1],entry=that[FIRST];entry;entry=entry.n){entry.r=true;if(entry.p)entry.p=entry.p.n=undefined;delete data[entry.i]}that[FIRST]=that[LAST]=undefined;that[SIZE]=0},"delete":function(key){var that=this,entry=getEntry(that,key);if(entry){var next=entry.n,prev=entry.p;delete that[O1][entry.i];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that[FIRST]==entry)that[FIRST]=next;if(that[LAST]==entry)that[LAST]=prev;that[SIZE]--}return!!entry},forEach:function forEach(callbackfn){var f=ctx(callbackfn,arguments[1],3),entry;while(entry=entry?entry.n:this[FIRST]){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function has(key){return!!getEntry(this,key)}});if($.DESC)$.setDesc(C.prototype,"size",{get:function(){return assert.def(this[SIZE])}});return C},def:function(that,key,value){var entry=getEntry(that,key),prev,index;if(entry){entry.v=value}else{that[LAST]=entry={i:index=fastKey(key,true),k:key,v:value,p:prev=that[LAST],n:undefined,r:false};if(!that[FIRST])that[FIRST]=entry;if(prev)prev.n=entry;that[SIZE]++;if(index!=="F")that[O1][index]=entry}return that},getEntry:getEntry,setIter:function(C,NAME,IS_MAP){require("./$.iter-define")(C,NAME,function(iterated,kind){set(this,ITER,{o:iterated,k:kind})},function(){var iter=this[ITER],kind=iter.k,entry=iter.l;while(entry&&entry.r)entry=entry.p;if(!iter.o||!(iter.l=entry=entry?entry.n:iter.o[FIRST])){iter.o=undefined;return step(1)}if(kind=="keys")return step(0,entry.k);if(kind=="values")return step(0,entry.v);return step(0,[entry.k,entry.v])},IS_MAP?"entries":"values",!IS_MAP,true)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.collection-strong.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.assert":620,"./$.ctx":627,"./$.for-of":631,"./$.iter":638,"./$.iter-define":636,"./$.mix":641,"./$.uid":655,_process:1069,buffer:919}],624:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $def=require("./$.def"),forOf=require("./$.for-of");module.exports=function(NAME){$def($def.P,NAME,{toJSON:function toJSON(){var arr=[];forOf(this,false,arr.push,arr);return arr}})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.collection-to-json.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$.def":628,"./$.for-of":631,_process:1069,buffer:919}],625:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var $=require("./$"),safe=require("./$.uid").safe,assert=require("./$.assert"),forOf=require("./$.for-of"),$has=$.has,isObject=$.isObject,hide=$.hide,isExtensible=Object.isExtensible||isObject,id=0,ID=safe("id"),WEAK=safe("weak"),LEAK=safe("leak"),method=require("./$.array-methods"),find=method(5),findIndex=method(6);function findFrozen(store,key){return find(store.array,function(it){return it[0]===key})}function leakStore(that){return that[LEAK]||hide(that,LEAK,{array:[],get:function(key){var entry=findFrozen(this,key);if(entry)return entry[1]},has:function(key){return!!findFrozen(this,key)},set:function(key,value){var entry=findFrozen(this,key);if(entry)entry[1]=value;else this.array.push([key,value])},"delete":function(key){var index=findIndex(this.array,function(it){return it[0]===key});if(~index)this.array.splice(index,1);return!!~index}})[LEAK]}module.exports={getConstructor:function(wrapper,NAME,IS_MAP,ADDER){var C=wrapper(function(that,iterable){$.set(assert.inst(that,C,NAME),ID,id++);if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that)});require("./$.mix")(C.prototype,{"delete":function(key){if(!isObject(key))return false;if(!isExtensible(key))return leakStore(this)["delete"](key);return $has(key,WEAK)&&$has(key[WEAK],this[ID])&&delete key[WEAK][this[ID]]},has:function has(key){if(!isObject(key))return false;if(!isExtensible(key))return leakStore(this).has(key);return $has(key,WEAK)&&$has(key[WEAK],this[ID])}});return C},def:function(that,key,value){if(!isExtensible(assert.obj(key))){leakStore(that).set(key,value)}else{$has(key,WEAK)||hide(key,WEAK,{});key[WEAK][that[ID]]=value}return that},leakStore:leakStore,WEAK:WEAK,ID:ID}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.collection-weak.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.array-methods":619,"./$.assert":620,"./$.for-of":631,"./$.mix":641,"./$.uid":655,_process:1069,buffer:919}],626:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var $=require("./$"),$def=require("./$.def"),BUGGY=require("./$.iter").BUGGY,forOf=require("./$.for-of"),species=require("./$.species"),assertInstance=require("./$.assert").inst;module.exports=function(NAME,wrapper,methods,common,IS_MAP,IS_WEAK){var Base=$.g[NAME],C=Base,ADDER=IS_MAP?"set":"add",proto=C&&C.prototype,O={};function fixMethod(KEY){var fn=proto[KEY];require("./$.redef")(proto,KEY,KEY=="delete"?function(a){return fn.call(this,a===0?0:a)}:KEY=="has"?function has(a){return fn.call(this,a===0?0:a)}:KEY=="get"?function get(a){return fn.call(this,a===0?0:a)}:KEY=="add"?function add(a){fn.call(this,a===0?0:a);return this}:function set(a,b){fn.call(this,a===0?0:a,b);return this})}if(!$.isFunction(C)||!(IS_WEAK||!BUGGY&&proto.forEach&&proto.entries)){C=common.getConstructor(wrapper,NAME,IS_MAP,ADDER);require("./$.mix")(C.prototype,methods)}else{var inst=new C,chain=inst[ADDER](IS_WEAK?{}:-0,1),buggyZero;if(!require("./$.iter-detect")(function(iter){new C(iter)})){C=wrapper(function(target,iterable){assertInstance(target,C,NAME);var that=new Base;if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that);return that});C.prototype=proto;proto.constructor=C}IS_WEAK||inst.forEach(function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixMethod("delete");fixMethod("has");IS_MAP&&fixMethod("get")}if(buggyZero||chain!==inst)fixMethod(ADDER)}require("./$.cof").set(C,NAME);O[NAME]=C;$def($def.G+$def.W+$def.F*(C!=Base),O);species(C);species($.core[NAME]);if(!IS_WEAK)common.setIter(C,NAME,IS_MAP);return C}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.collection.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.assert":620,"./$.cof":622,"./$.def":628,"./$.for-of":631,"./$.iter":638,"./$.iter-detect":637,"./$.mix":641,"./$.redef":644,"./$.species":649,_process:1069,buffer:919}],627:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var assertFunction=require("./$.assert").fn;module.exports=function(fn,that,length){assertFunction(fn);if(~length&&that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.ctx.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$.assert":620,_process:1069,buffer:919}],628:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),global=$.g,core=$.core,isFunction=$.isFunction,$redef=require("./$.redef");function ctx(fn,that){return function(){return fn.apply(that,arguments)}}global.core=core;$def.F=1;$def.G=2;$def.S=4;$def.P=8;$def.B=16;$def.W=32;function $def(type,name,source){var key,own,out,exp,isGlobal=type&$def.G,isProto=type&$def.P,target=isGlobal?global:type&$def.S?global[name]:(global[name]||{}).prototype,exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&$def.F)&&target&&key in target;out=(own?target:source)[key];if(type&$def.B&&own)exp=ctx(out,global);else exp=isProto&&isFunction(out)?ctx(Function.call,out):out;if(target&&!own)$redef(target,key,out);if(exports[key]!=out)$.hide(exports,key,exp);if(isProto)(exports.prototype||(exports.prototype={}))[key]=out}}module.exports=$def}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.def.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.redef":644,_process:1069,buffer:919}],629:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),document=$.g.document,isObject=$.isObject,is=isObject(document)&&isObject(document.createElement);module.exports=function(it){return is?document.createElement(it):{}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.dom-create.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],630:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$");module.exports=function(it){var keys=$.getKeys(it),getDesc=$.getDesc,getSymbols=$.getSymbols;if(getSymbols)$.each.call(getSymbols(it),function(key){if(getDesc(it,key).enumerable)keys.push(key)});return keys}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.enum-keys.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],631:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var ctx=require("./$.ctx"),get=require("./$.iter").get,call=require("./$.iter-call");module.exports=function(iterable,entries,fn,that){var iterator=get(iterable),f=ctx(fn,that,entries?2:1),step;while(!(step=iterator.next()).done){if(call(iterator,f,step.value,entries)===false){return call.close(iterator)}}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.for-of.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$.ctx":627,"./$.iter":638,"./$.iter-call":635,_process:1069,buffer:919}],632:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function($){$.FW=true;$.path=$.g;return $}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.fw.js","/node_modules/babel-core/node_modules/core-js/modules")},{_process:1069,buffer:919}],633:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),toString={}.toString,getNames=$.getNames;var windowNames=typeof window=="object"&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];function getWindowNames(it){try{return getNames(it)}catch(e){return windowNames.slice()}}module.exports.get=function getOwnPropertyNames(it){if(windowNames&&toString.call(it)=="[object Window]")return getWindowNames(it);return getNames($.toObject(it))}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.get-names.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],634:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(fn,args,that){var un=that===undefined;switch(args.length){case 0:return un?fn():fn.call(that);case 1:return un?fn(args[0]):fn.call(that,args[0]);case 2:return un?fn(args[0],args[1]):fn.call(that,args[0],args[1]);case 3:return un?fn(args[0],args[1],args[2]):fn.call(that,args[0],args[1],args[2]);case 4:return un?fn(args[0],args[1],args[2],args[3]):fn.call(that,args[0],args[1],args[2],args[3]);case 5:return un?fn(args[0],args[1],args[2],args[3],args[4]):fn.call(that,args[0],args[1],args[2],args[3],args[4])}return fn.apply(that,args)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.invoke.js","/node_modules/babel-core/node_modules/core-js/modules")},{_process:1069,buffer:919}],635:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var assertObject=require("./$.assert").obj;function close(iterator){var ret=iterator["return"];if(ret!==undefined)assertObject(ret.call(iterator))}function call(iterator,fn,value,entries){try{return entries?fn(assertObject(value)[0],value[1]):fn(value)}catch(e){close(iterator);throw e}}call.close=close;module.exports=call}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.iter-call.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$.assert":620,_process:1069,buffer:919}],636:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $def=require("./$.def"),$redef=require("./$.redef"),$=require("./$"),cof=require("./$.cof"),$iter=require("./$.iter"),SYMBOL_ITERATOR=require("./$.wks")("iterator"),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",Iterators=$iter.Iterators;module.exports=function(Base,NAME,Constructor,next,DEFAULT,IS_SET,FORCE){$iter.create(Constructor,NAME,next);function createMethod(kind){function $$(that){return new Constructor(that,kind)}switch(kind){case KEYS:return function keys(){return $$(this)};case VALUES:return function values(){return $$(this)}}return function entries(){return $$(this)}}var TAG=NAME+" Iterator",proto=Base.prototype,_native=proto[SYMBOL_ITERATOR]||proto[FF_ITERATOR]||DEFAULT&&proto[DEFAULT],_default=_native||createMethod(DEFAULT),methods,key;if(_native){var IteratorPrototype=$.getProto(_default.call(new Base));cof.set(IteratorPrototype,TAG,true);if($.FW&&$.has(proto,FF_ITERATOR))$iter.set(IteratorPrototype,$.that)}if($.FW||FORCE)$iter.set(proto,_default);Iterators[NAME]=_default;Iterators[TAG]=$.that;if(DEFAULT){methods={keys:IS_SET?_default:createMethod(KEYS),values:DEFAULT==VALUES?_default:createMethod(VALUES),entries:DEFAULT!=VALUES?_default:createMethod("entries")};if(FORCE)for(key in methods){if(!(key in proto))$redef(proto,key,methods[key])}else $def($def.P+$def.F*$iter.BUGGY,NAME,methods)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.iter-define.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.cof":622,"./$.def":628,"./$.iter":638,"./$.redef":644,"./$.wks":657,_process:1069,buffer:919}],637:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var SYMBOL_ITERATOR=require("./$.wks")("iterator"),SAFE_CLOSING=false;try{var riter=[7][SYMBOL_ITERATOR]();riter["return"]=function(){SAFE_CLOSING=true};Array.from(riter,function(){throw 2})}catch(e){}module.exports=function(exec){if(!SAFE_CLOSING)return false;var safe=false;try{var arr=[7],iter=arr[SYMBOL_ITERATOR]();iter.next=function(){safe=true};arr[SYMBOL_ITERATOR]=function(){return iter};exec(arr)}catch(e){}return safe}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.iter-detect.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$.wks":657,_process:1069,buffer:919}],638:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var $=require("./$"),cof=require("./$.cof"),classof=cof.classof,assert=require("./$.assert"),assertObject=assert.obj,SYMBOL_ITERATOR=require("./$.wks")("iterator"),FF_ITERATOR="@@iterator",Iterators=require("./$.shared")("iterators"),IteratorPrototype={};setIterator(IteratorPrototype,$.that);function setIterator(O,value){$.hide(O,SYMBOL_ITERATOR,value);if(FF_ITERATOR in[])$.hide(O,FF_ITERATOR,value)}module.exports={BUGGY:"keys"in[]&&!("next"in[].keys()),Iterators:Iterators,step:function(done,value){return{value:value,done:!!done}},is:function(it){var O=Object(it),Symbol=$.g.Symbol;return(Symbol&&Symbol.iterator||FF_ITERATOR)in O||SYMBOL_ITERATOR in O||$.has(Iterators,classof(O))},get:function(it){var Symbol=$.g.Symbol,getIter;if(it!=undefined){getIter=it[Symbol&&Symbol.iterator||FF_ITERATOR]||it[SYMBOL_ITERATOR]||Iterators[classof(it)]}assert($.isFunction(getIter),it," is not iterable!");return assertObject(getIter.call(it))},set:setIterator,create:function(Constructor,NAME,next,proto){Constructor.prototype=$.create(proto||IteratorPrototype,{next:$.desc(1,next)});cof.set(Constructor,NAME+" Iterator")}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.iter.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.assert":620,"./$.cof":622,"./$.shared":648,"./$.wks":657,_process:1069,buffer:919}],639:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var global=typeof self!="undefined"?self:Function("return this")(),core={},defineProperty=Object.defineProperty,hasOwnProperty={}.hasOwnProperty,ceil=Math.ceil,floor=Math.floor,max=Math.max,min=Math.min;var DESC=!!function(){try{return defineProperty({},"a",{get:function(){return 2}}).a==2}catch(e){}}();var hide=createDefiner(1);function toInteger(it){return isNaN(it=+it)?0:(it>0?floor:ceil)(it)}function desc(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}function simpleSet(object,key,value){object[key]=value;return object}function createDefiner(bitmap){return DESC?function(object,key,value){return $.setDesc(object,key,desc(bitmap,value))}:simpleSet}function isObject(it){return it!==null&&(typeof it=="object"||typeof it=="function")}function isFunction(it){return typeof it=="function"}function assertDefined(it){if(it==undefined)throw TypeError("Can't call method on "+it);return it}var $=module.exports=require("./$.fw")({g:global,core:core,html:global.document&&document.documentElement,isObject:isObject,isFunction:isFunction,that:function(){return this},toInteger:toInteger,toLength:function(it){return it>0?min(toInteger(it),9007199254740991):0},toIndex:function(index,length){index=toInteger(index);return index<0?max(index+length,0):min(index,length)},has:function(it,key){return hasOwnProperty.call(it,key)},create:Object.create,getProto:Object.getPrototypeOf,DESC:DESC,desc:desc,getDesc:Object.getOwnPropertyDescriptor,setDesc:defineProperty,setDescs:Object.defineProperties,getKeys:Object.keys,getNames:Object.getOwnPropertyNames,getSymbols:Object.getOwnPropertySymbols,assertDefined:assertDefined,ES5Object:Object,toObject:function(it){return $.ES5Object(assertDefined(it))},hide:hide,def:createDefiner(0),set:global.Symbol?simpleSet:hide,each:[].forEach});if(typeof __e!="undefined")__e=core;if(typeof __g!="undefined")__g=global}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$.fw":632,_process:1069,buffer:919}],640:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$");module.exports=function(object,el){var O=$.toObject(object),keys=$.getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.keyof.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],641:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $redef=require("./$.redef");module.exports=function(target,src){for(var key in src)$redef(target,key,src[key]);return target}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.mix.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$.redef":644,_process:1069,buffer:919}],642:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),assertObject=require("./$.assert").obj;module.exports=function ownKeys(it){assertObject(it);var keys=$.getNames(it),getSymbols=$.getSymbols;return getSymbols?keys.concat(getSymbols(it)):keys}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.own-keys.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.assert":620,_process:1069,buffer:919}],643:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var $=require("./$"),invoke=require("./$.invoke"),assertFunction=require("./$.assert").fn;module.exports=function(){var fn=assertFunction(this),length=arguments.length,pargs=Array(length),i=0,_=$.path._,holder=false;while(length>i)if((pargs[i]=arguments[i++])===_)holder=true;return function(){var that=this,_length=arguments.length,j=0,k=0,args;if(!holder&&!_length)return invoke(fn,pargs,that);args=pargs.slice();if(holder)for(;length>j;j++)if(args[j]===_)args[j]=arguments[k++];while(_length>k)args.push(arguments[k++]);return invoke(fn,args,that)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.partial.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.assert":620,"./$.invoke":634,_process:1069,buffer:919}],644:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),tpl=String({}.hasOwnProperty),SRC=require("./$.uid").safe("src"),_toString=Function.toString;function $redef(O,key,val,safe){if($.isFunction(val)){var base=O[key];$.hide(val,SRC,base?String(base):tpl.replace(/hasOwnProperty/,String(key)));if(!("name"in val))val.name=key}if(O===$.g){O[key]=val}else{if(!safe)delete O[key];$.hide(O,key,val)}}$redef(Function.prototype,"toString",function toString(){return $.has(this,SRC)?this[SRC]:_toString.call(this)});$.core.inspectSource=function(it){return _toString.call(it)};module.exports=$redef}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.redef.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.uid":655,_process:1069,buffer:919}],645:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";module.exports=function(regExp,replace,isStatic){var replacer=replace===Object(replace)?function(part){return replace[part]}:replace;return function(it){return String(isStatic?it:this).replace(regExp,replacer)}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.replacer.js","/node_modules/babel-core/node_modules/core-js/modules")},{_process:1069,buffer:919}],646:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=Object.is||function is(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.same.js","/node_modules/babel-core/node_modules/core-js/modules")},{_process:1069,buffer:919}],647:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),assert=require("./$.assert");function check(O,proto){ -assert.obj(O);assert(proto===null||$.isObject(proto),proto,": can't set as prototype!")}module.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(buggy,set){try{set=require("./$.ctx")(Function.call,$.getDesc(Object.prototype,"__proto__").set,2);set({},[])}catch(e){buggy=true}return function setPrototypeOf(O,proto){check(O,proto);if(buggy)O.__proto__=proto;else set(O,proto);return O}}():undefined),check:check}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.set-proto.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.assert":620,"./$.ctx":627,_process:1069,buffer:919}],648:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),SHARED="__core-js_shared__",store=$.g[SHARED]||$.hide($.g,SHARED,{})[SHARED];module.exports=function(key){return store[key]||(store[key]={})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.shared.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],649:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),SPECIES=require("./$.wks")("species");module.exports=function(C){if($.DESC&&!(SPECIES in C))$.setDesc(C,SPECIES,{configurable:true,get:$.that})}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.species.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.wks":657,_process:1069,buffer:919}],650:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$");module.exports=function(TO_STRING){return function(that,pos){var s=String($.assertDefined(that)),i=$.toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return TO_STRING?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?TO_STRING?s.charAt(i):a:TO_STRING?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.string-at.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],651:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),repeat=require("./$.string-repeat");module.exports=function(that,minLength,fillChar,left){var S=String($.assertDefined(that));if(minLength===undefined)return S;var intMinLength=$.toInteger(minLength);var fillLen=intMinLength-S.length;if(fillLen<0||fillLen===Infinity){throw new RangeError("Cannot satisfy string length "+minLength+" for string: "+S)}var sFillStr=fillChar===undefined?" ":String(fillChar);var sFillVal=repeat.call(sFillStr,Math.ceil(fillLen/sFillStr.length));if(sFillVal.length>fillLen)sFillVal=left?sFillVal.slice(sFillVal.length-fillLen):sFillVal.slice(0,fillLen);return left?sFillVal.concat(S):S.concat(sFillVal)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.string-pad.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.string-repeat":652,_process:1069,buffer:919}],652:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var $=require("./$");module.exports=function repeat(count){var str=String($.assertDefined(this)),res="",n=$.toInteger(count);if(n<0||n==Infinity)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.string-repeat.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],653:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){"use strict";var $=require("./$"),ctx=require("./$.ctx"),cof=require("./$.cof"),invoke=require("./$.invoke"),cel=require("./$.dom-create"),global=$.g,isFunction=$.isFunction,html=$.html,process=global.process,setTask=global.setImmediate,clearTask=global.clearImmediate,postMessage=global.postMessage,addEventListener=global.addEventListener,MessageChannel=global.MessageChannel,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",defer,channel,port;function run(){var id=+this;if($.has(queue,id)){var fn=queue[id];delete queue[id];fn()}}function listner(event){run.call(event.data)}if(!isFunction(setTask)||!isFunction(clearTask)){setTask=function(fn){var args=[],i=1;while(arguments.length>i)args.push(arguments[i++]);queue[++counter]=function(){invoke(isFunction(fn)?fn:Function(fn),args)};defer(counter);return counter};clearTask=function(id){delete queue[id]};if(cof(process)=="process"){defer=function(id){process.nextTick(ctx(run,id,1))}}else if(addEventListener&&isFunction(postMessage)&&!global.importScripts){defer=function(id){postMessage(id,"*")};addEventListener("message",listner,false)}else if(isFunction(MessageChannel)){channel=new MessageChannel;port=channel.port2;channel.port1.onmessage=listner;defer=ctx(port.postMessage,port,1)}else if(ONREADYSTATECHANGE in cel("script")){defer=function(id){html.appendChild(cel("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this);run.call(id)}}}else{defer=function(id){setTimeout(ctx(run,id,1),0)}}}module.exports={set:setTask,clear:clearTask}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.task.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.cof":622,"./$.ctx":627,"./$.dom-create":629,"./$.invoke":634,_process:1069,buffer:919}],654:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){module.exports=function(exec){try{exec();return false}catch(e){return true}}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.throws.js","/node_modules/babel-core/node_modules/core-js/modules")},{_process:1069,buffer:919}],655:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var sid=0;function uid(key){return"Symbol(".concat(key===undefined?"":key,")_",(++sid+Math.random()).toString(36))}uid.safe=require("./$").g.Symbol||uid;module.exports=uid}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.uid.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,_process:1069,buffer:919}],656:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var UNSCOPABLES=require("./$.wks")("unscopables");if(!(UNSCOPABLES in[]))require("./$").hide(Array.prototype,UNSCOPABLES,{});module.exports=function(key){[][UNSCOPABLES][key]=true}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.unscope.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.wks":657,_process:1069,buffer:919}],657:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var global=require("./$").g,store=require("./$.shared")("wks");module.exports=function(name){return store[name]||(store[name]=global.Symbol&&global.Symbol[name]||require("./$.uid").safe("Symbol."+name))}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/babel-core/node_modules/core-js/modules/$.wks.js","/node_modules/babel-core/node_modules/core-js/modules")},{"./$":639,"./$.shared":648,"./$.uid":655,_process:1069,buffer:919}],658:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){var $=require("./$"),cel=require("./$.dom-create"),cof=require("./$.cof"),$def=require("./$.def"),invoke=require("./$.invoke"),arrayMethod=require("./$.array-methods"),IE_PROTO=require("./$.uid").safe("__proto__"),assert=require("./$.assert"),assertObject=assert.obj,ObjectProto=Object.prototype,html=$.html,A=[],_slice=A.slice,_join=A.join,classof=cof.classof,has=$.has,defineProperty=$.setDesc,getOwnDescriptor=$.getDesc,defineProperties=$.setDescs,isFunction=$.isFunction,isObject=$.isObject,toObject=$.toObject,toLength=$.toLength,toIndex=$.toIndex,IE8_DOM_DEFINE=false,$indexOf=require("./$.array-includes")(false),$forEach=arrayMethod(0),$map=arrayMethod(1),$filter=arrayMethod(2),$some=arrayMethod(3),$every=arrayMethod(4);if(!$.DESC){try{IE8_DOM_DEFINE=defineProperty(cel("div"),"x",{get:function(){return 8}}).x==8}catch(e){}$.setDesc=function(O,P,Attributes){if(IE8_DOM_DEFINE)try{return defineProperty(O,P,Attributes)}catch(e){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported!");if("value"in Attributes)assertObject(O)[P]=Attributes.value;return O};$.getDesc=function(O,P){if(IE8_DOM_DEFINE)try{return getOwnDescriptor(O,P)}catch(e){}if(has(O,P))return $.desc(!ObjectProto.propertyIsEnumerable.call(O,P),O[P])};$.setDescs=defineProperties=function(O,Properties){assertObject(O);var keys=$.getKeys(Properties),length=keys.length,i=0,P;while(length>i)$.setDesc(O,P=keys[i++],Properties[P]);return O}}$def($def.S+$def.F*!$.DESC,"Object",{getOwnPropertyDescriptor:$.getDesc,defineProperty:$.setDesc,defineProperties:defineProperties});var keys1=("constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,"+"toLocaleString,toString,valueOf").split(","),keys2=keys1.concat("length","prototype"),keysLen1=keys1.length;var createDict=function(){var iframe=cel("iframe"),i=keysLen1,gt=">",iframeDocument;iframe.style.display="none";html.appendChild(iframe);iframe.src="javascript:";iframeDocument=iframe.contentWindow.document;iframeDocument.open();iframeDocument.write("