Repository: luckymarmot/API-Flow Branch: develop Commit: 24cc71aec64c Files: 207 Total size: 5.6 MB Directory structure: gitextract_azhcxwm0/ ├── .babelrc ├── .codeclimate.yml ├── .eslintignore ├── .flowconfig ├── .gitignore ├── .npmignore ├── .nvmrc ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── bin/ │ └── api-flow.js ├── configs/ │ ├── node/ │ │ ├── api-flow-config.js │ │ ├── api-flow.js │ │ └── webpack.config.babel.js │ ├── paw/ │ │ ├── generators/ │ │ │ ├── Generator.js │ │ │ ├── postman2/ │ │ │ │ ├── api-flow-config.js │ │ │ │ └── webpack.config.babel.js │ │ │ ├── raml1/ │ │ │ │ ├── api-flow-config.js │ │ │ │ └── webpack.config.babel.js │ │ │ └── swagger/ │ │ │ ├── api-flow-config.js │ │ │ └── webpack.config.babel.js │ │ └── importers/ │ │ ├── Importer.js │ │ ├── postman2/ │ │ │ ├── api-flow-config.js │ │ │ └── webpack.config.babel.js │ │ ├── raml1/ │ │ │ ├── api-flow-config.js │ │ │ └── webpack.config.babel.js │ │ └── swagger/ │ │ ├── api-flow-config.js │ │ └── webpack.config.babel.js │ ├── shared/ │ │ └── raml-1-parser.js │ ├── web/ │ │ ├── api-flow-config.js │ │ ├── api-flow.js │ │ └── webpack.config.babel.js │ └── webworker/ │ ├── api-flow-config.js │ ├── api-flow.js │ └── webpack.config.babel.js ├── linting/ │ ├── dev.yaml │ ├── eslint_base.yaml │ └── prod.yaml ├── package.json ├── scripts/ │ ├── clean.sh │ ├── configure.sh │ ├── flow-runner.js │ ├── generators.sh │ ├── importers.sh │ ├── lint.sh │ ├── pack.sh │ ├── runners.sh │ ├── test.sh │ ├── transfer.sh │ └── watch.sh ├── src/ │ ├── README.md │ ├── api-flow-config.js │ ├── api-flow.js │ ├── environments/ │ │ ├── environment.js │ │ ├── node/ │ │ │ └── Environment.js │ │ ├── paw/ │ │ │ └── Environment.js │ │ ├── template/ │ │ │ └── Environment.js │ │ ├── web/ │ │ │ └── Environment.js │ │ └── worker/ │ │ └── Environment.js │ ├── loaders/ │ │ ├── internal/ │ │ │ └── Loader.js │ │ ├── loaders.js │ │ ├── paw/ │ │ │ └── Loader.js │ │ ├── postman/ │ │ │ └── v2.0/ │ │ │ ├── Loader.js │ │ │ └── __tests__/ │ │ │ └── Loader.spec.js │ │ ├── raml/ │ │ │ └── Loader.js │ │ ├── swagger/ │ │ │ └── Loader.js │ │ └── template/ │ │ └── v1.0/ │ │ ├── Loader.js │ │ └── __tests__/ │ │ └── Loader.spec.js │ ├── mocks/ │ │ ├── PawMocks.js │ │ ├── PawShims.js │ │ └── __tests__/ │ │ ├── PawMocks.spec.js │ │ └── PawShims.spec.js │ ├── models/ │ │ ├── Api.js │ │ ├── Auth.js │ │ ├── Constraint.js │ │ ├── Contact.js │ │ ├── Context.js │ │ ├── Core.js │ │ ├── Group.js │ │ ├── Info.js │ │ ├── Interface.js │ │ ├── Item.js │ │ ├── License.js │ │ ├── ModelInfo.js │ │ ├── Parameter.js │ │ ├── ParameterContainer.js │ │ ├── Reference.js │ │ ├── Request.js │ │ ├── Resource.js │ │ ├── Response.js │ │ ├── Store.js │ │ ├── URL.js │ │ ├── URLComponent.js │ │ ├── Variable.js │ │ ├── __tests__/ │ │ │ ├── Api.spec.js │ │ │ ├── Constraint.spec.js │ │ │ ├── Contact.spec.js │ │ │ ├── Context.spec.js │ │ │ ├── Group.spec.js │ │ │ ├── Info.spec.js │ │ │ ├── Interface.spec.js │ │ │ ├── License.spec.js │ │ │ ├── ModelInfo.spec.js │ │ │ ├── Parameter.spec.js │ │ │ ├── ParameterContainer.spec.js │ │ │ ├── Reference.spec.js │ │ │ ├── Request.spec.js │ │ │ ├── Resource.spec.js │ │ │ ├── Response.spec.js │ │ │ ├── Store.spec.js │ │ │ ├── URL.spec.js │ │ │ ├── URLComponent.spec.js │ │ │ └── Variable.spec.js │ │ └── auths/ │ │ ├── AWSSig4.js │ │ ├── ApiKey.js │ │ ├── Basic.js │ │ ├── Custom.js │ │ ├── Digest.js │ │ ├── Hawk.js │ │ ├── NTLM.js │ │ ├── Negotiate.js │ │ ├── OAuth1.js │ │ ├── OAuth2.js │ │ └── __tests__/ │ │ ├── AWSSig4.spec.js │ │ ├── ApiKey.spec.js │ │ ├── Basic.spec.js │ │ ├── Custom.spec.js │ │ ├── Digest.spec.js │ │ ├── Hawk.spec.js │ │ ├── NTLM.spec.js │ │ ├── Negotiate.spec.js │ │ ├── OAuth1.spec.js │ │ └── OAuth2.spec.js │ ├── parsers/ │ │ ├── README.md │ │ ├── dummy/ │ │ │ └── Parser.js │ │ ├── internal/ │ │ │ └── Parser.js │ │ ├── parsers.js │ │ ├── paw/ │ │ │ ├── Parser.js │ │ │ └── __tests__/ │ │ │ └── Parser.spec.js │ │ ├── postman/ │ │ │ └── v2.0/ │ │ │ ├── Parser.js │ │ │ └── __tests__/ │ │ │ └── Parser.spec.js │ │ ├── raml/ │ │ │ └── v1.0/ │ │ │ ├── Parser.js │ │ │ └── __tests__/ │ │ │ └── Parser.spec.js │ │ ├── swagger/ │ │ │ └── v2.0/ │ │ │ ├── Parser.js │ │ │ └── __tests__/ │ │ │ └── Parser.spec.js │ │ └── template/ │ │ └── v1.0/ │ │ ├── Parser.js │ │ └── __tests__/ │ │ └── Parser.spec.js │ ├── serializers/ │ │ ├── api-blueprint/ │ │ │ └── 1A/ │ │ │ ├── Serializer.js │ │ │ └── __tests__/ │ │ │ └── Serializer.spec.js │ │ ├── internal/ │ │ │ └── Serializer.js │ │ ├── paw/ │ │ │ ├── Serializer.js │ │ │ └── __tests__/ │ │ │ └── Serializer.spec.js │ │ ├── postman/ │ │ │ └── v2.0/ │ │ │ ├── Serializer.js │ │ │ └── __tests__/ │ │ │ └── Serializer.spec.js │ │ ├── raml/ │ │ │ └── v1.0/ │ │ │ ├── Serializer.js │ │ │ └── __tests__/ │ │ │ └── Serializer.spec.js │ │ ├── serializers.js │ │ └── swagger/ │ │ └── v2.0/ │ │ ├── Serializer.js │ │ └── __tests__/ │ │ └── Serializer.spec.js │ └── utils/ │ ├── __tests__/ │ │ └── fp-utils.spec.js │ ├── fp-utils.js │ └── gen-utils.js ├── testing/ │ ├── e2e/ │ │ ├── internal-apiblueprint-1a/ │ │ │ ├── e2e.spec.js │ │ │ ├── test-case-0/ │ │ │ │ ├── input.json │ │ │ │ └── output.json │ │ │ └── test-case-1/ │ │ │ ├── input.json │ │ │ └── output.json │ │ ├── internal-internal/ │ │ │ ├── e2e.spec.js │ │ │ ├── test-case-0/ │ │ │ │ └── input.json │ │ │ └── test-case-1/ │ │ │ └── input.json │ │ ├── internal-postman2/ │ │ │ ├── e2e.spec.js │ │ │ ├── test-case-0/ │ │ │ │ ├── input.json │ │ │ │ └── output.json │ │ │ └── test-case-1/ │ │ │ ├── input.json │ │ │ └── output.json │ │ ├── internal-raml1/ │ │ │ ├── e2e.spec.js │ │ │ ├── test-case-0/ │ │ │ │ ├── input.json │ │ │ │ └── output.raml │ │ │ └── test-case-1/ │ │ │ ├── input.json │ │ │ └── output.raml │ │ ├── internal-swagger2/ │ │ │ ├── e2e.spec.js │ │ │ ├── test-case-0/ │ │ │ │ ├── input.json │ │ │ │ └── output.json │ │ │ └── test-case-1/ │ │ │ ├── input.json │ │ │ └── output.json │ │ ├── postman-collection2-internal/ │ │ │ ├── e2e.spec.js │ │ │ └── test-case-0/ │ │ │ ├── input.json │ │ │ └── output.json │ │ ├── raml1-internal/ │ │ │ ├── e2e.spec.js │ │ │ ├── test-case-0/ │ │ │ │ ├── input.raml │ │ │ │ └── output.json │ │ │ └── test-case-1/ │ │ │ ├── examples/ │ │ │ │ └── songs.xml │ │ │ ├── input.raml │ │ │ ├── libraries/ │ │ │ │ ├── api-library.raml │ │ │ │ └── songs-library.raml │ │ │ ├── output.json │ │ │ ├── schemas/ │ │ │ │ ├── idea.raml │ │ │ │ └── songs.xsd │ │ │ └── secured/ │ │ │ └── accessToken.raml │ │ └── swagger2-internal/ │ │ ├── e2e.spec.js │ │ ├── input.json │ │ └── output.json │ ├── e2e-runner.js │ ├── mocha-runner.js │ └── test-require-patch.js └── webpack.config.babel.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "presets": [ "es2015", "stage-0", "stage-1", "stage-2", "stage-3" ], "plugins": [ "transform-runtime", "transform-decorators-legacy" ], "env": { "test": { "plugins": [ "istanbul" ] } } } ================================================ FILE: .codeclimate.yml ================================================ engines: eslint: enabled: true config: config: ./linting/eslint_base.yaml fixme: enabled: true exclude_paths: - "scripts/" - "testing/" - "configs/" - "src/**/*.spec.js" ratings: paths: - "src/**/*.js" ================================================ FILE: .eslintignore ================================================ src/libs/ ================================================ FILE: .flowconfig ================================================ [ignore] **/.*badly-formed.* [options] suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe [libs] types/ ================================================ FILE: .gitignore ================================================ # Created by .ignore support plugin (hsz.mobi) ### JetBrains template # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio *.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/ # JIRA plugin atlassian-ide-plugin.xml # Crashlytics plugin (for Android Studio and IntelliJ) com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties # Build dist/ releases/ resources/ node_modules/ lib/ .DS_Store deploy-script.sh coverage/ .nyc_output/ ================================================ FILE: .npmignore ================================================ node_modules/ src/ build/ linting/ dist/paw/ dist/web/ dist/webworker/ .git/ .babelrc .eslintignore .gitignore .travis.yml .npmignore .nvmrc .travis.yml Makefile webpack.config.babel.js npm-shrinkwrap.json ================================================ FILE: .nvmrc ================================================ v7.4.0 ================================================ FILE: .travis.yml ================================================ language: node_js node_js: 7.4 cache: yarn: true directories: - node_modules env: - TEST_TARGET=lint - TEST_TARGET=unit - TEST_TARGET=e2e - TEST_TARGET=cov script: - make test ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2015 Paw Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Makefile ================================================ BASE=$(shell pwd) SCRIPTS=$(BASE)/scripts extensions_dir=$(HOME)/Library/Containers/com.luckymarmot.Paw/Data/Library/Application\ Support/com.luckymarmot.Paw/Extensions/ all: configure pack clean: sh "$(SCRIPTS)/clean.sh" $(BASE) configure: sh "$(SCRIPTS)/configure.sh" $(BASE) runners: sh "$(SCRIPTS)/runners.sh" $(BASE) $(TARGET) importers: sh "$(SCRIPTS)/importers.sh" $(BASE) $(TARGET) generators: sh "$(SCRIPTS)/generators.sh" $(BASE) $(TARGET) transfer: clean importers generators sh "$(SCRIPTS)/transfer.sh" $(BASE) $(extensions_dir) $(TARGET) pack: clean importers generators sh "$(SCRIPTS)/pack.sh" $(BASE) $(TARGET) lint: sh "$(SCRIPTS)/lint.sh" $(BASE) test: sh "$(SCRIPTS)/test.sh" $(BASE) $(TEST_TARGET) validate: lint test watch: sh "$(SCRIPTS)/watch.sh" $(BASE) $(COMMAND) ================================================ FILE: README.md ================================================ [![Build Status](https://travis-ci.org/luckymarmot/API-Flow.svg?branch=master)](https://travis-ci.org/luckymarmot/API-Flow) # API-Flow A flow written in ES6 using Immutable to convert between API description formats (Swagger, etc.) and other programs such as cURL command lines. ## What formats are supported and what will be in the future We currently support: - `Swagger v2.0 (in/out)` - `RAML v1.0 (in/out)` - `Postman Collection v2.0 (in/out)` - `Paw v3.1 (in/out)` We intend to support: - `Swagger v3.0` - `RAML v0.8` - `Postman Collection v1.0` - `Postman Dump v1.0` - `Insomnia v3.0` - `Api-Blueprint` - and many more. ## Installation ### from a cloned repository just run ```sh git clone https://github.com/luckymarmot/API-Flow.git cd API-Flow make install ``` This will install the node module dependencies ## Building the different libraries ### node, web, and webworker run the following command to build API-Flow for the different environments that you need ```sh # use TARGET="node" if you only want the node library make runners TARGET="node web webworker" ``` ### Paw You can use the following command to add the different extensions to Paw ```sh # use TARGET="swagger" if you only want the swagger bindings make transfer TARGET="swagger raml1 postman2" ``` ## Using the npm module ### as a standard library ```js const ApiFlow = require('api-flow'); // if from npm const ApiFlow = require('./dist/node/api-flow.js'); // if from `make runners TARGET="node"` const options = { source: { format: 'swagger', version: 'v2.0' }, target: { format: 'raml', version: 'v1.0' } } const promise = ApiFlow.transform({ options, uri: path.resolve(__dirname, './my_super_swagger.yml') }) promise.then((data) => { // do some cool stuff with the data }) ``` ### Using as a CLI (coming soon) ```sh node ./bin/api-flow.js some_swagger.json -f swagger -t raml > converted.yml ``` ### User Interface API-Flow is one of the main components of [Console.REST](https://github.com/luckymarmot/console-rest). If you're an API user, you can easily use [https://console.rest/](https://console.rest/) to convert API description files. If you're an API provider, you can add a button to your API docs to let your users open and play with your API in client apps including Paw or Postman. ## Contributing PRs are welcomed! Our sole requirement is that organizations that want to extend API-Flow to support their format write both a parser and a serializer, and not simply a serializer. ## Documentation You can find more information about the internal structure of API-Flow in [src](https://github.com/luckymarmot/API-Flow/tree/develop/src). We've also created a set of templates to help speed up the extension process: [loader](https://github.com/luckymarmot/API-Flow/tree/develop/src/loaders/template/v1.0), [parser](https://github.com/luckymarmot/API-Flow/tree/develop/src/parsers/template/v1.0/), and [environment](https://github.com/luckymarmot/API-Flow/tree/develop/src/environments/template) ## License This repository is released under the [MIT License](LICENSE). Feel free to fork, and modify! Copyright © 2016 Paw Inc. ## Contributors See [Contributors](https://github.com/luckymarmot/API-Flow/graphs/contributors). ================================================ FILE: bin/api-flow.js ================================================ #! /usr/bin/env node /* eslint-disable */ var FlowCLI = require('../dist/node/api-flow.js').default; var cli = new FlowCLI(process.argv); var parser = cli._createParser(); cli.processArguments(parser); cli.run().then((data) => { console.log(data) }); ================================================ FILE: configs/node/api-flow-config.js ================================================ import Environment from '../../src/environments/node/Environment' import SwaggerLoader from '../../src/loaders/swagger/Loader' import RAMLLoader from '../../src/loaders/raml/Loader' import PostmanV2Loader from '../../src/loaders/postman/v2.0/Loader' import SwaggerV2Parser from '../../src/parsers/swagger/v2.0/Parser' import RAMLV1Parser from '../../src/parsers/raml/v1.0/Parser' import PostmanV2Parser from '../../src/loaders/postman/v2.0/Parser' import SwaggerV2Serializer from '../../src/serializers/swagger/v2.0/Serializer' import RAMLV1Serializer from '../../src/serializers/raml/v1.0/Serializer' import PostmanV2Serializer from '../../src/serializers/postman/v2.0/Serializer' import InternalSerializer from '../../src/serializers/internal/Serializer' export const loaders = [ SwaggerLoader, RAMLLoader, PostmanV2Loader ] export const parsers = [ SwaggerV2Parser, RAMLV1Parser, PostmanV2Parser ] export const serializers = [ SwaggerV2Serializer, RAMLV1Serializer, InternalSerializer, PostmanV2Serializer ] export const environment = Environment ================================================ FILE: configs/node/api-flow.js ================================================ import ApiFlow from '../../src/api-flow' export default ApiFlow ================================================ FILE: configs/node/webpack.config.babel.js ================================================ const path = require('path') const config = { target: 'node', entry: path.resolve(__dirname, './api-flow.js'), output: { path: path.resolve(__dirname, '../../dist/node/'), filename: 'api-flow.js', library: 'ApiFlow', libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, use: 'babel-loader', include: [ path.resolve(__dirname, '../../src') ] }, { test: /\.json$/, use: 'json-loader', include: [ path.resolve(__dirname, '../../') ] } ], noParse: /node_modules\/json-schema\/lib\/validate\.js/ }, resolve: { alias: { 'api-flow-config$': path.resolve(__dirname, './api-flow-config.js') } }, node: { fs: false, request: false, net: false, tls: false } } module.exports = config ================================================ FILE: configs/paw/generators/Generator.js ================================================ import { registerCodeGenerator } from '../../../src/mocks/PawShims' import { target } from 'api-flow-config' import ApiFlow from '../../../src/api-flow' @registerCodeGenerator export default class SwaggerGenerator { static identifier = target.identifier static title = target.humanTitle static help = 'https://github.com/luckymarmot/API-Flow' static languageHighlighter = 'json' static fileExtension = 'json' /* eslint-disable no-unused-vars */ generate(context, reqs, opts) { /* eslint-enable no-unused-vars */ try { const options = { context, reqs, source: { format: 'paw', version: 'v3.0' }, target } const serialized = ApiFlow.serialize(ApiFlow.parse({ options })) return serialized } catch (e) { /* eslint-disable no-console */ console.error( this.constructor.title, 'generation failed with error:', e, e.stack, JSON.stringify(e, null, ' ') ) /* eslint-enable no-console */ throw e } } } ================================================ FILE: configs/paw/generators/postman2/api-flow-config.js ================================================ import Environment from '../../../../src/environments/paw/Environment' import PawLoader from '../../../../src/loaders/paw/Loader' import PawParser from '../../../../src/parsers/paw/Parser' import PostmanV2Serializer from '../../../../src/serializers/postman/v2.0/Serializer' export const loaders = [ PawLoader ] export const parsers = [ PawParser ] export const serializers = [ PostmanV2Serializer ] export const target = { identifier: 'com.luckymarmot.PawExtensions.PostmanCollectionGenerator', title: 'PostmanCollectionGenerator', humanTitle: 'Postman Collection 2.0', format: PostmanV2Serializer.__meta__.format, version: PostmanV2Serializer.__meta__.version } export const environment = Environment ================================================ FILE: configs/paw/generators/postman2/webpack.config.babel.js ================================================ const { target } = require('./api-flow-config.js') const path = require('path') const config = { target: 'web', entry: path.resolve(__dirname, '../Generator.js'), output: { path: path.resolve(__dirname, '../../../../dist/paw/', target.identifier), filename: target.title + '.js', libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, use: 'babel-loader', include: [ path.resolve(__dirname, '../../../../src'), path.resolve(__dirname, '../') ] }, { test: /\.json$/, use: 'json-loader', include: [ path.resolve(__dirname, '../../../../') ] } ], noParse: /node_modules\/json-schema\/lib\/validate\.js/ }, resolve: { alias: { 'api-flow-config$': path.resolve(__dirname, './api-flow-config.js') } }, node: { fs: false, request: false, net: false, tls: false } } module.exports = config ================================================ FILE: configs/paw/generators/raml1/api-flow-config.js ================================================ import Environment from '../../../../src/environments/paw/Environment' import PawLoader from '../../../../src/loaders/paw/Loader' import PawParser from '../../../../src/parsers/paw/Parser' import RAMLV1Serializer from '../../../../src/serializers/raml/v1.0/Serializer' export const loaders = [ PawLoader ] export const parsers = [ PawParser ] export const serializers = [ RAMLV1Serializer ] export const target = { identifier: 'com.luckymarmot.PawExtensions.RAML1Generator', title: 'RAML1Generator', humanTitle: 'RAML 1.0', format: RAMLV1Serializer.__meta__.format, version: RAMLV1Serializer.__meta__.version } export const environment = Environment ================================================ FILE: configs/paw/generators/raml1/webpack.config.babel.js ================================================ const { target } = require('./api-flow-config.js') const path = require('path') const config = { target: 'web', entry: path.resolve(__dirname, '../Generator.js'), output: { path: path.resolve(__dirname, '../../../../dist/paw/', target.identifier), filename: target.title + '.js', libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, use: 'babel-loader', include: [ path.resolve(__dirname, '../../../../src'), path.resolve(__dirname, '../') ] }, { test: /\.json$/, use: 'json-loader', include: [ path.resolve(__dirname, '../../../../') ] } ], noParse: /node_modules\/json-schema\/lib\/validate\.js/ }, resolve: { alias: { 'api-flow-config$': path.resolve(__dirname, './api-flow-config.js') } }, node: { fs: false, request: false, net: false, tls: false } } module.exports = config ================================================ FILE: configs/paw/generators/swagger/api-flow-config.js ================================================ import Environment from '../../../../src/environments/paw/Environment' import PawLoader from '../../../../src/loaders/paw/Loader' import PawParser from '../../../../src/parsers/paw/Parser' import SwaggerV2Serializer from '../../../../src/serializers/swagger/v2.0/Serializer' export const loaders = [ PawLoader ] export const parsers = [ PawParser ] export const serializers = [ SwaggerV2Serializer ] export const target = { identifier: 'com.luckymarmot.PawExtensions.SwaggerGenerator', title: 'SwaggerGenerator', humanTitle: 'Swagger 2.0', format: SwaggerV2Serializer.__meta__.format, version: SwaggerV2Serializer.__meta__.version } export const environment = Environment ================================================ FILE: configs/paw/generators/swagger/webpack.config.babel.js ================================================ const { target } = require('./api-flow-config.js') const path = require('path') const config = { target: 'web', entry: path.resolve(__dirname, '../Generator.js'), output: { path: path.resolve(__dirname, '../../../../dist/paw/', target.identifier), filename: target.title + '.js', libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, use: 'babel-loader', include: [ path.resolve(__dirname, '../../../../src'), path.resolve(__dirname, '../') ] }, { test: /\.json$/, use: 'json-loader', include: [ path.resolve(__dirname, '../../../../') ] } ], noParse: /node_modules\/json-schema\/lib\/validate\.js/ }, resolve: { alias: { 'api-flow-config$': path.resolve(__dirname, './api-flow-config.js') } }, node: { fs: false, request: false, net: false, tls: false } } module.exports = config ================================================ FILE: configs/paw/importers/Importer.js ================================================ import { registerImporter } from '../../../src/mocks/PawShims' import path from 'path' import { source } from 'api-flow-config' import ApiFlow from '../../../src/api-flow' import { convertEntryListInMap } from '../../../src/utils/fp-utils' const methods = {} @registerImporter // eslint-disable-line class SwaggerImporter { static identifier = source.identifier static title = source.humanTitle static fileExtensions = []; canImport(context, items) { return methods.canImport(context, items) } import(context, items, options) { return methods.import(context, items, options) } } methods.getUriFromItem = (item) => { if (item.url) { return item.url } if (!item.file || !item.file.path || !item.file.name) { return 'file://localhost/' } const uri = 'file://' + path.join(item.file.path, item.file.name) return uri } methods.getCacheFromItems = (items) => { return items.map(item => { const uri = methods.getUriFromItem(item) return { key: uri, value: item.content } }).reduce(convertEntryListInMap, {}) } methods.canImport = (context, items) => { const fixedItems = items.map(item => { item.uri = methods.getUriFromItem(item) return item }) const primaryUri = ApiFlow.findPrimaryUri({ items: fixedItems }) return primaryUri ? 1 : 0 } methods.import = (context, items) => { const options = { context, source, target: { format: 'paw', version: 'v3.0' } } const itemMap = methods.getCacheFromItems(items) ApiFlow.setCache(itemMap) const fixedItems = items.map(item => { item.uri = methods.getUriFromItem(item) return item }) const uri = ApiFlow.findPrimaryUri({ items: fixedItems }) return ApiFlow.transform({ options, uri }) // const statusMessage = methods.formatStatusMessage(parser, serializer) } export default SwaggerImporter ================================================ FILE: configs/paw/importers/postman2/api-flow-config.js ================================================ import Environment from '../../../../src/environments/paw/Environment' import PostmanCollectionV2Loader from '../../../../src/loaders/postman/v2.0/Loader' import PostmanCollectionV2Parser from '../../../../src/parsers/postman/v2.0/Parser' import PawSerializer from '../../../../src/serializers/paw/Serializer' export const loaders = [ PostmanCollectionV2Loader ] export const parsers = [ PostmanCollectionV2Parser ] export const serializers = [ PawSerializer ] export const source = { identifier: 'com.luckymarmot.PawExtensions.PostmanCollectionV2Importer', title: 'PostmanCollectionV2Importer', humanTitle: 'Postman Collection 2.0 Importer', format: PostmanCollectionV2Parser.__meta__.format, version: PostmanCollectionV2Parser.__meta__.version } export const environment = Environment ================================================ FILE: configs/paw/importers/postman2/webpack.config.babel.js ================================================ const { source } = require('./api-flow-config.js') const path = require('path') const config = { target: 'web', entry: path.resolve(__dirname, '../Importer.js'), output: { path: path.resolve(__dirname, '../../../../dist/paw/', source.identifier), filename: source.title + '.js', libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, use: 'babel-loader', include: [ path.resolve(__dirname, '../../../../src'), path.resolve(__dirname, '../') ] }, { test: /\.json$/, use: 'json-loader', include: [ path.resolve(__dirname, '../../../../') ] } ], noParse: /node_modules\/json-schema\/lib\/validate\.js/ }, resolve: { alias: { 'api-flow-config$': path.resolve(__dirname, './api-flow-config.js') } }, node: { fs: false, request: false, net: false, tls: false } } module.exports = config ================================================ FILE: configs/paw/importers/raml1/api-flow-config.js ================================================ import Environment from '../../../../src/environments/paw/Environment' import RAMLLoader from '../../../../src/loaders/raml/Loader' import RAMLV1Parser from '../../../../src/parsers/raml/v1.0/Parser' import PawSerializer from '../../../../src/serializers/paw/Serializer' export const loaders = [ RAMLLoader ] export const parsers = [ RAMLV1Parser ] export const serializers = [ PawSerializer ] export const source = { identifier: 'com.luckymarmot.PawExtensions.RAML1Importer', title: 'RAML1Importer', humanTitle: 'RAML 1.0 Importer', format: RAMLV1Parser.__meta__.format, version: RAMLV1Parser.__meta__.version } export const environment = Environment ================================================ FILE: configs/paw/importers/raml1/webpack.config.babel.js ================================================ const { source } = require('./api-flow-config.js') const path = require('path') const config = { target: 'web', entry: path.resolve(__dirname, '../Importer.js'), output: { path: path.resolve(__dirname, '../../../../dist/paw/', source.identifier), filename: source.title + '.js', libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, use: 'babel-loader', include: [ path.resolve(__dirname, '../../../../src'), path.resolve(__dirname, '../') ] }, { test: /\.json$/, use: 'json-loader', include: [ path.resolve(__dirname, '../../../../') ] } ], noParse: /node_modules\/json-schema\/lib\/validate\.js/ }, resolve: { alias: { 'api-flow-config$': path.resolve(__dirname, './api-flow-config.js'), 'raml-1-parser': path.resolve(__dirname, '../../../shared/raml-1-parser.js') } }, node: { fs: false, request: false, net: false, tls: false } } module.exports = config ================================================ FILE: configs/paw/importers/swagger/api-flow-config.js ================================================ import Environment from '../../../../src/environments/paw/Environment' import SwaggerLoader from '../../../../src/loaders/swagger/Loader' import SwaggerV2Parser from '../../../../src/parsers/swagger/v2.0/Parser' import PawSerializer from '../../../../src/serializers/paw/Serializer' export const loaders = [ SwaggerLoader ] export const parsers = [ SwaggerV2Parser ] export const serializers = [ PawSerializer ] export const source = { identifier: 'com.luckymarmot.PawExtensions.SwaggerImporter', title: 'SwaggerImporter', humanTitle: 'Swagger 2.0 Importer', format: SwaggerV2Parser.__meta__.format, version: SwaggerV2Parser.__meta__.version } export const environment = Environment ================================================ FILE: configs/paw/importers/swagger/webpack.config.babel.js ================================================ const { source } = require('./api-flow-config.js') const path = require('path') const config = { target: 'web', entry: path.resolve(__dirname, '../Importer.js'), output: { path: path.resolve(__dirname, '../../../../dist/paw/', source.identifier), filename: source.title + '.js', libraryTarget: 'umd' }, module: { rules: [ { test: /\.js$/, use: 'babel-loader', include: [ path.resolve(__dirname, '../../../../src'), path.resolve(__dirname, '../') ] }, { test: /\.json$/, use: 'json-loader', include: [ path.resolve(__dirname, '../../../../') ] } ], noParse: /node_modules\/json-schema\/lib\/validate\.js/ }, resolve: { alias: { 'api-flow-config$': path.resolve(__dirname, './api-flow-config.js') } }, node: { fs: false, request: false, net: false, tls: false } } module.exports = config ================================================ FILE: configs/shared/raml-1-parser.js ================================================ /* eslint-disable */ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=400)}([function(e,t,n){"use strict";function r(){return t.rt.getSchemaUtils()}function i(e){e.isUnion?e.addAdapter(new C(e)):e.range&&e.addAdapter(new E(e))}function a(e){return e.getSource&&"function"==typeof e.getSource}function o(e){var t=e;return t.genuineUserDefinedType&&t.isUserDefined&&t.isUserDefined()}function s(e,t,n,r,i){return new b(e,t).withDomain(n,i).withRange(r)}var u=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)};t.rt=n(337);var c=t.rt.nominalTypes;t.getSchemaUtils=r,t.TOP_LEVEL_EXTRA=t.rt.TOP_LEVEL_EXTRA,t.DEFINED_IN_TYPES_EXTRA=t.rt.DEFINED_IN_TYPES_EXTRA,t.USER_DEFINED_EXTRA=t.rt.USER_DEFINED_EXTRA,t.SOURCE_EXTRA=t.rt.SOURCE_EXTRA,t.tsInterfaces=t.rt.tsInterfaces,t.injector={inject:function(e){i(e)}},c.registerInjector(t.injector);var l=function(e){function t(){e.apply(this,arguments)}return u(t,e),t}(c.AbstractType);t.AbstractType=l;var p=function(e){function t(){e.apply(this,arguments)}return u(t,e),t}(c.ValueType);t.ValueType=p;var f=function(){function e(){}return e.isInstance=function(t){if(null!=t&&t.getClassIdentifier&&"function"==typeof t.getClassIdentifier)for(var n=0,r=t.getClassIdentifier();n=0&&a0?0:s-1;return arguments.length<3&&(i=n[o?o[u]:u],u+=e),t(n,r,i,o,u,s)}}function a(e){return function(t,n,r){n=E(n,r);for(var i=x(t),a=e>0?0:i-1;a>=0&&a0?o=a>=0?a:Math.max(a+s,o):s=a>=0?Math.min(a+1,s):a+s+1;else if(n&&a&&s)return a=n(r,i),r[a]===i?a:-1;if(i!==i)return a=t(m.call(r,o,s),A.isNaN),a>=0?a+o:-1;for(a=e>0?o:s-1;a>=0&&a=0&&t<=k};A.each=A.forEach=function(e,t,n){t=T(t,n);var r,i;if(R(e))for(r=0,i=e.length;r=0},A.invoke=function(e,t){var n=m.call(arguments,2),r=A.isFunction(t);return A.map(e,function(e){var i=r?t:e[t];return null==i?i:i.apply(e,n)})},A.pluck=function(e,t){return A.map(e,A.property(t))},A.where=function(e,t){return A.filter(e,A.matcher(t))},A.findWhere=function(e,t){return A.find(e,A.matcher(t))},A.max=function(e,t,n){var r,i,a=-(1/0),o=-(1/0);if(null==t&&null!=e){e=R(e)?e:A.values(e);for(var s=0,u=e.length;sa&&(a=r)}else t=E(t,n),A.each(e,function(e,n,r){((i=t(e,n,r))>o||i===-(1/0)&&a===-(1/0))&&(a=e,o=i)});return a},A.min=function(e,t,n){var r,i,a=1/0,o=1/0;if(null==t&&null!=e){e=R(e)?e:A.values(e);for(var s=0,u=e.length;sr||void 0===n)return 1;if(nt?(o&&(clearTimeout(o),o=null),s=c,a=e.apply(r,i),o||(r=i=null)):o||n.trailing===!1||(o=setTimeout(u,l)),a}},A.debounce=function(e,t,n){var r,i,a,o,s,u=function(){var c=A.now()-o;c=0?r=setTimeout(u,t-c):(r=null,n||(s=e.apply(a,i),r||(a=i=null)))};return function(){a=this,i=arguments,o=A.now();var c=n&&!r;return r||(r=setTimeout(u,t)),c&&(s=e.apply(a,i),a=i=null),s}},A.wrap=function(e,t){return A.partial(t,e)},A.negate=function(e){return function(){return!e.apply(this,arguments)}},A.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},A.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},A.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},A.once=A.partial(A.before,2);var P=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];A.keys=function(e){if(!A.isObject(e))return[];if(g)return g(e);var t=[];for(var n in e)A.has(e,n)&&t.push(n);return P&&s(e,t),t},A.allKeys=function(e){if(!A.isObject(e))return[];var t=[];for(var n in e)t.push(n);return P&&s(e,t),t},A.values=function(e){for(var t=A.keys(e),n=t.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},F=A.invert(U),B=function(e){var t=function(t){return e[t]},n="(?:"+A.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};A.escape=B(U),A.unescape=B(F),A.result=function(e,t,n){var r=null==e?void 0:e[t];return void 0===r&&(r=n),A.isFunction(r)?r.call(e):r};var K=0;A.uniqueId=function(e){var t=++K+"";return e?e+t:t},A.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},j=function(e){return"\\"+V[e]};A.template=function(e,t,n){!t&&n&&(t=n),t=A.defaults({},t,A.templateSettings);var r=RegExp([(t.escape||/(.)^/).source,(t.interpolate||/(.)^/).source,(t.evaluate||/(.)^/).source].join("|")+"|$","g"),i=0,a="__p+='";e.replace(r,function(t,n,r,o,s){return a+=e.slice(i,s).replace(/\\|'|\r|\n|\u2028|\u2029/g,j),i=s+t.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":o&&(a+="';\n"+o+"\n__p+='"),t}),a+="';\n",t.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var o=new Function(t.variable||"obj","_",a)}catch(e){throw e.source=a,e}var s=function(e){return o.call(this,e,A)},u=t.variable||"obj";return s.source="function("+u+"){\n"+a+"}",s},A.chain=function(e){var t=A(e);return t._chain=!0,t};var W=function(e,t){return e._chain?A(t).chain():t};A.mixin=function(e){A.each(A.functions(e),function(t){var n=A[t]=e[t];A.prototype[t]=function(){var e=[this._wrapped];return d.apply(e,arguments),W(this,n.apply(A,e))}})},A.mixin(A),A.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=l[e];A.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],W(this,n)}}),A.each(["concat","join","slice"],function(e){var t=l[e];A.prototype[e]=function(){return W(this,t.apply(this._wrapped,arguments))}}),A.prototype.value=function(){return this._wrapped},A.prototype.valueOf=A.prototype.toJSON=A.prototype.value,A.prototype.toString=function(){return""+this._wrapped},r=[],void 0!==(i=function(){return A}.apply(t,r))&&(e.exports=i)}).call(this)},function(e,t,n){var r,i;/** * @preserve date-and-time.js (c) KNOWLEDGECODE | MIT */ !function(a){"use strict";var o={},s="en",u={en:{MMMM:["January","February","March","April","May","June","July","August","September","October","November","December"],MMM:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dd:["Su","Mo","Tu","We","Th","Fr","Sa"],A:["a.m.","p.m."],formats:{YYYY:function(e){return("000"+e.getFullYear()).slice(-4)},YY:function(e){return("0"+e.getFullYear()).slice(-2)},Y:function(e){return""+e.getFullYear()},MMMM:function(e){return this.MMMM[e.getMonth()]},MMM:function(e){return this.MMM[e.getMonth()]},MM:function(e){return("0"+(e.getMonth()+1)).slice(-2)},M:function(e){return""+(e.getMonth()+1)},DD:function(e){return("0"+e.getDate()).slice(-2)},D:function(e){return""+e.getDate()},HH:function(e){return("0"+e.getHours()).slice(-2)},H:function(e){return""+e.getHours()},A:function(e){return this.A[e.getHours()>11|0]},hh:function(e){return("0"+(e.getHours()%12||12)).slice(-2)},h:function(e){return""+(e.getHours()%12||12)},mm:function(e){return("0"+e.getMinutes()).slice(-2)},m:function(e){return""+e.getMinutes()},ss:function(e){return("0"+e.getSeconds()).slice(-2)},s:function(e){return""+e.getSeconds()},SSS:function(e){return("00"+e.getMilliseconds()).slice(-3)},SS:function(e){return("0"+(e.getMilliseconds()/10|0)).slice(-2)},S:function(e){return""+(e.getMilliseconds()/100|0)},dddd:function(e){return this.dddd[e.getDay()]},ddd:function(e){return this.ddd[e.getDay()]},dd:function(e){return this.dd[e.getDay()]},Z:function(e){var t=e.utc?0:e.getTimezoneOffset()/.6;return(t>0?"-":"+")+("000"+Math.abs(t-t%100*.4)).slice(-4)},post:function(e){return e}},parsers:{h:function(e,t){return(12===e?0:e)+12*t},pre:function(e){return e}}}},c=function(){return"object"==typeof e&&"object"==typeof e.exports},l=function(e,t){for(var n=0,r=e.length;n0&&(o.trace=e.extras.map(function(e){return _(e,t)})),o}var g=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},v=n(0),b=n(24),S=n(1),A=n(17),T=v,E=n(46),C=n(21),N=n(314),w=n(35),k=n(25),x=n(316),R=n(3),I=n(9),D=n(64),M=T,P=n(14),L=n(89),O=n(140),U=n(139),F=n(5),B=n(28),K=v.rt,V=n(63),j=n(146);t.qName=r;var W=function(){function e(e,t){this._node=e,this._parent=t,this._implicit=!1,this.values={},e&&e.setHighLevelParseResult(this)}return e.isInstance=function(t){return null!=t&&t.getClassIdentifier&&"function"==typeof t.getClassIdentifier&&S.contains(t.getClassIdentifier(),e.CLASS_IDENTIFIER)},e.prototype.getClassIdentifier=function(){return[].concat(e.CLASS_IDENTIFIER)},e.prototype.getKind=function(){return b.NodeKind.BASIC},e.prototype.asAttr=function(){return null},e.prototype.asElement=function(){return null},e.prototype.hashkey=function(){return this._hashkey||(this._hashkey=this.parent()?this.parent().hashkey()+"/"+this.name():this.name()),this._hashkey},e.prototype.root=function(){return this.parent()?this.parent().root():this},e.prototype.version=function(){return""},e.prototype.getLowLevelStart=function(){return this.lowLevel().kind()===I.Kind.SCALAR?this.lowLevel().start():this.lowLevel().keyStart()},e.prototype.getLowLevelEnd=function(){return this.lowLevel().kind()===I.Kind.SCALAR?this.lowLevel().end():this.lowLevel().keyEnd()},e.prototype.isSameNode=function(e){return!(!e||e.lowLevel().actual()!=this.lowLevel().actual())},e.prototype.checkContextValue=function(e,t,n){var r=this.computedValue(e);return!(!r||r.indexOf(t)==-1)||(t==r||"false"==t)},e.prototype.printDetails=function(e){return(e?e:"")+"Unkown\n"},e.prototype.testSerialize=function(e){return(e?e:"")+"Unkown\n"},e.prototype.errors=function(){var e=[],t=l(e,this);return this.validate(t),e},e.prototype.markCh=function(){for(var e=this.lowLevel();A.LowLevelProxyNode.isInstance(e);)e=e.originalNode();if(e=e._node?e._node:e,e.markCh)return!0;e.markCh=1},e.prototype.unmarkCh=function(){for(var e=this.lowLevel();A.LowLevelProxyNode.isInstance(e);)e=e.originalNode();e=e._node?e._node:e,delete e.markCh},e.prototype.validate=function(e){w.validate(this,e);for(var t=0,n=d(this);t1){t+="["+n.indexOf(this)+"]"}return this.cachedId=t,t}return this.cachedId="",this.cachedId},e.prototype.localId=function(){return this.name()},e.prototype.resetIDs=function(){this.cachedId=null,this.cachedFullId=null},e.prototype.fullLocalId=function(){var e=this;if(this.cachedFullId)return this.cachedFullId;if(this._parent){var t=".";t+=null!=this.property()&&F.isAnnotationsProperty(this.property())?this.lowLevel().key():this.name();var n=this.parent().directChildren().filter(function(t){return t.name()==e.name()});if(n.length>1){t+="["+n.indexOf(this)+"]"}return this.cachedFullId=t,t}return this.cachedFullId=this.localId(),this.cachedFullId},e.prototype.property=function(){return null},e.prototype.reuseMode=function(){return this._reuseMode},e.prototype.setReuseMode=function(e){this._reuseMode=e},e.prototype.isReused=function(){return this._isReused},e.prototype.setReused=function(e){this._isReused=e,this.children().forEach(function(t){return t.setReused(e)})},e.prototype.setJSON=function(e){this._jsonCache=e},e.prototype.getJSON=function(){return this._jsonCache},e.CLASS_IDENTIFIER="highLevelImpl.BasicASTNode",e}();t.BasicASTNode=W;var q=function(){function e(e,t,n,r){void 0===r&&(r=null),this.node=e,this._parent=t,this.kv=r,this._pr=n}return e.isInstance=function(t){return null!=t&&t.getClassIdentifier&&"function"==typeof t.getClassIdentifier&&S.contains(t.getClassIdentifier(),e.CLASS_IDENTIFIER)},e.prototype.getClassIdentifier=function(){return[].concat(e.CLASS_IDENTIFIER)},e.prototype.valueName=function(){var e=null;return this.kv&&(e=this.kv),e=this.node.key(),this._pr&&this._pr.isAnnotation()&&e&&"("==e.charAt(0)&&(e=e.substring(1,e.length-1)),e},e.prototype.children=function(){return this.node.children().map(function(t){return new e(t,null,null)})},e.prototype.lowLevel=function(){return this.node},e.prototype.toHighLevel=function(e){if(!e&&this._parent&&(e=this._parent),this._hl)return this._hl;var t=this.valueName(),n=C.referenceTargets(this._pr,e).filter(function(n){return r(n,e)==t});if(n&&n[0]){var i=n[0].localType(),a=new X(this.node,e,i,this._pr);return this._pr&&this._pr.childRestrictions().forEach(function(e){a.setComputed(e.name,e.value)}),this._hl=a,a}return null},e.prototype.toHighLevel2=function(e){!e&&this._parent&&(e=this._parent);var t=this.valueName(),n=C.referenceTargets(this._pr,e).filter(function(n){return r(n,e)==t});if(n&&n[0]){var i=n[0].localType(),a=new X(this.node,e,i,this._pr);return this._pr&&this._pr.childRestrictions().forEach(function(e){a.setComputed(e.name,e.value)}),a}if(this._pr.range()){var a=new X(this.node.parent(),e,this._pr.range(),this._pr);return this._pr&&this._pr.childRestrictions().forEach(function(e){a.setComputed(e.name,e.value)}),a}return null},e.prototype.resetHighLevelNode=function(){this._hl=null},e.CLASS_IDENTIFIER="highLevelImpl.StructuredValue",e}();t.StructuredValue=q,t.isStructuredValue=i;var z=function(e){function t(t,n,r,i,a){void 0===a&&(a=!1),e.call(this,t,n),this._def=r,this._prop=i,this.fromKey=a}return g(t,e),t.isInstance=function(e){return null!=e&&e.getClassIdentifier&&"function"==typeof e.getClassIdentifier&&S.contains(e.getClassIdentifier(),t.CLASS_IDENTIFIER_ASTPropImpl)},t.prototype.getClassIdentifier=function(){return e.prototype.getClassIdentifier.call(this).concat(t.CLASS_IDENTIFIER_ASTPropImpl)},t.prototype.definition=function(){return this._def},t.prototype.asAttr=function(){return this},t.prototype.errors=function(){var e=[],t=l(e,this);return this.parent().validate(t),e},t.prototype.isString=function(){return!(!this._def||this._def.key()!==R.Universe08.StringType&&this._def.key()!=R.Universe10.StringType)},t.prototype.isAnnotatedScalar=function(){return!this.property().isAnnotation()&&!this.property().isKey()&&this.lowLevel().isAnnotatedScalar()},t.prototype.annotations=function(){var e=this.lowLevel().children(),n=[],r=this.definition().universe().type(R.Universe10.Annotable.name);if(!r)return n;for(var i=r.property("annotations"),a=0;a0&&this.property()&&(F.isTypeProperty(this.property())||F.isItemsProperty(this.property()))&&this.parent()&&F.isTypeDeclarationSibling(this.parent().definition())?new q(this._node,this.parent(),this._prop):i},t.prototype.name=function(){return this._prop.nameId()},t.prototype.printDetails=function(e){var t=this.definition().nameId(),n=this.property().range().nameId(),r=(e?e:"")+(this.name()+" : ")+t+"["+n+"] = "+this.value()+(this.property().isKey()&&this.optional()?"?":"")+"\n";if(q.isInstance(this.value())){var i=this.value().toHighLevel();i&&i.printDetails&&(r+=i.printDetails(e+"\t"))}return r},t.prototype.testSerialize=function(e){var t=this.definition().nameId(),n=(e?e:"")+(this.name()+" : ")+t+" = "+this.value()+"\n";if(q.isInstance(this.value())){var r=this.value().toHighLevel();if(r&&r.testSerialize)n+=r.testSerialize((e?e:"")+" ");else{var i=this.value().lowLevel(),a=i.dumpToObject(),o=JSON.stringify(a),s="";o.split("\n").forEach(function(t){return s+=(e?e:"")+" "+t+"\n"}),n+=s+"\n"}}return n},t.prototype.isAttr=function(){return!0},t.prototype.isUnknown=function(){return!1},t.prototype.setValue=function(e){N.setValue(this,e),this._value=null},t.prototype.setKey=function(e){N.setKey(this,e),this._value=null},t.prototype.children=function(){return[]},t.prototype.addStringValue=function(e){N.addStringValue(this,e),this._value=null},t.prototype.addStructuredValue=function(e){N.addStructuredValue(this,e),this._value=null},t.prototype.addValue=function(e){if(!this.property().isMultiValue())throw new Error("setValue(string) only apply to multi-values properties");"string"==typeof e?this.addStringValue(e):this.addStructuredValue(e),this._value=null},t.prototype.isEmbedded=function(){var e=this.lowLevel().asMapping().key.value;return this.property().canBeValue()&&e!=this.property().nameId()},t.prototype.remove=function(){N.removeAttr(this)},t.prototype.setValues=function(e){N.setValues(this,e),this._value=null},t.prototype.isEmpty=function(){if(!this.property().isMultiValue())throw new Error("isEmpty() only apply to multi-values attributes");var e=this.parent(),t=(e.lowLevel(),e.attributes(this.name()));if(0==t.length)return!0;if(1==t.length){var n=t[0].lowLevel();return!(!n.isMapping()||null!=n.value())}return!1},t.prototype.isFromKey=function(){return this.fromKey},t.CLASS_IDENTIFIER_ASTPropImpl="highLevelImpl.ASTPropImpl",t}(W);t.ASTPropImpl=z,t.isASTPropImpl=a;var H=new E.BasicNodeBuilder;!function(e){e[e.MERGE=0]="MERGE",e[e.AGGREGATE=1]="AGGREGATE"}(t.OverlayMergeMode||(t.OverlayMergeMode={}));var Y=t.OverlayMergeMode,J=function(e){function t(n,r){if(e.call(this),this._node=n,this._highLevelRoot=r,r.root().getMaster()&&this._node===r.lowLevel()){var i=r.getMasterCounterPart();i&&(this._toMerge=new t(i.lowLevel(),i))}}return g(t,e),t.isInstance=function(e){return null!=e&&e.getClassIdentifier&&"function"==typeof e.getClassIdentifier&&S.contains(e.getClassIdentifier(),t.CLASS_IDENTIFIER_LowLevelWrapperForTypeSystem)},t.prototype.getClassIdentifier=function(){return e.prototype.getClassIdentifier.call(this).concat(t.CLASS_IDENTIFIER_LowLevelWrapperForTypeSystem)},t.prototype.contentProvider=function(){var e=this._node&&this._node.includeBaseUnit()&&(this._node.includePath&&this._node.includePath()?this._node.includeBaseUnit().resolve(this._node.includePath()):this._node.includeBaseUnit());return new V.ContentProvider(e)},t.prototype.key=function(){var e=this._node.key();return this._node.optional()&&(e+="?"),e},t.prototype.value=function(){var e=this._node.valueKind();if(e===P.Kind.SEQ)return this.children().map(function(e){return e.value()});if(e===P.Kind.MAP||e===P.Kind.ANCHOR_REF){var n=this._node.dumpToObject(!1);return n[this.key()]}if(this._node.kind()==P.Kind.MAP){var n=this._node.dumpToObject(!1);return n}if(e===P.Kind.INCLUDE_REF){var r=null,i=this._node.includePath();try{r=this._node.unit().resolve(i)}catch(e){}if(null!=r&&r.isRAMLUnit()){var a=r.ast(),o=new t(a,r.highLevel().asElement());return a.kind()==P.Kind.SEQ?o.children().map(function(e){return e.value()}):o.value()}}return this._node.value()},t.prototype.children=function(){var e=this;if(this._children)return this._children;"uses"!=this.key()||this._node.parent().parent()?this._children=this._node.children().map(function(n){return new t(n,e._highLevelRoot)}):this._children=this._node.children().map(function(t){return new G(t,e._highLevelRoot)}),this.childByKey={};for(var n=0;n0?K.NodeKind.MAP:K.NodeKind.SCALAR},t.prototype.getSource=function(){if(!this._node)return null;var e=this._node.highLevelNode();if(!e){var t=this._node.start(),n=C.deepFindNode(this._highLevelRoot,t,t,!0,!1);return n&&(this._node.setHighLevelParseResult(n),X.isInstance(n)&&this._node.setHighLevelNode(n)),n}return e},t.prototype.node=function(){return this._node},t.CLASS_IDENTIFIER_LowLevelWrapperForTypeSystem="highLevelImpl.LowLevelWrapperForTypeSystem",t}(v.SourceProvider);t.LowLevelWrapperForTypeSystem=J;var G=function(e){function t(){e.apply(this,arguments)}return g(t,e),t.prototype.children=function(){var e=this._node.unit().resolve(this.value());return e&&e.isRAMLUnit()&&e.contents().trim().length>0?new J(e.ast(),this._highLevelRoot).children():[]},t.prototype.anchor=function(){return this._node.actual()},t.prototype.childWithKey=function(e){for(var t=this.children(),n=0;n=0)for(var r=this.parent();null!=r;){if(F.isResourceTypeType(r.definition())||F.isTraitType(r.definition())){e=!0;break}r=r.parent()}}return e},t.prototype.localType=function(){return x.typeFromNode(this)},t.prototype.patchProp=function(e){this._prop=e},t.prototype.getKind=function(){return b.NodeKind.NODE},t.prototype.wrapperNode=function(){if(!this._wrapperNode){if(F.isExampleSpecType(this.definition())){var e=o(this);return L.examplesFromNominal(e,this,!0,!1)[0]}var t=this.definition()&&this.definition().universe();t&&"RAML10"==t.version()?this.definition()&&this.definition().isAssignableFrom(T.universesInfo.Universe10.LibraryBase.name)||this.children():this.children(),this._wrapperNode=this.buildWrapperNode()}return this._wrapperNode},t.prototype.asElement=function(){return this},t.prototype.buildWrapperNode=function(){var e=this.definition().universe().version();return"RAML10"==e?O.buildWrapperNode(this):"RAML08"==e?U.buildWrapperNode(this):null},t.prototype.propertiesAllowedToUse=function(){var e=this;return this.definition().allProperties().filter(function(t){return e.isAllowedToUse(t)})},t.prototype.isAllowedToUse=function(e){var t=this,n=!0;return!e.getAdapter(M.RAMLPropertyService).isSystem()&&(e.getContextRequirements().forEach(function(e){if(e.name.indexOf("(")!=-1)return!0;var r=t.computedValue(e.name);r?n=n&&r==e.value:e.value&&(n=!1)}),n)},t.prototype.allowRecursive=function(){return!!this.definition().getAdapter(M.RAMLService).isUserDefined()},t.prototype.setWrapperNode=function(e){this._wrapperNode=e},t.prototype.setAssociatedType=function(e){this._associatedDef=e},t.prototype.associatedType=function(){return this._associatedDef},t.prototype.knownIds=function(){return this.isAuxilary(),this._knownIds?this._knownIds:{}},t.prototype.findById=function(e){var t=this,n=this.root();if(n!=this)return n.findById(e);if(!this._knownIds){this._knownIds={};var r=C.allChildren(this);r.forEach(function(e){return t._knownIds[e.id()]=e})}if(this.isAuxilary()){if(!this._slaveIds){this._slaveIds={};var r=C.allChildren(this);r.forEach(function(e){return t._slaveIds[e.id()]=e})}var i=this._slaveIds[e];if(i)return i}return this._knownIds[e]},t.prototype.isAuxilary=function(){if(this._isAux)return!0;if(this._auxChecked)return!1;this._auxChecked=!0;var e=this.getMaster();return!!e&&(this._isAux=!0,this.initilizeKnownIDs(e),!0)},t.prototype.initilizeKnownIDs=function(e){var t=this;this._knownIds={},C.allChildren(e).forEach(function(e){return t._knownIds[e.id()]=e}),this._knownIds[""]=e},t.prototype.getMaster=function(){if(this.masterApi)return this.masterApi;var e=this.calculateMasterByRef();return e&&e.setSlave(this),e},t.prototype.overrideMaster=function(e){this.masterApi=e,this.resetAuxilaryState(),e&&e.setSlave(this)},t.prototype.setSlave=function(e){this.slave=e},t.prototype.setMergeMode=function(e){this.overlayMergeMode=e,this.resetAuxilaryState()},t.prototype.getMergeMode=function(){return this.overlayMergeMode},t.prototype.calculateMasterByRef=function(){var e=this.lowLevel().unit();if(!e)return null;var t=e.getMasterReferenceNode();if(!t||!t.value())return null;var n=this.lowLevel();if(n.master)return n.master;var r=t.value(),i=this.lowLevel().unit().project().resolve(this.lowLevel().unit().path(),r);if(!i)return null;var a=i.expandedHighLevel();return a.setMergeMode(this.overlayMergeMode),n.master=a,a},t.prototype.resetAuxilaryState=function(){this._isAux=!1,this._auxChecked=!1,this._knownIds=null,this.clearChildrenCache()},t.prototype.printDetails=function(e){var t="";return e||(e=""),t+=e+this.definition().nameId()+"["+(this.property()?this.property().range().nameId():"")+"] <--- "+(this.property()?this.property().nameId():"")+"\n",this.children().forEach(function(n){t+=n.printDetails(e+"\t")}),t},t.prototype.testSerialize=function(e){var t="";return e||(e=""),t+=e+this.definition().nameId()+" <-- "+(this.property()?this.property().nameId():"")+"\n",this.children().forEach(function(n){n.testSerialize&&(t+=n.testSerialize(e+" "))}),t},t.prototype.getExtractedChildren=function(){var e=this.root();if(e.isAuxilary()){if(e._knownIds){var t=e._knownIds[this.id()];if(t){return t.children()}}return[]}return[]},t.prototype.getMasterCounterPart=function(){var e=this.root();if(e.isAuxilary()){if(e._knownIds){return e._knownIds[this.id()]}return null}return null},t.prototype.getExtractedLowLevelChildren=function(e){var t=this.root();if(t.isAuxilary()){if(t._knownLowLevelIds){var n=t._knownLowLevelIds[this.id()];if(n)return n.children()}return[]}return[]},t.prototype.allowsQuestion=function(){return this._allowQuestion||this.definition().getAdapter(M.RAMLService).getAllowQuestion()},t.prototype.findReferences=function(){var e=this,t=[];C.refFinder(this.root(),this,t),t.length>1&&(t=t.filter(function(t){return t!=e&&t.parent()!=e}));var n=[];return t.forEach(function(e){S.find(n,function(t){return t==e})||n.push(e)}),n},t.prototype.setNamePatch=function(e){this._patchedName=e},t.prototype.isNamePatch=function(){return this._patchedName},t.prototype.name=function(){if(this._patchedName)return this._patchedName;var t=S.find(this.directChildren(),function(e){return e.property()&&e.property().getAdapter(M.RAMLPropertyService).isKey()});if(t&&z.isInstance(t)){var n=null,r=this.definition(),i=r.universe().version();if(r&&"RAML10"==i&&t.isFromKey()){var a=this._node.key();n=this._node.optional()?a+"?":a}else n=t.value();return n}return e.prototype.name.call(this)},t.prototype.findElementAtOffset=function(e){return this._findNode(this,e,e)},t.prototype.isElement=function(){return!0},t.prototype.universe=function(){return this._universe?this._universe:this.definition().universe()},t.prototype.setUniverse=function(e){this._universe=e},t.prototype._findNode=function(e,t,n){var r=this;if(null==e)return null;if(e.lowLevel()&&e.lowLevel().start()<=t&&e.lowLevel().end()>=n){var i=e;return e.elements().forEach(function(a){if(a.lowLevel().unit()==e.lowLevel().unit()){var o=r._findNode(a,t,n);o&&(i=o)}}),i}return null},t.prototype.isStub=function(){return!this.lowLevel().unit()||this.lowLevel().unit().isStubUnit()},t.prototype.add=function(e){N.addToNode(this,e)},t.prototype.remove=function(e){N.removeNodeFrom(this,e)},t.prototype.dump=function(e){return this._node.dump()},t.prototype.patchType=function(e){this._def=e;this._associatedDef;this._associatedDef=null,this._children=null,this._mergedChildren=null},t.prototype.children=function(){var e=this.lowLevel();return e&&e.isValueInclude&&e.isValueInclude()&&B.isWaitingFor(e.includePath())?(this._children=null,[]):this._children?this._mergedChildren?this._mergedChildren:(this._mergedChildren=this.mergeChildren(this._children,this.getExtractedChildren()),this._mergedChildren):this._node?(this._children=H.process(this,this._node.children()),this._children=this._children.filter(function(e){return null!=e}),this.mergeChildren(this._children,this.getExtractedChildren())):[]},t.prototype.mergeChildren=function(e,t){var n=this,r=this.root();if(r.overlayMergeMode==Y.AGGREGATE)return e.concat(t);if(r.overlayMergeMode==Y.MERGE){var i=[];return e.forEach(function(e){var r=S.find(t,function(t){return t.fullLocalId()==e.fullLocalId()});r?n.mergeChild(i,e,r):i.push(e)}),t.forEach(function(t){S.find(e,function(e){return t.fullLocalId()==e.fullLocalId()})||i.push(t)}),i}return null},t.prototype.mergeLowLevelChildren=function(e,t){var n=this,r=this.root();if(r.overlayMergeMode==Y.AGGREGATE)return e.concat(t);if(r.overlayMergeMode==Y.MERGE){var i=[];return e.forEach(function(e){var r=S.find(t,function(t){return t.key()==e.key()});r?n.mergeLowLevelChild(i,e,r):i.push(e)}),t.forEach(function(t){S.find(e,function(e){return t.key()==e.key()})||i.push(t)}),i}return null},t.prototype.mergeLowLevelChild=function(e,t,n){if(t.kind()!=n.kind())return e.push(t),void e.push(n);e.push(t)},t.prototype.mergeChild=function(e,t,n){return t.getKind()!=n.getKind()?(e.push(t),void e.push(n)):t.getKind()==b.NodeKind.NODE?void e.push(t):t.getKind()==b.NodeKind.ATTRIBUTE?void e.push(t):t.getKind()==b.NodeKind.BASIC?(e.push(t),void e.push(n)):void 0},t.prototype.directChildren=function(){return this._children?this._children:this._node?(this._children=H.process(this,this._node.children()),this._mergedChildren=null,this._children):[]},t.prototype.resetChildren=function(){this._children=null,this._mergedChildren=null},t.prototype.isEmptyRamlFile=function(){return this.lowLevel().root().isScalar()},t.prototype.initRamlFile=function(){N.initEmptyRAMLFile(this)},t.prototype.createAttr=function(e,t){N.createAttr(this,e,t)},t.prototype.isAttr=function(){return!1},t.prototype.isUnknown=function(){return!1},t.prototype.value=function(){return this._node.value()},t.prototype.valuesOf=function(e){var t=this._def.property(e);return null!=t?this.elements().filter(function(e){return e.property()==t}):[]},t.prototype.attr=function(e){return S.find(this.attrs(),function(t){return t.name()==e})},t.prototype.attrOrCreate=function(e){return this.attr(e)||this.createAttr(e,""),this.attr(e)},t.prototype.attrValue=function(e){var t=this.attr(e);return t?t.value():null},t.prototype.attributes=function(e){return S.filter(this.attrs(),function(t){return t.name()==e})},t.prototype.attrs=function(){var e=this.children().filter(function(e){return e.isAttr()});if(this._patchedName){var t=S.find(this.definition().allProperties(),function(e){return e.getAdapter(M.RAMLPropertyService).isKey()});if(t){var n=new z(this.lowLevel(),this,t.range(),t,!0);return n._value=this._patchedName,[n].concat(e)}}return e},t.prototype.elements=function(){return this.children().filter(function(e){return!e.isAttr()&&!e.isUnknown()})},t.prototype.element=function(e){var t=this.elementsOfKind(e);return t.length>0?t[0]:null},t.prototype.elementsOfKind=function(e){return this.elements().filter(function(t){return t.property().nameId()==e})},t.prototype.definition=function(){return this._def},t.prototype.property=function(){return this._prop},t.prototype.isExpanded=function(){return this._expanded},t.prototype.copy=function(){return new t(this.lowLevel().copy(),this.parent(),this.definition(),this.property())},t.prototype.clearChildrenCache=function(){this._children=null,this._mergedChildren=null},t.prototype.optionalProperties=function(){var e=this.definition();if(null==e)return[];var t=[],n={};return this.lowLevel().children().forEach(function(e){e.optional()&&(n[e.key()]=!0)}),e.allProperties().forEach(function(e){var r=e;n[r.nameId()]&&t.push(r.nameId())}),t},t.prototype.setReuseMode=function(e){this._reuseMode=e,this._children&&this.lowLevel().valueKind()!=P.Kind.SEQ&&this._children.forEach(function(t){return t.setReuseMode(e)})},t.prototype.reusedNode=function(){return this._reusedNode},t.prototype.setReusedNode=function(e){this._reusedNode=e},t.prototype.resetRuntimeTypes=function(){delete this._associatedDef,this.elements().forEach(function(e){return e.resetRuntimeTypes()})},t.CLASS_IDENTIFIER_ASTNodeImpl="highLevelImpl.ASTNodeImpl",t}(W);t.ASTNodeImpl=X,t.universeProvider=n(88);var $=function(e,n){var r=s(e),i=r&&r[1]||"",a=r&&r.length>2&&r[2]||"Api",o=r&&r.length>2&&r[2],u="1.0"==i?new T.Universe(null,"RAML10",t.universeProvider("RAML10"),"RAML10"):new T.Universe(null,"RAML08",t.universeProvider("RAML08"));return"API"==a?a="Api":"NamedExample"==a?a="ExampleSpec":"DataType"==a?a="TypeDeclaration":"SecurityScheme"==a?a="AbstractSecurityScheme":"AnnotationTypeDeclaration"==a&&(a="TypeDeclaration"),u.setOriginalTopLevelText(o),u.setTopLevel(a),u.setTypedVersion(i),{ptype:a,localUniverse:u}};t.ramlFirstLine=s,t.getFragmentDefenitionName=u,t.fromUnit=c,t.createBasicValidationAcceptor=l,t.isAnnotationTypeFragment=p;var Q=function(){function e(e){this._node=e}return e.prototype.kind=function(){return"AnnotatedNode"},e.prototype.annotationsMap=function(){var e=this;return this._annotationsMap||(this._annotationsMap={},this.annotations().forEach(function(t){var n=t.name(),r=n.lastIndexOf(".");r>=0&&(n=n.substring(r+1)),e._annotationsMap[n]=t})),this._annotationsMap},e.prototype.annotations=function(){if(!this._annotations){var e=[];this._node.isElement()?e=this._node.asElement().attributes(T.universesInfo.Universe10.Annotable.properties.annotations.name):this._node.isAttr()&&(e=this._node.asAttr().annotations()),this._annotations=e.map(function(e){return new Z(e)})}return this._annotations},e.prototype.value=function(){if(this._node.isElement())return this._node.asElement().wrapperNode().toJSON();if(this._node.isAttr()){var e=this._node.asAttr().value();return q.isInstance(e)?e.lowLevel().dump():e}return this._node.lowLevel().dump()},e.prototype.name=function(){return this._node.name()},e.prototype.entry=function(){return this._node},e}();t.AnnotatedNode=Q;var Z=function(){function e(e){this.attr=e}return e.prototype.name=function(){return this.attr.value().valueName()},e.prototype.value=function(){var e=this.attr.value();if(q.isInstance(e)){var t=e.lowLevel().dumpToObject();return t[Object.keys(t)[0]]}return e},e.prototype.definition=function(){var e=this.attr.parent(),t=this.name(),n=C.referenceTargets(this.attr.property(),e).filter(function(n){return r(n,e)==t});return 0==n.length?null:n[0].parsedType()},e}();t.AnnotationInstance=Z,t.applyNodeValidationPlugins=d,t.applyNodeAnnotationValidationPlugins=m,t.toParserErrors=h},function(e,t,n){"use strict";function r(e){return!!e&&(e.nameId()===qe.Universe10.Api.properties.documentation.name||e.nameId()===qe.Universe08.Api.properties.documentation.name)}function i(e){return e===qe.Universe10.Trait.properties.usage.name||e===qe.Universe08.Trait.properties.usage.name||e===qe.Universe10.ResourceType.properties.usage.name||e===qe.Universe08.ResourceType.properties.usage.name||e===qe.Universe10.Library.properties.usage.name||e===qe.Universe10.Overlay.properties.usage.name||e===qe.Universe10.Extension.properties.usage.name}function a(e){return!!e&&i(e.nameId())}function o(e){return!!e&&(e.nameId()==qe.Universe10.Overlay.properties.extends.name||e.nameId()==qe.Universe10.Extension.properties.extends.name)}function s(e){return e===qe.Universe10.TypeDeclaration.properties.description.name||"description"===e}function u(e){return!!e&&s(e.nameId())}function c(e){return e===qe.Universe10.TypeDeclaration.properties.required.name||e===qe.Universe08.Parameter.properties.required.name||"required"===e}function l(e){return e===qe.Universe10.TypeDeclaration.properties.displayName.name||"displayName"===e}function p(e){return!!e&&l(e.nameId())}function f(e){return!!e&&c(e.nameId())}function d(e){return e===qe.Universe10.Api.properties.title.name||e===qe.Universe08.Api.properties.title.name||e===qe.Universe10.DocumentationItem.properties.title.name||e===qe.Universe08.DocumentationItem.properties.title.name||e===qe.Universe10.Overlay.properties.title.name||e===qe.Universe10.Extension.properties.title.name}function m(e){return!!e&&d(e.nameId())}function h(e){return!!e&&y(e.nameId())}function y(e){return e===qe.Universe08.MethodBase.properties.headers.name||e===qe.Universe08.Response.properties.headers.name||e===qe.Universe08.SecuritySchemePart.properties.headers.name||e===qe.Universe10.MethodBase.properties.headers.name||e===qe.Universe10.Response.properties.headers.name}function _(e){return!!e&&g(e.nameId())}function g(e){return e===qe.Universe08.BodyLike.properties.formParameters.name}function v(e){return!!e&&b(e.nameId())}function b(e){return e===qe.Universe08.MethodBase.properties.queryParameters.name||e===qe.Universe08.SecuritySchemePart.properties.queryParameters.name||e===qe.Universe10.MethodBase.properties.queryParameters.name}function S(e){return!!e&&(e.nameId()===qe.Universe10.Api.properties.annotations.name||e.nameId()===qe.Universe10.TypeDeclaration.properties.annotations.name||e.nameId()===qe.Universe10.Response.properties.annotations.name)}function A(e){return!!e&&e.nameId()===qe.Universe10.AnnotationRef.properties.annotation.name}function T(e){return!!e&&(e.nameId()===qe.Universe10.MethodBase.properties.is.name||e.nameId()===qe.Universe08.Method.properties.is.name||e.nameId()===qe.Universe10.ResourceBase.properties.is.name||e.nameId()===qe.Universe08.ResourceType.properties.is.name||e.nameId()===qe.Universe08.Resource.properties.is.name)}function E(e){return!!e&&(e.nameId()===qe.Universe10.Api.properties.securedBy.name||e.nameId()===qe.Universe08.Api.properties.securedBy.name||e.nameId()===qe.Universe10.MethodBase.properties.securedBy.name||e.nameId()===qe.Universe08.MethodBase.properties.securedBy.name||e.nameId()===qe.Universe08.ResourceType.properties.securedBy.name||e.nameId()===qe.Universe08.Resource.properties.securedBy.name||e.nameId()===qe.Universe10.ResourceBase.properties.securedBy.name)}function C(e){return!!e&&(e.nameId()===qe.Universe10.LibraryBase.properties.securitySchemes.name||e.nameId()===qe.Universe08.Api.properties.securitySchemes.name)}function N(e){return!!e&&(e.nameId()===qe.Universe10.SecuritySchemeRef.properties.securityScheme.name||e.nameId()===qe.Universe08.SecuritySchemeRef.properties.securityScheme.name)}function w(e){return!!e&&(e.nameId()===qe.Universe10.AbstractSecurityScheme.properties.type.name||e.nameId()===qe.Universe08.AbstractSecurityScheme.properties.type.name||e.nameId()===qe.Universe08.ResourceType.properties.type.name||e.nameId()===qe.Universe08.Resource.properties.type.name||e.nameId()===qe.Universe08.Parameter.properties.type.name||e.nameId()===qe.Universe10.ResourceBase.properties.type.name||e.nameId()===qe.Universe10.TypeDeclaration.properties.type.name)}function k(e){return!!e&&e.nameId()===qe.Universe10.ArrayTypeDeclaration.properties.items.name}function x(e){return!!e&&e.nameId()===qe.Universe10.ArrayTypeDeclaration.properties.structuredItems.name}function R(e){return!!e&&e.nameId()===qe.Universe10.ObjectTypeDeclaration.properties.properties.name}function I(e){return!!e&&(e.nameId()===qe.Universe10.MethodBase.properties.responses.name||e.nameId()===qe.Universe08.MethodBase.properties.responses.name)}function D(e){return!!e&&(e.nameId()===qe.Universe10.Api.properties.protocols.name||e.nameId()===qe.Universe08.Api.properties.protocols.name||e.nameId()===qe.Universe10.MethodBase.properties.protocols.name)}function M(e){return!!e&&(e.nameId()===qe.Universe10.TypeDeclaration.properties.name.name||e.nameId()===qe.Universe10.TypeDeclaration.properties.name.name||e.nameId()===qe.Universe08.AbstractSecurityScheme.properties.name.name||e.nameId()===qe.Universe10.AbstractSecurityScheme.properties.name.name||e.nameId()===qe.Universe08.Trait.properties.name.name||e.nameId()===qe.Universe10.Trait.properties.name.name||"name"===e.nameId())}function P(e){return!!e&&(e.nameId()===qe.Universe10.MethodBase.properties.body.name||e.nameId()===qe.Universe08.MethodBase.properties.body.name||e.nameId()===qe.Universe10.Response.properties.body.name||e.nameId()===qe.Universe08.Response.properties.body.name)}function L(e){return!!e&&(e.nameId()===qe.Universe10.TypeDeclaration.properties.default.name||e.nameId()===qe.Universe08.Parameter.properties.default.name)}function O(e){return!!e&&(e.nameId()===qe.Universe08.BodyLike.properties.schema.name||e.nameId()===qe.Universe08.XMLBody.properties.schema.name||e.nameId()===qe.Universe08.JSONBody.properties.schema.name||e.nameId()===qe.Universe10.TypeDeclaration.properties.schema.name)}function U(e){return!!e&&(e.nameId()===qe.Universe08.Api.properties.traits.name||e.nameId()===qe.Universe10.LibraryBase.properties.traits.name)}function F(e){return!!e&&(e.nameId()===qe.Universe08.TraitRef.properties.trait.name||e.nameId()===qe.Universe10.TraitRef.properties.trait.name)}function B(e){return!!e&&(e.nameId()===qe.Universe08.Api.properties.resourceTypes.name||e.nameId()===qe.Universe10.LibraryBase.properties.resourceTypes.name)}function K(e){return!!e&&(e.nameId()===qe.Universe08.ResourceTypeRef.properties.resourceType.name||e.nameId()===qe.Universe10.ResourceTypeRef.properties.resourceType.name)}function V(e){return!!e&&e.nameId()===qe.Universe10.TypeDeclaration.properties.facets.name}function j(e){return!!e&&(e.nameId()===qe.Universe08.Api.properties.schemas.name||e.nameId()===qe.Universe10.LibraryBase.properties.schemas.name)}function W(e){return!!e&&(e.nameId()===qe.Universe10.Api.properties.resources.name||e.nameId()===qe.Universe08.Api.properties.resources.name||e.nameId()===qe.Universe10.Resource.properties.resources.name||e.nameId()===qe.Universe08.Resource.properties.resources.name)}function q(e){return!!e&&(e.nameId()===qe.Universe10.ResourceBase.properties.methods.name||e.nameId()===qe.Universe08.Resource.properties.methods.name||e.nameId()===qe.Universe08.ResourceType.properties.methods.name)}function z(e){return e&&e.nameId()===qe.Universe10.LibraryBase.properties.types.name}function H(e){return!!e&&(e.nameId()===qe.Universe10.TypeDeclaration.properties.example.name||"example"===e.nameId())}function Y(e){return!!e&&(e.nameId()===qe.Universe10.StringTypeDeclaration.properties.enum.name||e.nameId()===qe.Universe10.NumberTypeDeclaration.properties.enum.name||e.nameId()===qe.Universe08.StringTypeDeclaration.properties.enum.name)}function J(e){return!!e&&(e.nameId()===qe.Universe10.TypeDeclaration.properties.example.name||e.nameId()===qe.Universe10.TypeDeclaration.properties.examples.name)}function G(e){return!!e&&e.nameId()===qe.Universe08.GlobalSchema.properties.value.name}function X(e){return!!e&&(e.nameId()===qe.Universe08.Api.properties.uriParameters.name||e.nameId()===qe.Universe08.ResourceType.properties.uriParameters.name||e.nameId()===qe.Universe08.Resource.properties.uriParameters.name||e.nameId()===qe.Universe10.ResourceBase.properties.uriParameters.name)}function $(e){return!!e&&(e.nameId()===qe.Universe08.Resource.properties.baseUriParameters.name||e.nameId()===qe.Universe08.Api.properties.baseUriParameters.name||e.nameId()===qe.Universe10.Api.properties.baseUriParameters.name)}function Q(e){return!!e&&(e.nameId()===qe.Universe08.Api.properties.RAMLVersion.name||e.nameId()===qe.Universe10.Api.properties.RAMLVersion.name)}function Z(e){return!!e&&e.nameId()===qe.Universe10.FragmentDeclaration.properties.uses.name}function ee(e){return!!e&&e.nameId()===qe.Universe10.LibraryBase.properties.annotationTypes.name}function te(e){return e.key()==qe.Universe10.Method||e.key()==qe.Universe08.Method}function ne(e){return e.key()==qe.Universe10.Api||e.key()==qe.Universe08.Api}function re(e){return e.key()==qe.Universe10.BooleanType||e.key()==qe.Universe08.BooleanType}function ie(e){return e.key()==qe.Universe10.MarkdownString||e.key()==qe.Universe08.MarkdownString}function ae(e){return e.key()==qe.Universe10.Resource||e.key()==qe.Universe08.Resource}function oe(e){return e.key()==qe.Universe10.Trait||e.key()==qe.Universe08.Trait}function se(e){return e.key()==qe.Universe10.TraitRef||e.key()==qe.Universe08.TraitRef}function ue(e){return e.key()==qe.Universe10.ResourceTypeRef||e.key()==qe.Universe08.ResourceTypeRef}function ce(e){return e.key()==qe.Universe08.GlobalSchema}function le(e){return e.key()==qe.Universe10.AbstractSecurityScheme||e.key()==qe.Universe08.AbstractSecurityScheme}function pe(e){return e.isAssignableFrom(qe.Universe10.AbstractSecurityScheme.name)}function fe(e){return e.key()==qe.Universe10.SecuritySchemeRef||e.key()==qe.Universe08.SecuritySchemeRef}function de(e){return e.key()==qe.Universe10.TypeDeclaration}function me(e){return e.key()==qe.Universe10.Response||e.key()==qe.Universe08.Response}function he(e){return e.key()==qe.Universe08.BodyLike}function ye(e){return e.key()==qe.Universe10.Overlay}function _e(e){return!1}function ge(e){return e.key()==qe.Universe10.ResourceType||e.key()==qe.Universe08.ResourceType}function ve(e){return e.key()==qe.Universe10.SchemaString||e.key()==qe.Universe08.SchemaString}function be(e){return e.key()==qe.Universe10.MethodBase||e.key()==qe.Universe08.MethodBase}function Se(e){return e.key()==qe.Universe10.Library}function Ae(e){return e.key()==qe.Universe10.StringType||e.key()==qe.Universe08.StringType}function Te(e){return e.key()==qe.Universe10.ExampleSpec}function Ee(e){return e.key()==qe.Universe10.Extension}function Ce(e){return e.isAssignableFrom(qe.Universe10.TypeDeclaration.name)}function Ne(e){return e.key()==qe.Universe10.DocumentationItem||e.key()==qe.Universe08.DocumentationItem}function we(e){return e.isAssignableFrom(qe.Universe10.AnnotationRef.name)}function ke(e){return e.isAssignableFrom(qe.Universe10.Api.name)||e.isAssignableFrom(qe.Universe08.Api.name)}function xe(e){return e.isAssignableFrom(qe.Universe10.LibraryBase.name)}function Re(e){return e.isAssignableFrom(qe.Universe10.ResourceBase.name)||e.isAssignableFrom(qe.Universe08.Resource.name)}function Ie(e){return e.isAssignableFrom(qe.Universe10.ObjectTypeDeclaration.name)}function De(e){return e.isAssignableFrom(qe.Universe10.TypeDeclaration.name)}function Me(e){return e.isAssignableFrom(qe.Universe10.StringTypeDeclaration.name)}function Pe(e){return e.isAssignableFrom(qe.Universe10.TypeDeclaration.name)}function Le(e){return e.isAssignableFrom(qe.Universe10.MethodBase.name)||e.isAssignableFrom(qe.Universe08.MethodBase.name)}function Oe(e){return e.key()==qe.Universe10.SecuritySchemePart||e.key()==qe.Universe08.SecuritySchemePart}function Ue(e){return e.nameId()===qe.Universe08.Api.properties.mediaType.name||e.nameId()===qe.Universe10.Api.properties.mediaType.name}function Fe(e){return"RAML08"==e.universe().version()}function Be(e){return"RAML10"==e.universe().version()}function Ke(e){return Fe(e.definition())}function Ve(e){return Fe(e.definition())}function je(e){return Be(e.definition())}function We(e){return Be(e.definition())}var qe=n(3);t.isDocumentationProperty=r,t.isUsagePropertyName=i,t.isUsageProperty=a,t.isMasterRefProperty=o,t.isDescriptionPropertyName=s,t.isDescriptionProperty=u,t.isRequiredPropertyName=c,t.isDisplayNamePropertyName=l,t.isDisplayNameProperty=p,t.isRequiredProperty=f,t.isTitlePropertyName=d,t.isTitleProperty=m,t.isHeadersProperty=h,t.isHeadersPropertyName=y,t.isFormParametersProperty=_,t.isFormParametersPropertyName=g,t.isQueryParametersProperty=v,t.isQueryParametersPropertyName=b,t.isAnnotationsProperty=S,t.isAnnotationProperty=A,t.isIsProperty=T,t.isSecuredByProperty=E,t.isSecuritySchemesProperty=C,t.isSecuritySchemeProperty=N,t.isTypeProperty=w,t.isItemsProperty=k,t.isStructuredItemsProperty=x,t.isPropertiesProperty=R,t.isResponsesProperty=I,t.isProtocolsProperty=D,t.isNameProperty=M,t.isBodyProperty=P,t.isDefaultValue=L,t.isSchemaProperty=O,t.isTraitsProperty=U,t.isTraitProperty=F,t.isResourceTypesProperty=B,t.isResourceTypeProperty=K,t.isFacetsProperty=V,t.isSchemasProperty=j,t.isResourcesProperty=W,t.isMethodsProperty=q,t.isTypesProperty=z,t.isExampleProperty=H,t.isEnumProperty=Y,t.isExamplesProperty=J,t.isValueProperty=G,t.isUriParametersProperty=X,t.isBaseUriParametersProperty=$,t.isRAMLVersionProperty=Q,t.isUsesProperty=Z,t.isAnnotationTypesProperty=ee,t.isMethodType=te,t.isApiType=ne,t.isBooleanTypeType=re,t.isMarkdownStringType=ie,t.isResourceType=ae,t.isTraitType=oe,t.isTraitRefType=se,t.isResourceTypeRefType=ue,t.isGlobalSchemaType=ce,t.isSecuritySchemaType=le,t.isSecuritySchemaTypeDescendant=pe,t.isSecuritySchemeRefType=fe,t.isTypeDeclarationType=de,t.isResponseType=me,t.isBodyLikeType=he,t.isOverlayType=ye,t.isAnnotationTypeType=_e,t.isResourceTypeType=ge,t.isSchemaStringType=ve,t.isMethodBaseType=be,t.isLibraryType=Se,t.isStringTypeType=Ae,t.isExampleSpecType=Te,t.isExtensionType=Ee,t.isTypeDeclarationTypeOrDescendant=Ce,t.isDocumentationType=Ne,t.isAnnotationRefTypeOrDescendant=we,t.isApiSibling=ke,t.isLibraryBaseSibling=xe,t.isResourceBaseSibling=Re,t.isObjectTypeDeclarationSibling=Ie,t.isTypeDeclarationDescendant=De,t.isStringTypeDeclarationDescendant=Me,t.isTypeDeclarationSibling=Pe,t.isMethodBaseSibling=Le,t.isSecuritySchemePartType=Oe,t.isMediaTypeProperty=Ue,t.isRAML08Type=Fe,t.isRAML10Type=Be,t.isRAML08Node=Ke,t.isRAML08Attribute=Ve,t.isRAML10Node=je,t.isRAML10Attribute=We},function(e,t,n){"use strict";function r(){return new T(T.OK,"","",null)}function i(e,t,n,r,i){void 0===n&&(n={}),void 0===r&&(r=T.ERROR),void 0===i&&(i=!1);var a=E(e,n);return new T(r,e.code,a,t,i)}function a(){return te}function o(e,t){return new Z(e,t)}function s(e,t){return new ee(e,t)}function u(e,n){var r=new $(e);return n.forEach(function(e){return r.addSuper(e)}),r.isSubTypeOf(t.NIL)&&(r.nullable=!0),r}function c(e){return u(e,[t.OBJECT])}function l(e,t,n){if(t.isScalar()&&n.isScalar()){if(t.allSubTypes().indexOf(n)!=-1)return t;if(n.allSubTypes().indexOf(t)!=-1)return n}var r=t.oneMeta(x.Discriminator),i=n.oneMeta(x.Discriminator);if(r&&i&&r.property===i.property){var a=t.descValue(),o=n.descValue();if(a!==o){var s=e[r.property];if(s===a)return t;if(s===o)return n}}return null}function p(e){return parseFloat(e)==parseInt(e)&&!isNaN(e)}function f(e){for(var t=[];null!=e;){if(null!=e.name()){t.push(e.name());break}if(!(e instanceof $))break;var n=e.contextMeta();if(null==n)break;t.push(n.path()),e=n._owner}return t.reverse()}function d(e,n,a){var o=n.metaOfType(x.Discriminator);if(0==o.length)return null;var s=o[0].value(),u=b.find([n].concat(n.allSuperTypes()),function(e){return e.getExtra(t.GLOBAL)});if(!u)return null;var c=u.name(),l=n.metaOfType(x.DiscriminatorValue);if(0!=l.length&&(c=l[0].value()),c){if(e.hasOwnProperty(s)){var p=e[s];if(p!=c){var f=i(T.CODE_INCORRECT_DISCRIMINATOR,this,{rootType:u.name(),value:p,propName:s},T.WARNING);return m(f,{name:s,child:a}),f}return r()}var d=i(T.CODE_MISSING_DISCRIMINATOR,this,{rootType:u.name(),propName:s});return m(d,a),d}}function m(e,t){if(e.getValidationPath()){for(var n=h(t),r=n;r.child;)r=r.child;r.child=e.getValidationPath(),e.setValidationPath(n)}else e.setValidationPath(t);e.getSubStatuses().forEach(function(e){m(e,t)})}function h(e){if(e){for(var t=e,n=null,r=null;t;)if(n){var i={name:t.name};r.child=i,t=t.child,r=i}else n={name:t.name},r=n,t=t.child,r=n;return n}return null}function y(e){for(var t=A.getAnnotationValidationPlugins(),n=[],r=0,i=t;r0){var e=[];return this.subStatus.forEach(function(t){return e=e.concat(t.getErrors())}),e}return[this]}return[]},e.prototype.getSubStatuses=function(){return this.subStatus},e.prototype.getSeverity=function(){return this.severity},e.prototype.getMessage=function(){return this.message},e.prototype.setMessage=function(e){this.message=e},e.prototype.getSource=function(){return this.source},e.prototype.getCode=function(){return this.code},e.prototype.setCode=function(e){this.code=e},e.prototype.isWarning=function(){return this.severity==e.WARNING},e.prototype.isError=function(){return this.severity==e.ERROR},e.prototype.isOk=function(){return this.severity===e.OK},e.prototype.isInfo=function(){return this.severity===e.INFO},e.prototype.setSource=function(e){this.source=e},e.prototype.toString=function(){return this.isOk()?"OK":this.message},e.prototype.getExtra=function(e){return this.takeNodeFromSource&&e==A.SOURCE_EXTRA&&this.source instanceof C?this.source.node():null},e.prototype.putExtra=function(e,t){},e.CODE_CONFLICTING_TYPE_KIND=4,e.CODE_INCORRECT_DISCRIMINATOR=t.messageRegistry.INCORRECT_DISCRIMINATOR,e.CODE_MISSING_DISCRIMINATOR=t.messageRegistry.MISSING_DISCRIMINATOR,e.ERROR=3,e.INFO=1,e.OK=0,e.WARNING=2,e}();t.Status=T,t.ok=r,t.SCHEMA_AND_TYPE=A.SCHEMA_AND_TYPE_EXTRA,t.GLOBAL=A.GLOBAL_EXTRA,t.TOPLEVEL=A.TOP_LEVEL_EXTRA,t.SOURCE_EXTRA=A.SOURCE_EXTRA;var E=function(e,t){for(var n="",r=e.message,i=0,a=r.indexOf("{{");a>=0;a=r.indexOf("{{",i)){if(n+=r.substring(i,a),(i=r.indexOf("}}",a))<0){i=a;break}a+="{{".length;var o=r.substring(a,i);i+="}}".length;var s=t[o];if(void 0===s)throw new Error("Message parameter '"+o+"' has no value specified.");n+=s}return n+=r.substring(i,r.length)};t.error=i;var C=function(){function e(e){this._inheritable=e,this._annotations=[]}return e.prototype.node=function(){return this._node},e.prototype.setNode=function(e){this._node=e},e.prototype.owner=function(){return this._owner},e.prototype.isInheritable=function(){return this._inheritable},e.prototype.validateSelf=function(e){for(var t=r(),n=0,i=this._annotations;n0&&(o.child=r[r.length-1]),r.push(o)}i=i.pop()}m(this,r.pop());var s=k.anotherRestrictionComponent();n=s?" between types '"+f(this.source)+"' and '"+f(s)+"'":" in type '"+f(this.source)+"'"}this.message="Restrictions conflict"+n+": "+e},n.prototype.getConflictDescription=function(){var e="";return e+="Restrictions coflict:\n",e+=this._stack.getRestriction()+" conflicts with "+this._conflicting+"\n",e+="at\n",e+=this._stack.pop()},n.prototype.getConflicting=function(){return this._conflicting},n.prototype.getStack=function(){return this._stack},n.prototype.toRestriction=function(){return new ie(this._stack,this.message,this._conflicting)},n}(T);t.RestrictionsConflict=V;var j=0;t.VALIDATED_TYPE=null;var W=function(){function e(e){this._name=e,this.metaInfo=[],this._subTypes=[],this.innerid=j++,this.extras={},this._locked=!1}return e.prototype.getExtra=function(e){return this.extras[e]},e.prototype.putExtra=function(e,t){this.extras[e]=t},e.prototype.id=function(){return this.innerid},e.prototype.knownProperties=function(){return this.metaOfType(F.MatchesProperty)},e.prototype.lock=function(){this._locked=!0},e.prototype.isLocked=function(){return this._locked},e.prototype.allFacets=function(){return this.meta()},e.prototype.declaredFacets=function(){return this.declaredMeta()},e.prototype.isSubTypeOf=function(e){return e===t.ANY||this===e||this.superTypes().some(function(t){return t.isSubTypeOf(e)})},e.prototype.isSuperTypeOf=function(e){return this===e||this.allSubTypes().indexOf(e)!=-1},e.prototype.addMeta=function(e){this.metaInfo.push(e),e._owner=this},e.prototype.name=function(){return this._name},e.prototype.label=function(){return this._name},e.prototype.subTypes=function(){return this._subTypes},e.prototype.superTypes=function(){return[]},e.prototype.addSupertypeAnnotation=function(e,t){if(e&&0!=e.length){this.supertypeAnnotations||(this.supertypeAnnotations=[]);var n=this.supertypeAnnotations[t];n||(n={},this.supertypeAnnotations[t]=n);for(var r=0,i=e;r0&&l.forEach(function(e){var a=i(t.messageRegistry.CYCLIC_DEPENDENCY,n,{typeName:e});m(a,{name:e}),r.addSubStatus(a)})}if(this.supertypeAnnotations)for(var p=0;p1&&c.forEach(function(e){e.isExternal()?l=!0:p=!0}),l&&p&&e.addSubStatus(i(t.messageRegistry.EXTERNALS_MIX,this)),this instanceof Z){this.options().forEach(function(r){r.isExternal()&&e.addSubStatus(i(t.messageRegistry.EXTERNALS_MIX,n))})}if(this.isExternal()&&this.getExtra(A.HAS_FACETS)){var f=i(t.messageRegistry.EXTERNAL_FACET,this,{name:this.getExtra(A.HAS_FACETS)});m(f,{name:this.getExtra(A.HAS_FACETS)}),e.addSubStatus(f)}},e.prototype.familyWithArray=function(){var e=this.allSuperTypes(),t=this.oneMeta(L.ComponentShouldBeOfType);if(t){var n=t.value();e=e.concat(n.familyWithArray())}return e},e.prototype.validateMeta=function(e){var t=new T(T.OK,"","",this);return this.declaredMeta().forEach(function(n){n.validateSelf(e).getErrors().forEach(function(e){return t.addSubStatus(e)})}),this.validateFacets(t),t},e.prototype.validateFacets=function(e){var n=this,r={},a={},o={};this.meta().forEach(function(e){if(e instanceof D.FacetDeclaration){var t=e;r[t.actualName()]=t,t.isOptional()||t.owner()!==n&&(o[t.actualName()]=t),t.owner()!=n&&(a[t.actualName()]=t)}}),this.declaredMeta().forEach(function(r){if(r instanceof D.FacetDeclaration){var o=r;if(o.owner()==n){var s=o.actualName();a.hasOwnProperty(s)&&e.addSubStatus(i(t.messageRegistry.OVERRIDE_FACET,n,{name:s}));var u=R.getInstance().facetPrototypeWithName(s);(u&&u.isApplicable(n)||"type"==s||"properties"==o.facetName()||"schema"==s||"facets"==s||"uses"==s)&&e.addSubStatus(i(t.messageRegistry.OVERRIDE_BUILTIN_FACET,n,{name:s})),"("==s.charAt(0)&&e.addSubStatus(i(t.messageRegistry.FACET_START_BRACKET,n,{name:s}))}}});var s={};this.meta().forEach(function(e){e instanceof P.PropertyIs&&(s[e.propId()]=!0)});for(var u=0,c=this.meta();u0&&e.addSubStatus(i(t.messageRegistry.MISSING_REQUIRED_FACETS,this,{facetsList:Object.keys(o).map(function(e){return"'"+e+"'"}).join(",")}))},e.prototype.allSuperTypes=function(){var e=[];return this.fillSuperTypes(e),e},e.prototype.fillSuperTypes=function(e){this.superTypes().forEach(function(t){b.contains(e,t)||(e.push(t),t.fillSuperTypes(e))})},e.prototype.allSubTypes=function(){var e=[];return this.fillSubTypes(e),e},e.prototype.fillSubTypes=function(e){this.subTypes().forEach(function(t){b.contains(e,t)||(e.push(t),t.fillSubTypes(e))})},e.prototype.inherit=function(e){var t=new $(e);return t.addSuper(this),t},e.prototype.isAnonymous=function(){return!this._name||0===this._name.length},e.prototype.isEmpty=function(){return!(this.metaInfo.length>2)&&0==this.metaInfo.filter(function(e){return!(e instanceof U.NotScalar)&&(!(e instanceof x.DiscriminatorValue)||e.isStrict())}).length},e.prototype.isArray=function(){return this===t.ARRAY||this.allSuperTypes().indexOf(t.ARRAY)!=-1},e.prototype.propertySet=function(){var e=[];return this.meta().forEach(function(t){if(t instanceof P.PropertyIs){var n=t;e.push(n.propertyName())}}),b.uniq(e)},e.prototype.checkConfluent=function(){if(this.computeConfluent)return r();this.computeConfluent=!0;var e=k.anotherRestrictionComponentsCount();try{var t=k.optimize(this.restrictions()),n=b.find(t,function(e){return e instanceof ne});if(n){var i=null,a=null;if(n instanceof ie){var o=n;i=o.getStack(),a=o.another()}return new V(a,i,this)}return r()}finally{this.computeConfluent=!1,k.releaseAnotherRestrictionComponent(e)}},e.prototype.isObject=function(){return this==t.OBJECT||this.allSuperTypes().indexOf(t.OBJECT)!=-1},e.prototype.isExternal=function(){return this==t.EXTERNAL||this.allSuperTypes().indexOf(t.EXTERNAL)!=-1},e.prototype.isBoolean=function(){return this==t.BOOLEAN||this.allSuperTypes().indexOf(t.BOOLEAN)!=-1},e.prototype.isString=function(){return this==t.STRING||this.allSuperTypes().indexOf(t.STRING)!=-1},e.prototype.isNumber=function(){return this==t.NUMBER||this.allSuperTypes().indexOf(t.NUMBER)!=-1},e.prototype.isFile=function(){return this==t.FILE||this.allSuperTypes().indexOf(t.FILE)!=-1},e.prototype.isScalar=function(){return this==t.SCALAR||this.allSuperTypes().indexOf(t.SCALAR)!=-1},e.prototype.isDateTime=function(){return this==t.DATETIME||this.allSuperTypes().indexOf(t.DATETIME)!=-1},e.prototype.isDateOnly=function(){return this==t.DATE_ONLY||this.allSuperTypes().indexOf(t.DATE_ONLY)!=-1},e.prototype.isTimeOnly=function(){return this==t.TIME_ONLY||this.allSuperTypes().indexOf(t.TIME_ONLY)!=-1},e.prototype.isInteger=function(){return this==t.INTEGER||this.allSuperTypes().indexOf(t.INTEGER)!=-1},e.prototype.isDateTimeOnly=function(){return this==t.DATETIME_ONLY||this.allSuperTypes().indexOf(t.DATETIME_ONLY)!=-1},e.prototype.isUnknown=function(){return this==t.UNKNOWN||this.allSuperTypes().indexOf(t.UNKNOWN)!=-1},e.prototype.isRecurrent=function(){return this==t.RECURRENT||this.allSuperTypes().indexOf(t.RECURRENT)!=-1},e.prototype.isBuiltin=function(){return this.metaInfo.indexOf(G)!=-1},e.prototype.exampleObject=function(){return O.example(this)},e.prototype.isPolymorphic=function(){return this.meta().some(function(e){return e instanceof z})},e.prototype.restrictions=function(e){if(void 0===e&&(e=!1),this.isUnion()){var t=[];return this.superTypes().forEach(function(e){t=t.concat(e.restrictions())}),t=t.concat(this.meta().filter(function(e){return e instanceof w}))}var n=[],r=null;return this.meta().forEach(function(t){if(t instanceof w){if(t instanceof ae&&e){if(r)return;r=t}n.push(t)}}),n},e.prototype.customFacets=function(){return this.declaredMeta().filter(function(e){return e instanceof x.CustomFacet})},e.prototype.allCustomFacets=function(){return this.meta().filter(function(e){return e instanceof x.CustomFacet})},e.prototype.isUnion=function(){var e=!1;return!this.isBuiltin()&&(this.allSuperTypes().forEach(function(t){return e=e||t instanceof Z}),e)},e.prototype.isIntersection=function(){var e=!1;return!this.isBuiltin()&&(this.allSuperTypes().forEach(function(t){return e=e||t instanceof ee}),e)},e.prototype.meta=function(){return[].concat(this.metaInfo)},e.prototype.validateDirect=function(e,n,r,a){var o=this;void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===a&&(a=null);var s=t.VALIDATED_TYPE;try{var u=t.autoCloseFlag;n&&(t.autoCloseFlag=!0),t.VALIDATED_TYPE=this;var c=new T(T.OK,"","",this);if(!(r||null!==e&&void 0!==e||this.nullable))return i(t.messageRegistry.OBJECT_EXPECTED,this);if(this.restrictions(!0).forEach(function(t){return c.addSubStatus(t.check(e,a))}),(n||t.autoCloseFlag)&&this.isObject()&&!this.oneMeta(I.KnownPropertyRestriction)){var l=new I.KnownPropertyRestriction(!1);l.patchOwner(this),l.check(e).getErrors().forEach(function(e){var t=new T(T.WARNING,e.getCode(),e.getMessage(),o);m(t,e.getValidationPath()),c.addSubStatus(t)})}}finally{t.autoCloseFlag=u,t.VALIDATED_TYPE=s}return c},e.prototype.validate=function(e,n,a){void 0===n&&(n=!1),void 0===a&&(a=!0);var o=t.autoCloseFlag;if(!(a||null!==e&&void 0!==e||this.nullable))return i(t.messageRegistry.NULL_NOT_ALLOWED,this);n&&(t.autoCloseFlag=!0);try{for(var s,u=[],c=this.subTypes().concat(this),l=0,p=c;l1;){e:for(var i=0;i0?t[0].value().label()+"[]":e.prototype.label.call(this)},t.prototype.contextMeta=function(){return this._contextMeta},t.prototype.setContextMeta=function(e){this._contextMeta=e},t.prototype.patch=function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t])},t}(W);t.InheritedType=$;var Q=function(e){function t(t,n){e.call(this,t),this._options=n}return v(t,e),t.prototype.allOptions=function(){var e=this,t=[];return this._options.forEach(function(n){n.kind()==e.kind()?t=t.concat(n.allOptions()):t.push(n)}),b.unique(t)},t.prototype.options=function(){return this._options},t}(W);t.DerivedType=Q;var Z=function(e){function n(t,n){var r=this;e.call(this,t,n),this.options().forEach(function(e){e.nullable&&(r.nullable=!0)})}return v(n,e),n.prototype.kind=function(){return"union"},n.prototype.isSubTypeOf=function(e){var t=!0;return this.allOptions().forEach(function(n){n.isSubTypeOf(e)||(t=!1)}),t},n.prototype.validate=function(e){return this.validateDirect(e)},n.prototype.typeFamily=function(){var e=[];return this.allOptions().forEach(function(t){e=e.concat(t.typeFamily())}),e},n.prototype.knownProperties=function(){var e=this.metaOfType(F.MatchesProperty);return this.options().forEach(function(t){e=e.concat(t.knownProperties())}),e},n.prototype.validateDirect=function(e,t){void 0===t&&(t=!1);var n=new T(T.OK,"","",this);return this.restrictions().forEach(function(t){return n.addSubStatus(t.check(e,null))}),n},n.prototype.isUnion=function(){return!0},n.prototype.restrictions=function(){return[new le(this.allOptions().map(function(e){return new pe(e.restrictions())}),t.messageRegistry.UNION_TYPE_FAILURE,t.messageRegistry.UNION_TYPE_FAILURE_DETAILS)]},n.prototype.label=function(){return this.options().map(function(e){return e.label()}).join("|")},n}(Q);t.UnionType=Z;var ee=function(e){function t(){e.apply(this,arguments)}return v(t,e),t.prototype.kind=function(){return"intersection"},t.prototype.restrictions=function(){var e=[];return this.allOptions().forEach(function(t){return e=e.concat(t.restrictions())}),[new pe(e)]},t.prototype.label=function(){return this.options().map(function(e){return e.label()}).join("&")},t.prototype.isIntersection=function(){return!0},t}(Q);t.IntersectionType=ee;var te=new B;t.builtInRegistry=a,t.union=o,t.intersect=s,t.derive=u,t.deriveObjectType=c;var ne=function(e){function n(){e.apply(this,arguments)}return v(n,e),n.prototype.check=function(e){return null===e||void 0===e?r():i(t.messageRegistry.NOTHING,this)},n.prototype.requiredType=function(){return t.ANY},n.prototype.facetName=function(){return"nothing"},n.prototype.value=function(){return"!!!"},n}(w);t.NothingRestriction=ne;var re=function(){function e(e,t,n){this._previous=e,this._restriction=t,this.id=n}return e.prototype.getRestriction=function(){return this._restriction},e.prototype.pop=function(){return this._previous},e.prototype.push=function(t){return new e(this,t,t.toString())},e}();t.RestrictionStackEntry=re;var ie=function(e){function t(t,n,r){e.call(this),this._entry=t,this._message=n,this._another=r}return v(t,e),t.prototype.getMessage=function(){return this._message},t.prototype.getStack=function(){return this._entry},t.prototype.another=function(){return this._another},t}(ne);t.NothingRestrictionWithLocation=ie;var ae=function(e){function t(){e.apply(this,arguments)}return v(t,e),t}(w);t.GenericTypeOf=ae;var oe=function(e){function n(t){e.call(this),this.val=t}return v(n,e),n.prototype.check=function(e){var n=typeof e;return null===e||void 0===e?r():(Array.isArray(e)&&(n="array"),n===this.val?r():i(t.messageRegistry.TYPE_EXPECTED,this,{typeName:this.val}))},n.prototype.value=function(){return this.val},n.prototype.requiredType=function(){return t.ANY},n.prototype.facetName=function(){return"typeOf"},n.prototype.composeWith=function(e){if(e instanceof n){return e.val==this.val?this:this.nothing(e)}return null},n.prototype.toString=function(){return"should be of type "+this.val},n}(ae);t.TypeOfRestriction=oe;var se=function(e){function n(){e.call(this)}return v(n,e),n.prototype.check=function(e){return"number"==typeof e&&p(e)?r():i(t.messageRegistry.INTEGER_EXPECTED,this)},n.prototype.requiredType=function(){return t.ANY},n.prototype.value=function(){return!0},n.prototype.facetName=function(){return"should be integer"},n}(ae);t.IntegerRestriction=se;var ue=function(e){function n(){e.call(this)}return v(n,e),n.prototype.check=function(e){return null===e||void 0==e||"null"===e?r():i(t.messageRegistry.NULL_EXPECTED,this)},n.prototype.requiredType=function(){return t.ANY},n.prototype.value=function(){return!0},n.prototype.facetName=function(){return"should be null"},n}(ae);t.NullRestriction=ue;var ce=function(e){function n(){e.call(this)}return v(n,e),n.prototype.check=function(e){return e?"number"==typeof e||"boolean"==typeof e||"string"==typeof e?r():i(t.messageRegistry.SCALAR_EXPECTED,this):r()},n.prototype.requiredType=function(){return t.ANY},n.prototype.facetName=function(){return"should be scalar"},n.prototype.value=function(){return!0},n}(ae);t.ScalarRestriction=ce;var le=function(e){function n(t,n,r){e.call(this),this.val=t,this._extraMessage=n,this._extraOptionMessage=r}return v(n,e),n.prototype.check=function(e,t){for(var n=this,a=new T(T.OK,"","",this),o=[],s=0;s0){for(var c=0,l=o;c=0&&(n=n.substring(r+1)),e._annotationsMap[n]=t})),this._annotationsMap},e.prototype.annotations=function(){var e=this;return this._annotations||(this._annotations=this._type.meta().filter(function(e){return e.kind()==A.MetaInformationKind.Annotation}).map(function(t){return new ve(t,e.reg)})),this._annotations},e.prototype.value=function(){return _e.storeAsJSON(this._type)},e.prototype.name=function(){return this._type.name()},e.prototype.entry=function(){return this._type},e}();t.AnnotatedType=ge;var ve=function(){function e(e,t){this.actual=e}return e.prototype.name=function(){return this.actual.facetName()},e.prototype.value=function(){return this.actual.value()},e.prototype.definition=function(){return te.get(this.actual.facetName())},e.prototype.annotation=function(){return this.actual},e}();t.AnnotationInstance=ve,t.applyAnnotationValidationPlugins=y,t.applyTypeValidationPlugins=_},function(e,t,n){"use strict";function r(e,t){return f.serializeToXML(e,t)}function i(e,t){if("string"==typeof e&&(t.isObject()||t.isArray()||t.isExternal()||t.isUnion())){var n=e,r=n.trim().charAt(0);if("{"==r||"["==r||"null"==n.trim())try{return JSON.parse(n)}catch(e){if(t.isObject()||t.isArray()){var i=s.error(u.CAN_NOT_PARSE_JSON,this,{msg:e.message});return i}}if("<"==r)try{var a=f.readObject(n,t),o=f.getXmlErrors(a);if(o){var c=s.error(u.INVALID_XML,null);return o.forEach(function(e){return c.addSubStatus(e)}),c}return a}catch(e){}}return t.getExtra(d.REPEAT)&&(e=[e]),e}function a(e,t,n){t?s.setValidationPath(e,{name:"examples",child:{name:n}}):s.setValidationPath(e,{name:"examples",child:{name:n,child:{name:"value"}}})}var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},s=n(6),u=s.messageRegistry,c=n(6),l=n(8),p=n(1),f=n(343),d=n(48),m=function(e){function t(t,n,r){void 0===r&&(r=!1),e.call(this,r),this._name=t,this._value=n}return o(t,e),t.prototype.value=function(){return this._value},t.prototype.requiredType=function(){return s.ANY},t.prototype.facetName=function(){return this._name},t.prototype.kind=function(){return null},t}(s.TypeInformation);t.MetaInfo=m;var h=function(e){function t(t){e.call(this,"description",t)}return o(t,e),t.prototype.kind=function(){return d.MetaInformationKind.Description},t}(m);t.Description=h;var y=function(e){function t(){e.call(this,"notScalar",!0)}return o(t,e),t.prototype.kind=function(){return d.MetaInformationKind.NotScalar},t}(m);t.NotScalar=y;var _=function(e){function t(t){e.call(this,"displayName",t)}return o(t,e),t.prototype.kind=function(){return d.MetaInformationKind.DisplayName},t}(m);t.DisplayName=_;var g=function(e){function t(t){e.call(this,"usage",t)}return o(t,e),t.prototype.kind=function(){return d.MetaInformationKind.Usage},t}(m);t.Usage=g;var v=function(e){function t(t,n){e.call(this,t,n)}return o(t,e),t.prototype.validateSelf=function(t,n){void 0===n&&(n=!1);var r=t.get(this.facetName());if(!r)return s.error(u.UNKNOWN_ANNOTATION,this,{facetName:this.facetName()});var i=s.ok(),a=this.value();a||r.isString()&&(a="");var o=r.metaOfType(N),c=n?"Example":"TypeDeclaration";if(o.length>0){var l=[];if(0==o.filter(function(e){var t=e.value();return Array.isArray(t)?(l=l.concat(t),t.indexOf(c)>=0):(l.push(t),t==c)}).length){var p=l.map(function(e){return"'"+e+"'"}).join(", "),f=s.error(u.INVALID_ANNOTATION_LOCATION,this,{aName:e.prototype.facetName.call(this),aValues:p});i.addSubStatus(f)}}var d=r.validateDirect(a,!0,!1);if(!d.isOk()){var m=s.error(u.INVALID_ANNOTATION_VALUE,this,{msg:d.getMessage()});m.addSubStatus(d),i.addSubStatus(m)}return s.setValidationPath(i,{name:"("+this.facetName()+")"}),i},t.prototype.kind=function(){return d.MetaInformationKind.Annotation},t.prototype.ownerFacet=function(){return this._ownerFacet},t.prototype.setOwnerFacet=function(e){this._ownerFacet=e},t}(m);t.Annotation=v;var b=function(e){function t(t,n,r,i){void 0===i&&(i=!1),e.call(this,t,n,!0),this.name=t,this._type=n,this.optional=r,this.builtIn=i}return o(t,e),t.prototype.actualName=function(){return"?"==this.name.charAt(this.name.length-1)?this.name.substr(0,this.name.length-1):this.name},t.prototype.isOptional=function(){return this.optional},t.prototype.type=function(){return this._type},t.prototype.kind=function(){return d.MetaInformationKind.FacetDeclaration},t.prototype.isBuiltIn=function(){return this.builtIn},t}(m);t.FacetDeclaration=b;var S=function(e){function t(t,n){e.call(this,t,n,!0)}return o(t,e),t.prototype.kind=function(){return d.MetaInformationKind.CustomFacet},t}(m);t.CustomFacet=S;var A=[{propName:"strict",propType:"boolean",messageEntry:u.STRICT_BOOLEAN},{propName:"displayName",propType:"string",messageEntry:u.DISPLAY_NAME_STRING},{propName:"description",propType:"string",messageEntry:u.DESCRIPTION_STRING}],T=function(e){function t(t){e.call(this,"example",t)}return o(t,e),t.prototype.validateSelf=function(e){var t=s.ok();t.addSubStatus(this.validateValue(e));var n=this.validateAnnotations(e);return s.setValidationPath(n,{name:this.facetName()}),t.addSubStatus(n),t},t.prototype.validateValue=function(e){var t=this.value(),n=!1,r=s.ok();if("object"==typeof t&&t&&t.value){for(var a=0,o=A;a2&&"("==e.charAt(0)&&")"==e.charAt(e.length-1)}),i=0,a=r;i0&&m.forEach(function(e){return l[e.value()]=!0})}var h=e[o];if(!l[h]){var y=s.error(c.Status.CODE_INCORRECT_DISCRIMINATOR,this,{rootType:r.name(),value:h,propName:o},c.Status.WARNING);return s.setValidationPath(y,{name:o,child:n}),y}return s.ok()}var _=s.error(c.Status.CODE_MISSING_DISCRIMINATOR,this,{rootType:r.name(),propName:o});return s.setValidationPath(_,n),_}return s.ok()},t.prototype.facetName=function(){return"discriminatorValue"},t.prototype.validateSelf=function(t){var n=e.prototype.validateSelf.call(this,t);if(this.strict){var r=this.owner().oneMeta(R);if(this.owner().isSubTypeOf(s.OBJECT))if(this.owner().getExtra(s.GLOBAL)===!1)n.addSubStatus(s.error(u.DISCRIMINATOR_FOR_INLINE,this));else if(r){var i=p.find(this.owner().meta(),function(e){return e instanceof l.PropertyIs&&e.propertyName()==r.value()});if(i){var a=i.value().validate(this.value());a.isOk()||n.addSubStatus(s.error(u.INVALID_DISCRIMINATOR_VALUE,this,{msg:a.getMessage()}))}}else n.addSubStatus(s.error(u.DISCRIMINATOR_VALUE_WITHOUT_DISCRIMINATOR,this));else n.addSubStatus(s.error(u.DISCRIMINATOR_FOR_OBJECT,this))}return n.getValidationPath()||s.setValidationPath(n,{name:this.facetName()}),n},t.prototype.requiredType=function(){return s.OBJECT},t.prototype.value=function(){return this._value},t.prototype.kind=function(){return d.MetaInformationKind.DiscriminatorValue},t.prototype.isStrict=function(){return this.strict},t}(s.Constraint);t.DiscriminatorValue=I},function(e,t,n){"use strict";function r(){return A.length>0?A[A.length-1]:null}function i(e){for(var t;e;)t=e.owner(),e=t instanceof p.InheritedType?t.contextMeta():null;A.push(t)}function a(e){for(void 0===e&&(e=0);A.length>e;)A.pop()}function o(){return A.length}function s(e){return parseFloat(e)==parseInt(e)&&!isNaN(e)}function u(e){e=e.map(function(e){return e.preoptimize()});var t=[];e.forEach(function(e){if(e instanceof h.AndRestriction){e.options().forEach(function(e){t.push(e)})}else t.push(e)});for(var n=!0;n;){n=!1;for(var r=0;r0)&&i.length>0){var a=new p.Status(p.Status.OK,"","",this);return i.forEach(function(e){var n=p.error(f.UNKNOWN_PROPERTY,t,{propName:e});p.setValidationPath(n,{name:e}),a.addSubStatus(n)}),a}}return p.ok()},t.prototype.composeWith=function(e){if(!this._value)return null;if(e instanceof t){var n=e;if(m.isEqual(this.owner().propertySet(),n.owner().propertySet()))return n}if(e instanceof b){var r=e,i=r.value();if(this.owner().propertySet().indexOf(i)==-1)return this.nothing(r)}},t}(p.Constraint);t.KnownPropertyRestriction=v;var b=function(e){function t(t){e.call(this),this.name=t}return l(t,e),t.prototype.check=function(e){return e&&"object"==typeof e&&!Array.isArray(e)?e.hasOwnProperty(this.name)?p.ok():p.error(f.REQUIRED_PROPERTY_MISSING,this,{propName:this.name}):p.ok()},t.prototype.requiredType=function(){return p.OBJECT},t.prototype.facetName=function(){return"hasProperty"},t.prototype.value=function(){return this.name},t.prototype.composeWith=function(e){if(e instanceof t){if(e.name===this.name)return this}return null},t}(p.Constraint);t.HasProperty=b;var S=function(e){function t(t,n,r){void 0===r&&(r=!1),e.call(this,n),this.name=t,this.type=n,this.optional=r}return l(t,e),t.prototype.matches=function(e){return e===this.name},t.prototype.path=function(){return this.name},t.prototype.check=function(e,t){if(e&&"object"==typeof e&&e.hasOwnProperty(this.name)){var n=this.validateProp(e,this.name,this.type,t);return!n.isOk()&&this.optional&&null==e[this.name]?p.ok():n}return p.ok()},t.prototype.requiredType=function(){return p.OBJECT},t.prototype.propId=function(){return this.name},t.prototype.propertyName=function(){return this.name},t.prototype.facetName=function(){return"propertyIs"},t.prototype.value=function(){return this.type},t.prototype.composeWith=function(e){if(e instanceof t){var n=e;if(n.name===this.name){if(this.type.typeFamily().indexOf(n.type)!=-1)return n;if(n.type.typeFamily().indexOf(this.type)!=-1)return this;i(e);var r=this.intersect(this.type,n.type);try{var a=r.checkConfluent();if(!a.isOk()){return a.toRestriction()}return new t(this.name,r)}finally{this.release(r)}}}return null},t}(_);t.PropertyIs=S;var A=[];t.anotherRestrictionComponent=r,t.releaseAnotherRestrictionComponent=a,t.anotherRestrictionComponentsCount=o;var T=function(e){function t(t,n){e.call(this,n),this.regexp=t,this.type=n}return l(t,e),t.prototype.path=function(){return"/"+this.regexp+"/"},t.prototype.matches=function(e){return!!e.match(this.regexp)},t.prototype.requiredType=function(){return p.OBJECT},t.prototype.propId=function(){return"["+this.regexp+"]"},t.prototype.facetName=function(){return"mapPropertyIs"},t.prototype.value=function(){return this.type},t.prototype.regexpValue=function(){return this.regexp},t.prototype.validateSelf=function(t){var n=this.checkValue();return n?p.error(f.INVALID_REGEXP,this,{msg:n}):e.prototype.validateSelf.call(this,t)},t.prototype.checkValue=function(){try{new RegExp(this.regexp)}catch(e){return e.message}return null},t.prototype.composeWith=function(e){if(e instanceof t){var n=e;if(n.regexp===this.regexp){if(this.type.typeFamily().indexOf(n.type)!=-1)return n;if(n.type.typeFamily().indexOf(this.type)!=-1)return this;var r=this.intersect(this.type,n.type);try{var i=r.checkConfluent();if(!i.isOk()){return i.toRestriction()}return new t(this.regexp,r)}finally{this.release(r)}}}return null},t.prototype.check=function(e,t){if(e&&"object"==typeof e){var n={};null!=this._owner&&this._owner.meta().filter(function(e){return e instanceof S}).forEach(function(e){n[e.propertyName()]=!0});for(var r=new p.Status(p.Status.OK,"","",this),i=0,a=Object.getOwnPropertyNames(e);i0){var a=(this.owner(),m.find(this.requiredTypes(),function(e){return n.checkOwner(e)}));a&&(i=!0)}else i=!0;var o;if(i)o=this.checkValue();else{var s=this.requiredType().name();this.requiredTypes()&&this.requiredTypes().length>0&&(s="["+this.requiredTypes().map(function(e){return e.name()}).join()+"]");var o=p.error(f.FACET_USAGE_RESTRICTION,this,{facetName:this.facetName(),typeNames:s})}if(o&&!o.isOk())return p.setValidationPath(o,{name:this.facetName()}),o;var u=[r,o].filter(function(e){return e&&!e.isOk()});if(0==u.length)return p.ok();if(1==u.length)return u[0];for(var c=p.ok(),l=0,d=u;lt)return this.createError();return p.ok()},t.prototype.createError=function(){return new y.Status(y.Status.ERROR,f.MINMAX_RESTRICTION_VIOLATION.code,this.toString(),this)},t.prototype.minValue=function(){return this._isInt?0:Number.NEGATIVE_INFINITY},t.prototype.requiredType=function(){return this._requiredType},t.prototype.checkValue=function(){return"number"!=typeof this._value?p.error(f.FACET_REQUIRE_NUMBER,this,{facetName:this.facetName()},p.Status.ERROR,!0):this.isIntConstraint()&&!s(this.value())?p.error(f.FACET_REQUIRE_INTEGER,this,{facetName:this.facetName()},p.Status.ERROR,!0):this.value()n.value()?n:this;if(n.facetName()===this._opposite)if(this.isMax()){if(n.value()>this.value())return this.nothing(e)}else if(n.value()0?new t(r):this.nothing(e,"no common file types")}return null},t.prototype.value=function(){return this._value},t.prototype.checkValue=function(){return p.ok()},t.prototype.toString=function(){return"supported file types: "+this._value.join(", ")},t}(C);t.FileTypes=B;var K=function(e){function t(t){e.call(this),this._value=t}return l(t,e),t.prototype.facetName=function(){return"format"},t.prototype.requiredType=function(){return p.SCALAR},t.prototype.requiredTypes=function(){return[p.NUMBER,p.INTEGER,p.DATETIME]},t.prototype.check=function(e){return p.ok()},t.prototype.composeWith=function(e){if(e instanceof t){return e._value===this._value?this:this.nothing(e,"Format restrictions can not be composed at one type")}return null},t.prototype.value=function(){return this._value},t.prototype.checkValue=function(){var e=this;try{var t=[];if(this.owner().isSubTypeOf(p.INTEGER))t=["int32","int64","int","int16","int8"];else if(this.owner().isSubTypeOf(p.NUMBER))t=["int32","int64","int","long","float","double","int16","int8"];else{if(!this.owner().isSubTypeOf(p.DATETIME))return null;t=["rfc3339","rfc2616"]}if(!m.find(t,function(t){return t==e.value()}))return p.error(f.ALLOWED_FORMAT_VALUES,this,{allowedValues:t.map(function(e){return"'"+e+"'"}).join(", ")},p.Status.ERROR,!0)}catch(e){return new y.Status(y.Status.ERROR,"",e.message,this)}return null},t.prototype.toString=function(){return"should have format:"+this.value},t}(C);t.Format=K;var V=function(e){function t(t){e.call(this),this._value=t}return l(t,e),t.prototype.facetName=function(){return"enum"},t.prototype.requiredType=function(){return p.ANY},t.prototype.check=function(e){if(!this.checkStatus){var t=this.value();if(Array.isArray(t)||(t=[t]),!t.some(function(t){return t==e})){var n=Array.isArray(this._value)?this._value.map(function(e){return"'"+e+"'"}).join(", "):"'"+this._value+"'";return p.error(f.ENUM_RESTRICTION,this,{values:n})}}return p.ok()},t.prototype.composeWith=function(e){if(e instanceof t){var n=e,r=m.intersection(this._value,n._value);return 0==r.length?this.nothing(e):new t(r)}return null},t.prototype.value=function(){return this._value},t.prototype.checkValue=function(){var e=this;if(!this.owner().isSubTypeOf(this.requiredType()))return p.error(f.ENUM_OWNER_TYPES,this,{typeNames:this.requiredType().name()},p.Status.ERROR,!0);if(this.requiredTypes()&&this.requiredTypes().length>0){var t=this.owner();if(!m.find(this.requiredTypes(),function(e){return t.isSubTypeOf(e)})){var n="["+this.requiredTypes().map(function(e){return"'"+e.name()+"'"}).join(", ")+"]";return p.error(f.ENUM_OWNER_TYPES,this,{typeNames:n},p.Status.ERROR,!0)}}if(!Array.isArray(this._value))return p.error(f.ENUM_ARRAY,this,{},p.Status.ERROR,!0);var r=p.ok();this.checkStatus=!0;try{this._value.forEach(function(t,n){var i=e.owner().validate(t);i.isOk()||(p.setValidationPath(i,{name:n}),r.addSubStatus(i))})}finally{this.checkStatus=!1}return r},t.prototype.toString=function(){return"value should be one of: "+(Array.isArray(this._value)?this._value.map(function(e){return"'"+e+"'"}).join(", "):"'"+this._value+"'")},t}(C);t.Enum=V,t.optimize=u},function(e,t,n){"use strict";function r(){return new W}function i(e){if(null==e)return null;switch(e.kind){case N.Kind.SCALAR:return{errors:[],startPosition:e.startPosition,endPosition:e.endPosition,value:e.value,kind:N.Kind.SCALAR,parent:e.parent};case N.Kind.MAPPING:var t=e;return{errors:[],key:i(t.key),value:i(t.value),startPosition:t.startPosition,endPosition:t.endPosition,kind:N.Kind.MAPPING,parent:t.parent};case N.Kind.MAP:var n=e;return{errors:[],startPosition:e.startPosition,endPosition:e.endPosition,mappings:n.mappings.map(function(e){return i(e)}),kind:N.Kind.MAP,parent:n.parent}}return e}function a(e){return e.match(/^.*((\r\n|\n|\r)|$)/gm)}function o(e,t){for(var n=a(e),r=[],i=0;i0?i[0]:null})}var A=n(20),T=n(11),E=n(162),C=n(47),N=n(14),w=n(1),k=n(64),x=n(4),R=n(141),I=n(28),D=n(15),M=n(142),P=n(327),L=n(3),O=n(25),U=n(60),F=N.YAMLException;t.Kind={SCALAR:N.Kind.SCALAR};var B=function(){function e(e){this.text="",this.indent=e}return e.prototype.isLastNL=function(){return this.text.length>0&&"\n"==this.text[this.text.length-1]},e.prototype.addWithIndent=function(e,t){this.isLastNL()&&(this.text+=k.indent(e),this.text+=this.indent),this.text+=t},e.prototype.addChar=function(e){this.isLastNL()&&(this.text+=this.indent),this.text+=e},e.prototype.append=function(e){for(var t=0;t300&&a<400){var o=n.getResponseHeader("location");if(o)return e.url=o,this.execute(e,!1)}return{status:a,statusText:n.statusText,headers:n.getAllResponseHeaders().split("\n").map(function(e){var t=e.indexOf(":");return{name:e.substring(0,t).trim(),value:e.substring(t+1).trim()}}),content:{text:n.responseText,mimeType:n.responseType}}},e.prototype.appendParams=function(e,t){var n=e.queryString&&e.queryString.length>0;if(n){t+="?";var r=[];n&&(r=r.concat(e.queryString.map(function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)}))),t+=r.join("&")}return t},e.prototype.log=function(e,t){},e.prototype.executeAsync=function(e,t){void 0===t&&(t=!0);var n=r(),i=e.url;t&&(i=this.appendParams(e,e.url));var a=this;return new Promise(function(t,r){n.open(e.method,i,!0),n.onload=function(){t({status:n.status,statusText:n.statusText,headers:n.getAllResponseHeaders().split("\n").map(function(e){var t=e.indexOf(":");return{name:e.substring(0,t).trim(),value:e.substring(t+1).trim()}}),content:{text:n.responseText,mimeType:n.responseType}})},n.onerror=function(){r(new F("Network Error"))},a.doRequest(e,n)})},e.prototype.doRequest=function(e,t){if(e.headers&&e.headers.forEach(function(e){return t.setRequestHeader(e.name,e.value)}),e.postData)if(e.postData.params){var n=e.postData.params.map(function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)}).join("&");t.send(n)}else t.send(e.postData.text);else t.send()},e}();t.SimpleExecutor=q;var z=function(){function e(){this.executor=new q}return e.prototype.getResource=function(e){if("undefined"!=typeof atom&&null!=atom){var t=I.get(e);if(t)return t;I.addNotify(e);try{var n={content:""};return this.getResourceAsync(e).then(function(t){try{t.errorMessage?I.set(e,{content:null,errorMessage:null}):(t.errorMessage=null,I.set(e,t))}finally{n.callback&&n.callback(I.get(e)),I.removeNotity(e)}},function(t){I.set(e,{content:null,errorMessage:null}),n.callback&&n.callback(I.get(e)),I.removeNotity(e)}),n}catch(e){console.log("Error"),console.log(e)}}var r=this.executor.execute({method:"get",url:e});if(!r)throw new F("Unable to execute GET "+e);return this.toResponse(r,e)},e.prototype.getResourceAsync=function(e){var t=this;return this.executor.executeAsync({method:"get",url:e}).then(function(n){return n?t.toResponse(n,e):Promise.reject(new F("Unable to execute GET "+e))},function(t){return Promise.reject(new F("Unable to execute GET "+e))})},e.prototype.toResponse=function(e,t){var n=null;e.status>=400&&(n="GET "+t+"\nreturned error: "+e.status,e.statusText&&(n+=" "+e.statusText));var r=null;return e.content&&e.content.text&&(r=e.content.text),{content:r,errorMessage:n}},e}();t.HTTPResolverImpl=z;var H=function(){function e(){}return e.prototype.content=function(e){if("string"!=typeof e&&(e=""+e),!C.existsSync(e))return null;try{return C.readFileSync(e).toString()}catch(e){return null}},e.prototype.list=function(e){return C.readdirSync(e)},e.prototype.contentAsync=function(e){return new Promise(function(t,n){C.readFile(e,function(e,r){if(null!=e)return n(e);t(r.toString())})})},e.prototype.listAsync=function(e){return new Promise(function(t,n){C.readdir(e,function(e,r){if(null!=e)return t(e);n(r)})})},e}();t.FSResolverImpl=H;var Y=function(e,t,n){if(t&&(t.startPosition>=e&&(t.startPosition+=n),t.endPosition>e&&(t.endPosition+=n),t.kind==N.Kind.MAPPING)){var r=t;Y(e,r.key,n),Y(e,r.value,n)}},J=function(e,t){for(var n="",r=e.start()-1;r>0;){var i=t[r];if(" "!=i&&"-"!=i)break;n=" "+n,r--}return n},G=function(){function e(e,t,n){this.rootPath=e,this.resolver=t,this._httpResolver=n,this.listeners=[],this.tlisteners=[],this.pathToUnit={},this.failedUnits={},this._fsEnabled=!0,this._namespaceResolver=new U.NamespaceResolver,null==this.resolver?this.resolver=new H:this._fsEnabled=!1,null==this._httpResolver&&(this._httpResolver=new z)}return e.prototype.getRootPath=function(){return this.rootPath},e.prototype.setFSResolver=function(e){this.resolver=e},e.prototype.setHTTPResolver=function(e){this._httpResolver=e},e.prototype.fsEnabled=function(){return this._fsEnabled},e.prototype.cloneWithResolver=function(t,n){void 0===n&&(n=null);var r=new e(this.rootPath,t,n?n:this._httpResolver);for(var i in this.pathToUnit)r.pathToUnit[i]=this.pathToUnit[i].cloneToProject(r);return r},e.prototype.setCachedUnitContent=function(e,t,n){void 0===n&&(n=!0);var r=e,i=A.toAbsolutePath(this.rootPath,e),a=new K(r,t,n,this,i);return this.pathToUnit[i]=a,a},e.prototype.resolveAsync=function(e,t){var n=this;if(!t)return Promise.reject(new F("Unit path is null"));var r=M.getIncludeReference(t),i=t;r&&(t=r.getIncludePath());var a=A.buildPath(t,e,this.rootPath);if(r){var o=A.toAbsolutePath(T.dirname(A.toAbsolutePath(this.rootPath,e)),r.encodedName());this.pathToUnit[a]?Promise.resolve(void 0).then(function(e){return n.pathToUnit[o]=new K(r.encodedName(),M.resolveContents(i,n.pathToUnit[a].contents()),!1,n,o),n.pathToUnit[o]}):this.unitAsync(a,!0).then(function(e){return n.pathToUnit[a]=e,n.pathToUnit[o]=new K(r.encodedName(),M.resolveContents(i,n.pathToUnit[a].contents()),!1,n,o),n.pathToUnit[o]})}return this.unitAsync(a,!0)},e.prototype.resolve=function(e,t){if(!t)return null;t=t.replace(/\\/g,"/");var n=M.getIncludeReference(t),r=t;n&&(t=n.getIncludePath());var i=A.buildPath(t,e,this.rootPath);if(n){this.pathToUnit[i]||(this.pathToUnit[i]=this.unit(i,!0));var a=this.pathToUnit[i],o=A.toAbsolutePath(T.dirname(A.toAbsolutePath(this.rootPath,e)),n.encodedName());return this.pathToUnit[o]?this.pathToUnit[o]:(this.pathToUnit[o]=new K(n.encodedName(),M.resolveContents(r,a&&a.contents()),!1,this,o),this.pathToUnit[o])}return this.unit(i,!0)},e.prototype.units=function(){var e=this;if(!this.resolver.list)throw new F("Provided FSResolver is unable to list files. Please, use ExtendedFSResolver.");return this.resolver.list(this.rootPath).filter(function(e){return".raml"==T.extname(e)}).map(function(t){return e.unit(t)}).filter(function(e){return e.isTopLevel()})},e.prototype.unitsAsync=function(){var e=this;return this.resolver.listAsync?this.resolver.listAsync(this.rootPath).then(function(t){var n=t.filter(function(e){return".raml"==T.extname(e)}).map(function(t){return e.unitAsync(t).then(function(e){return e.isTopLevel()?e:null},function(e){return null})});return Promise.all(n).then(function(e){return e.filter(function(e){return null!=e})})}):Promise.reject(new F("Provided FSResolver is unable to list files. Please, use ExtendedFSResolver."))},e.prototype.lexerErrors=function(){var e=[];return this.units().forEach(function(t){e=e.concat(t.lexerErrors())}),e},e.prototype.deleteUnit=function(e,t){void 0===t&&(t=!1);var n=null;n=A.isWebPath(e)?e:t?e:A.toAbsolutePath(this.rootPath,e),delete this.pathToUnit[n]},e.prototype.unit=function(e,t){if(void 0===t&&(t=!1),t||A.isWebPath(e)){if(null!=this.failedUnits[e]&&!this.failedUnits[e].inner)return null}else{var n=A.toAbsolutePath(this.rootPath,e);if(this.failedUnits[n]&&!this.failedUnits[e].inner)return null}var r,i=null,a=e;if(A.isWebPath(e)){if(this.pathToUnit[a])return this.pathToUnit[a];if(this._httpResolver){if((r=this._httpResolver.getResource(e))&&r.errorMessage)throw new F(r.errorMessage);i=r?r.content:null}else r=(new z).getResource(a),i=r?r.content:null}else{"/"!=e.charAt(0)||t||(e=e.substr(1));var a=A.toAbsolutePath(this.rootPath,e);if(this.pathToUnit[a])return this.pathToUnit[a];if(A.isWebPath(a))if(this._httpResolver){var o=this._httpResolver.getResource(a);if(o&&o.errorMessage)throw new F(o.errorMessage);i=o?o.content:null}else{var s=(new z).getResource(a);i=s?s.content:null}else i=this.resolver.content(a)}if(null==i)return null;var u=D.stringStartsWith(i,"#%RAML"),c=A.isWebPath(this.rootPath)==A.isWebPath(a)?T.relative(this.rootPath,a):a,l=new K(c,i,u,this,a);return this.pathToUnit[a]=l,r&&(r.callback=function(e){l.updateContent(e&&e.content)}),l},e.prototype.unitAsync=function(e,t){var n=this;void 0===t&&(t=!1);var r=null,i=e;if(A.isWebPath(e)){if(this.pathToUnit[i])return Promise.resolve(this.pathToUnit[i]);if(this._httpResolver){var a=this._httpResolver.getResourceAsync(i);r=a.then(function(e){return e.errorMessage?Promise.reject(new F(e.errorMessage)):e.content})}else r=(new z).getResourceAsync(i)}else{if("/"!=e.charAt(0)||t||(e=e.substr(1)),i=t?e:A.toAbsolutePath(this.rootPath,e),this.pathToUnit[i])return Promise.resolve(this.pathToUnit[i]);if(A.isWebPath(i))if(this._httpResolver){var a=this._httpResolver.getResourceAsync(i);r=a.then(function(e){return e.errorMessage?Promise.reject(new F(e.errorMessage)):e.content})}else r=(new z).getResourceAsync(i);else r=this.resolver.contentAsync(i)}if(null==r)return Promise.resolve(null);var o=A.isWebPath(this.rootPath)==A.isWebPath(i)?T.relative(this.rootPath,i):i;return r.then(function(e){if(null==e)return Promise.reject(new F("Can note resolve "+i));var t=D.stringStartsWith(e,"#%RAML"),r=new K(o,e,t,n,i);return n.pathToUnit[i]=r,r},function(e){return"object"==typeof e&&e instanceof F?Promise.reject(e):Promise.reject(new F(e.toString()))}).then(function(e){return e.isRAMLUnit()?e:P.isScheme(e.contents())?P.startDownloadingReferencesAsync(e.contents(),e):e})},e.prototype.visualizeNewlines=function(e){for(var t="",n=0;n1&&r[1].trim().length>0){return n+s(r[1])}return n+" "},e.prototype.startIndent=function(e){e.unit().contents();if(e==e.root())return"";var t=a(e.dump());if(t.length>0){console.log("FIRST: "+t[0]);return s(t[0])+" "}return""},e.prototype.canWriteInOneLine=function(e){return!1},e.prototype.isOneLine=function(e){return e.text().indexOf("\n")<0},e.prototype.recalcPositionsUp=function(e){for(var t=e;t;)t.recalcEndPositionFromChilds(),t=t.parent()},e.prototype.add2=function(e,t,n,r,i){void 0===i&&(i=!1);var a=e.unit(),o=(e.root(),null);if(r&&(X.isInstance(r)&&(o=r),Q.isInstance(r)&&(o=r.point)),e.isValueInclude()){var s=e.children();if(0==s.length)throw new F("not implemented: insert into empty include ref");var u=s[0].parent();return void this.add2(u,t,n,o,i)}var c=(new k.TextRange(a.contents(),t.start(),t.end()),new k.TextRange(a.contents(),e.start(),e.end()),e.unit().contents());e.valueKind()==N.Kind.SEQ&&(e=d(e.valueAsSeq(),e,e.unit()));var i=this.isJson(e),l=i?"":this.indent(e.isSeq()?e.parent():e),p=l,f=l.length,m=e.isSeq()||e.isMapping()&&(e.isValueSeq()||e.isValueScalar()||!e.asMapping().value);(n=n)&&(i||m&&(p+=" ",f+=2));var h=new B(p);t.markupNode(h,t._actualNode(),0,i);var y=h.text;if(n){var _=k.trimEnd(y),g=y.length-_.length;if(g>0){var v=y.length;y=y.substring(0,v-g),t.shiftNodes(v-g,-g)}}n&&!i?(t.highLevelNode(),e.isMapping(),y=e.isSeq()||e.isMapping()&&(e.isValueSeq()||e.isValueScalar()||!e.asMapping().value)?l+"- "+y:l+y):y=l+y;var b=e.end();if(o)o!=e?b=o.end():i&&n||(b=e.keyEnd()+1,b=new k.TextRange(c,b,b).extendAnyUntilNewLines().endpos());else if(i&&n){var S=e.asSeq();S&&(b=S.items.length>0?S.items[S.items.length-1].endPosition:S.endPosition-1)}else if(r&&Q.isInstance(r)){var A=r;A.type==$.START&&(b=e.keyEnd()+1,b=new k.TextRange(c,b,b).extendAnyUntilNewLines().endpos())}if(b=new k.TextRange(c,0,b).extendToNewlines().reduceSpaces().endpos(),i&&e.isSeq()){var S=e.asSeq();S.items.length>0&&(y=", "+y,f+=2)}else b>0&&"\n"!=c[b-1]&&(y="\n"+y,f++);var T=0;n&&!i&&(y+="\n",T++);var E=c.substring(0,b)+y+c.substring(b,c.length),C=a;if(C.updateContentSafe(E),this.executeReplace(new k.TextRange(c,b,b),y,C),e.root().shiftNodes(b,f+(t.end()-t.start())+T),o){for(var s=e.children(),w=-1,x=0;x=0?e.addChild(t,w+1):e.addChild(t)}else e.addChild(t);t.shiftNodes(0,b+f),this.recalcPositionsUp(e),t.setUnit(e.unit()),t.visit(function(t){return t.setUnit(e.unit()),!0})},e.prototype.isJsonMap=function(e){if(!e.isMap())return!1;var t=e.text().trim();return t.length>=2&&"{"==t[0]&&"}"==t[t.length-1]},e.prototype.isJsonSeq=function(e){if(!e.isSeq())return!1;var t=e.text().trim();return t.length>=2&&"["==t[0]&&"]"==t[t.length-1]},e.prototype.isJson=function(e){return this.isJsonMap(e)||this.isJsonSeq(e)},e.prototype.remove=function(e,t,n){var r=n.parent();if(n._oldText=n.dump(),this.isOneLine(n)&&n.isMapping()&&n.parent().isMap()){var i=n.parent();if(1==i.asMap().mappings.length&&null!=i.parent())return void this.remove(e,i.parent(),i)}if(this.isOneLine(n)&&n.isScalar()&&n.parent().isSeq()){var a=n.parent();if(1==a.asSeq().items.length)return void this.remove(e,a.parent(),a)}if(t.isMapping()&&n.isSeq()){var o=t.parent();return void this.remove(e,o,t)}var s=new k.TextRange(e.contents(),n.start(),n.end()),u=(new k.TextRange(e.contents(),t.start(),t.end()),new k.TextRange(e.contents(),r.start(),r.end()),s.startpos());if(t.isSeq()){var c=n.isSeq()?n:n.parentOfKind(N.Kind.SEQ);s=c&&this.isJson(c)?s.extendSpaces().extendCharIfAny(",").extendSpaces():s.extendToStartOfLine().extendAnyUntilNewLines().extendToNewlines()}t.isMap()&&(s=s.trimEnd().extendAnyUntilNewLines().extendToNewlines(),s=s.extendToStartOfLine().extendUntilNewlinesBack()),t.kind()==N.Kind.MAPPING&&(this.isJson(n)&&this.isOneLine(n)||(s=s.extendSpacesUntilNewLines(),s=s.extendToNewlines(),s=s.extendToStartOfLine().extendUntilNewlinesBack())),n.isSeq()&&(s=s.reduceSpaces());var l=e;l.updateContentSafe(s.remove()),this.executeReplace(s,"",l),n.parent().removeChild(n);var p=-s.len();t.root().shiftNodes(u,p),this.recalcPositionsUp(t)},e.prototype.changeKey=function(e,t,n){var r=new k.TextRange(t.unit().contents(),t.keyStart(),t.keyEnd());if(t.kind()==N.Kind.MAPPING){var i=t._actualNode().key;i.value=n,i.endPosition=i.startPosition+n.length}var a=e;this.executeReplace(r,n,a);var o=n.length-r.len();t.root().shiftNodes(r.startpos(),o,t),this.recalcPositionsUp(t)},e.prototype.executeReplace=function(e,t,n){var r=new A.TextChangeCommand(e.startpos(),e.endpos()-e.startpos(),t,n);n.project();try{this.tlisteners.forEach(function(e){return e(r)})}catch(e){return!1}var i=e.replace(t);return n.updateContentSafe(i),!0},e.prototype.changeValue=function(e,t,n){var r,i=new k.TextRange(t.unit().contents(),t.start(),t.end()),a=0,o=null,s=null;if(t.kind()==N.Kind.SCALAR){if("string"!=typeof n)throw new F("not implemented");t.asScalar().value=n,r=n}else if(t.kind()==N.Kind.MAPPING){if(s=t.asMapping(),t.isValueInclude()){var u=t.valueAsInclude(),c=u.value,l=c,f=t.unit().resolve(l);if(null==f)return void console.log("attr.setValue: couldn't resolve: "+l);if(f.isRAMLUnit())return;return void(M.getIncludeReference(c)||f.updateContent(n))}if(i=s.value?i.withStart(t.valueStart()).withEnd(t.valueEnd()):i.withStart(t.keyEnd()+1).withEnd(t.keyEnd()+1),i=i.reduceNewlinesEnd(),null==n)r="",s.value=null;else if("string"==typeof n||null==n){var d=n,m=this.indent(t);if(d&&k.isMultiLine(d)&&(d=""+k.makeMutiLine(d,m.length/2)),r=d,s.value){if(s.value.kind==N.Kind.SEQ){console.log("seq value");s.value.items[0];throw"assign value!!!"}if(s.value.kind==N.Kind.SCALAR){var h=s.value,y=h.value||"";h.value=d,s.value.endPosition=s.value.startPosition+d.length,s.endPosition=s.value.endPosition,a+=d.length-y.length}}else if(console.log("no value"),s.value=N.newScalar(d),s.value.startPosition=t.keyEnd()+1,s.value.endPosition=s.value.startPosition+d.length,s.endPosition=s.value.endPosition,e.contents().length>t.keyEnd()+1){var _=t.keyEnd()+1;":"==e.contents()[_-1]&&(r=" "+r,s.value.startPosition++,s.value.endPosition++,s.endPosition++,a++)}}else{var g=n;if(g.isMapping())n=p([g.asMapping()]),g=n;else if(!g.isMap())throw new F("only MAP/MAPPING nodes allowed as values");var v=new B("");g.markupNode(v,g._actualNode(),0,!0),r=""+v.text,g.shiftNodes(0,i.startpos()+a),o=g}}else console.log("Unsupported change value case: "+t.kindName());var b=e;this.executeReplace(i,r,b);var S=r.length-i.len();t.root().shiftNodes(i.endpos()+0,S,t),o&&(s.value=o._actualNode()),this.recalcPositionsUp(t)},e.prototype.initWithRoot=function(e,t){var n=e.end();t.markup(!1),t._actualNode().startPosition=n,t._actualNode().endPosition=n,t.setUnit(e.unit())},e.prototype.execute=function(e){var t=this;e.commands.forEach(function(e){switch(e.kind){case A.CommandKind.CHANGE_VALUE:var n=e.target,r=n.value();r||(r="");var i=e.value;if(console.log("set value: "+typeof r+" ==> "+typeof i),"string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r||"string"!=typeof i)if("string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r||"string"==typeof i)if("string"!=typeof r&&"string"==typeof i){var a=e.value;if(r.kind()!=N.Kind.MAPPING)throw new F("unsupported case: attribute value conversion: "+typeof r+" ==> "+typeof i+" not supported");k.isMultiLine(a)?(n.children().forEach(function(e){t.remove(n.unit(),n,e)}),t.changeValue(n.unit(),n,a)):t.changeKey(n.unit(),r,a)}else{if("string"==typeof r||"string"==typeof i)throw new F("shouldn't be this case: attribute value conversion "+typeof r+" ==> "+typeof i+" not supported");var o=i;if(o.isMapping()&&(i=p([o.asMapping()])),r==i)break;var s=i;s.asMap();n.children().forEach(function(e){t.remove(n.unit(),n,e)}),s.children().forEach(function(e){}),t.changeValue(n.unit(),n,i)}else t.changeValue(n.unit(),n,i);else r!=i&&t.changeValue(n.unit(),n,i);return;case A.CommandKind.CHANGE_KEY:var n=e.target;return void t.changeKey(n.unit(),n,e.value);case A.CommandKind.ADD_CHILD:var n=e.target,u=e.value;return void t.add2(n,u,e.toSeq,e.insertionPoint);case A.CommandKind.REMOVE_CHILD:var c=e.target,s=e.value;return void t.remove(c.unit(),c,s);case A.CommandKind.INIT_RAML_FILE:var l=e.target,f=e.value;return void t.initWithRoot(l,f);default:return void console.log("UNSUPPORTED COMMAND: "+A.CommandKind[e.kind])}})},e.prototype.replaceYamlNode=function(e,t,n,r,i){var a=N.load(t,{ignoreDuplicateKeys:!0});this.updatePositions(e.start(),a),e.root().shiftNodes(n,r);var o=e.parent(),s=e._actualNode(),u=s.parent;if(a.parent=u,o&&o.kind()==N.Kind.MAP){var c=o._actualNode();c.mappings=c.mappings.map(function(e){return e!=s?e:a})}e.updateFrom(a),this.recalcPositionsUp(e)},e.prototype.executeTextChange2=function(e){var t=e.unit,n=t.contents(),r=e.target;if(r){var i=n.substring(r.start(),r.end());n=n.substr(0,e.offset)+e.text+n.substr(e.offset+e.replacementLength);var a=i.substr(0,e.offset-r.start())+e.text+i.substr(e.offset-r.start()+e.replacementLength);if(t.updateContentSafe(n),e.offset>r.start())try{var o=e.text.length-e.replacementLength,s=e.offset;r.unit().project().replaceYamlNode(r,a,s,o,e.unit)}catch(e){console.log("New node contents (causes error below): \n"+a),console.log("Reparse error: "+e.stack)}}else n=n.substr(0,e.offset)+e.text+n.substr(e.offset+e.replacementLength);t.updateContent(n),this.listeners.forEach(function(e){e(null)}),this.tlisteners.forEach(function(t){t(e)})},e.prototype.executeTextChange=function(e){(new Date).getTime();try{var t=e.unit.contents(),n=e.target;null==n&&(n=this.findNode(e.unit.ast(),e.offset,e.offset+e.replacementLength));var r=e.unit;if(n){var a=t.substring(n.start(),n.end()),o=t;t=t.substr(0,e.offset)+e.text+t.substr(e.offset+e.replacementLength);var s=a.substr(0,e.offset-n.start())+e.text+a.substr(e.offset-n.start()+e.replacementLength);r.updateContentSafe(t);u(o,e);if(e.offset>n.start())try{var c=N.load(s,{ignoreDuplicateKeys:!0});this.updatePositions(n.start(),c);var l=e.text.length-e.replacementLength;if(e.unit.ast().shiftNodes(e.offset,l),null!=c&&c.kind==N.Kind.MAP){var p=c.mappings[0],f=n._actualNode(),d=f.parent,m=new A.ASTDelta,h=e.unit;if(m.commands=[new A.ASTChangeCommand(A.CommandKind.CHANGE_VALUE,new X(i(f),h,null,null,null),new X(p,h,null,null,null),0)],d&&d.kind==N.Kind.MAP){var y=d;y.mappings=y.mappings.map(function(e){return e!=f?e:p})}return p.parent=d,this.recalcPositionsUp(n),n.updateFrom(p),this.listeners.forEach(function(e){e(m)}),void this.tlisteners.forEach(function(t){t(e)})}}catch(e){console.log("New node contents (causes error below): \n"+s),console.log("Reparse error: "+e.stack)}}else t=t.substr(0,e.offset)+e.text+t.substr(e.offset+e.replacementLength);(new Date).getTime(); //!find node in scope r.updateContent(t),this.listeners.forEach(function(e){e(null)}),this.tlisteners.forEach(function(t){t(e)})}finally{(new Date).getTime()}},e.prototype.updatePositions=function(e,t){var n=this;if(null!=t)switch(t.startPosition==-1?t.startPosition=e:t.startPosition=e+t.startPosition,t.endPosition=e+t.endPosition,t.kind){case N.Kind.MAP:t.mappings.forEach(function(t){return n.updatePositions(e,t)});break;case N.Kind.MAPPING:var r=t;this.updatePositions(e,r.key),this.updatePositions(e,r.value);break;case N.Kind.SCALAR:break;case N.Kind.SEQ:t.items.forEach(function(t){return n.updatePositions(e,t)})}},e.prototype.findNode=function(e,t,n){var r=this;if(null==e)return null;var i=e;if(e.start()<=t&&e.end()>=n){var a=e;return i.directChildren().forEach(function(e){var i=r.findNode(e,t,n);i&&(a=i)}),a}return null},e.prototype.addTextChangeListener=function(e){this.tlisteners.push(e)},e.prototype.removeTextChangeListener=function(e){this.tlisteners=this.tlisteners.filter(function(t){return t!=e})},e.prototype.addListener=function(e){this.listeners.push(e)},e.prototype.removeListener=function(e){this.listeners=this.listeners.filter(function(t){return t!=e})},e.prototype.namespaceResolver=function(){return this._namespaceResolver},e}();t.Project=G;var X=function(){function e(e,t,n,r,i,a,o){void 0===a&&(a=!1),void 0===o&&(o=!1),this._node=e,this._unit=t,this._parent=n,this._anchor=r,this._include=i,this.cacheChildren=a,this._includesContents=o,this._errors=[]}return e.isInstance=function(t){return null!=t&&t.getClassIdentifier&&"function"==typeof t.getClassIdentifier&&w.contains(t.getClassIdentifier(),e.CLASS_IDENTIFIER)},e.prototype.getClassIdentifier=function(){return[].concat(e.CLASS_IDENTIFIER)},e.prototype.actual=function(){return this._node},e.prototype.yamlNode=function(){return this._node},e.prototype.includesContents=function(){return this._includesContents},e.prototype.setIncludesContents=function(e){this._includesContents=e},e.prototype.gatherIncludes=function(t,n,r,i){var a=this;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=!0),null!=this._node){var o=this._node.kind;if(o!=N.Kind.SCALAR)if(o==N.Kind.MAP){var s=this._node;1!=s.mappings.length||i?s.mappings.map(function(t){return new e(t,a._unit,a,r?r:a._anchor,n?n:a._include,a.cacheChildren)}).forEach(function(e){return e.gatherIncludes(t)}):new e(s.mappings[0].value,this._unit,this,n,r,this.cacheChildren).gatherIncludes(t)}else if(o==N.Kind.MAPPING){var u=this._node;null==u.value||new e(u.value,this._unit,this,r?r:this._anchor,n?n:this._include,this.cacheChildren).gatherIncludes(t)}else if(o==N.Kind.SEQ){var c=this._node;c.items.filter(function(e){return null!=e}).map(function(t){return new e(t,a._unit,a,r?r:a._anchor,n?n:a._include,a.cacheChildren)}).forEach(function(e){return e.gatherIncludes(t)})}else o==N.Kind.INCLUDE_REF&&this._unit&&t.push(this);else if(P.isScheme(this._node.value)){var l=P.getReferences(this._node.value,this.unit());l.forEach(function(n){var r=N.newScalar(n);r.kind=N.Kind.INCLUDE_REF;var i=new e(r,a.unit(),null,null,null);t.push(i)})}}},e.prototype.setHighLevelParseResult=function(e){this._highLevelParseResult=e},e.prototype.highLevelParseResult=function(){return this._highLevelParseResult},e.prototype.setHighLevelNode=function(e){this._highLevelNode=e},e.prototype.highLevelNode=function(){return this._highLevelNode},e.prototype.start=function(){return this._node.startPosition},e.prototype.errors=function(){return this._errors},e.prototype.addIncludeError=function(e){if(!w.find(this._errors,function(t){return t.message==e.message})){var t=this._node;t.includeErrors||(t.includeErrors=[]),w.find(t.includeErrors,function(t){return t.message==e.message})||(this._errors.push(e),t.includeErrors.push(e))}},e.prototype.parent=function(){return this._parent},e.prototype.recalcEndPositionFromChilds=function(){var e=(this.children(),this.children()[0]),t=this.children()[this.children().length-1];if(this.isMapping()){var n=this.asMapping();if(n.value)if(n.value.kind==N.Kind.MAP){var r=n.value;r.startPosition<0&&e&&(r.startPosition=e.start()),t&&(this._node.endPosition=t._node.endPosition),this._node.endPosition=Math.max(this._node.endPosition,n.value.endPosition)}else if(n.value.kind==N.Kind.SEQ){var i=n.value;if(i.startPosition<0&&i.items.length>0){var a=i.items[0].startPosition,o=new k.TextRange(this.unit().contents(),a,a);o=o.extendSpacesBack().extendCharIfAnyBack("-"),i.startPosition=o.startpos()}if(i.items.length>0){var s=i.items[i.items.length-1];this._node.endPosition=Math.max(this._node.endPosition,i.endPosition,s.endPosition),i.endPosition=Math.max(this._node.endPosition,i.endPosition,s.endPosition)}}else n.value.kind==N.Kind.SCALAR||t&&(this._node.endPosition=t._node.endPosition)}else t&&(this._node.endPosition=t._node.endPosition)},e.prototype.isValueLocal=function(){if(this._node.kind==N.Kind.MAPPING){var e=this._node.value.kind;return e!=N.Kind.INCLUDE_REF&&e!=N.Kind.ANCHOR_REF}return!0},e.prototype.keyStart=function(){return this._node.kind==N.Kind.MAPPING?this._node.key.startPosition:-1},e.prototype.keyEnd=function(){return this._node.kind==N.Kind.MAPPING?this._node.key.endPosition:-1},e.prototype.valueStart=function(){if(this._node.kind==N.Kind.MAPPING){var e=this.asMapping();return e.value?e.value.startPosition:e.endPosition}return this._node.kind==N.Kind.SCALAR?this.start():-1},e.prototype.valueEnd=function(){if(this._node.kind==N.Kind.MAPPING){var e=this.asMapping();return e.value?e.value.endPosition:e.endPosition}return this._node.kind==N.Kind.SCALAR?this.end():-1},e.prototype.end=function(){return this._node.endPosition},e.prototype.dump=function(){if(this._oldText)return this._oldText;if(this._unit&&this._node.startPosition>0&&this._node.endPosition>0){var e=this._unit.contents().substring(this._node.startPosition,this._node.endPosition);return e=o(e,J(this,this._unit.contents()))}return N.dump(this.dumpToObject(),{})},e.prototype.dumpToObject=function(e){return void 0===e&&(e=!1),this.dumpNode(this._node,e)},e.prototype.dumpNode=function(e,t){var n=this;if(void 0===t&&(t=!1),!e)return null;if(e.kind==N.Kind.INCLUDE_REF){if(this._unit){var r=e,i=r.value,a=null;try{a=this._unit.resolve(i)}catch(e){}if(null==a)return null;if(a.isRAMLUnit()&&this.canInclude(a)){var o=this.unit(),s=a;s.addIncludedBy(o.absolutePath()),o.getIncludedByPaths().forEach(function(e){s.addIncludedBy(e)});var u=a.ast();if(u)return u.dumpToObject(t)}else if(this.canInclude(a))return a.contents()}return null}if(e.kind==N.Kind.SEQ){var l=e,p=[];return l.items.forEach(function(e){return p.push(n.dumpNode(e,t))}),p}if(e.kind==N.Kind.ANCHOR_REF){var f=e;return this.dumpNode(f.value,t)}if(e.kind==N.Kind.MAPPING){var d=e,m={},h=d.value,y=this.dumpNode(h,t);return m[""+this.dumpNode(d.key,t)]=y,m}if(e.kind==N.Kind.SCALAR){var r=e,_=r.value;return r.plainScalar&&(_=c(_)),_}if(e.kind==N.Kind.MAP){var g=e,v={};return g.mappings&&g.mappings.forEach(function(e){var r=n.dumpNode(e.value,t);null==r&&(r=t?"!$$$novalue":r),v[n.dumpNode(e.key,t)+""]=r}),v}},e.prototype.keyKind=function(){return this._node.key?this._node.key.kind:null},e.prototype._actualNode=function(){return this._node},e.prototype.execute=function(e){this.unit()?this.unit().project().execute(e):e.commands.forEach(function(e){switch(e.kind){case A.CommandKind.CHANGE_VALUE:var t=e.target,n=e.value,r=t._actualNode();t.start();return void(r.kind==N.Kind.MAPPING&&(r.value=N.newScalar(""+n)));case A.CommandKind.CHANGE_KEY:var t=e.target,n=e.value,r=t._actualNode();if(r.kind==N.Kind.MAPPING){r.key.value=n}return}})},e.prototype.updateFrom=function(e){this._node=e},e.prototype.isAnnotatedScalar=function(){if(!this.unit())return!1;var e;if(this.kind()==N.Kind.MAPPING&&this.valueKind()==N.Kind.MAP?e=this._node.value.mappings:null==this.key()&&this.kind()==N.Kind.MAP&&(e=this._node.mappings),e){var t=e.length>0;return e.forEach(function(e){"value"!==e.key.value&&(e.key.value&&"("==e.key.value.charAt(0)&&")"==e.key.value.charAt(e.key.value.length-1)||(t=!1))}),t}return!1},e.prototype.value=function(t){if(!this._node)return"";if(this._node.kind==N.Kind.SCALAR){if("~"===this._node.value&&null===this._node.valueObject)return t?"null":null;if(!t&&""+this._node.valueObject===this._node.value)return this._node.valueObject;var n=this._node.value;return t||this._node.plainScalar&&(n=c(n)),n}if(this._node.kind==N.Kind.ANCHOR_REF){return new e(this._node.value,this._unit,this,null,null).value(t)}if(this._node.kind==N.Kind.MAPPING){var r=this._node;if(null==r.value)return null;if(this.isAnnotatedScalar())for(var i=new e(r.value,this._unit,this,null,null),a=i.children(),o=0;o=0?r.mappings.splice(t,0,n.asMapping()):r.mappings.push(n.asMapping())}else if(this.isMapping()){var i=this.asMapping(),a=i.value;if(!i.value&&n.isMap())return void(i.value=n._actualNode());if(i.value&&i.value.kind==N.Kind.SCALAR&&(i.value=null,a=null),a||(a=n.isScalar()||n.highLevelNode()&&n.highLevelNode().property().getAdapter(R.RAMLPropertyParserService).isEmbedMap()?N.newSeq():N.newMap(),i.value=a),a.kind==N.Kind.MAP){var r=a;null!=r.mappings&&void 0!=r.mappings||(r.mappings=[]),n.isScalar(),t>=0?r.mappings.splice(t,0,n.asMapping()):r.mappings.push(n.asMapping())}else{if(a.kind!=N.Kind.SEQ)throw new F("Insert into mapping with "+N.Kind[i.value.kind]+" value not supported");var o=a;t>=0?o.items.splice(t,0,n._actualNode()):o.items.push(n._actualNode())}}else{if(!this.isSeq())throw new F("Insert into "+this.kindName()+" not supported");var o=this.asSeq();t>=0?o.items.splice(t,0,n._actualNode()):o.items.push(n._actualNode())}},e.prototype.removeChild=function(e){this._oldText=null;var t,n,r=e;if(this.kind()==N.Kind.SEQ){var i=this.asSeq();t=r._node,n=i.items.indexOf(t),n>-1&&i.items.splice(n,1)}else if(this.kind()==N.Kind.MAP){var a=this.asMap();t=r.asMapping(),n=a.mappings.indexOf(t),n>-1&&a.mappings.splice(n,1)}else{if(this.kind()!=N.Kind.MAPPING)throw new F("Delete from "+N.Kind[this.kind()]+" unsupported");var o=this.asMapping();if(r._actualNode()==o.value)o.value=null;else{var a=o.value;t=r.asMapping(),a&&a.mappings&&(n=a.mappings.indexOf(t))>-1&&a.mappings.splice(n,1)}}},e.prototype.hasInnerIncludeError=function(){return this.innerIncludeErrors},e.prototype.includeErrors=function(){if(this._node.kind==N.Kind.MAPPING){var t=this._node;if(null==t.value)return[];var n=new e(t.value,this._unit,this,this._anchor,this._include),r=n.includeErrors();return this.innerIncludeErrors=n.hasInnerIncludeError(),r}var i=[];if(this._node.kind==N.Kind.INCLUDE_REF){var t=this._node;if(null==t.value)return[];var a=this.includePath(),o=null;try{o=this._unit.resolve(a)}catch(e){this.innerIncludeErrors=e.inner;var s="Can not resolve "+a+" due to: "+e.message;return i.push(s),i}var u=this._node.includeErrors;if(u&&u.length>0)return this.innerIncludeErrors=!0,i=u.map(function(e){return"object"==typeof e&&e instanceof F?e.message:e.toString()});if(null==o)return i.push("Can not resolve "+a),i;if(o.isRAMLUnit()){if(o.ast())return[];i.push(a+" can not be parsed")}}return i},e.prototype.joinMappingsWithFullIncludeAnchor=function(t,n,r){var i=this,a=w.find(t,function(e){return e.key&&e.value&&e.key.kind==N.Kind.SCALAR&&"<<"==e.key.value&&e.value.kind==N.Kind.ANCHOR_REF});if(!a)return t.map(function(t){return new e(t,i._unit,i,r?r:i._anchor,n?n:i._include,i.cacheChildren)});var o=w.filter(t,function(e){return!(e.key.kind==N.Kind.SCALAR&&"<<"==e.key.value&&e.value.kind==N.Kind.ANCHOR_REF)}),s=new e(a.value,this._unit,this,n,r,this.cacheChildren).children(null,null,!0);return o.map(function(t){return new e(t,i._unit,i,r?r:i._anchor,n?n:i._include,i.cacheChildren)}).concat(s)},e.prototype.children=function(t,n,r){var i=this;if(void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=!0),null==this._node)return[];if(this.cacheChildren&&this._children)return this._children;var a,o=this._node.kind;if(o==N.Kind.SCALAR)a=[];else if(o==N.Kind.MAP){var s=this._node;a=1!=s.mappings.length||r?this.joinMappingsWithFullIncludeAnchor(s.mappings,t,n):new e(s.mappings[0].value,this._unit,this,t,n,this.cacheChildren).children(null,null,!0)}else if(o==N.Kind.MAPPING){var u=this._node;if(null==u.value)a=[];else{var c=new e(u.value,this._unit,this,n?n:this._anchor,t?t:this._include,this.cacheChildren);a=c.children(),c.includesContents()&&this.setIncludesContents(!0)}}else if(o==N.Kind.SEQ){var l=this._node;a=l.items.filter(function(e){return null!=e}).map(function(r){return new e(r,i._unit,i,n?n:i._anchor,t?t:i._include,i.cacheChildren)})}else if(o==N.Kind.INCLUDE_REF){if(this._unit){var p=this.includePath(),f=null;try{f=this._unit.resolve(p)}catch(e){}if(null==f)a=[];else if(f.isRAMLUnit())if(this.canInclude(f)){var d=this.unit(),m=f;m.addIncludedBy(d.absolutePath()),d.getIncludedByPaths().forEach(function(e){m.addIncludedBy(e)});var h=f.ast();h&&(this.cacheChildren&&(h=_(h)),a=f.ast().children(this,null),this.setIncludesContents(!0))}else this.addIncludeError&&this.addIncludeError(new F("Recursive definition"))}a||(a=[])}else{if(o!=N.Kind.ANCHOR_REF)throw new F("Should never happen; kind : "+N.Kind[this._node.kind]);var y=this._node;a=new e(y.value,this._unit,this,null,null,this.cacheChildren).children()}return this.cacheChildren&&(this._children=a),a},e.prototype.canInclude=function(e){for(var t=this.includedFrom();null!=t;){if(t.unit().absolutePath()==e.absolutePath())return!1;t=t.includedFrom()}return!this.unit().includedByContains(e.absolutePath())},e.prototype.directChildren=function(t,n,r){var i=this;if(void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=!0),this._node){switch(this._node.kind){case N.Kind.SCALAR:return[];case N.Kind.MAP:var a=this._node;return 1!=a.mappings.length||r?a.mappings.map(function(r){return new e(r,i._unit,i,n?n:i._anchor,t?t:i._include)}):new e(a.mappings[0].value,this._unit,this,t,n).directChildren(null,null,!0);case N.Kind.MAPPING:var o=this._node;return null==o.value?[]:new e(o.value,this._unit,this,n?n:this._anchor,t?t:this._include).directChildren();case N.Kind.SEQ:return this._node.items.filter(function(e){return null!=e}).map(function(r){return new e(r,i._unit,i,n?n:i._anchor,t?t:i._include)});case N.Kind.INCLUDE_REF:return[];case N.Kind.ANCHOR_REF:return[]}throw new F("Should never happen; kind : "+N.Kind[this._node.kind])}return[]},e.prototype.anchorId=function(){return this._node.anchorId},e.prototype.unit=function(){return this._unit},e.prototype.containingUnit=function(){return this.valueKind()==N.Kind.INCLUDE_REF?this.unit().resolve(this._node.value.value):this.kind()==N.Kind.INCLUDE_REF?this.unit().resolve(this._node.value):this._unit},e.prototype.includeBaseUnit=function(){return this._unit},e.prototype.setUnit=function(e){this._unit=e},e.prototype.includePath=function(){var e=this.getIncludeString();return e?e:null},e.prototype.includeReference=function(){var e=this.getIncludeString();return e?M.getIncludeReference(e):null},e.prototype.getIncludeString=function(){if(this._node.kind==N.Kind.INCLUDE_REF){return this._node.value}if(this._node.kind==N.Kind.MAPPING){var t=this._node;return null==t.value?null:new e(t.value,this._unit,this,null,null).getIncludeString()}return null},e.prototype.anchoredFrom=function(){return this._anchor},e.prototype.includedFrom=function(){return this._include},e.prototype.kind=function(){return this._actualNode().kind},e.prototype.valueKind=function(){if(this._node.kind!=N.Kind.MAPPING)return null;var e=this._node;return e.value?e.value.kind:null},e.prototype.anchorValueKind=function(){if(this.valueKind()==N.Kind.ANCHOR_REF){return this._node.value.value.kind}return null},e.prototype.valueKindName=function(){var e=this.valueKind();return void 0!=e?N.Kind[e]:null},e.prototype.kindName=function(){return N.Kind[this.kind()]},e.prototype.indent=function(e,t){void 0===t&&(t="");for(var n="",r=0;r0&&e.append(", "),this.markupNode(e,o[s],n,r);r&&e.append("}");break;case N.Kind.SEQ:for(var u=t.items,s=0;s=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,i="/"===o.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),a=r(n.split("/")),o=Math.min(i.length,a.length),s=o,u=0;u=0&&e.lastIndexOf(t)===n}function p(e,t,n){return void 0===n&&(n=0),e.length-t.length>=n&&e.substring(n,n+t.length)===t}function f(e){return"_"==e[e.length-1]}function d(e,t,n){var r,i=!1;e[t]=function(){return i||(i=!0,r=n.apply(e)),r}}function m(e,n){void 0===n&&(n=f);for(var r in e)n(r)&&t.ifInstanceOf(e[r],Function,function(t){return 0===t.length?d(e,r,t):null})}function h(e,t){void 0!==e&&t(e)}function y(e){return"string"==typeof e&&""!=e&&l(e,".raml")}function _(e){for(var t,n=[],r=new RegExp("require\\('([^']+)'\\)","gi");t=r.exec(e);)n.push(t[1]);for(var i=new RegExp('require\\("([^"]+)"\\)',"gi");t=i.exec(e);)n.push(t[1]);return n=T.unique(n).filter(function(e){return""!=e}),n.sort(),n}function g(e){return void 0!==e&&null!=e}function v(e){return 0==e.length?e:e.charAt(0).toUpperCase()+e.substr(1)}function b(e,t,n){void 0===n&&(n=!1);var r=Object.keys(t);if(n){var i={};r.forEach(function(e){return i[e]=!0}),Object.keys(e).forEach(function(e){return i[e]=!0}),r=Object.keys(i)}r.forEach(function(n){var r=e[n];r instanceof Object?(t[n]||(t[n]={}),b(r,t[n],!0)):void 0!=r&&(t[n]=e[n])})}function S(e,t){return Object.keys(t).forEach(function(n){return e=A(e,n,t[n])}),e}function A(e,t,n){for(var r="",i=0,a=e.indexOf(t);a=0;a=e.indexOf(t,i))r+=e.substring(i,a),r+=n,i=a+t.length;return r+=e.substring(i,e.length)}var T=n(1),E=n(84);t.defined=function(e){return null!==e&&void 0!==e},t.flattenArrayOfObjects=r,t.find=i,t.isInstance=function(e,t){return e instanceof t?[e]:[]},t.ifInstanceOf=function(e,t,n){return e instanceof t?n(e):null},t.toTuples=a,t.fromTuples=o,t.collectInstancesOf=function(e,n){return s([],function(r){return e.forEach(function(e){return t.ifInstanceOf(e,n,function(e){return r.push(e)})})})},t.collectInstancesOfInMap=function(e,t){return Object.keys(e).map(function(t){return[t,e[t]]}).filter(function(e){return e[1]instanceof t}).map(function(e){return e})},t.asArray=function(e){return t.defined(e)?e instanceof Array?e:[e]:[]},t.shallowCopy=function(e){return s({},function(t){return Object.keys(e).forEach(function(n){return t[n]=e[n]})})},t.flatMap=function(e,n){return t.flatten(e.map(n))},t.flatten=function(e){return Array.prototype.concat.apply([],e)},t.takeWhile=function(e,t){return s([],function(n){for(var r=0;r=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function h(e){return+e!=e&&(e=0),a.alloc(+e)}function y(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function _(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return w(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}var c;if(i){var l=-1;for(c=n;cs&&(n=s-u),c=n;c>=0;c--){for(var p=!0,f=0;fi&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=n){var u,c,l,p;switch(s){case 1:a<128&&(o=a);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&a)<<6|63&u)>127&&(o=p);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(p=(15&a)<<12|(63&u)<<6|63&c)>2047&&(p<55296||p>57343)&&(o=p);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(p=(15&a)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&p<1114112&&(o=p)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return x(r)}function x(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function U(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function F(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,i){return i||F(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,r,23,4),n+4}function K(e,t,n,r,i){return i||F(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,r,52,8),n+8}function V(e){if(e=j(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function j(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function q(e,t){t=t||1/0;for(var n,r=e.length,i=null,a=[],o=0;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function z(e){for(var t=[],n=0;n>8,i=n%256,a.push(i),a.push(r);return a}function Y(e){return X.toByteArray(V(e))}function J(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function G(e){return e!==e}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var X=n(174),$=n(180),Q=n(117);t.Buffer=a,t.SlowBuffer=h,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return o(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return u(null,e,t,n)},a.allocUnsafe=function(e){return c(null,e)},a.allocUnsafeSlow=function(e){return c(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},a.prototype.compare=function(e,t,n,r,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,s=n-t,u=Math.min(o,s),c=this.slice(r,i),l=e.slice(t,n),p=0;pi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return S(this,e,t,n);case"utf8":case"utf-8":return A(this,e,t,n);case"ascii":return T(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;a.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,a=0;++a=i&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),$.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),$.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),$.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),$.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){L(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return K(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return K(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o0?n[0].value(e):this._originalNode.value(e),y.isInstance(t)){var r=t.key();if(r)for(var i=this;1==i.children().length&&(i.kind()==a.Kind.MAPPING||i.kind()==a.Kind.MAP||i.kind()==a.Kind.SEQ);)if(i=i.children()[0],i.originalNode().key()==r){t=i;break}this._valueOverride=t}return t},t.prototype.children=function(){var e=this;if(this._children)return this._children;for(var n=[],r=!1,i=!1,o=0,s=this._adoptedNodes;o0&&(i=!0,c[0].key()&&this.originalNode().valueKind()!=a.Kind.SEQ&&(r=!0))}if(r)n=this.collectChildrenWithKeys();else if(i){n=this.collectChildrenWithKeys();var l={};this._adoptedNodes.forEach(function(r){return r.children().filter(function(e){return!e.key()}).forEach(function(i){var a=r==e.primaryNode(),o=e.buildKey(i);if(a||!l[o]){l[o]=!0;var s=r.transformer()?r.transformer():e.transformer(),u=y.isInstance(i)?i.originalNode():i;n.push(new t(u,e,s,e.ramlVersion,a))}})})}else n=[];return this._children=n,this._preserveAnnotations&&this._children.forEach(function(e){return e.preserveAnnotations()}),n},t.prototype.buildKey=function(e){var t=o.serialize(e),n=this.nodeDefinition();if(n&&(n.key()==l.Universe08.TraitRef||n.key()==l.Universe08.ResourceTypeRef||n.key()==l.Universe10.TraitRef||n.key()==l.Universe10.ResourceTypeRef)&&t&&"object"==typeof t){var r=Object.keys(t);r.length>0&&(t=r[0])}return null==t?"":s(t)},t.prototype.collectChildrenWithKeys=function(){for(var e=this,n=[],r={},i=0,a=this._adoptedNodes;i=0;if(a.forEach(function(e){var t=e.node.optional()&&("RAML10"!=_||g&&u);o=o&&t,s=s||e.isPrimary}),s){var c=[];a.filter(function(e){return e.isPrimary}).forEach(function(n){var r=n.transformer?n.transformer:e.transformer();c.push(new t(n.node,e,r,e.ramlVersion,!0))});var l=c[0];a.filter(function(e){return!e.isPrimary}).forEach(function(e){l.adopt(e.node,e.transformer)}),c.forEach(function(e){return n.push(e)})}else if(!o){for(var p=a[0].transformer?a[0].transformer:e.transformer(),l=new t(a[0].node,e,p,e.ramlVersion,!1),f=1;f=0?this._children[o]=a:this._children.push(a),a},t.prototype.removeChild=function(e){if(this._children&&null!=e){var t=this._children.indexOf(e);if(t>=0){for(var n=t;n + "+this.content.length+".\nUnit path: "+this.absPath)},e.prototype.initMapping=function(){if(null==this.mapping){if(null==this.content)throw new Error("Line Mapper has been given null content"+(null!=this.absPath?". Path: "+this.absPath:" and null path."));this.mapping=[];for(var e=0,t=this.content.length,n=0;n1)for(var n=1;n0&&(c[e.method()]=t)});var l,p=t.type();if(null!=p){var f=s(i);l=this.readGenerictData(e,p,t.highLevel(),"resource type",r,f)}var m={resourceType:l,traits:u,methodTraits:c};if(n.push(m),l){var h=l.node,y=d.qName(h.highLevel(),e.highLevel());a[y]?m.resourceType=null:(a[y]=!0,this.collectResourceData(e,h,n,l.transformer,i,a))}return n},e.prototype.extractTraits=function(e,t,n,r){var i=this;void 0===r&&(r={}),n=n.concat([e.highLevel()]);for(var a=[],o=-1;o>")){var o=e.substring(2,e.length-2),s=this.structuredParams[o];if(null!=s)return{value:s,errors:a}}for(var u=e,c=new I,l=0,f=u.indexOf("<<");f>=0;f=u.indexOf("<<",l)){c.append(u.substring(l,f));var d=f;if(f+="<<".length,(l=this.paramUpperBound(u,f))==-1)break;var m=u.substring(f,l);l+=">>".length;var y,o,_=u.substring(d,l),g=p(m);if(g.length>0){var v=m.indexOf("|");if(o=m.substring(0,v).trim(),y=this.params[o],y&&"string"==typeof y&&y.indexOf("<<")>=0&&this.vDelegate&&(y=this.vDelegate.transform(y,t,n,r).value),y)for(var b=0,S=g;b=0&&this.vDelegate&&(y=this.vDelegate.transform(y,t,n,r).value);null!==y&&void 0!==y||(i[o]=!0,y=_),c.append(y)}return c.append(u.substring(l,u.length)),{value:c.value(),errors:a}}return{value:e,errors:a}},e.prototype.paramUpperBound=function(e,t){for(var n=0,r=t;r>",r)){if(0==n)return r;n--,r++}return e.length},e.prototype.children=function(e){var t=this.substitutionNode(e);return t?t.children():null},e.prototype.valueKind=function(e){var t=this.substitutionNode(e);return t?t.valueKind():null},e.prototype.includePath=function(e){var t=this.substitutionNode(e);return t?t.includePath():null},e.prototype.substitutionNode=function(e){var t=this.paramName(e);return t&&this.structuredParams[t]},e.prototype.paramName=function(e){var t=null;if(e.valueKind()==m.Kind.SCALAR){var n=(""+e.value()).trim();h.stringStartsWith(n,"<<")&&h.stringEndsWith(n,">>")&&(t=n.substring(2,n.length-2))}return t},e}();t.ValueTransformer=D;var M=function(e){function t(t,n,r){e.call(this,null!=n?n.templateKind:"",null!=n?n.templateName:"",r),this.owner=t,this.delegate=n}return f(t,e),t.prototype.transform=function(t,n,r,i){if(null==t||null!=r&&!r())return{value:t,errors:[]};var a={value:t,errors:[]},o=!1;P.forEach(function(e){return o=o||t.toString().indexOf("<<"+e)>=0}),o&&(this.initParams(),a=e.prototype.transform.call(this,t,n,r,i));var s=null!=this.delegate?this.delegate.transform(a.value,n,r,i):a.value;return null!=r&&r()&&null!=i&&(s.value=i(s.value,this)),s},t.prototype.initParams=function(){for(var e,t,n="",r=this.owner.highLevel().lowLevel(),i=r,a=null;i;){var o=i.key();if(null!=o)if(h.stringStartsWith(o,"/")){if(!t)for(var s=o.split("/"),u=s.length-1;u>=0;u--){var c=s[u];if(c.indexOf("{")==-1){t=s[u];break}c.length>0&&(a=c)}n=o+n}else e=o;i=i.parent()}t||a&&(t=""),this.params={resourcePath:n,resourcePathName:t},e&&(this.params.methodName=e)},t.prototype.children=function(e){return null!=this.delegate?this.delegate.children(e):null},t.prototype.valueKind=function(e){return null!=this.delegate?this.delegate.valueKind(e):null},t.prototype.includePath=function(e){return null!=this.delegate?this.delegate.includePath(e):null},t}(D);t.DefaultTransformer=M;var P=["resourcePath","resourcePathName","methodName"]},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){function r(e,t){var n=a(e,t);return i(n)?n:void 0}var i=n(218),a=n(241);e.exports=r},function(e,t,n){"use strict";function r(){return Object.keys(d).length>0}function i(e){f.push(e)}function a(e){d[e]=!0}function o(e){delete d[e],f.forEach(function(t){return t(e)})}function s(e){return!!d[e]}function u(e,t){p.set(e,t)}function c(e){return p.get(e)}n(116);n(176),n(356);var l=n(291),p=l(50);t.hasAsyncRequests=r,t.addLoadCallback=i;var f=[],d={};t.addNotify=a,t.removeNotity=o,t.isWaitingFor=s,t.set=u,t.get=c},function(e,t,n){"use strict";function r(e){var t=e.value();if("string"==typeof t||null==t){var n=f.createNode(t,null,e.lowLevel().unit());n._actualNode().startPosition=e.lowLevel().valueStart(),n._actualNode().endPosition=e.lowLevel().valueEnd();return new p.StructuredValue(n,e.parent(),e.property())}return t}function i(e){var t=e._meta;t.resetPrimitiveValuesMeta();var n=e.highLevel();return n.definition().allProperties().forEach(function(r){var i=r.nameId(),a=n.attributes(i),o=!1,s=!1;if(a.forEach(function(e){o=o||null!=e.value(),s=s||e.optional()}),!o){var u=e.getDefaultsCalculator();if(null!=u.attributeDefaultIfEnabled(n,r)){var c=u.insertionKind(n,r);c==d.InsertionKind.CALCULATED?t.registerCalculatedValue(i):c==d.InsertionKind.BY_DEFAULT&&t.registerInsertedAsDefaultValue(i)}}}),t}function a(e,t){return t?e.map(function(e){return t(e)}):e.map(function(e){return e.value()})}function o(e){var t=[],n=e.errors();return null!=n&&(t=t.concat(n)),s(t.map(function(t){return u(e,t)}))}function s(e){var t=[],n={};e.map(function(e){n[JSON.stringify(e)]=e});for(var r=Object.keys(n),i=0;i0&&(o.trace=t.extras.map(function(t){return u(e,t)})),o}function c(e){if(e.isScalar())return!0;for(var t=e.allSuperTypes().filter(function(e){return e.isUnion()||e.isIntersection()}),n=0,r=t;n0?new S(e[0]):null}return new S(this.node)},e.prototype.values=function(){return this.isArray()?this.node.children().map(function(e){return new S(e)}):[new S(this.node)]},e.prototype.isArray=function(){var e=this.node.children();if(e.length>0&&null==e[0].key())return!0;var t=this.node.highLevelNode();if(t){var n=t.property();if(n){var r=n.range();if(r)return r.isArray()}}return this.node.valueKind()==_.Kind.SEQ},e.CLASS_IDENTIFIER="parserCore.TypeInstancePropertyImpl",e}();t.TypeInstancePropertyImpl=A;var T=function(){function e(e,t,n){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===n&&(n=!1),this._insertedAsDefault=e,this._calculated=t,this._optional=n}return e.prototype.calculated=function(){return this._calculated},e.prototype.insertedAsDefault=function(){return this._insertedAsDefault},e.prototype.setCalculated=function(){this._calculated=!0},e.prototype.setInsertedAsDefault=function(){this._insertedAsDefault=!0},e.prototype.setOptional=function(){this._optional=!0},e.prototype.optional=function(){return this._optional},e.prototype.isDefault=function(){return!(this._insertedAsDefault||this._calculated||this._optional)},e.prototype.toJSON=function(){var e={};return this._calculated&&(e.calculated=!0),this._insertedAsDefault&&(e.insertedAsDefault=!0),this._optional&&(e.optional=!0),e},e}();t.ValueMetadataImpl=T;var E=function(e){function t(){e.apply(this,arguments),this.valuesMeta={}}return l(t,e),t.prototype.primitiveValuesMeta=function(){return this.valuesMeta},t.prototype.registerInsertedAsDefaultValue=function(e){var t=this.valuesMeta[e];null==t?this.valuesMeta[e]=new T(!0):t.setInsertedAsDefault()},t.prototype.registerCalculatedValue=function(e){var t=this.valuesMeta[e];null==t?this.valuesMeta[e]=new T(!1,!0):t.setCalculated()},t.prototype.registerOptionalValue=function(e){var t=this.valuesMeta[e];null==t?this.valuesMeta[e]=new T(!1,!1,!0):t.setOptional()},t.prototype.resetPrimitiveValuesMeta=function(){this.valuesMeta={}},t.prototype.isDefault=function(){return!!e.prototype.isDefault.call(this)&&0==Object.keys(this.valuesMeta).length},t.prototype.toJSON=function(){var t=this,n=e.prototype.toJSON.call(this),r={},i=Object.keys(this.valuesMeta);return i.length>0&&(i.forEach(function(e){var n=t.valuesMeta[e].toJSON();Object.keys(n).length>0&&(r[e]=n)}),n.primitiveValuesMeta=r),n},t}(T);t.NodeMetadataImpl=E,t.fillElementMeta=i,t.attributesToValues=a,t.errors=o,t.filterErrors=s,t.basicError=u},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);c.call(this,e),l.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||s(a,this)}function a(e){e.end()}var o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=r;var s=n(83),u=n(39);u.inherits=n(26);var c=n(154),l=n(94);u.inherits(r,c);for(var p=o(l.prototype),f=0;f0){var v=g.map(function(e,t){var n="'"+e+"'";return t==g.length-1?n:t==g.length-2?n+" or ":n+", "}).join("");r=$(De.INVALID_PROPERTY_OWNER_TYPE,{propName:s,namesStr:v},e)}}}}return r}function d(e,t){if(e.isElement()){if(e.invalidSequence){var n=e.property().nameId();n=Re.sentenceCase(Ie.singular(n)),t.acceptUnique(Z(De.SEQUENCE_NOT_ALLOWED_10,{propName:n},e.lowLevel().parent().parent(),e))}var r=e.asElement();if(r.definition().isAssignableFrom(ye.Universe10.LibraryBase.name)){var i,a=!1,o=!1;r.lowLevel().children().forEach(function(e){"schemas"==e.key()&&(a=!0,i=e),"types"==e.key()&&(o=!0)}),a&&o&&t.accept(ht(i,r,ue.IssueCode.ILLEGAL_PROPERTY_VALUE,!1,"types and schemas are mutually exclusive",!1))}r.definition().requiredProperties()&&r.definition().requiredProperties().length;m(e,t),(new tt).validate(r,t),(new dt).validate(r,t)}else m(e,t);(new pt).validate(e,t)}function m(e,t,n){void 0===n&&(n=!1);var r=e.parent(),i=e.lowLevel().value();if(e.lowLevel()){if(e.lowLevel().keyKind()==pe.Kind.MAP&&t.accept($(De.NODE_KEY_IS_A_MAP,{},e)),e.lowLevel().keyKind()==pe.Kind.SEQ&&null==i){var a=!1;e.isElement()&&e.asElement().definition().isAssignableFrom(ye.Universe10.TypeDeclaration.name)&&(a=!0),a||t.accept($(De.NODE_KEY_IS_A_SEQUENCE,{},e))}null==r&&e.lowLevel().errors().forEach(function(n){var r=n.mark?n.mark.position:0,i={code:"YAML_ERROR",message:n.message,node:null,start:r,end:r+1,isWarning:!1,path:e.lowLevel().unit()==e.root().lowLevel().unit()?null:e.lowLevel().unit().path(),unit:e.lowLevel().unit()};t.accept(i)})}if(e.isUnknown()){if(e.name().indexOf("<<")!=-1&&null!=p(r))return(new Ve).validateName(e,t),!1;if(e.needSequence&&t.accept($(De.SEQUENCE_REQUIRED,{name:e.name()},e)),e.needMap)return e.knownProperty?t.accept($(De.PROPERTY_MUST_BE_A_MAP_10,{propName:e.knownProperty.nameId()},e)):t.accept($(De.MAP_REQUIRED,{},e)),!1;if(e.unresolvedRef&&t.accept($(De.UNRESOLVED_REFERENCE,{ref:i},e)),e.knownProperty){if(0==e.lowLevel().includeErrors().length){if(p(r)&&Ee.startsWith(i,"<<")&&Ee.endsWith(i,">>"))return!1;if("body"==e.name()&&e.computedValue("mediaType"))return!1;"~"!=e.lowLevel().value()&&t.accept($(De.SCALAR_PROHIBITED,{propName:e.name()},e))}}else{var o=f(e);o||(o=$(De.UNKNOWN_NODE,{name:e.name()},e)),t.accept(o)}}if(e.markCh()&&!e.allowRecursive())return!!e.property()&&(t.accept($(De.RECURSIVE_DEFINITION,{name:e.name()},e)),!1);if(e.definition&&e.definition().isAssignableFrom(ye.Universe10.Operation.name)){var s=y(e.wrapperNode()),u=s.queryStringComesFrom,c=s.queryParamsComesFrom;u&&c&&(t.accept(h(u,e,!1)),t.accept(h(c,e,!0)))}return e.definition&&e.definition()&&(e.definition().key()===ye.Universe10.Overlay||e.definition().key()===ye.Universe10.Extension)&&A(e,t,n),!0}function h(e,t,n){var r=e,i=e,a=n?ye.Universe10.Operation.properties.queryString.name:ye.Universe10.Operation.properties.queryParameters.name;return r.unit?Z(De.PROPERTY_ALREADY_SPECIFIED,{propName:a},r,t):$(De.PROPERTY_ALREADY_SPECIFIED,{propName:a},i)}function y(e){return{queryParamsComesFrom:_(e,!0),queryStringComesFrom:_(e,!1)}}function _(e,t){if(!e)return null;var n=v(e,t);if(n)return n;var r=e.is&&e.is()||[],i=le.find(r,function(e){return _(e.trait(),t)});if(i)return i.highLevel();var a=e.parentResource&&e.parentResource(),o=a&&g(a,t);return o?o:(a=e.parent&&e.parent(),a&&a.highLevel().definition().isAssignableFrom(ye.Universe10.ResourceBase.name)?g(a,t):null)}function g(e,t){var n=e.is(),r=le.find(n,function(e){return _(e.trait(),t)});if(r)return r.highLevel();var i=e.type(),a=i&&i.resourceType();return a&&g(a,t)?i.highLevel():void 0}function v(e,t){return t?b(e):S(e)}function b(e){var t=e.highLevel();return t.lowLevel&&le.find(t.lowLevel().children(),function(e){return e.key&&e.key()===ye.Universe10.Operation.properties.queryParameters.name})}function S(e){return e.highLevel().element(ye.Universe10.Operation.properties.queryString.name)}function A(e,t,n){if(void 0===n&&(n=!1),!e.parent()){var r=e.asElement();if(r&&r.isAuxilary()){var i=r.getMaster();i&&d(i,t)}}}function T(e,t,n){if(void 0===n&&(n=!1),m(e,t,n))try{(e.definition&&e.definition()&&(e.definition().key()===ye.Universe10.Overlay||e.definition().key()===ye.Universe10.Extension)?e.children():e.directChildren()).filter(function(e){return!n||e.property&&e.property()&&e.property().isRequired()}).forEach(function(n){if(n&&n.errorMessage){var r=n.errorMessage;return void t.accept($(r.entry,r.parameters,n.name()?n:e))}n.validate(t)})}finally{e.unmarkCh()}}function E(e){var t=e.value();if("string"==typeof t&&t.indexOf("<<")!=-1)return!0;for(var n=e.children(),r=0;r0)return void T(e,t,!0)}if(i.definition().isAnnotationType()||i.property()&&"annotations"==i.property().nameId())return void(new Ze).validate(i,t);if(i.definition().isAssignableFrom(ye.Universe10.UsesDeclaration.name)){var s=i.attr(ye.Universe10.UsesDeclaration.properties.value.name);if(s&&s.value()){var u=i.lowLevel().unit().resolve(s.value());if(u&&null!==u.contents()){if(!Ne.isWaitingFor(s.value())){var c=[];if(0===u.contents().trim().length)return void t.accept($(De.EMPTY_FILE,{path:s.value()},i,!1));if(u.highLevel().validate(de.createBasicValidationAcceptor(c,u.highLevel())),c.length>0){var l=Fe(s,i);c.forEach(function(e){e.unit=null==e.unit?u:e.unit,e.path||(e.path=u.absolutePath())});for(var f=0,d=c;f0;)h=h.extras[0];h!=l&&(h.extras||(h.extras=[]),h.extras.push(l)),t.accept(m)}}}}else t.accept($(De.INVALID_LIBRARY_PATH,{path:s.value()},i,!1))}}if(i.definition().isAssignableFrom(ye.Universe10.TypeDeclaration.name)){if(p(i)&&E(i.lowLevel()))return;return i.attrs().forEach(function(n){var r=n.property().range().key();if(r==ye.Universe08.RelativeUriString||r==ye.Universe10.RelativeUriString)return void(new He).validate(n,t);if(r==ye.Universe08.FullUriTemplateString||r==ye.Universe10.FullUriTemplateString)return void(new He).validate(n,t);if(n.property().getAdapter(ve.RAMLPropertyService).isKey()){var a=e.property()&&e.property().nameId();if(a==ye.Universe08.Resource.properties.uriParameters.name||a==ye.Universe08.Resource.properties.baseUriParameters.name)return;if(i.property()&&i.property().nameId()==ye.Universe10.MethodBase.properties.body.name)return void(new Ye).validate(n,t)}}),(new ot).validate(i,t),(new st).validate(i,t),(new it).validate(i,t),void(new et).validate(i,t)}if(i.definition().isAssignableFrom(ye.Universe10.LibraryBase.name)){var y,_=!1,g=!1;i.lowLevel().children().forEach(function(e){"schemas"==e.key()&&(_=!0,y=e),"types"==e.key()&&(g=!0)}),_&&g&&t.accept(Z(De.TYPES_AND_SCHEMAS_ARE_EXCLUSIVE,{},y,i))}var v=i.definition().requiredProperties()&&i.definition().requiredProperties().length>0,b=i.definition().getAdapter(ve.RAMLService).getAllowAny();b?v&&T(e,t,!0):T(e,t),(new ft).validate(i,t),(new tt).validate(i,t),(new dt).validate(i,t)}else T(e,t);(new pt).validate(e,t)}function N(e,t){if(e.lowLevel()){delete e.lowLevel().actual()._inc,e.children().forEach(function(e){return N(e,t)})}}function w(e,t){var n=e.lowLevel();if(n){var r=n.actual();if(!r._inc){if(e.isElement()){var i=e.name();"string"==typeof i&&null!=i&&i.indexOf(" ")!=-1&&t.accept($(De.SPACES_IN_KEY,{value:i},e,!0))}if(r._inc=!0,n){n.includeErrors().forEach(function(n){var r=!1;e.lowLevel().hasInnerIncludeError()&&(r=!0);var i=$(De.INCLUDE_ERROR,{msg:n},e,r);t.accept(i)});var a=n.includePath();if(null!=a&&!me.isAbsolute(a)&&!ce.isWebPath(a)){var o=n.unit().absolutePath();if(x(me.dirname(o),a)>0){var s=$(De.PATH_EXCEEDS_ROOT,{},e,!0);t.accept(s)}}}e.children().forEach(function(e){return w(e,t)}),0==e.children().length&&null!=n&&n.children().forEach(function(n){return k(n,t,e)})}}}function k(e,t,n){e.includeErrors().forEach(function(r){var i=!1;e.hasInnerIncludeError()&&(i=!0);var a=Z(De.INCLUDE_ERROR,{msg:r},e,n,i);t.accept(a)});var r=e.includePath();if(null!=r&&!me.isAbsolute(r)&&!ce.isWebPath(r)){var i=e.unit().absolutePath();if(x(me.dirname(i),r)>0){var a=Z(De.PATH_EXCEEDS_ROOT,{},e,n,!0);t.accept(a)}}e.children().forEach(function(e){return k(e,t,n)})}function x(e,t){for(var n=Be(e),r=Be(t),i=n.length,a=0,o=0,s=r;o0){var c=!1,l=t.definition().allSuperTypes();l=l.concat([t.definition()]);var p=l.map(function(e){return e.nameId()});if(u.forEach(function(e){"API"==e&&(e="Api"),"NamedExample"==e&&(e="ExampleSpec"),"SecurityScheme"==e&&(e="AbstractSecurityScheme"),"SecuritySchemeSettings"==e&&(e="SecuritySchemeSettings"),le.find(p,function(t){return t==e})?c=!0:("Parameter"==e&&t.computedValue("location")&&(c=!0),"Field"==e&&t.computedValue("field")&&(c=!0))}),!c){var f=u.map(function(e){return"'"+e+"'"}).join(", ");return new qe(De.INVALID_ANNOTATION_LOCATION,{aName:n,aValues:f})}}}}return _}if(e.key()==ye.Universe08.SchemaString||e.key()==ye.Universe10.SchemaString){var d=!1;if(fe.UserDefinedProp.isInstance(r)){var m=r,h=m.node();if(h){var y=h.property();y&&(d=_e.isTypeProperty(y)||_e.isSchemaProperty(y))}}if(d)return!1;var _=we.createSchema(n,z(t.lowLevel(),i&&i.lowLevel()));if(!_)return _;if(_ instanceof Error)_.canBeRef=!0;else{var g=!1;try{JSON.parse(n),g=!0}catch(e){}if(g)try{_.validateSelf()}catch(e){return e.isWarning=!0,e}}return _}if(e.key()==ye.Universe08.StatusCodeString||e.key()==ye.Universe10.StatusCodeString){var v=te(n);if(null!=v)return v}if(e.key()==ye.Universe08.BooleanType||e.isAssignableFrom(ye.Universe10.BooleanType.name)){if("true"!==n&&"false"!==n&&n!==!0&&n!==!1)return new qe(De.BOOLEAN_EXPECTED);if(i){var b=i.lowLevel().value(!0);if("true"!==b&&"false"!==b)return new qe(De.BOOLEAN_EXPECTED)}}if(e.key()==ye.Universe08.NumberType||e.isAssignableFrom(ye.Universe10.NumberType.name)){var S=parseFloat(n);if(isNaN(S))return new qe(De.NUMBER_EXPECTED,{propName:r.nameId()})}if((e.key()==ye.Universe08.StringType||e.isAssignableFrom(ye.Universe10.StringType.name))&&null===n&&t&&r){var A=t.attr(r.nameId());if(A){var T=A.lowLevel().children();if(T&&T.length>0)return new qe(De.STRING_EXPECTED_3,{propName:r.nameId()})}}return!0}catch(e){return e.canBeRef=!0,e}}function M(e){if(!e)return!1;var t=e.toLowerCase(),n=e.toUpperCase();return e!==t&&e!==n}function P(e){if(!e)return null;if(e.isElement()){var n=e,r=n.definition();if(r&&t.typeToName.hasOwnProperty(r.nameId()))return t.typeToName[r.nameId()];if(r.isAssignableFrom(ye.Universe10.TypeDeclaration.name)||r.isAssignableFrom(ye.Universe08.Parameter.name)){if(n.property()&&t.parameterPropertyToName.hasOwnProperty(n.property().nameId()))return t.parameterPropertyToName[n.property().nameId()];if(n.property()&&n.parent()&&n.property().nameId()==ye.Universe10.LibraryBase.properties.types.name&&n.parent().definition()&&n.parent().definition().isAssignableFrom(ye.Universe10.LibraryBase.name))return"type";if(n.property()&&n.parent()&&n.property().nameId()==ye.Universe10.LibraryBase.properties.securitySchemes.name&&n.parent().definition()&&n.parent().definition().isAssignableFrom(ye.Universe10.LibraryBase.name))return"security scheme"}}return null}function L(e,t,n){var r=Ae.declRoot(n);r._cach||(r._cach={});var i=e.id();if(e.domain()&&(i+=e.domain().nameId()),i){var a=r._cach[i];if(a)return null!=a[t]}var o=Ae.enumValues(e,n),s={};return o.forEach(function(e){return s[e]=1}),e.id()&&(r._cach[i]=s),null!=s[t]}function O(e,n,r,i){if(F(e,n,i),B(e,n,i),r&&("null"!=r||!e.isAllowNull())){var a=e.getAdapter(ve.RAMLPropertyService),o=L(e,r,n.parent());if(o||n.lowLevel().unit().absolutePath()===n.parent().lowLevel().unit().absolutePath()||(o=L(e,r,de.fromUnit(n.lowLevel().unit()))),!o){if("string"==typeof r&&0==r.indexOf("x-")&&e.nameId()==ye.Universe10.TypeDeclaration.properties.type.name)return!0;var s=a.isReference&&a.isReference()&&a.referencesTo&&a.referencesTo()&&a.referencesTo().nameId&&a.referencesTo().nameId(),u=t.typeToName[s]||V(n),c={referencedToName:u,ref:r},l=u?De.UNRECOGNIZED_ELEMENT:De.UNRESOLVED_REFERENCE,p=K(l,e,n);return i.accept($(p,c,n,e.range().key()===ye.Universe08.SchemaString)),!0}return!(!U(n)||!_e.isTraitRefType(n.definition()))&&(i.accept($(De.DUPLICATE_TRAIT_REFERENCE,{refValue:r},n)),!0)}}function U(e){var t,n=e.property().domain().universe().version();if(!(t="RAML10"==n?oe(ae.serialize(e.lowLevel())):e.value()&&e.value().valueName&&e.value().valueName()))return!1;var r=e.parent&&e.parent();if(!r)return!1;var i=e.name&&e.name();if(!i)return!1;var a=r.attributes&&r.attributes(i);if(!a)return!1;if(0===a.length)return!1;var o=0;return a.forEach(function(e){var r;"RAML10"==n?t=oe(ae.serialize(e.lowLevel())):r=e.value&&e.value()&&e.value().valueName&&e.value().valueName(),r===t&&o++}),o>1}function F(e,t,n){if(_e.isIsProperty(e)){var r=t.lowLevel();if(null!=r){var i=null,a=r.parent(),o=null!=a?a.parent():null;if(r.kind()==pe.Kind.MAPPING&&r.key()&&"is"==r.key()?i=r:null!=a&&a.kind()==pe.Kind.MAPPING&&a.key()&&"is"==a.key()?i=a:null!=o&&o.kind()==pe.Kind.MAPPING&&o.key()&&"is"==o.key()&&(i=o),null!=i){null==i.value()||i.children()&&0!=i.children().length||n.accept($(De.IS_IS_ARRAY,{},t));var s=!1;i.children().forEach(function(e){e.kind()!=pe.Kind.SCALAR&&e.kind()!=pe.Kind.MAP&&(s=!0)}),s&&n.accept($(De.IS_IS_ARRAY,{},t))}}}}function B(e,t,n){if(_e.isTypeProperty(e)&&_e.isResourceTypeRefType(t.definition())){var r=t.lowLevel();null==t.value()&&r&&r.children()&&0==r.children().length?r.kind()==pe.Kind.MAPPING&&null!=r.valueKind()&&n.accept($(De.RESOURCE_TYPE_NAME,{},t)):null==t.value()&&r&&r.children()&&r.children().length>1&&n.accept($(De.MULTIPLE_RESOURCE_TYPES,{},t))}}function K(e,t,n){return"type"==t.nameId()&&"RAML08"==t.domain().universe().version()&&t.domain().isAssignableFrom(ye.Universe08.Parameter.name)?De.TYPES_VARIETY_RESTRICTION:null!=n.parent()&&_e.isSecuritySchemaType(n.parent().definition())?De.UNRECOGNIZED_SECURITY_SCHEME:e}function V(e){var t=e&&e.lowLevel()&&e.lowLevel().key();if(t===ye.Universe10.AbstractSecurityScheme.properties.type.name){var n=e.parent()&&e.parent().definition()&&e.parent().definition().nameId();if(n===ye.Universe10.AbstractSecurityScheme.name)return"security scheme type"}else if(t===ye.Universe08.BodyLike.properties.schema.name){var n=e.parent()&&e.parent().definition()&&e.parent().definition().nameId();if(n===ye.Universe08.BodyLike.name)return"schema"}}function j(e,t){return q(e,t.getValidationPath())}function W(e){var t=e.getExtra(Te.SOURCE_EXTRA);return de.LowLevelWrapperForTypeSystem.isInstance(t)?t.node():null}function q(e,t){if(!t)return e;var n=e.children().filter(function(e){return(!e.isAttr()||!e.asAttr().isFromKey())&&e.name()===t.name});if(e.isElement()&&_e.isTypeDeclarationDescendant(e.asElement().definition())){var r=e.lowLevel();n=le.uniq(e.directChildren().concat(e.children())).filter(function(e){return(!e.isAttr()||!e.asAttr().isFromKey())&&e.name()===t.name}).sort(function(e,t){for(var n=e.lowLevel().parent();n&&n.kind()!=pe.Kind.MAPPING;)n=n.parent();for(var i=t.lowLevel().parent();i&&i.kind()!=pe.Kind.MAPPING;)i=i.parent();return n==r?-1:i==r?1:0})}var i=t.child&&"number"==typeof t.child.name?t.child.name:-1;if(i>=0&&n.length>i)return q(n[i],t.child.child);if(n.length>0)return q(n[0],t.child);if(!e.lowLevel())return e;for(var a=e.lowLevel().children(),o=0;o=0;a=r.indexOf("{{",i)){if(n+=r.substring(i,a),(i=r.indexOf("}}",a))<0){i=a;break}a+="{{".length;var o=r.substring(a,i);i+="}}".length;var s=t[o];if(void 0===s)throw new Error("Message parameter '"+o+"' has no value specified.");n+=s}return n+=r.substring(i,r.length)}var re=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},ie=n(9),ae=n(62),oe=n(118),se=n(17),ue=n(24),ce=n(20),le=n(1),pe=n(14),fe=n(0),de=n(4),me=n(11),he=n(47),ye=n(3),_e=n(5),ge=n(88),ve=fe,be=n(315),Se=n(25),Ae=n(21),Te=fe.rt,Ee=n(64),Ce=n(63),Ne=n(28),we=fe.getSchemaUtils(),ke=n(135),xe=n(145),Re=n(70),Ie=n(82),De=n(90),Me=function(){function e(){this.validateNotStrictExamples=!0}return e}(),Pe=new Me,Le=n(289);t.RESERVED_TEMPLATE_PARAMETERS={resourcePathName:'Part of the resource path following the rightmost "/"',methodName:"Method name",resourcePath:"Path of the resource"};var Oe=function(e,t,n){if(he.existsSync(e))try{var i=he.readFileSync(e).toString(),a=new Ue(t);r(i,a,null),a.visit(n)}catch(e){console.log("Error in custom linter"),console.log(e)}},Ue=function(){function e(e){this.acceptor=e,this.nodes={}}return e.prototype.error=function(e,t){this.acceptor.accept($(De.INVALID_VALUE_SCHEMA,{iValue:t},e.highLevel()))},e.prototype.errorOnProperty=function(e,t,n){var r=e.highLevel().attr(t);this.acceptor.accept($(De.INVALID_VALUE_SCHEMA,{iValue:n},r))},e.prototype.warningOnProperty=function(e,t,n){var r=e.highLevel().attr(t);this.acceptor.accept($(De.INVALID_VALUE_SCHEMA,{iValue:n},r,!0))},e.prototype.warning=function(e,t){this.acceptor.accept($(De.INVALID_VALUE_SCHEMA,{iValue:t},e.highLevel(),!0))},e.prototype.registerRule=function(e,t){var n=this.nodes[e];n||(n=[],this.nodes[e]=n),n.push(t)},e.prototype.visit=function(e){var t=this,n=e.definition();this.process(n,e),n.allSuperTypes().forEach(function(n){return t.process(n,e)}),e.elements().forEach(function(e){return t.visit(e)})},e.prototype.process=function(e,t){var n=this;if(fe.NodeClass.isInstance(e)&&!e.getAdapter(ve.RAMLService).getDeclaringNode()){var r=this.nodes[e.nameId()];r&&r.forEach(function(e){return e(t.wrapperNode(),n)})}},e}();!function(){function e(){}e.prototype.toString=function(){return this.prev?this.value+"."+this.prev.toString():this.value},e.prototype.last=function(){return this.prev?this.prev.last():this},e}();t.validateBasicFlat=m;!function(){function e(){}e}();t.validateBasic=T;var Fe=function(e,t){var n=t.lowLevel().start(),r=[];if(n<0){for(var i=t.attr("key").value().split("."),a=[],o=t.parent(),s=0,u=i;s1&&":"==t.charAt(1)&&/^win/.test(e.platform)&&(t=t.substring(2));var n=t.split("/");return 0==n[0].length&&(n=n.slice(1)),n.length>0&&0==n[n.length-1].length&&(n=n.slice(0,n.length-1)),n},Ke=function(e,t,n){try{new RegExp(e)}catch(r){t.accept($(De.ILLEGAL_PATTERN,{value:e},n))}},Ve=function(){function e(){}return e.prototype.validateName=function(e,t){var n=e.name();if(n){var r=e.lowLevel().keyStart();this.check(n,r,e,t)}},e.prototype.validateValue=function(e,t){var n=e.value();if("string"==typeof n){var r=e.lowLevel().valueStart();this.check(n,r,e,t)}},e.prototype.hasTraitOrResourceTypeParent=function(e){for(var t=e.parent();null!=t;){if(!t.definition())return!1;if(_e.isTraitType(t.definition())||_e.isResourceTypeType(t.definition()))return!0;t=t.parent()}return!1},e.prototype.check=function(e,t,n,r){if(!this.hasTraitOrResourceTypeParent(n))return[];for(var i=[],a=0,o=e.indexOf("<<");o>=0;o=e.indexOf("<<",a)){o+="<<".length,a=e.indexOf(">>",o);var s=e.substring(o,a),u=s.indexOf("|");if(0==(u>=0?s.substring(0,u):s).trim().length){var c=$(De.TEMPLATE_PARAMETER_NAME_MUST_CONTAIN_NONWHITESPACE_CHARACTERS,{},n);c.start=t+o,c.end=t+a,r.accept(c)}if(u!=-1){u++;for(var l=s.split("|").slice(1).map(function(e){return e.trim()}),p=Se.getTransformNames(),f=0,d=l;f>".length}return i},e}(),je=function(){function e(){}return e.prototype.validate=function(t,n){var r=t.parent();if(r&&(r.definition().isAssignableFrom(ye.Universe08.Method.name)||r.definition().isAssignableFrom(ye.Universe10.Method.name))){le.find(r.lowLevel()&&r.lowLevel().children()||[],function(e){var t=e.key();return t&&(ye.Universe08.MethodBase.properties.body.name===t||ye.Universe10.MethodBase.properties.body.name===t)})&&le.find(e.methodsWithoutRequestBody,function(e){return r.name()===e})&&n.accept($(De.REQUEST_BODY_DISABLED,{methodName:r.name()},r))}},e.methodsWithoutRequestBody=["trace"],e}(),We=function(){function e(){}return e.prototype.validate=function(e,t){var n=i(e,t),r=e.value(),a=e.parent().definition().universe().version(),c=null!=p(e.parent());if(!e.property().range().hasStructure()){if(de.StructuredValue.isInstance(r)&&!e.property().isSelfNode()){if(o(e.property())&&e.property().domain().key()==ye.Universe08.BodyLike){return void new de.ASTNodeImpl(e.lowLevel(),e.parent(),e.parent().definition().universe().type(ye.Universe08.BodyLike.name),e.property()).validate(t)}if("RAML10"==a&&c)return;t.accept($(De.SCALAR_EXPECTED,{},e))}else{var f=e.lowLevel().valueKind();if(e.lowLevel().valueKind()!=pe.Kind.INCLUDE_REF&&!e.property().getAdapter(ve.RAMLPropertyService).isKey()&&!e.property().isMultiValue()){var d=e.property().range().key();d!=ye.Universe08.StringType&&d!=ye.Universe08.MarkdownString&&d!=ye.Universe08.MimeType||f!=pe.Kind.SEQ&&f!=pe.Kind.MAPPING&&f!=pe.Kind.MAP&&(!e.property().isRequired()&&"mediaType"!=e.property().nameId()||null!=f&&void 0!==f)||e.property().domain().getAdapter(ve.RAMLService).isInlinedTemplates()||t.accept($(De.STRING_EXPECTED,{propName:e.name()},e))}}if(e.isAnnotatedScalar()){var m=new Ze;e.annotations().forEach(function(e){var n=e.value(),r=n.toHighLevel();r?m.validate(r,t):t.accept($(De.UNKNOWN_ANNOTATION,{aName:n.valueName()},e))})}}var h;if("string"==typeof r?h=r:de.StructuredValue.isInstance(r)&&(h=r.valueName()),!(h&&h.indexOf("<<")!=-1&&h.indexOf(">>")>h.indexOf("<<")&&((new Ve).validateValue(e,t),c))){if((new je).validate(e,t),e.property().range().key()==ye.Universe08.MimeType||e.property().range().key()==ye.Universe10.MimeType||e.property().nameId()==ye.Universe10.TypeDeclaration.properties.name.name&&e.parent().property().nameId()==ye.Universe10.MethodBase.properties.body.name)return void(new Ye).validate(e,t);if(u(e.property())||s(e.property())){if("RAML08"==a){e.lowLevel().value();if(e.lowLevel().children().length>0){var y=u(e.property())?"'example'":"'defaultValue'";t.accept($(De.STRING_EXPECTED_2,{propName:y},e,!1))}}(new ct).validate(e,t)}if(l(e.property())){if("RAML08"==a){var _=e.lowLevel().parent(),g=pe.Kind.SEQ;se.LowLevelProxyNode.isInstance(e.lowLevel())?_.valueKind()!=g&&t.accept($(De.SECUREDBY_LIST_08,{},e,!1)):_.kind()!=g&&t.accept($(De.SECUREDBY_LIST_08,{},e,!1))}if((new ct).validate(e,t),"RAML10"==a&&de.StructuredValue.isInstance(r)){var v=r,b=v.children().filter(function(e){return"scopes"==e.valueName()});if(b.length>0){var S=e.findReferencedValue();if(S){var A=[];b.forEach(function(e){var t=e.children();if(t.length>0)t.forEach(function(e){var t=e.lowLevel().value();null==t||c&&t.indexOf("<<")>=0||A.push(e)});else{var n=e.lowLevel().value();null==n||c&&n.indexOf("<<")>=0||A.push(e)}});var T={},E=S.element(fe.universesInfo.Universe10.AbstractSecurityScheme.properties.settings.name);if(E){E.attributes(fe.universesInfo.Universe10.OAuth2SecuritySchemeSettings.properties.scopes.name).forEach(function(e){return T[e.value()]=!0})}for(var C=0,N=A;C0&&(le.find(b,function(e){return e==n})||n&&0==n.indexOf("x-")&&r.nameId()==ye.Universe08.AbstractSecurityScheme.properties.type.name||f.accept($(De.INVALID_VALUE,{iValue:n,aValues:b.map(function(e){return"'"+e+"'"}).join(", ")},e)))}},e}(),He=function(){function e(){}return e.prototype.validate=function(e,t){try{var n=(new Je).parseUrl(e.value()||"");if(n.some(function(e){return"version"==e})&&"baseUri"==e.property().nameId()){e.root().attr("version")||t.accept($(De.MISSING_VERSION,{},e,!1))}n.some(function(e){return 0==e.length})&&t.accept($(De.URI_PARAMETER_NAME_MISSING,{},e,!1))}catch(n){t.accept($(De.URI_EXCEPTION,{msg:n.message},e,!1))}},e}(),Ye=function(){function e(){}return e.prototype.validate=function(e,t){try{var n=e.value();if(!n)return;if("*/*"==n)return;if(n.indexOf("/*")==n.length-2&&(n=n.substring(0,n.length-2)+"/xxx"),e.parent()&&e.parent().parent()&&e.parent().parent().definition().isAssignableFrom(ye.Universe10.Trait.name)&&n.indexOf("<<")>=0)return;if("body"==n&&e.parent().parent()){var r=e.parent().parent().definition().key();(r===ye.Universe08.Response||r===ye.Universe10.Response||e.parent().parent().definition().isAssignableFrom(ye.Universe10.MethodBase.name))&&(n=e.parent().computedValue("mediaType"))}var i=ke.parse(n);i.type.match(/[\w\d][\w\d!#\$&\-\^_+\.]*/)||t.accept($(De.INVALID_MEDIATYPE,{mediaType:i.type},e))}catch(n){t.accept($(De.MEDIATYPE_EXCEPTION,{msg:n.message},e))}(e.value()&&"multipart/form-data"==e.value()||"application/x-www-form-urlencoded"==e.value())&&e.parent()&&e.parent().parent()&&e.parent().parent().property()&&e.parent().parent().property().nameId()==ye.Universe10.MethodBase.properties.responses.name&&t.accept($(De.FORM_IN_RESPONSE,{},e,!0))},e}(),Je=function(){function e(){}return e.prototype.checkBaseUri=function(e,t,n,r){var i=t.root().attr("baseUri");if(i){var a=i.value();try{var o=this.parseUrl(a);le.find(o,function(e){return e==n})||r.accept($(De.UNUSED_URL_PARAMETER,{paramName:""},e))}catch(e){}}else r.accept($(De.UNUSED_URL_PARAMETER,{paramName:""},e))},e.prototype.parseUrl=function(e){for(var t=[],n="",r=!1,i=0,a=0;a0)throw new Error("Invalid resource name: unmatched '{'");if(i<0)throw new Error("Invalid resource name: unmatched '}'");return t},e.prototype.validate=function(e,t){var n=e.value();if(e.parent().property().nameId()==ye.Universe10.Api.properties.baseUri.name){var r=e.parent().parent();return void this.checkBaseUri(e,r,n,t)}var r=e.parent().parent(),i=r.name();if(r.definition().key()===ye.Universe10.Api||r.definition().key()===ye.Universe08.Api)return void this.checkBaseUri(e,r,n,t);if(r.definition().key()!=ye.Universe10.ResourceType&&r.definition().key()!=ye.Universe08.ResourceType)try{var a=this.parseUrl(i);if(!le.find(a,function(e){return e==n})){var o=e.root().attr(ye.Universe10.Api.properties.baseUri.name);if(o&&e.name()===ye.Universe08.Api.properties.baseUriParameters.name){var s=o.value();if(s&&(a=this.parseUrl(s))&&a.length>0&&le.find(a,function(e){return e==n}))return}t.accept($(De.UNUSED_URL_PARAMETER,{paramName:"'"+n+"'"},e))}}catch(e){}},e}();t.UrlParameterNameValidator=Je,t.typeToName={},t.typeToName[ye.Universe08.Trait.name]="trait",t.typeToName[ye.Universe08.ResourceType.name]="resource type",t.typeToName[ye.Universe10.Trait.name]="trait",t.typeToName[ye.Universe10.ResourceType.name]="resource type",t.typeToName[ye.Universe10.AbstractSecurityScheme.name]="security scheme",t.typeToName[ye.Universe10.Method.name]="method",t.typeToName[ye.Universe08.Method.name]="method",t.typeToName[ye.Universe10.Resource.name]="resource",t.typeToName[ye.Universe08.Resource.name]="resource",t.typeToName[ye.Universe10.Api.name]="api",t.typeToName[ye.Universe08.Api.name]="api",t.typeToName[ye.Universe10.Response.name]="response",t.typeToName[ye.Universe08.Response.name]="response",t.typeToName[ye.Universe08.BodyLike.name]="body",t.parameterPropertyToName={},t.parameterPropertyToName[ye.Universe08.MethodBase.properties.headers.name]="header",t.parameterPropertyToName[ye.Universe08.MethodBase.properties.queryParameters.name]="query parameter",t.parameterPropertyToName[ye.Universe08.Api.properties.uriParameters.name]="uri parameter",t.parameterPropertyToName[ye.Universe08.Api.properties.baseUriParameters.name]="base uri parameter",t.parameterPropertyToName[ye.Universe08.BodyLike.properties.formParameters.name]="form parameter",t.parameterPropertyToName[ye.Universe10.MethodBase.properties.headers.name]="header",t.parameterPropertyToName[ye.Universe10.MethodBase.properties.queryParameters.name]="query parameter",t.parameterPropertyToName[ye.Universe10.ResourceBase.properties.uriParameters.name]="uri parameter",t.parameterPropertyToName[ye.Universe10.Api.properties.baseUriParameters.name]="base uri parameter",t.parameterPropertyToName[ye.Universe10.MethodBase.properties.body.name]="body",t.getHumanReadableNodeName=P;var Ge=function(){function e(){}return e.prototype.validate=function(e,t){var n=e.value(),r=n,i=e.property();if("string"==typeof n){if(O(i,e,n,t),fe.ReferenceType.isInstance(i.range())){var a=(i.range(),ie.createNode(""+n,e.lowLevel().parent(),e.lowLevel().unit()));a._actualNode().startPosition=e.lowLevel().valueStart(),a._actualNode().endPosition=e.lowLevel().valueEnd();var o=new de.StructuredValue(a,e.parent(),e.property()),s=o.toHighLevel();s&&s.validate(t)}}else if(null!=n){var u=n;if(u){r=u.valueName();var c=u.valueName();if(!O(i,e,c,t)){var l=u.toHighLevel();l&&l.validate(t)}}else r=null}else e.definition().isAssignableFrom(ye.Universe10.Reference.name)&&O(i,e,null,t);if(r){var p=R(i.range(),e.parent(),r,i);if(p instanceof Error){if(qe.isInstance(p)){var f=p;t.accept($(f.messageEntry,f.parameters,e,p.isWarning))}else t.accept($(De.SCHEMA_EXCEPTION,{msg:p.message},e,p.isWarning));p=null}}},e}(),Xe=function(){function e(){}return e.prototype.validate=function(e,t){var n=e.universe(),r=n.getTypedVersion();if(r){if("0.8"!==r&&"1.0"!==r){var i=$(De.UNKNOWN_RAML_VERSION,{},e);t.accept(i)}var a=n.getOriginalTopLevelText();if(a){var o={typeName:a};if(a!=e.definition().nameId()){if("Api"==e.definition().nameId()){var i=$(De.UNKNOWN_TOPL_LEVEL_TYPE,o,e);t.accept(i)}}else if("Api"==n.getOriginalTopLevelText()){var i=$(De.REDUNDANT_FRAGMENT_NAME,o,e);t.accept(i)}}}},e}(),$e=function(){function e(){}return e.prototype.validate=function(e,t){var n=this;e.definition().getAdapter(ve.RAMLService).getContextRequirements().forEach(function(n){if(!e.checkContextValue(n.name,n.value,n.value)){var r={v1:n.name,v2:n.value,v3:e.definition().nameId()},i=De.CONTEXT_REQUIREMENT_VIOLATION;"location"==n.name&&"ParameterLocation.FORM"==n.value&&(i=De.WEB_FORMS),t.accept($(i,r,e))}});var r,i=e.definition().getAdapter(ve.RAMLService).isInlinedTemplates();if(i){for(var a={},o=0,s=e.lowLevel().children();o0?t.accept($(De.ALLOWED_TARGETS_MUST_BE_ARRAY,{},e,!1)):this.annotables[r]||t.accept($(De.UNSUPPORTED_ANNOTATION_TARGET,{aTarget:r},e,!1))}},e}(),tt=function(){function e(){}return e.prototype.validate=function(e,t){if(!e.definition().isAnnotationType()){if(e.lowLevel().keyKind()==pe.Kind.SEQ){e.definition().isAssignableFrom(ye.Universe10.TypeDeclaration.name)||t.accept($(De.NODE_KEY_IS_A_SEQUENCE,{},e))}var n=e.name();if(null==n&&null==(n=e.lowLevel().key())&&(n=""),e.definition().key()==ye.Universe08.GlobalSchema&&e.lowLevel().valueKind()!=pe.Kind.SCALAR){var r=!1;if(e.lowLevel().valueKind()==pe.Kind.ANCHOR_REF||e.lowLevel().valueKind()==pe.Kind.INCLUDE_REF){"string"==typeof e.lowLevel().value()&&(r=!0)}r||t.accept($(De.SCHEMA_NAME_MUST_BE_STRING,{name:n},e))}e.parent()||((new Xe).validate(e,t),e.definition().key()!=ye.Universe08.Api&&e.definition().key()!=ye.Universe10.Api||(new be).validateApi(e.wrapperNode(),t),(new Qe).validate(e,t),a(e,t)),(new at).validate(e,t);var o=e.definition();if(o.key()==ye.Universe08.BodyLike&&e.lowLevel().children().map(function(e){return e.key()}).some(function(e){return"formParameters"===e}))if(e.parent()&&e.parent().definition().key()==ye.Universe08.Response){var s=$(De.FORM_PARAMS_IN_RESPONSE,{},e);t.accept(s)}else if(e.lowLevel().children().map(function(e){return e.key()}).some(function(e){return"schema"===e||"example"===e})){var s=$(De.FORM_PARAMS_WITH_EXAMPLE,{},e);t.accept(s)}if(o.key()==ye.Universe10.OAuth2SecuritySchemeSettings){var u=!1;if(e.attributes("authorizationGrants").forEach(function(e){var n=e.value();if("authorization_code"===n||"implicit"===n)u=!0;else if("password"!==n&&"client_credentials"!==n&&n&&"string"==typeof n&&n.indexOf("://")==-1&&n.indexOf(":")==-1){var r=$(De.AUTHORIZATION_GRANTS_ENUM,{},e);t.accept(r)}}),u&&!e.attr("authorizationUri")){var s=$(De.AUTHORIZATION_URI_REQUIRED,{},e);t.accept(s)}}if(e.definition().isAssignableFrom(ye.Universe08.Parameter.name)||e.definition().isAssignableFrom(ye.Universe10.TypeDeclaration.name)){var c=e.attributes("enum").map(function(e){return e.value()});if(c.length!=le.uniq(c).length){var s=$(De.REPEATING_COMPONENTS_IN_ENUM,{},e);t.accept(s)}if(e.definition().isAssignableFrom(ye.Universe08.NumberTypeDeclaration.name)||e.definition().isAssignableFrom(ye.Universe10.NumberTypeDeclaration.name)){var l=e.definition().isAssignableFrom(ye.Universe08.IntegerTypeDeclaration.name)||e.definition().isAssignableFrom(ye.Universe10.IntegerTypeDeclaration.name);e.attributes("enum").forEach(function(e){var n=l?parseInt(e.value()):parseFloat(e.value());if(!(l?!isNaN(n)&&e.value().indexOf(".")===-1:!isNaN(n))){var r=$(l?De.INTEGER_EXPECTED:De.NUMBER_EXPECTED_2,{},e);t.accept(r)}})}}_e.isResourceTypeType(e.definition())&&null==e.value()&&"null"===e.lowLevel().value(!0)&&t.accept($(De.RESOURCE_TYPE_NULL,{},e)),i(e,t);var p=e.value();if(("string"==typeof p||"number"==typeof p||"boolean"==typeof p)&&!e.definition().getAdapter(ve.RAMLService).allowValue()&&e.parent()&&"~"!=p){var s=$(De.SCALAR_PROHIBITED_2,{name:n},e);t.accept(s)}(new $e).validate(e,t),(new ut).validate(e,t),(new it).validate(e,t)}},e}(),nt=function(){function e(){}return e.prototype.validate=function(e,t){"version"==e.attrValue(ye.Universe10.TypeDeclaration.properties.name.name)&&t.accept($(De.VERSION_NOT_ALLOWED,{},e))},e}(),rt=function(){function e(e,t,n,r){void 0===r&&(r=!1),this.definitions=e,this.propertyName=t,this.assignableFrom=r,this.validator=n}return e.prototype.validate=function(e,t){var n=e.definition();if(null!=n){if(this.assignableFrom?this.definitions.some(function(e){return n.isAssignableFrom(e.name)}):this.definitions.some(function(e){return e===n})){if(null!=this.propertyName){if(null==e.property())return;if(e.property().nameId()!=this.propertyName)return}this.validator.validate(e,t)}}},e}(),it=function(){function e(){}return e.createRegistry=function(){var t=[];return e.registerValidator(t,[ye.Universe10.TypeDeclaration,ye.Universe08.Parameter],ye.Universe10.Api.properties.baseUriParameters.name,new nt,!0),t},e.registerValidator=function(e,t,n,r,i){void 0===i&&(i=!1);var a=new rt(t,n,r,i);e.push(a)},e.prototype.validate=function(t,n){e.entries.forEach(function(e){return e.validate(t,n)})},e.entries=e.createRegistry(),e}(),at=function(){function e(){}return e.prototype.allowsAnyChildren=function(e,t){var n=e.property(),r=e.definition();return!(!_e.isAnnotationTypeType(r)&&!_e.isTypeDeclarationTypeOrDescendant(r)||!_e.isAnnotationTypesProperty(n))||(!(e.parent()!=t||!_e.isTypesProperty(n)||!_e.isTypeDeclarationTypeOrDescendant(r))||(!(!_e.isSchemasProperty(n)||!_e.isTypeDeclarationTypeOrDescendant(r))||(!(e.parent()!=t||!_e.isDocumentationProperty(n)||!_e.isDocumentationType(r))||(!!_e.isAnnotationsProperty(n)||(!!_e.isUsesProperty(n)||!!_e.isExamplesProperty(n))))))},e.prototype.nodeAllowedDueToParent=function(e,t){for(var n=e;n!=t&&null!=n;){if(this.allowsAnyChildren(n,t))return!0;n=n.parent()}return!1},e.prototype.validate=function(e,t){var n=e.root();if(!n.isExpanded()||n.lowLevel().unit().absolutePath()==e.lowLevel().unit().absolutePath()){e.property(),e.definition();if(_e.isOverlayType(n.definition())){if(e==n)return void this.validateProperties(e,t);if(!this.nodeAllowedDueToParent(e,n)){var r=n.knownIds();if(r){if(r.hasOwnProperty(e.id()))return void this.validateProperties(e,t);t.accept($(De.INVALID_OVERLAY_NODE,{nodeId:e.id()},e))}}}}},e.prototype.validateProperties=function(e,t){var n=e.root(),r=n.lowLevel().unit().absolutePath(),i=n.isExpanded();e.attrs().forEach(function(n){i&&r!=n.lowLevel().unit().absolutePath()||n.property().getAdapter(ve.RAMLPropertyService).isKey()||n.parent()==e&&(n.isElement()||_e.isTitlePropertyName(n.name())||_e.isDescriptionPropertyName(n.name())||_e.isDisplayNamePropertyName(n.name())||_e.isUsagePropertyName(n.name())||_e.isExampleProperty(n.property())||_e.isMasterRefProperty(n.property())||_e.isAnnotationsProperty(n.property())||_e.isUsesProperty(n.property())||t.accept($(De.INVALID_OVERRIDE_IN_OVERLAY,{propName:n.name()},n)))})},e}(),ot=function(){function e(){}return e.prototype.validate=function(e,t){var n=this;(new at).validate(e,t),e.directChildren().forEach(function(e){e.isElement()&&n.validate(e.asElement(),t)})},e}(),st=function(){function e(){}return e.prototype.val=function(e,t,n){var r=this;if(e.kind()==pe.Kind.MAP||e.kind()==pe.Kind.MAPPING){var i={};e.children().forEach(function(e){var r=e.key();if(r){if(i.hasOwnProperty(r)){var a=$(De.KEYS_SHOULD_BE_UNIQUE,{},n,!1);e.unit()==n.lowLevel().unit()&&(a.start=e.keyStart(),a.end=e.keyEnd()),t.accept(a)}i[r]=1}})}e.children().forEach(function(e){r.val(e,t,n)})},e.prototype.validate=function(e,t){this.val(e.lowLevel(),t,e)},e}(),ut=function(){function e(){}return e.prototype.validate=function(e,t){this.validateChildElements(e,t);var n=e.lowLevel().children(),r=le.groupBy(n.filter(function(e){return null!=e.key()}),function(e){return e.key()});this.validateChildAttributes(e,r,t),this.validateUnrecognizedLowLevelChildren(e,r,t)},e.prototype.validateChildElements=function(e,t){var n={};e.directChildren().filter(function(e){return e.isElement()}).forEach(function(e){var t=e;if(!t._computed&&t.name()){var r=t.name()+t.property().nameId();n.hasOwnProperty(r)?t.isNamePatch()||n[r].push(t):n[r]=[t]}}),Object.keys(n).forEach(function(e){var r=n[e];!r||r.length<2||r.forEach(function(e){var n=P(e),r={name:e.name()},i=De.ALREADY_EXISTS_IN_CONTEXT;n&&(r.capitalized=Re.upperCaseFirst(n),i=De.ALREADY_EXISTS);var a=$(i,r,e);t.accept(a)})})},e.prototype.validateChildAttributes=function(e,t,n){var r=this.getHighLevelAttributes(e),i=le.groupBy(r,function(e){return e.name()}),a=this.allowsAnyAndHasRequireds(e);Object.keys(i).forEach(function(r){if(!(i[r].length<2)){var o=i[r][0].isUnknown(),s=!o&&i[r][0].property().isMultiValue();s&&(e.definition().isAssignableFrom(ye.Universe08.SecuritySchemeSettings.name)||e.definition().isAssignableFrom(ye.Universe10.SecuritySchemeSettings.name))&&(s=t[r]&&1===t[r].length),(o&&a||!s||s&&null!=t[r]&&t[r].length>1)&&i[r].forEach(function(e){var t={propName:e.property()?e.property().nameId():e.name()},r=De.PROPERTY_USED,i=P(e.parent());i&&(t.parent=Re.upperCaseFirst(i),r=De.PARENT_PROPERTY_USED);var a=$(r,t,e);n.accept(a)})}})},e.prototype.validateUnrecognizedLowLevelChildren=function(e,t,n){var r=e.directChildren(),i=le.groupBy(r,function(e){return e.name()});Object.keys(t).forEach(function(r){if(r&&t[r].length>1&&!i[r]){if(e.definition().isAssignableFrom(ye.Universe10.ObjectTypeDeclaration.name))return;var a={propName:r},o=De.PROPERTY_USED,s=P(e);s&&(a.parent=Re.upperCaseFirst(s),o=De.PARENT_PROPERTY_USED),t[r].forEach(function(t){var r=Z(o,a,t,e);r.start=t.keyStart(),r.end=t.keyEnd(),n.accept(r)})}})},e.prototype.filterMultiValueAnnotations=function(e,t,n){this.getHighLevelAttributes(e);Object.keys(t).forEach(function(e){"("!==e.charAt(0)||t[e].length})},e.prototype.getHighLevelAttributes=function(e){var t=this.allowsAnyAndHasRequireds(e);return e.directChildren().filter(function(e){return e.isAttr()||t})},e.prototype.allowsAnyAndHasRequireds=function(e){var t=e.definition().requiredProperties(),n=t&&t.length>0,r=e.definition().getAdapter(ve.RAMLService);return r&&r.getAllowAny()&&n},e}(),ct=function(){function e(){}return e.prototype.validate=function(e,t){var n=this.isStrict(e);if(n||Pe.validateNotStrictExamples){var r=this.parseObject(e,t,n);if(r){var i=this.aquireSchema(e);i&&i.validate(r,t,n)}}},e.prototype.isExampleNode=function(e){return this.isSingleExampleNode(e)||this.isExampleNodeInMultipleDecl(e)},e.prototype.isSingleExampleNode=function(e){return e.name()==ye.Universe10.TypeDeclaration.properties.example.name},e.prototype.isExampleNodeInMultipleDecl=function(e){var t=e.parent();return!!t&&_e.isExampleSpecType(t.definition())},e.prototype.findParentSchemaOrTypeAttribute=function(e){var t=e.parent().attr(ye.Universe10.TypeDeclaration.properties.schema.name);return t?t:(t=e.parent().attr(ye.Universe10.TypeDeclaration.properties.type.name))?t:e.parent()?(t=e.parent().parent().attr(ye.Universe10.TypeDeclaration.properties.schema.name))?t:(t=e.parent().parent().attr(ye.Universe10.TypeDeclaration.properties.type.name),t?t:null):null},e.prototype.aquireSchema=function(e){var t=e.parent().definition().isAssignableFrom(ye.Universe10.TypeDeclaration.name);if(this.isExampleNode(e)){var n=e;if(this.isExampleNodeInMultipleDecl(e)&&(n=e.parent()),n.parent()&&(n.parent().definition().isAssignableFrom(ye.Universe10.TypeDeclaration.name)&&null===n.parent().parent()?t=!1:n.parent().property().nameId()==ye.Universe10.LibraryBase.properties.types.name&&(t=!1),n.parent().parent())){var r=n.parent().parent().definition().key();r!=ye.Universe08.Method&&r!=ye.Universe10.Method||n.parent().property().nameId()==ye.Universe10.MethodBase.properties.queryParameters.name||(t=!0),r!=ye.Universe08.Response&&r!=ye.Universe10.Response||(t=!0)}}if(e.parent().definition().key()==ye.Universe08.BodyLike||t){var i=this.findParentSchemaOrTypeAttribute(e);if(i){var a=i.value();if(de.StructuredValue.isInstance(a))return null;var o=(""+a).trim(),s=null;if("{"==o.charAt(0))try{s=we.getJSONSchema(o,z(i.lowLevel()))}catch(e){return null}if("<"==o.charAt(0))try{s=we.getXMLSchema(o)}catch(e){return null}if(s)return{validate:function(t,n,r){try{if(t.__$validated)return;if(s instanceof Error)return void n.accept($(De.INVALID_VALUE_SCHEMA,{iValue:s.message},e,!r));s.validateObject(t)}catch(t){var a="Cannot assign to read only property '__$validated' of ";if(t.message&&0==t.message.indexOf(a)){var o=t.message.substr(a.length,t.message.length-a.length);return void n.accept($(De.INVALID_JSON_SCHEMA,{propName:o},i,!r))}if("Object.keys called on non-object"==t.message)return;return void n.accept($(De.EXAMPLE_SCHEMA_FAILURE,{msg:t.message},e,!r))}}};if(o.length>0){var u=e.parent(),c=u&&u.parent(),l=u&&u.definition()&&u.definition().isAssignableFrom(ye.Universe10.ObjectTypeDeclaration.name)&&u;if(l=l||c&&c.definition()&&c.definition().isAssignableFrom(ye.Universe10.ObjectTypeDeclaration.name)&&c)return this.typeValidator(l,e)}}}return this.getSchemaFromModel(e)},e.prototype.getSchemaFromModel=function(e){var t=e.parent();return this.typeValidator(t,e)},e.prototype.typeValidator=function(e,t){return{validate:function(n,r,i){var a=e.parsedType();if(a&&!a.isUnknown()){"number"==typeof n&&a.isString()&&(n=""+n),"boolean"==typeof n&&a.isString()&&(n=""+n),a.getExtra("repeat")&&(n=[n]);var o=a.validate(n,!1);o.isOk()||o.getErrors().forEach(function(e){return r.accept(Q(e.getCode(),e.getMessage(),t,!i))})}}}},e.prototype.toObject=function(e,t,n){var r=t.lowLevel().dumpToObject(!0);return this.testDublication(e,t.lowLevel(),n),r.example?r.example:r.content?r.content:void 0},e.prototype.testDublication=function(e,t,n){var r=this,i={};t.children().forEach(function(t){t.key()&&(i[t.key()]&&n.accept($(De.KEYS_SHOULD_BE_UNIQUE,{},new de.BasicASTNode(t,e.parent()))),i[t.key()]=t),r.testDublication(e,t,n)})},e.prototype.parseObject=function(e,t,n){var r=null,i=e.value(),a=J(e);if(de.StructuredValue.isInstance(i))r=this.toObject(e,i,t);else if(a){if(H(a))try{r=JSON.parse(i)}catch(r){return void t.accept($(De.CAN_NOT_PARSE_JSON,{msg:r.message},e,!n))}if(Y(a))try{r=xe.parseXML(i)}catch(r){return void t.accept($(De.CAN_NOT_PARSE_XML,{msg:r.message},e,!n))}}else try{if(!(i&&i.length>0)||"["!=i.trim().charAt(0)&&"{"!=i.trim().charAt(0)&&"<"!=i.trim().charAt(0)){if("true"==i)return!0;if("false"==i)return!1;var o=parseFloat(i);return isNaN(o)?i:o}r=JSON.parse(i)}catch(a){if(0!=i.trim().indexOf("<"))return i;try{r=xe.parseXML(i)}catch(r){return void t.accept($(De.CAN_NOT_PARSE_XML,{msg:r.message},e,!n))}}return r},e.prototype.isStrict=function(e){if(_e.isDefaultValue(e.property()))return!0;if(_e.isExampleProperty(e.property())&&"RAML08"==e.parent().definition().universe().version())return!1;var t=!1,n=e.parent().attr("strict");return n&&"true"==n.value()&&(t=!0),t},e}();t.ExampleAndDefaultValueValidator=ct;var lt=function(e,t,n){var r=Re.sentence(e);return t||(r=Re.ucFirst(r)),n&&(r=Ie.plural(r)),r},pt=function(){function e(){}return e.prototype.validate=function(e,t){if(e.isAttr()){if(!e.optional())return;var n=e,r=n.property();if(r.isMultiValue()||r.range().isArray())return;if(!r.isFromParentKey()){var i=p(n.parent());if(i&&r.isValueProperty()){var a=lt(i,!0,!0),o=$(De.OPTIONAL_SCLARAR_PROPERTIES_10,{templateNamePlural:a,propName:n.name()},n,!1);t.accept(o)}}}else if(e.isElement()){var s=e,r=s.property(),u=s.allowsQuestion();if(!u){var c=r?lt(r.nameId(),!0,!0):"API root";s.optionalProperties().forEach(function(n){s.children().forEach(function(n){var r={propName:c,oPropName:n.lowLevel().key()},i=$(De.OPTIONAL_PROPERTIES_10,r,e,!1);t.accept(i)})})}var l=e.asElement().definition();if(e.optional()&&"RAML10"==l.universe().version()){var r=e.property(),f=_e.isQueryParametersProperty(r)||_e.isUriParametersProperty(r)||_e.isHeadersProperty(r);if(!(_e.isMethodType(l)||_e.isTypeDeclarationType(l)&&f)){var o=$(De.ONLY_METHODS_CAN_BE_OPTIONAL,{},e,!1);t.accept(o)}}}},e}(),ft=function(){function e(){}return e.prototype.validate=function(e,t){var n=e.definition(),r=ye.Universe10.Api.properties.baseUri.name,i=ye.Universe10.Api.properties.baseUriParameters.name,a=ye.Universe10.Resource.properties.relativeUri.name,o=ye.Universe10.ResourceBase.properties.uriParameters.name;if(_e.isApiSibling(n))this.inspectParameters(e,t,r,i);else if(_e.isResourceType(n)){var s=e.root();this.inspectParameters(e,t,r,i,s),this.inspectParameters(e,t,a,o)}else if(_e.isResourceTypeType(n)){var s=e.root();this.inspectParameters(e,t,r,i,s)}},e.prototype.inspectParameters=function(e,t,n,r,i){i=i||e;var a="",o=i.attr(n);o&&((a=o.value())&&"string"==typeof a||(a="")),e.elementsOfKind(r).forEach(function(n){var i=n.attr(ye.Universe10.TypeDeclaration.properties.name.name);if(i){var o=i.value();if(null!=o&&a.indexOf("{"+o+"}")<0){if(_e.isResourceTypeType(e.definition())&&o.indexOf("<<")>=0)return;var s=Re.upperCaseFirst(Ie.singular(Re.sentence(r))),u=$(De.PROPERTY_UNUSED,{propName:s},n,!0);t.accept(u)}}})},e}(),dt=function(){function e(){this.nameProperty=ye.Universe10.ResourceType.properties.name.name}return e.prototype.validate=function(e,t){var n=e.definition();if(_e.isLibraryBaseSibling(n)||_e.isApiType(n)){var r=(ye.Universe10.LibraryBase.properties.resourceTypes.name,ye.Universe10.ResourceBase.properties.type.name),i=(ye.Universe10.LibraryBase.properties.traits.name,ye.Universe10.MethodBase.properties.is.name),a=Ae.globalDeclarations(e).filter(function(e){return _e.isResourceTypeType(e.definition())}),o=Ae.globalDeclarations(e).filter(function(e){return _e.isTraitType(e.definition())});this.checkCycles(a,r,t),this.checkCycles(o,i,t)}},e.prototype.checkCycles=function(e,t,n){var r=this,i={};e.forEach(function(e){i[r.templateName(e)]=e});var a={};e.forEach(function(e){a[r.templateName(e)]||r.findCyclesInDefinition(e,t,i).forEach(function(t){t.forEach(function(e){return a[e]=!0}),t=t.reverse();var r=lt(e.definition().nameId()),i=t.join(" -> "),o={typeName:r,cycle:i},s=$(De.CYCLE_IN_DEFINITION,o,e,!1);n.accept(s)})})},e.prototype.templateName=function(e){var t=e.attr(this.nameProperty);return t?t.value():null},e.prototype.findCyclesInDefinition=function(e,t,n,r){void 0===r&&(r={});var i=this.templateName(e);if(r[i])return[[i]];var a={};Object.keys(r).forEach(function(e){return a[e]=r[e]}),a[i]=!0;for(var o=[],s=e.attributes(t),u=0;u0&&(l=f);var d=s.keyEnd();d>0&&(p=d)}if(p0&&d>f&&(l=f,p=d)}}return{code:t,isWarning:n,message:r,node:e,start:l,end:p,path:i?s.unit()?s.unit().path():"":null,extras:[],unit:e?s.unit():null}},ht=function(e,t,n,r,i,a){var o=e.unit()&&e.unit().contents(),s=o&&o.length,u=e.start(),c=e.end();if(s&&c>=s&&(c=s-1),e.key()&&e.keyStart()){var l=e.keyStart();l>0&&(u=l);var p=e.keyEnd();p>0&&(c=p)}return{code:n,isWarning:r,message:i,node:t,start:u,end:c,path:a?e.unit()?e.unit().path():"":null,extras:[],unit:e?e.unit():null}};t.toIssue=X,t.createIssue1=$,t.createIssue=Q,t.createLLIssue=ee,t.validateResponseString=te}).call(t,n(23))},function(e,t,n){"use strict";function r(e,t,n){var r=e.definition().property(t);return r?d(r.range(),r,n):null}function i(e,t,n,r){var i=y.newMap(n.map(function(e){return y.newMapping(y.newScalar(e.key),y.newScalar(e.value))})),a=new m.ASTNode(i,r?r.lowLevel().unit():null,r?r.lowLevel():null,null,null);return new h.StructuredValue(a,r,r?r.definition().property(e):null,t)}function a(e,t,n){var r=e.definition().property(t);if(!r)return null;var i=r.range(),a=e.lowLevel().unit().stub(),o=d(i,r,n,a);return o.isInEdit=!0,o.lowLevel()._unit=a,o._parent=e.copy(),o._parent.lowLevel()._unit=a,o}function o(e,t){return a(e,"resources",t)}function s(e,t){return a(e,"methods",t)}function u(e,t){return a(e,"responses",t)}function c(e,t){return a(e,"body",t)}function l(e,t){return a(e,"uriParameters",t)}function p(e,t){return a(e,"queryParameters",t)}function f(e,t){var n=m.createMapping(e.nameId(),t);return new h.ASTPropImpl(n,null,e.range(),e)}function d(e,t,n,r){void 0===n&&(n=null);var i=m.createNode(n?n:"key",null,r),a=new h.ASTNodeImpl(i,null,e,t);return i.unit()||(i._unit=r),a.children(),a}var m=n(9),h=n(4),y=n(14);t.createStub0=r,t.genStructuredValue=i,t.createStub=a,t.createResourceStub=o,t.createMethodStub=s,t.createResponseStub=u,t.createBodyStub=c,t.createUriParameterStub=l,t.createQueryParameterStub=p,t.createAttr=f,t.createStubNode=d},function(e,t,n){(function(){var t,r,i,a,o,s,u,c,l,p,f={}.hasOwnProperty;p=n(19),l=n(58),c=n(283),o=null,t=null,r=null,i=null,a=null,s=null,u=null,e.exports=function(){function e(e){this.parent=e,this.options=this.parent.options,this.stringify=this.parent.stringify,null===o&&(o=n(167),t=n(163),r=n(164),i=n(165),a=n(166),s=n(373),u=n(375))}return e.prototype.element=function(e,t,n){var r,i,a,o,s,u,d,m,h,y;if(u=null,null==t&&(t={}),t=t.valueOf(),p(t)||(h=[t,n],n=h[0],t=h[1]),null!=e&&(e=e.valueOf()),Array.isArray(e))for(a=0,d=e.length;a0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,o,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(s=o;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){function r(e){return null==e?void 0===e?u:s:c&&c in Object(e)?a(e):o(e)}var i=n(52),a=n(239),o=n(264),s="[object Null]",u="[object Undefined]",c=i?i.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e){return null!=e&&a(e.length)&&!i(e)}var i=n(58),a=n(79);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){function r(e){return o(e)?i(e):a(e)}var i=n(203),a=n(124),o=n(42);e.exports=r},function(e,t){var n={tr:{regexp:/\u0130|\u0049|\u0049\u0307/g,map:{"İ":"i",I:"ı","İ":"i"}},az:{regexp:/[\u0130]/g,map:{"İ":"i",I:"ı","İ":"i"}},lt:{regexp:/[\u0049\u004A\u012E\u00CC\u00CD\u0128]/g,map:{I:"i̇",J:"j̇","Į":"į̇","Ì":"i̇̀","Í":"i̇́","Ĩ":"i̇̃"}}};e.exports=function(e,t){var r=n[t];return e=null==e?"":String(e),r&&(e=e.replace(r.regexp,function(e){return r.map[e]})),e.toLowerCase()}},function(e,t,n){"use strict";function r(e,t){if(void 0===t&&(t=0),t>20)return[];try{var n=[],i=e.leftType();i&&n.push(i);var a=e.rightType();if(a)if(a.hasUnionInHierarchy()){var o=r(a.unionInHierarchy(),t+1);n=n.concat(o)}else n.push(a);return n}finally{}}function i(e){var t=e.definition();if(!t||!E.isTypeDeclarationDescendant(t))return!1;var n=e.lowLevel();if(n.valueKind()!==_.Kind.SEQ)return!1;var r=n.children();if(null==r)return!1;for(var i=0,a=r;i0&&c.forEach(function(e){u||m(e,n,u)&&(u=e)}),u}}finally{r._node&&delete r._node.descriminate}}function d(e){for(var t,n=[e].concat(e.allSuperTypes()),r=0;r=r.length&&(r=i.keyPrefix(),n=i):(n=i,r=i.nameId()))}),n},e}(),R=0,I=function(){function e(){this.shouldDescriminate=!1}return e.prototype.process=function(e,t){var n=this,a=e.lowLevel();e._mergedChildren=null;var o=a._node?a._node:a;try{if(o.currentChildren)return o.currentChildren;if(!e.definition())return;if(null==e.parent()&&!this.shouldDescriminate){this.shouldDescriminate=!0;try{var s=this.process(e,t),u=e;u._children=s;var c=p(e);c&&u.patchType(c);var s=this.process(e,t);u._children=s}finally{this.shouldDescriminate=!1}}if(e.definition().hasUnionInHierarchy()&&e.parent()&&e.property().nameId()==T.Universe10.LibraryBase.properties.annotations.name){var l=r(e.definition().unionInHierarchy()),f=null,d=null,m=null,h=1e3,y=e;if(l.forEach(function(r){if(!f&&!r.hasUnionInHierarchy()){y.patchType(r);if(0==R){R++;try{for(var i=n.process(e,t),a=0,o=0;oa&&(h=a,d=i,m=r)}finally{R--}}}}),f)return y.patchType(m),f;d&&y.patchType(m)}var g=new x(e.definition().allProperties());if(null==e.parent()||e.lowLevel().includePath()){var v=e.definition().universe();"RAML10"==v.version()&&(e.definition().property("uses")||v.type("FragmentDeclaration").allProperties().forEach(function(e){return g.add(e)}))}var S=e,A=S._allowQuestion||e.definition().getAdapter(C.RAMLService).getAllowQuestion(),N=[];if(g.parentKey){if(e.lowLevel().key()){var k=new b.ASTPropImpl(e.lowLevel(),e,g.parentKey.range(),g.parentKey,!0);N.push(k);if(e.property()&&E.isBodyProperty(e.property())&&e.lowLevel().key()==e.property().nameId()){!D(S)&&S._computedKey&&k.overrideValue(S._computedKey)}}if(e.lowLevel().valueKind()===_.Kind.SEQ&&!i(e)){var I=new b.BasicASTNode(e.lowLevel(),S);return I.errorMessage={entry:w.DEFINITION_SHOULD_BE_A_MAP,parameters:{typeName:e.definition().nameId()}},N.push(I),N}}if(null!=e.lowLevel().value(!0))if(g.parentValue)N.push(new b.ASTPropImpl(e.lowLevel(),e,g.parentValue.range(),g.parentValue));else if(g.canBeValue){var M=e.lowLevel().value();null==M&&(M=e.lowLevel().value(!0)),"string"==typeof M&&M.trim().length>0&&N.push(new b.ASTPropImpl(e.lowLevel(),e,g.canBeValue.range(),g.canBeValue))}if(S._children=N,S.definition().getAdapter(C.RAMLService).isUserDefined())N=this.processChildren(t,S,N,A,g);else if(S.definition().key()==T.Universe08.Api||S.definition().key()==T.Universe10.Api){var P=t.filter(function(e){return"uses"==e.key()});N=this.processChildren(P,S,N,A,g);var L=t.filter(function(e){return"types"==e.key()});N=this.processChildren(L,S,N,A,g);var O=t.filter(function(e){return"types"!=e.key()&&"uses"!=e.key()});N=this.processChildren(O,S,N,A,g)}else N=this.processChildren(t,S,N,A,g);return S._children=N,N}finally{}},e.prototype.isTypeDeclarationShortcut=function(e,t){var n=E.isTypeProperty(t);return!!(e.definition()&&E.isTypeDeclarationTypeOrDescendant(e.definition())&&n&&e.lowLevel()&&e.lowLevel().valueKind()===_.Kind.SEQ)},e.prototype.processChildren=function(e,t,n,r,i){var a=this,o=T.Universe10.TypeDeclaration.name,s=T.Universe10.TypeDeclaration.properties.type.name,u=T.Universe10.ArrayTypeDeclaration.properties.items.name;if(t.definition()&&t.definition().isAssignableFrom(o)&&t.lowLevel()&&i.canBeValue&&(i.canBeValue.nameId()===s||i.canBeValue.nameId()===u)&&t.lowLevel()._node&&t.lowLevel()._node.value&&t.lowLevel()._node.value.kind===_.Kind.SEQ)return e.forEach(function(e){var r=new b.ASTPropImpl(e,t,i.canBeValue.range(),i.canBeValue);n.push(r)}),n;var c=t.root().lowLevel().unit();e.forEach(function(e){if(i.canBeValue&&a.isTypeDeclarationShortcut(t,i.canBeValue))return void n.push(new b.ASTPropImpl(e,t,i.canBeValue.range(),i.canBeValue));var o=e.key(),s=null!=o?i.match(o):null;if(null!=s){var u=s.range();if(s.isAnnotation()&&"annotations"!=o){var l=new b.ASTPropImpl(e,t,u,s);return void n.push(l)}var p=s.isMultiValue();u.isArray()?(p=!0,u=u.array().componentType(),!0):u.hasArrayInHierarchy()&&(p=!0,!0);var d,m=!1;if(t.reuseMode()&&e.valueKind()!=_.Kind.SEQ){var y=t.reusedNode();if(y){var v=[e],A=t.lowLevel();!s.isMerged()&&p&&(d=[],v=e.children(),A=e);for(var N=0,x=v;N0||P.length>1)&&p)if(P.length>1&&E.isTypeDeclarationSibling(t.definition())&&(E.isTypeProperty(s)||E.isItemsProperty(s))&&e.valueKind()!=_.Kind.SEQ){var l=new b.ASTPropImpl(e,t,u,s);n.push(l),t.setComputed(s.nameId(),l)}else{var O=[];P.forEach(function(e){var r=new b.ASTPropImpl(e,t,u,s);n.push(r),O.push(e.value())}),s.isInherited()&&t.setComputed(s.nameId(),O)}else{s.isInherited()&&t.setComputed(s.nameId(),e.value());var U=new b.ASTPropImpl(e,t,u,s);if(L||e.valueKind()==_.Kind.MAP){var F=s.range().nameId();s.getAdapter(C.RAMLPropertyService).isExampleProperty()||("StringType"==F&&(F="string"),"NumberType"==F&&(F="number"),"BooleanType"==F&&(F="boolean"),"string"!=F&&"number"!=F&&"boolean"!=F||e.isAnnotatedScalar()||(U.errorMessage={entry:w.INVALID_PROPERTY_RANGE,parameters:{propName:s.groupName(),range:F}},0==d.length&&"enum"==s.groupName()&&(U.errorMessage={entry:w.ENUM_IS_EMPTY,parameters:{}},e.valueKind()==_.Kind.MAP&&(U.errorMessage={entry:w.ENUM_MUST_BE_AN_ARRAY,parameters:{}}))))}n.push(U)}return}var B=[];if(t._children=n,null!=e.value()&&("string"==typeof e.value()||"boolean"==typeof e.value()||"number"==typeof e.value())&&(""+e.value()).trim().length>0){if(!s.range().allProperties().some(function(e){var t=e;return!!t&&(t.canBeValue()&&t.isFromParentValue())})){var K=new b.BasicASTNode(e,t);K.getLowLevelEnd=function(){return-1},K.getLowLevelStart=function(){return-1},K.knownProperty=s,n.push(K)}}if(s.isMerged()){var V=new b.ASTNodeImpl(e,t,u,s);V._allowQuestion=r,B.push(V)}else if(p)if(s.getAdapter(C.RAMLPropertyService).isEmbedMap()){var j=d,W=[],q=!1;if(j.forEach(function(e){e.kind()==_.Kind.INCLUDE_REF&&"RAML08"==t.universe().version()?e.children().forEach(function(e){var n=new b.ASTNodeImpl(e,t,u,s);n._allowQuestion=r,B.push(n),q=!0}):W.push(e)}),j=W,0==j.length){if(s.range().key()==T.Universe08.ResourceType&&!q){var z=new b.BasicASTNode(e,t);z.errorMessage={entry:w.PROPERTY_MUST_BE_A_MAP,parameters:{propName:s.nameId()}},n.push(z)}if(e.valueKind()==_.Kind.SCALAR&&s.range().key()==T.Universe08.AbstractSecurityScheme){var z=new b.BasicASTNode(e.parent(),t);z.errorMessage={entry:w.PROPERTY_MUST_BE_A_MAP,parameters:{propName:s.nameId()}},n.push(z)}}if(j.forEach(function(e){var i=e.children();if(e.key()||1!=i.length)if("RAML10"==t.universe().version()){var a=new b.ASTNodeImpl(e,t,u,s);a._allowQuestion=r,B.push(a)}else{var o=new b.BasicASTNode(e,t);n.push(o),e.key()&&(o.needSequence=!0)}else if("RAML10"!=t.universe().version()||t.parent()){var a=new b.ASTNodeImpl(i[0],t,u,s);a._allowQuestion=r,B.push(a)}}),"RAML10"==t.universe().version()&&e.valueKind()==_.Kind.SEQ){var K=new b.BasicASTNode(e,t);n.push(K),K.needMap=!0,K.knownProperty=s}}else{var H={},Y=[];if(h.NodeClass.isInstance(u)){var J=u;J.getAdapter(C.RAMLService).getCanInherit().length>0&&J.getAdapter(C.RAMLService).getCanInherit().forEach(function(n){for(var i=t.computedValue(n),a=Array.isArray(i)?i:[i],o=0;o0?G.forEach(function(e){return B.push(e)}):Y.forEach(function(e){return B.push(e)})}else B.push(new b.ASTNodeImpl(e,t,u,s));t._children=t._children.concat(B),n=n.concat(B),B.forEach(function(e){var n=f(s,t,e);n&&n!=e.definition()&&e.patchType(n),e._associatedDef=null,s.childRestrictions().forEach(function(t){e.setComputed(t.name,t.value)});e.definition()})}else S.LowLevelCompositeNode.isInstance(e)&&null==e.primaryNode()||n.push(new b.BasicASTNode(e,t))});var l=t.reusedNode();if(l&&t.lowLevel().valueKind()!=_.Kind.SEQ){var p={};l.elements().forEach(function(e){return p[e.property().nameId()+"_"+e.lowLevel().key()]=e}),l.attrs().forEach(function(e){return p[e.property().nameId()+"_"+e.lowLevel().key()]=e}),n.filter(function(e){return e.isElement()||e.isAttr()}).forEach(function(e){var n=p[e.property().nameId()+"_"+e.lowLevel().key()];n&&n!=e&&e.isElement()&&e.lowLevel().parent().valueKind()!=_.Kind.SEQ&&(e.setReusedNode(n),e.setReuseMode(t.reuseMode()))})}return n},e}();t.BasicNodeBuilder=I,t.doDescrimination=p;var D=function(e){for(var t=!1,n=e;n;){var r=n.definition();if(E.isTraitType(r)||E.isResourceTypeType(r)){t=!0;break}n=n.parent()}return t}},function(e,t){function n(e){return null}function r(e,t){}function i(e){return!1}function a(e){}function o(e){}function s(e){return{isDirectory:function(){return!1},isSymbolicLink:function(){return!1},isFile:function(){return!1}}}function u(e){return this.statSync(e)}function c(e,t){return[]}function l(e){}t.readFileSync=n,t.writeFileSync=r,t.existsSync=i,t.mkdirSync=a,t.readdirSync=o,t.statSync=s,t.lstatSync=u,t.list=c,t.onChange=l},function(e,t,n){"use strict";(function(e){function n(){var t=e.ramlValidation;if(t){var n=t.typeValidators;if(Array.isArray(n))return n}return[]}function r(){var t=e.ramlValidation;if(t){var n=t.typesystemAnnotationValidators;if(Array.isArray(n))return n}return[]}t.REPEAT="repeat",t.PARSE_ERROR="parseError",t.TOP_LEVEL_EXTRA="topLevel",t.DEFINED_IN_TYPES_EXTRA="definedInTypes",t.USER_DEFINED_EXTRA="USER_DEFINED",t.SOURCE_EXTRA="SOURCE",t.SCHEMA_AND_TYPE_EXTRA="SCHEMA",t.GLOBAL_EXTRA="GLOBAL",t.HAS_FACETS="HAS_FACETS",t.HAS_ITEMS="HAS_ITEMS",function(e){e[e.Description=0]="Description",e[e.NotScalar=1]="NotScalar",e[e.DisplayName=2]="DisplayName",e[e.Usage=3]="Usage",e[e.Annotation=4]="Annotation",e[e.FacetDeclaration=5]="FacetDeclaration",e[e.CustomFacet=6]="CustomFacet",e[e.Example=7]="Example",e[e.Required=8]="Required",e[e.HasPropertiesFacet=9]="HasPropertiesFacet",e[e.AllowedTargets=10]="AllowedTargets",e[e.Examples=11]="Examples",e[e.XMLInfo=12]="XMLInfo",e[e.Default=13]="Default",e[e.Constraint=14]="Constraint",e[e.Modifier=15]="Modifier",e[e.Discriminator=16]="Discriminator",e[e.DiscriminatorValue=17]="DiscriminatorValue"}(t.MetaInformationKind||(t.MetaInformationKind={}));t.MetaInformationKind;t.getTypeValidationPlugins=n,t.getAnnotationValidationPlugins=r}).call(t,n(13))},function(e,t,n){"use strict";function r(e,t,n){var i=[];return e.include.forEach(function(e){n=r(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&i.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===i.indexOf(t)})}function i(){function e(e){r[e.tag]=e}var t,n,r={};for(t=0,n=arguments.length;t0&&(u[e.attr("method").value()]=t)});var l,p=t.attr("type");if(null!=p){var f=c(i);l=this.readGenerictData(e,p,t,"resource type",r,f)}var d={resourceType:l,traits:s,methodTraits:u};if(n.push(d),l){var m=l.node,y=h.qName(m,e);a[y]?d.resourceType=null:(a[y]=!0,this.collectResourceData(e,m,n,l.transformer,i,a))}return n},e.prototype.extractTraits=function(e,t,n,r){var i=this;void 0===r&&(r={}),n=n.concat([e]);for(var a=[],o=-1;o>")){var o=e.substring(2,e.length-2),s=this.structuredParams[o];if(null!=s)return{value:s,errors:a}}for(var u=e,c=new D,l=0,p=u.indexOf("<<");p>=0;p=u.indexOf("<<",l)){c.append(u.substring(l,p));var f=p;if(p+="<<".length,(l=this.paramUpperBound(u,p))==-1)break;var m=u.substring(p,l);l+=">>".length;var h,o,y=u.substring(f,l),g=d(m);if(g.length>0){var v=m.indexOf("|");if(o=m.substring(0,v).trim(),h=this.params[o],h&&"string"==typeof h&&h.indexOf("<<")>=0&&this.vDelegate&&(h=this.vDelegate.transform(h,t,n,r).value),h)for(var b=0,S=g;b=0&&this.vDelegate&&(h=this.vDelegate.transform(h,t,n,r).value);null!==h&&void 0!==h||(i[o]=!0,h=y),c.append(h)}return c.append(u.substring(l,u.length)),{value:c.value(),errors:a}}return{value:e,errors:a}},e.prototype.paramUpperBound=function(e,t){for(var n=0,r=t;r>",r)){if(0==n)return r;n--,r++}return e.length},e.prototype.children=function(e){var t=this.substitutionNode(e);return t?t.children():null},e.prototype.valueKind=function(e){var t=this.substitutionNode(e);return t?t.valueKind():null},e.prototype.includePath=function(e){var t=this.substitutionNode(e);return t?t.includePath():null},e.prototype.substitutionNode=function(e){var t=this.paramName(e);return t&&this.structuredParams[t]},e.prototype.paramName=function(e){var t=null;if(e.valueKind()==y.Kind.SCALAR){var n=(""+e.value()).trim();_.stringStartsWith(n,"<<")&&_.stringEndsWith(n,">>")&&(t=n.substring(2,n.length-2))}return t},e}();t.ValueTransformer=M;var P=function(e){function t(t,n,r){e.call(this,null!=n?n.templateKind:"",null!=n?n.templateName:"",r),this.owner=t,this.delegate=n}return m(t,e),t.prototype.transform=function(t,n,r,i){if(null==t||null!=r&&!r())return{value:t,errors:[]};var a={value:t,errors:[]},o=!1;L.forEach(function(e){return o=o||t.toString().indexOf("<<"+e)>=0}),o&&(this.initParams(),a=e.prototype.transform.call(this,t,n,r,i));var s=null!=this.delegate?this.delegate.transform(a.value,n,r,i):a.value;return null!=r&&r()&&null!=i&&(s.value=i(s.value,this)),s},t.prototype.initParams=function(){for(var e,t,n="",r=this.owner.lowLevel(),i=r,a=null;i;){var o=i.key();if(null!=o)if(_.stringStartsWith(o,"/")){if(!t)for(var s=o.split("/"),u=s.length-1;u>=0;u--){var c=s[u];if(c.indexOf("{")==-1){t=s[u];break}c.length>0&&(a=c)}n=o+n}else e=o;i=i.parent()}t||a&&(t=""),this.params={resourcePath:n,resourcePathName:t},e&&(this.params.methodName=e)},t.prototype.children=function(e){return null!=this.delegate?this.delegate.children(e):null},t.prototype.valueKind=function(e){return null!=this.delegate?this.delegate.valueKind(e):null},t.prototype.includePath=function(e){return null!=this.delegate?this.delegate.includePath(e):null},t}(M);t.DefaultTransformer=P;var L=["resourcePath","resourcePathName","methodName"]},function(e,t,n){"use strict";function r(e){var t=e.ast(),n=p.find(t.children(),function(e){return e.key()==o.Universe10.Extension.properties.extends.name});return n&&n.value()}var i=n(20),a=n(11),o=n(3),s=n(14),u=n(28),c=n(4),l=n(0),p=n(1),f=function(){function e(){this.expandedAbsToNsMap={},this._expandedNSMap={},this.byPathMap={},this.byNsMap={},this._hasFragments={},this._unitModels={}}return e.prototype.hasTemplates=function(e){var t=this.unitModel(e);if(!t.traits.isEmpty()||!t.resourceTypes.isEmpty())return!0;var n=this.expandedPathMap(e);if(n)for(var i=0,a=Object.keys(n);i0&&w.length>0&&n.charAt(0).toLowerCase()!=w.charAt(0).toLowerCase()?w:a.relative(n,w),C=C.replace(/\\/g,"/");var k=new d(_,h.unit,C);v[k.absolutePath()]||(o[m]=k,p.push(k),v[k.absolutePath()]=!0)}}r.forEach(function(e){e.includedFrom()&&(e=e.parent()),T(e)}),null==e.parent()&&(g[e.unit().absolutePath()]=!1)}};T(S.ast())}}for(var E={},C=0,N=Object.keys(o);Ct.length)return!1;if(e.lengthi)return!1}return!0},e.prototype.hasFragments=function(e){return this.calculateExpandedNamespaces(e),!!this._hasFragments[e.absolutePath()]},e.prototype.unitModel=function(e){var t=e.absolutePath(),n=this._unitModels[t];return n||(n=new h(e),this._unitModels[t]=n),n},e}();t.NamespaceResolver=f;var d=function(){function e(e,t,n){this.usesNodes=e,this.unit=t,this.includePath=n,this.namespaceSegments=this.usesNodes.map(function(e){return e.key()})}return e.prototype.steps=function(){return this.namespaceSegments.length},e.prototype.namespace=function(){return this.namespaceSegments.join(".")},e.prototype.absolutePath=function(){return this.unit.absolutePath()},e}();t.UsesInfo=d;var m=function(){function e(e){this.name=e,this.array=[],this.map={}}return e.isInstance=function(t){return null!=t&&t.getClassIdentifier&&"function"==typeof t.getClassIdentifier&&p.contains(t.getClassIdentifier(),e.CLASS_IDENTIFIER)},e.prototype.getClassIdentifier=function(){return[].concat(e.CLASS_IDENTIFIER)},e.prototype.addElement=function(e){this.array.push(e),this.map[e.key()]=e},e.prototype.hasElement=function(e){return null!=this.map[e]},e.prototype.getElement=function(e){return this.map[e]},e.prototype.isEmpty=function(){return 0==this.array.length},e.CLASS_IDENTIFIER="namespaceResolver.ElementsCollection",e}();t.ElementsCollection=m;var h=function(){function e(e){this.unit=e,this.initCollections()}return e.prototype.initCollections=function(){this.types=new m(l.universesInfo.Universe10.LibraryBase.properties.types.name),this.annotationTypes=new m(l.universesInfo.Universe10.LibraryBase.properties.annotationTypes.name),this.securitySchemes=new m(l.universesInfo.Universe10.LibraryBase.properties.securitySchemes.name),this.traits=new m(l.universesInfo.Universe10.LibraryBase.properties.traits.name),this.resourceTypes=new m(l.universesInfo.Universe10.LibraryBase.properties.resourceTypes.name);var e=this.unit.ast();if(e&&this.isLibraryBaseDescendant(this.unit))for(var t="0.8"==c.ramlFirstLine(this.unit.contents())[1],n=0,r=e.children();n0&&r.push(t[0])})):r=t,r.forEach(function(t){return e.addElement(t)})},e.prototype.isLibraryBaseDescendant=function(e){var t=this,n=c.ramlFirstLine(e.contents());if(!n)return!1;if(n.length<3||!n[2])return!0;var r=n[2];if(!this.libTypeDescendants){this.libTypeDescendants={};var i=l.getUniverse("RAML10"),a=i.type(l.universesInfo.Universe10.LibraryBase.name);[a].concat(a.allSubTypes()).forEach(function(e){return t.libTypeDescendants[e.nameId()]=!0})}return this.libTypeDescendants[r]},e}();t.UnitModel=h},function(e,t,n){"use strict";function r(e){if(null==e||"string"!=typeof e)return{status:w.NOT_REQUIRED};for(var t="",n={},r=0,i=e.indexOf("<<");i>=0;i=e.indexOf("<<",r)){if(t+=e.substring(r,i),(r=e.indexOf(">>",i))<0)return{status:w.ERROR};r+=">>".length;var a=e.substring(i,r),o=k+i+k;n[o]=a,t+=o}return 0==t.length?{status:w.NOT_REQUIRED}:(t+=e.substring(r,e.length),{resultingString:t,substitutions:n,status:w.OK})}function i(e,t){if(null==e)return{status:w.NOT_REQUIRED};for(var n="",r=0,i=e.indexOf(k);i>=0;i=e.indexOf(k,r)){if(r=e.indexOf(k,i+1),(r+=k.length)<0)return{status:w.ERROR};var a=e.substring(i,r),o=t[a];if(null==o)return{status:w.ERROR};n+=o}return 0==n.length?{status:w.NOT_REQUIRED}:(n+=e.substring(r,e.length),{resultingString:n,substitutions:t,status:w.OK})}function a(e){for(var t=!1,n=0;n=0&&(i=e.substring(0,o),a=e.substring(o+1));for(var s,u=!1,c=r.length;c>0;c--){var l=r[c-1],p=l.highLevel();if(p.isElement()&&S.isLibraryType(p.asElement().definition())){if(u)break;u=!0}var f=l;if(i){f=null;var d=n.nsMap(l);if(d){var m=d[i];m&&(f=m.unit)}}if(f){var h=f.highLevel();if(h&&h.isElement()&&(s=b.find(h.asElement().elementsOfKind(t),function(e){return e.name()==a})))break}}return s}function p(e){var t=e.indexOf("<<");return!(t<0)&&(0!=t||e.indexOf(">>",t)+">>".length!=e.length)}var f=n(20),d=n(4),m=n(14),h=n(9),y=n(62),_=n(15),g=n(17),v=n(3),b=n(1),S=n(5),A=n(60),T=n(0),E=T.rt.typeExpressions;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.PATH=1]="PATH"}(t.PatchMode||(t.PatchMode={}));var C=t.PatchMode,N=function(){function e(e){void 0===e&&(e=C.DEFAULT),this.mode=e,this._outerDependencies={},this._libModels={}}return e.prototype.process=function(e,t,n,r){var i=this;if(void 0===t&&(t=e),void 0===n&&(n=!1),void 0===r&&(r=!1),!e.lowLevel().libProcessed){var a=e.lowLevel().unit().project().namespaceResolver();this.patchReferences(e,t,a),r&&this.patchNodeName(e,t.lowLevel().unit(),a),n?this.removeUses(e):this.patchUses(e,a),e.elements().forEach(function(e){return i.removeUses(e)}),this.resetTypes(e),e.lowLevel().libProcessed=!0}},e.prototype.patchReferences=function(e,t,n,r){if(void 0===t&&(t=e),void 0===n&&(n=new A.NamespaceResolver),void 0===r&&(r=[t.lowLevel().unit()]),!e.isReused()){var i;if(null!=e.definition().property(v.Universe10.TypeDeclaration.properties.annotations.name)){var a=e.lowLevel();if(!g.LowLevelCompositeNode.isInstance(a))return;var s=v.Universe10.MethodBase.properties.is.name,u=e.attributes(s);0!=u.length&&(i=o(e,u.map(function(e){return e.lowLevel()}).map(function(e){return g.LowLevelProxyNode.isInstance(e)?{node:e,transformer:e.transformer()}:{node:e,transformer:null}}),r[0].absolutePath()))}for(var c=e.attrs(),l=0,p=c;l0&&(l=f[0])}var m=D(l);if(!m&&l.isArray()&&(m=D(l.componentType())),!m){var h=t.lowLevel().unit(),y=(h.absolutePath(),e.attributes(v.Universe10.TypeDeclaration.properties.type.name));0==y.length&&(y=e.attributes(v.Universe10.TypeDeclaration.properties.schema.name));var _=e.attributes(v.Universe10.ArrayTypeDeclaration.properties.items.name);y=y.concat(_);for(var S=0,A=y;S=0){var L=u(C),O=L.value();if(M=r(O),M.status==w.OK)I=x?M.resultingString:O;else{if(M.status==w.ERROR)return;R=null}}var U;if(P){U=[];for(var F=0,B=P;F=0&&p(a)&&(l=!1);var f=s.resolveReferenceValue(a,h,o,n,R,c,l);null!=f&&(r.value=f.value(),H=!0,s.registerPatchedReference(f))}}),W=H&&!q?E.serializeToString(z):k}else if(M.status!=w.OK||null!=R){I.indexOf("<<")>=0&&p(I)&&(I=k,R=null);var Y=this.resolveReferenceValue(I,h,o,n,R,c);null!=Y&&(this.registerPatchedReference(Y),W=Y.value())}if(null!=W&&(T.lowLevel().setValueOverride(W),T.overrideValue(null)),this.popUnitIfNeeded(o,j),U)for(var J=0,G=U.reverse();J=0){var p=!0,f=t.highLevel().types();u=i.transform(e,!0,function(){return p},function(e,n){var i=s.resolveReferenceValueBasic(e,t,r,n.unitsChain,a);return null==i&&(i=new x(null,e,s.collectionName(a),t,C.DEFAULT)),p=l?(f.getAnnotationType(i.value()),!1):(f.getType(i.value()),!1),i}).value}return void 0!==u&&c(u)||(u=this.resolveReferenceValueBasic(e,t,r,n,a)),u},e.prototype.patchNodeName=function(e,t,n){var r=e.lowLevel(),i=r.key(),a=e.definition();if(S.isTypeDeclarationSibling(a)){var o=e.localType();o.isAnnotationType()&&(a=o)}var s=this.resolveReferenceValueBasic(i,t,n,[r.unit()],a);null!=s&&(r.setKeyOverride(s.value()),e.resetIDs())},e.prototype.resolveReferenceValueBasic=function(e,t,n,r,i){if(null==e||"string"!=typeof e)return null;var a,o,s=S.isTypeDeclarationDescendant(i),u=s&&_.stringEndsWith(e,"?"),c=u?e.substring(0,e.length-1):e,l=c.lastIndexOf(".");if(l>=0){var p=c.substring(0,l);o=c.substring(l+1);for(var d=r.length;d>0;d--){var m=r[d-1],h=n.nsMap(m);if(null!=h){var y=h[p];if(null!=y&&null!=(a=y.unit))break}}}else{if(s&&null!=T.rt.builtInTypes().get(c))return null;o=c,a=r[r.length-1]}var g=this.collectionName(i);if(null==a||a.absolutePath()==t.absolutePath())return null;var v=n.resolveNamespace(t,a);if(null==v)return null;var b=v.namespace();if(null==b)return null;if(this.mode==C.PATH){var A=a.absolutePath().replace(/\\/g,"/");f.isWebPath(A)||(A="file://"+A),b=A+"#/"+g}return u&&(o+="?"),new x(b,o,g,a,this.mode)},e.prototype.patchUses=function(e,t){var n=e.lowLevel();if(e.children(),g.LowLevelCompositeNode.isInstance(n)){var r=n.unit(),i=t.expandedPathMap(r);if(null!=i){var a=t.pathMap(r);a||(a={});for(var o=n,s=n.children(),c=v.Universe10.FragmentDeclaration.properties.uses.name,l=s.filter(function(e){return e.key()==c}),p=u(n),f=p;g.LowLevelProxyNode.isInstance(f);)f=f.originalNode();var m,y=Object.keys(a).map(function(e){return i[e]}),_=Object.keys(i).map(function(e){return i[e]}).filter(function(e){return!a[e.absolutePath()]}),b=r.absolutePath(),A={};if(l.length>0)m=l[0],m.children().forEach(function(e){return A[e.key()]=!0});else{var T=h.createMapNode("uses");T._parent=f,T.setUnit(f.unit()),m=o.replaceChild(null,T)}for(var E=e.definition().property(c),C=E.range(),N=e._children.filter(function(e){if(e.lowLevel().unit().absolutePath()==b)return!0;var t=e.property();return!t||!S.isUsesProperty(t)}),w=e._mergedChildren.filter(function(e){if(e.lowLevel().unit().absolutePath()==b)return!0;var t=e.property();return!t||!S.isUsesProperty(t)}),k=0,x=y.concat(_);k0&&n.removeChild(i[0]),e._children=e.directChildren().filter(function(e){var t=e.property();return null==t||!S.isUsesProperty(t)}),e._mergedChildren=e.children().filter(function(e){var t=e.property();return null==t||!S.isUsesProperty(t)})}},e.prototype.resetTypes=function(e){for(var t=0,n=e.elements();t0&&(n.__$errors__=r)}return n}var s=[];return e.children().forEach(function(e){s.push(i(e,t))}),s}function a(e){var t=[].concat(e.errors());return e.children().forEach(function(e){var n=e.children();if(0==n.length)return void e.errors().forEach(function(e){return t.push(e)});n[0].key()||n.forEach(function(e){0==e.children().length&&e.errors().forEach(function(e){return t.push(e)})})}),t}function o(e,t){return t&&e&&t.escapeNumericKeys&&0==e.replace(/\d/g,"").trim().length?"__$EscapedKey$__"+e:e}function s(e,t){return e?(t=t||{},t.escapeNumericKeys&&p.stringStartsWith(e,"__$EscapedKey$__")&&0==e.substring("__$EscapedKey$__".length).replace(/\d/g,"").trim().length?e.substring("__$EscapedKey$__".length):e):e}var u=n(14),c=n(20),l=n(4),p=n(15),f=n(9),d=u.YAMLException,m=function(){function e(e,t,n,r,i,a){void 0===a&&(a={}),this._absolutePath=e,this._path=t,this._content=n,this._project=r,this._isTopoLevel=i,this.serializeOptions=a,this._node=new h(this,JSON.parse(this._content),null,a)}return e.prototype.highLevel=function(){return l.fromUnit(this)},e.prototype.absolutePath=function(){return this._absolutePath},e.prototype.clone=function(){return null},e.prototype.contents=function(){return this._content},e.prototype.lexerErrors=function(){return[]},e.prototype.path=function(){return this._content},e.prototype.isTopLevel=function(){return this._isTopoLevel},e.prototype.ast=function(){return this._node},e.prototype.expandedHighLevel=function(){return this.highLevel()},e.prototype.isDirty=function(){return!0},e.prototype.getIncludeNodes=function(){return[]},e.prototype.resolveAsync=function(e){return null},e.prototype.isRAMLUnit=function(){return!0},e.prototype.project=function(){return this._project},e.prototype.updateContent=function(e){},e.prototype.ramlVersion=function(){throw new d("not implemented")},e.prototype.lineMapper=function(){return new c.LineMapperImpl(this.contents(),this.absolutePath())},e.prototype.resolve=function(e){return null},e.prototype.isOverlayOrExtension=function(){return!1},e.prototype.getMasterReferenceNode=function(){return null},e}();t.CompilationUnit=m;var h=function(){function e(e,t,n,r,i){var a=this;void 0===r&&(r={}),this._unit=e,this._object=t,this._parent=n,this.options=r,this._key=i,this._isOptional=!1,this._object instanceof Object&&Object.keys(this._object).forEach(function(e){var t=s(e,a.options);if(t!=e){var n=a._object[e];delete a._object[e],a._object[t]=n}}),this._key&&p.stringEndsWith(this._key,"?")&&(this._isOptional=!0,this._key=this._key.substring(0,this._key.length-1))}return e.prototype.keyKind=function(){return null},e.prototype.isAnnotatedScalar=function(){return!1},e.prototype.hasInnerIncludeError=function(){return!1},e.prototype.start=function(){return-1},e.prototype.end=function(){return-1},e.prototype.value=function(){return this._object},e.prototype.actual=function(){return this._object},e.prototype.includeErrors=function(){return[]},e.prototype.includePath=function(){return null},e.prototype.includeReference=function(){return null},e.prototype.key=function(){return this._key},e.prototype.optional=function(){return this._isOptional},e.prototype.children=function(){var t=this;return this._object?Array.isArray(this._object)?this._object.map(function(n){return new e(t._unit,n,t,t.options)}):this._object instanceof Object?Object.keys(this._object).map(function(n){return new e(t._unit,t._object[n],t,t.options,n)}):[]:[]},e.prototype.parent=function(){return this._parent},e.prototype.unit=function(){return this._unit},e.prototype.containingUnit=function(){return this._unit},e.prototype.includeBaseUnit=function(){return this._unit},e.prototype.anchorId=function(){return null},e.prototype.errors=function(){return[]},e.prototype.anchoredFrom=function(){return this},e.prototype.includedFrom=function(){return this},e.prototype.visit=function(e){e(this)&&this.children().forEach(function(t){return t.visit(e)})},e.prototype.dumpToObject=function(){return this._object},e.prototype.addChild=function(e){},e.prototype.execute=function(e){},e.prototype.dump=function(){return JSON.stringify(this._object)},e.prototype.keyStart=function(){return-1},e.prototype.keyEnd=function(){return-1},e.prototype.valueStart=function(){return-1},e.prototype.valueEnd=function(){return-1},e.prototype.isValueLocal=function(){return!0},e.prototype.kind=function(){return Array.isArray(this._object)?u.Kind.SEQ:this._object instanceof Object?u.Kind.MAP:u.Kind.SCALAR},e.prototype.valueKind=function(){if(!this._object)return null;var e=typeof this._object;return Array.isArray(this._object)?u.Kind.SEQ:"object"==e?u.Kind.MAP:"string"==e||"number"==e||"boolean"==e?u.Kind.SCALAR:null},e.prototype.anchorValueKind=function(){return null},e.prototype.show=function(e){},e.prototype.setHighLevelParseResult=function(e){this._highLevelParseResult=e},e.prototype.highLevelParseResult=function(){return this._highLevelParseResult},e.prototype.setHighLevelNode=function(e){this._highLevelNode=e},e.prototype.highLevelNode=function(){return this._highLevelNode},e.prototype.text=function(e){throw new d("not implemented")},e.prototype.copy=function(){throw new d("not implemented")},e.prototype.markup=function(e){throw new d("not implemented")},e.prototype.nodeDefinition=function(){return f.getDefinitionForLowLevelNode(this)},e.prototype.includesContents=function(){return!1},e}();t.AstNode=h,t.serialize2=r,t.serialize=i},function(e,t,n){"use strict";function r(e){return a.isWebPath(e)}var i=n(11),a=n(20),o=n(28),s=function(){function e(e){this.unit=e}return e.prototype.contextPath=function(){return this.unit?this.unit.absolutePath()||"":""},e.prototype.normalizePath=function(e){if(!e)return e;var t;if(r(e)){var n=0===e.toLowerCase().indexOf("https")?"https://":"http://";t=n+i.normalize(e.substring(n.length)).replace(/\\/g,"/")}else t=i.normalize(e).replace(/\\/g,"/");return t},e.prototype.content=function(e){var t=this.normalizePath(e),n=this.toRelativeIfNeeded(t),r=this.unit.resolve(n);return r?r.contents()||"":""},e.prototype.contentAsync=function(e){var t=this.normalizePath(e),n=this.toRelativeIfNeeded(t),r=this.unit.resolveAsync(n);return r?r.then(function(e){return e&&e.contents()||""}):Promise.resolve("")},e.prototype.toRelativeIfNeeded=function(e){var t=e;return i.isAbsolute(e)&&!r(e)&&(t=i.relative(i.dirname(this.unit.absolutePath()),e)),t},e.prototype.hasAsyncRequests=function(){return o.hasAsyncRequests()},e.prototype.resolvePath=function(e,t){return a.buildPath(t,e,this.unit.project().getRootPath())},e.prototype.isAbsolutePath=function(e){return!!e&&(!!r(e)||i.isAbsolute(e))},e.prototype.promiseResolve=function(e){return Promise.resolve(e)},e}();t.ContentProvider=s},function(e,t,n){"use strict";function r(e){return e&&e.indexOf("\n")>=0}function i(e){return r(e)&&e.length>2&&"|"==e[0]&&("\n"==e[1]||"\r"==e[1]||"\n"==e[2])}function a(e,t){var n="";if(r(e)){n+="|\n";for(var i=d(e),a=0;a0;){var n=e[t-1];if(" "!=n&&"\t"!=n&&"\r"!=n&&"\n"!=n)break;t--}return e.substring(0,t)}function f(e){return s(p(e))}function d(e){return e.match(/^.*((\r\n|\n|\r)|$)/gm)}function m(e,t){if(!e||!t||e.length0;){var n=this.contents[t-1];if(" "!=n&&"\t"!=n)break;t--}return new e(this.contents,this.start,t)},e.prototype.extendToStartOfLine=function(){for(var t=this.start;t>0;){var n=this.contents[t-1];if("\r"==n||"\n"==n)break;t--}return new e(this.contents,t,this.end)},e.prototype.extendAnyUntilNewLines=function(){var t=this.end;if(t>0){if("\n"==this.contents[t-1])return this}for(;t0){if("\n"==this.contents[t-1])return this}for(;t0;){if(" "!=this.contents[t-1])break;t--}return new e(this.contents,t,this.end)},e.prototype.extendCharIfAny=function(t){var n=this.end;return n0&&this.contents[n-1]==t&&n--,new e(this.contents,n,this.end)},e.prototype.extendToNewlines=function(){var t=this.end;if(t>0){if("\n"==this.contents[t-1])return this}for(;t0;){var n=this.contents[t-1];if("\r"==n||"\n"==n)break;t--}return new e(this.contents,t,this.end)},e.prototype.reduceNewlinesEnd=function(){for(var t=this.end;t>this.start;){var n=this.contents[t-1];if("\r"!=n&&"\n"!=n)break;t--}return new e(this.contents,this.start,t)},e.prototype.reduceSpaces=function(){for(var t=this.end;t>this.start;){if(" "!=this.contents[t-1])break;t--}return new e(this.contents,this.start,t)},e.prototype.replace=function(e){return this.sub(0,this.start)+e+this.sub(this.end,this.unitText().length)},e.prototype.remove=function(){return this.sub(0,this.start)+this.sub(this.end,this.unitText().length)},e}();t.TextRange=_},function(e,t,n){"use strict";function r(){return h?h:h=new m}var i=n(6),a=n(7),o=n(6),s=n(8),u=n(7),c=n(7),l=n(7),p=n(7),f=n(8),d=function(){function e(e,t){this._construct=e,this._constructWithValue=t}return e.prototype.isSimple=function(){return null!=this._constructWithValue},e.prototype.newInstance=function(){return this._construct()},e.prototype.createWithValue=function(e){return this._constructWithValue(e)},e.prototype.isApplicable=function(e){var t=this.newInstance(),n=t.requiredType(),r=t.requiredTypes();return r&&r.length>0?r.some(function(t){return e.isSubTypeOf(t)}):e.isSubTypeOf(n)},e.prototype.isInheritable=function(){return this.newInstance().isInheritable()},e.prototype.isConstraint=function(){return this.newInstance()instanceof i.Constraint},e.prototype.isMeta=function(){return!this.isConstraint()},e.prototype.name=function(){return this.newInstance().facetName()},e}();t.FacetPrototype=d;var m=function(){function e(){var e=this;this.constraints=[new d(function(){return new s.MinProperties(1)},function(e){return new s.MinProperties(e)}),new d(function(){return new s.MaxProperties(1)},function(e){return new s.MaxProperties(e)}),new d(function(){return new s.MinItems(1)},function(e){return new s.MinItems(e)}),new d(function(){return new s.MaxItems(1)},function(e){return new s.MaxItems(e)}),new d(function(){return new s.MinLength(1)},function(e){return new s.MinLength(e)}),new d(function(){return new s.MaxLength(1)},function(e){return new s.MaxLength(e)}),new d(function(){return new s.Minimum(1)},function(e){return new s.Minimum(e)}),new d(function(){return new f.MultipleOf(1)},function(e){return new f.MultipleOf(e)}),new d(function(){return new s.Maximum(1)},function(e){return new s.Maximum(e)}),new d(function(){return new s.Enum([""])},function(e){return new s.Enum(e)}),new d(function(){return new s.Pattern(".")},function(e){return new s.Pattern(e)}),new d(function(){return new s.Format("")},function(e){return new s.Format(e)}),new d(function(){return new s.PropertyIs("x",i.ANY)},null),new d(function(){return new s.AdditionalPropertyIs(i.ANY)},null),new d(function(){return new s.MapPropertyIs(".",i.ANY)},null),new d(function(){return new s.HasProperty("x")},null),new d(function(){return new s.UniqueItems(!0)},function(e){return new s.UniqueItems(e)}),new d(function(){return new s.ComponentShouldBeOfType(i.ANY)},null),new d(function(){return new s.KnownPropertyRestriction(!1)},function(e){return new s.KnownPropertyRestriction(e)}),new d(function(){return new s.FileTypes([""])},function(e){return new s.FileTypes(e)})],this.meta=[new d(function(){return new a.Discriminator("kind")},function(e){return new a.Discriminator(e)}),new d(function(){return new a.DiscriminatorValue("x")},function(e){return new a.DiscriminatorValue(e)}),new d(function(){return new u.Default("")},function(e){return new u.Default(e)}),new d(function(){return new p.Usage("")},function(e){return new p.Usage(e)}),new d(function(){return new u.Example("")},function(e){return new u.Example(e)}),new d(function(){return new l.Required(!0)},function(e){return new l.Required(e)}),new d(function(){return new a.Examples({})},function(e){return new a.Examples(e)}),new d(function(){return new u.Description("")},function(e){return new u.Description(e)}),new d(function(){return new u.DisplayName("")},function(e){return new u.DisplayName(e)}),new d(function(){return new o.Abstract},function(e){return new o.Abstract}),new d(function(){return new o.Polymorphic},function(e){return new o.Polymorphic}),new d(function(){return new c.XMLInfo({})},function(e){return new c.XMLInfo(e)})],this.known={},this.allPrototypes().forEach(function(t){return e.known[t.name()]=t})}return e.prototype.allPrototypes=function(){return this.meta.concat(this.constraints)},e.prototype.buildFacet=function(e,t){return this.known.hasOwnProperty(e)&&this.known[e].isSimple()?this.known[e].createWithValue(t):null},e.prototype.facetPrototypeWithName=function(e){return this.known.hasOwnProperty(e)?this.known[e]:null},e.prototype.applyableTo=function(e){return this.allPrototypes().filter(function(t){return t.isApplicable(e)})},e.prototype.allMeta=function(){return this.allPrototypes().filter(function(e){return e.isMeta()})},e}();t.Registry=m;var h;t.getInstance=r},function(e,t,n){function r(){i.call(this)}e.exports=r;var i=n(40).EventEmitter;n(26)(r,i),r.Readable=n(155),r.Writable=n(349),r.Duplex=n(345),r.Transform=n(348),r.PassThrough=n(347),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&c.pause&&c.pause()}function r(){c.readable&&c.resume&&c.resume()}function a(){l||(l=!0,e.end())}function o(){l||(l=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){c.removeListener("data",n),e.removeListener("drain",r),c.removeListener("end",a),c.removeListener("close",o),c.removeListener("error",s),e.removeListener("error",s),c.removeListener("end",u),c.removeListener("close",u),e.removeListener("close",u)}var c=this;c.on("data",n),e.on("drain",r),e._isStdio||t&&t.end===!1||(c.on("end",a),c.on("close",o));var l=!1;return c.on("error",s),e.on("error",s),c.on("end",u),c.on("close",u),e.on("close",u),e.emit("pipe",c),e}},function(e,t,n){"use strict";function r(e,t){return{name:e,methods:[],typeParameters:[],typeParameterConstraint:[],implements:[],fields:[],isInterface:t,annotations:[],extends:[],moduleName:null,annotationOverridings:{}}}function i(e,t,n){return a.parseStruct(e,t,n)}t.helpers=n(158);var a=n(160),o=function(){function e(){}return e}();t.EnumDeclaration=o,function(e){e[e.BASIC=0]="BASIC",e[e.ARRAY=1]="ARRAY",e[e.UNION=2]="UNION"}(t.TypeKind||(t.TypeKind={}));t.TypeKind;t.classDecl=r,t.parseStruct=i},function(e,t,n){"use strict";var r=function(){function e(e,t){void 0===t&&(t=null),this.name="YAMLException",this.reason=e,this.mark=t,this.message=this.toString(!1)}return e.prototype.toString=function(e){void 0===e&&(e=!1);var t;return t="JS-YAML: "+(this.reason||"(unknown reason)"),!e&&this.mark&&(t+=" "+this.mark.toString()),t},e}();e.exports=r},function(e,t,n){"use strict";(function(e){var r=n(16),i=r.Buffer,a=r.SlowBuffer,o=r.kMaxLength||2147483647;t.alloc=function(e,t,n){if("function"==typeof i.alloc)return i.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>o)throw new RangeError("size is too large");var r=n,a=t;void 0===a&&(r=void 0,a=0);var s=new i(e);if("string"==typeof a)for(var u=new i(a,r),c=u.length,l=-1;++lo)throw new RangeError("size is too large");return new i(e)},t.from=function(t,n,r){if("function"==typeof i.from&&(!e.Uint8Array||Uint8Array.from!==i.from))return i.from(t,n,r);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new i(t,n);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var a=n;if(1===arguments.length)return new i(t);void 0===a&&(a=0);var o=r;if(void 0===o&&(o=t.byteLength-a),a>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(o>t.byteLength-a)throw new RangeError("'length' is out of bounds");return new i(t.slice(a,a+o))}if(i.isBuffer(t)){var s=new i(t.length);return t.copy(s,0,0,t.length),s}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new i(t);if("Buffer"===t.type&&Array.isArray(t.data))return new i(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},t.allocUnsafeSlow=function(e){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=o)throw new RangeError("size is too large");return new a(e)}}).call(t,n(13))},function(e,t,n){t.dot=t.dotCase=n(179),t.swap=t.swapCase=n(355),t.path=t.pathCase=n(294),t.upper=t.upperCase=n(32),t.lower=t.lowerCase=n(45),t.camel=t.camelCase=n(102),t.snake=t.snakeCase=n(156),t.title=t.titleCase=n(358),t.param=t.paramCase=n(292),t.pascal=t.pascalCase=n(293),t.constant=t.constantCase=n(177),t.sentence=t.sentenceCase=n(31),t.isUpper=t.isUpperCase=n(184),t.isLower=t.isLowerCase=n(183),t.ucFirst=t.upperCaseFirst=n(161),t.lcFirst=t.lowerCaseFirst=n(290)},function(e,t,n){var r=n(27),i=n(22),a=r(i,"Map");e.exports=a},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=r}var r=9007199254740991;e.exports=n},function(e,t,n){function r(e){return"symbol"==typeof e||a(e)&&i(e)==o}var i=n(41),a=n(43),o="[object Symbol]";e.exports=r},function(e,t,n){var r=n(219),i=n(229),a=n(263),o=a&&a.isTypedArray,s=o?i(o):r;e.exports=s},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){function e(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function t(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function n(t,n){return t===t.toUpperCase()?n.toUpperCase():t[0]===t[0].toUpperCase()?e(n):n.toLowerCase()}function r(e,t){return e.replace(/\$(\d{1,2})/g,function(e,n){return t[n]||""})}function i(e,t,i){if(!e.length||c.hasOwnProperty(e))return t;for(var a=i.length;a--;){var o=i[a];if(o[0].test(t))return t.replace(o[0],function(e,t,i){var a=r(o[1],arguments);return""===e?n(i[t-1],a):n(e,a)})}return t}function a(e,t,r){return function(a){var o=a.toLowerCase();return t.hasOwnProperty(o)?n(a,o):e.hasOwnProperty(o)?n(a,e[o]):i(o,a,r)}}function o(e,t,n){var r=1===t?o.singular(e):o.plural(e);return(n?t+" ":"")+r}var s=[],u=[],c={},l={},p={};return o.plural=a(p,l,s),o.singular=a(l,p,u),o.addPluralRule=function(e,n){s.push([t(e),n])},o.addSingularRule=function(e,n){u.push([t(e),n])},o.addUncountableRule=function(e){if("string"==typeof e)return void(c[e.toLowerCase()]=!0);o.addPluralRule(e,"$0"),o.addSingularRule(e,"$0")},o.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),p[e]=t,l[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["thief","thieves"],["genie","genies"],["groove","grooves"],["pickaxe","pickaxes"],["whiskey","whiskies"]].forEach(function(e){return o.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|tlas|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/(m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return o.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(?:sis|ses)$/i,"$1sis"],[/(^analy)(?:sis|ses)$/i,"$1sis"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/(^[pl]|zomb|^(?:neck)?t|[aeo][lt]|cut)ies$/i,"$1ie"],[/(\b(?:mon|smil))ies$/i,"$1ey"],[/(m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i,"$1"],[/(e[mn]u)s?$/i,"$1"],[/(movie|twelve)s$/i,"$1"],[/(cris|test|diagnos)(?:is|es)$/i,"$1is"],[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return o.addSingularRule(e[0],e[1])}),["advice","agenda","bison","bream","buffalo","carp","chassis","cod","cooperation","corps","digestion","debris","diabetes","energy","equipment","elk","excretion","expertise","flounder","gallows","garbage","graffiti","headquarters","health","herpes","highjinks","homework","information","jeans","justice","kudos","labour","machinery","mackerel","media","mews","moose","news","pike","plankton","pliers","pollution","premises","rain","rice","salmon","scissors","series","sewage","shambles","shrimp","species","staff","swine","trout","tuna","whiting","wildebeest","wildlife","you",/pox$/i,/ois$/i,/deer$/i,/fish$/i,/sheep$/i,/measles$/i,/[^aeiou]ese$/i].forEach(o.addUncountableRule),o})},function(e,t,n){"use strict";(function(t){function n(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,i)});default:for(a=new Array(s-1),o=0;o0){var p=[];i.forEach(function(e){if(!e||0==e.trim().length)throw new Error("Extensions and overlays list should contain legal file paths")}),i.forEach(function(e){p.push(o.unit(e,S.isAbsolute(e)))}),p.forEach(function(e){return h(e,a)}),l=h(N.mergeAPIs(c,p,E.OverlayMergeMode.MERGE),a)}else l=h(c,a),l.setMergeMode(E.OverlayMergeMode.MERGE);if(!c)throw new Error("Can not resolve :"+e);if(a.rejectOnErrors&&l&&l.errors().filter(function(e){return!e.isWarning}).length)throw y(l);return l}function c(e,t,n){return l(e,t,n).then(function(e){return e})}function l(e,t,n){return p(e,t,n).then(function(e){if(!e)return null;for(var r=Array.isArray(t),i=r?n:t,a=e;null!=a;){v(a.wrapperNode(),i);var o=a.getMaster();a=o?o.asElement():null}return e.wrapperNode()})}function p(e,t,n){var r=Array.isArray(t),i=r?t:null,a=r?n:t;a=a||{};var o=m(e,a),s=e.indexOf("://"),u=s!=-1&&s<6?e:S.basename(e);return n&&!i&&(i=null),i&&0!=i.length?(i.forEach(function(e){if(!e||0==e.trim().length)throw new Error("Extensions and overlays list should contain legal file paths")}),d(o,u,a).then(function(e){var t=[];return i.forEach(function(e){t.push(d(o,e,a))}),Promise.all(t).then(function(t){var n=[];return t.forEach(function(e){return n.push(e.lowLevel().unit())}),N.mergeAPIs(e.lowLevel().unit(),n,E.OverlayMergeMode.MERGE)}).then(function(e){return h(e,a)})})):d(o,u,a).then(function(e){return e.setMergeMode(E.OverlayMergeMode.MERGE),e})}function f(e){if(null==e)return null;var t=e.getAdapter(x.RAMLService).getDeclaringNode();return null==t?null:t.wrapperNode()}function d(e,t,n){return C.fetchIncludesAndMasterAsync(e,t).then(function(e){try{var t=h(e,n);return n.rejectOnErrors&&t&&t.errors().filter(function(e){return!e.isWarning}).length?Promise.reject(y(t)):t}catch(e){return Promise.reject(e)}})}function m(e,t){t=t||{};var n,r=t.fsResolver,i=t.httpResolver,a=t.reusedNode;if(a)n=a.lowLevel().unit().project(),n.deleteUnit(S.basename(e)),r&&n.setFSResolver(r),i&&n.setHTTPResolver(i);else{var o=S.dirname(e);n=new T.Project(o,r,i)}return n}function h(e,t,n){if(void 0===n&&(n=!1),t=t||{},!e)return null;var r=null,i=null;e.isRAMLUnit?r=e:(i=e,r=i.lowLevel().unit());var a=r.contents(),o=E.ramlFirstLine(a);if(!o)throw new Error("Invalid first line. A RAML document is expected to start with '#%RAML '.");var s,u=o[1];o[2];if("0.8"==u?s="RAML08":"1.0"==u&&(s="RAML10"),!s)throw new Error("Unknown version of RAML expected to see one of '#%RAML 0.8' or '#%RAML 1.0'");if("RAML08"==s&&n)throw new Error("Extensions and overlays are not supported in RAML 0.8.");var c=M(s);c.type(void 0);return i||(i=E.fromUnit(r),t.reusedNode&&t.reusedNode.lowLevel().unit().absolutePath()==r.absolutePath()&&g(i,t.reusedNode)&&i.setReusedNode(t.reusedNode)),i}function y(e){var t=new Error("Api contains errors.");return t.parserErrors=E.toParserErrors(e.errors(),e),t}function _(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0);var r=M("RAML10"),i=r.type(k.Universe10.Api.name),a=new T.Project(e),o=[];return a.units().forEach(function(e){var r=e.ast();t&&(r=C.toChildCachingNode(r));var a=new b.ApiImpl(new E.ASTNodeImpl(r,null,i,null));n&&(a=N.expandTraitsAndResourceTypes(a)),o.push(a)}),o}function g(e,t){if(!t)return!1;for(var n=e.lowLevel().unit().contents(),r=t.lowLevel().unit().contents(),i=Math.min(n.length,r.length),a=-1,o=0;o0&&""==n.charAt(a).replace(/\s/,"");)a--;a<0&&n.length!=r.length&&(a=i);var s=D.deepFindNode(t,a,a+1);if(!s)return!0;if(s.lowLevel().unit().absolutePath()!=e.lowLevel().unit().absolutePath())return!0;var u=s.isElement()?s.asElement():s.parent();if(!u)return!0;var c=u.property();if(!c)return!0;if(I.isAnnotationsProperty(c)&&(u=u.parent()),!u)return!0;for(var l=u;l;){var p=l.definition();if(I.isResourceTypeType(p)||I.isTraitType(p))return!1;var f=l.property();if(!f)return!0;if(I.isTypeDeclarationDescendant(p)&&(I.isTypesProperty(f)||I.isAnnotationTypesProperty(f)))return!1;var d=f.range();if(I.isResourceTypeRefType(d)||I.isTraitRefType(d))return!1;l=l.parent()}return!0}function v(e,t){t=t||{},null!=t.attributeDefaults&&e?e.setAttributeDefaults(t.attributeDefaults):e&&e.setAttributeDefaults(!0)}var b=n(34),S=n(11),A=n(84),T=n(9),E=n(4),C=n(9),N=n(25),w=n(59),k=n(3),x=n(141),R=n(328),I=n(5),D=n(21),M=n(88);t.load=r,t.loadSync=i,t.loadApi=a,t.loadRAML=o,t.loadRAMLHL=s,t.loadApiAsync=c,t.loadRAMLAsync=l,t.loadRAMLAsyncHL=p,t.getLanguageElementByRuntimeType=f,t.toError=y,t.loadApis1=_},function(e,t,n){"use strict";function r(e){var t=R.getUniverse("RAML08"),n=t.type("Method");return x.createStubNode(n,null,e)}function i(e){var t=R.getUniverse("RAML08"),n=t.type("StringTypeDeclaration");return x.createStubNode(n,null,e)}function a(e){var t=R.getUniverse("RAML08"),n=t.type("BooleanTypeDeclaration");return x.createStubNode(n,null,e)}function o(e){var t=R.getUniverse("RAML08"),n=t.type("NumberTypeDeclaration");return x.createStubNode(n,null,e)}function s(e){var t=R.getUniverse("RAML08"),n=t.type("IntegerTypeDeclaration");return x.createStubNode(n,null,e)}function u(e){var t=R.getUniverse("RAML08"),n=t.type("DateTypeDeclaration");return x.createStubNode(n,null,e)}function c(e){var t=R.getUniverse("RAML08"),n=t.type("FileTypeDeclaration");return x.createStubNode(n,null,e)}function l(e){var t=R.getUniverse("RAML08"),n=t.type("XMLBody");return x.createStubNode(n,null,e)}function p(e){var t=R.getUniverse("RAML08"),n=t.type("JSONBody");return x.createStubNode(n,null,e)}function f(e){var t=R.getUniverse("RAML08"),n=t.type("SecuritySchemePart");return x.createStubNode(n,null,e)}function d(e){var t=R.getUniverse("RAML08"),n=t.type("Trait");return x.createStubNode(n,null,e)}function m(e){var t=R.getUniverse("RAML08"),n=t.type("OAuth1SecuritySchemeSettings");return x.createStubNode(n,null,e)}function h(e){var t=R.getUniverse("RAML08"),n=t.type("OAuth2SecuritySchemeSettings");return x.createStubNode(n,null,e)}function y(e){var t=R.getUniverse("RAML08"),n=t.type("OAuth2SecurityScheme");return x.createStubNode(n,null,e)}function _(e){var t=R.getUniverse("RAML08"),n=t.type("OAuth1SecurityScheme");return x.createStubNode(n,null,e)}function g(e){var t=R.getUniverse("RAML08"),n=t.type("BasicSecurityScheme");return x.createStubNode(n,null,e)}function v(e){var t=R.getUniverse("RAML08"),n=t.type("DigestSecurityScheme");return x.createStubNode(n,null,e)}function b(e){var t=R.getUniverse("RAML08"),n=t.type("CustomSecurityScheme");return x.createStubNode(n,null,e)}function S(e){var t=R.getUniverse("RAML08"),n=t.type("GlobalSchema");return x.createStubNode(n,null,e)}function A(e){var t=R.getUniverse("RAML08"),n=t.type("DocumentationItem");return x.createStubNode(n,null,e)}function T(e,t,n){return D.loadApi(e,t,n).getOrElse(null)}function E(e,t,n){return D.loadApi(e,t,n).getOrElse(null)}function C(e,t,n){return D.loadApiAsync(e,t,n)}function N(e,t,n){return D.loadRAMLAsync(e,t,n)}function w(e){return D.getLanguageElementByRuntimeType(e)}var k=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},x=n(36),R=n(0),I=n(29),D=n(85),M=n(319),P=function(e){function t(){e.apply(this,arguments)}return k(t,e),t.prototype.title=function(){return e.prototype.attribute.call(this,"title",this.toString)},t.prototype.setTitle=function(e){return this.highLevel().attrOrCreate("title").setValue(""+e),this},t.prototype.version=function(){return e.prototype.attribute.call(this,"version",this.toString)},t.prototype.setVersion=function(e){return this.highLevel().attrOrCreate("version").setValue(""+e),this},t.prototype.baseUri=function(){return e.prototype.attribute.call(this,"baseUri",function(e){return new ke(e)})},t.prototype.baseUriParameters_original=function(){return e.prototype.elements.call(this,"baseUriParameters")},t.prototype.uriParameters=function(){return e.prototype.elements.call(this,"uriParameters")},t.prototype.protocols=function(){return e.prototype.attributes.call(this,"protocols",this.toString)},t.prototype.setProtocols=function(e){return this.highLevel().attrOrCreate("protocols").setValue(""+e),this},t.prototype.mediaType=function(){return e.prototype.attribute.call(this,"mediaType",function(e){return new Ce(e)})},t.prototype.schemas=function(){return e.prototype.elements.call(this,"schemas")},t.prototype.traits_original=function(){return e.prototype.elements.call(this,"traits")},t.prototype.securedBy=function(){return e.prototype.attributes.call(this,"securedBy",function(e){return new le(e)})},t.prototype.securitySchemes=function(){return e.prototype.elements.call(this,"securitySchemes")},t.prototype.resourceTypes_original=function(){return e.prototype.elements.call(this,"resourceTypes")},t.prototype.resources=function(){return e.prototype.elements.call(this,"resources")},t.prototype.documentation=function(){return e.prototype.elements.call(this,"documentation")},t.prototype.wrapperClassName=function(){return"ApiImpl"},t.prototype.kind=function(){return"Api"},t.prototype.allKinds=function(){return e.prototype.allKinds.call(this).concat("Api")},t.prototype.allWrapperClassNames=function(){return e.prototype.allWrapperClassNames.call(this).concat("RAML08.ApiImpl")},t.isInstance=function(e){if(null!=e&&e.allWrapperClassNames&&"function"==typeof e.allWrapperClassNames)for(var t=0,n=e.allWrapperClassNames();t=0){n=(a?i.getAnnotationTypeRegistry():i.getTypeRegistry()).get(o)}else n=a?i.getAnnotationType(o):i.getType(o)}}return new he.TypeInstanceImpl(t,n)}function q(e){var t=e.highLevel().value();return"string"==typeof t||null==t?t:t.valueName()}function z(e){return J(e)}function H(e){return J(e)}function Y(e){return J(e)}function J(e){var t=e.highLevel(),n=t.parent(),r=e.name(),i=Re.referenceTargets(t.property(),n).filter(function(e){return ge.qName(e,n)==r});return 0==i.length?null:i[0].wrapperNode()}function G(e,t,n,r){void 0===r&&(r=!0);var i=t.lowLevel(),a=t.definition().property(n?"example":"examples"),o=Se.getUniverse("RAML10"),s=o.type(Ae.Universe10.ExampleSpec.name);return e.examples().filter(function(e){return null!=e&&!e.isEmpty()&&e.isSingle()==n}).map(function(e){var n=e.asJSON(),o=e.isSingle()?"example":null,u=i.unit(),c=new De.AstNode(u,n,i,null,o),l=r?new ge.ASTNodeImpl(c,t,s,a):t,p=e.annotations(),f=Oe(p,c,l,u),d=e.scalarsAnnotations(),m={};return Object.keys(d).forEach(function(e){return m[e]=Oe(d[e],c,l,u)}),new Ke(l,e,f,{description:function(){return m.description||[]},displayName:function(){return m.displayName||[]},strict:function(){return m.strict||[]}})})}function X(e,t){void 0===t&&(t=!1);var n=e.runtimeDefinition();return n?G(n,e.highLevel(),t):[]}function $(e){var t=X(e,!0);return t.length>0?t[0]:null}function Q(e){return X(e)}function Z(e){var t=e.runtimeDefinition(),n=t.fixedFacets();if(e.kind()==Ae.Universe10.UnionTypeDeclaration.name)for(var r=t.allFixedBuiltInFacets(),i=0,a=Object.keys(r);i=0&&!((c=t.indexOf("}",++p))<0);p=t.indexOf("{",c)){var f=t.substring(p,c);if(l[f]=!0,s[f])s[f].forEach(function(e){return u.push(e)});else{var d=a.universe(),m=d.type(Ae.Universe10.StringTypeDeclaration.name),h=be.createStubNode(m,null,f,i.lowLevel().unit()),y=me.buildWrapperNode(h),_=y.highLevel();_.setParent(i),y.meta().setCalculated(),y.setName(f),_.patchProp(o),u.push(y)}}return Object.keys(s).filter(function(e){return!l[e]}).forEach(function(e){return s[e].forEach(function(e){return u.push(e)})}),u}function le(e){if(e.kind()==Ae.Universe10.Method.name||Pe.isTypeDeclarationSibling(e.definition())){for(var t=!1,n=e.highLevel().parent();null!=n;){var r=n.definition();if(Pe.isResourceTypeType(r)||Pe.isTraitType(r)){t=!0;break}n=n.parent()}if(!t)return null}var i=e.highLevel();if(null==i)return null;var a=i.lowLevel();if(null==a)return null;var o=a.children().filter(function(e){var t=e.key();return!!t&&(("("!=t.charAt(0)||")"!=t.charAt(t.length-1))&&t.indexOf("<<")>=0)});return 0==o.length?null:new he.TypeInstanceImpl(o)}var pe=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},fe=n(87),de=n(34),me=n(140),he=n(29),ye=n(324),_e=n(24),ge=n(4),ve=n(35),be=n(36),Se=n(0),Ae=n(3),Te=n(3),Ee=n(84),Ce=n(15),Ne=n(25),we=n(59),ke=n(17),xe=n(61),Re=n(21),Ie=n(9),De=n(62),Me=n(11),Pe=n(5),Le=n(46);t.resolveType=r,t.runtimeType=i,t.load=a,t.completeRelativeUri=o,t.expandSpec=s,t.expandTraitsAndResourceTypes=u,t.expandLibraries=c,t.absoluteUri=l,t.validateInstance=p,t.validateInstanceWithDetailedStatuses=f,t.traitsPrimary=d,t.allTraits=m,t.resourceTypesPrimary=h,t.allResourceTypes=y,t.relativeUriSegments=g,t.parentResource=v,t.parent=b,t.childResource=S,t.getResource=A,t.childMethod=T,t.getMethod=E,t.ownerApi=N,t.methodId=w,t.isOkRange=k,t.allResources=x,t.matchUri=R;t.uriParametersPrimary=I,t.uriParameters=D,t.baseUriParametersPrimary=M,t.baseUriParameters=P,t.absoluteUriParameters=L,t.protocolsPrimary=O,t.allProtocols=U,t.securedByPrimary=F,t.allSecuredBy=B,t.securitySchemeName=K,t.securityScheme=V,t.RAMLVersion=j,t.structuredValue=W,t.referenceName=q,t.referencedTrait=z,t.referencedAnnotation=H,t.referencedResourceType=Y;var Oe=function(e,t,n,r){var i=[];if(e)for(var a=Se.getUniverse("RAML10"),o=a.type("Annotable").property("annotations"),s=0,u=Object.keys(e);s0?e.type()[0]:"string",this.example=e.example(),this.required=e.required(),this.default=e.default()}return e}(),Ke=function(e){function t(t,n,r,i){e.call(this,t),this.expandable=n,this._annotations=r,this._scalarAnnotations=i}return pe(t,e),t.prototype.value=function(){return this.expandable.asString()},t.prototype.structuredValue=function(){var e;e=this.expandable.isJSONString()||this.expandable.isYAML()?this.expandable.asJSON():this.expandable.original();var t=this._node.lowLevel(),n=this.expandable.isSingle()?"example":null,r=new De.AstNode(t.unit(),e,t,null,n);return new he.TypeInstanceImpl(r)},t.prototype.strict=function(){return this.expandable.strict()},t.prototype.description=function(){var e=this.expandable.description();if(null==e&&null!==e)return null;var t=be.createAttr(this._node.definition().property(Ae.Universe10.ExampleSpec.properties.description.name),e);return new de.MarkdownStringImpl(t)},t.prototype.name=function(){return this.expandable.name()},t.prototype.displayName=function(){return this.expandable.displayName()},t.prototype.annotations=function(){return this._annotations},t.prototype.scalarsAnnotations=function(){return this._scalarAnnotations},t.prototype.uses=function(){return e.prototype.elements.call(this,"uses")},t}(he.BasicNodeImpl);t.ExampleSpecImpl=Ke},function(e,t){e.exports={34:{code:"34",message:""},1104:{code:"1104",message:""},1105:{code:"1105",message:""},1106:{code:"1106",message:""},1107:{code:"1107",message:""},1108:{code:"1108",message:""},1109:{code:"1109",message:""},1110:{code:"1110",message:""},CONTEXT_REQUIREMENT_VIOLATION:{code:"CONTEXT_REQUIREMENT_VIOLATION",message:"{{v1}} should be {{v2}} to use type {{v3}}"},INVALID_PARAMETER_NAME:{code:"INVALID_PARAMETER_NAME",message:"Invalid parameter name: '{{paramName}}' is reserved"},UNUSED_PARAMETER:{code:"UNUSED_PARAMETER",message:"Unused parameter: '{{paramName}}'"},INVALID_PROPERTY_OWNER_TYPE:{code:"INVALID_PROPERTY_OWNER_TYPE",message:"Property '{{propName}}' can only be used if type is {{namesStr}}"},NODE_KEY_IS_A_MAP:{code:"NODE_KEY_IS_A_MAP",message:"Node key can not be a map"},NODE_KEY_IS_A_SEQUENCE:{code:"NODE_KEY_IS_A_SEQUENCE",message:"Node key can not be a sequence"},SEQUENCE_REQUIRED:{code:"SEQUENCE_REQUIRED",message:"Node: '{{name}}' should be wrapped in sequence"},PROPERTY_MUST_BE_A_MAP_10:{code:"PROPERTY_MUST_BE_A_MAP_10",message:"'{{propName}}' should be a map in RAML 1.0"},PROPERTY_MUST_BE_A_MAP:{code:"PROPERTY_MUST_BE_A_MAP",message:"Property '{{propName}}' should be a map"},PROPERTY_MUST_BE_A_SEQUENCE:{code:"PROPERTY_MUST_BE_A_SEQUENCE",message:"Property '{{propName}}' should be a sequence"},INVALID_PROPERTY_RANGE:{code:"INVALID_PROPERTY_RANGE",message:"Property '{{propName}}' must be a {{range}}"},MAP_REQUIRED:{code:"MAP_REQUIRED",message:"should be a map in RAML 1.0"},UNRESOLVED_REFERENCE:{code:"UNRESOLVED_REFERENCE",message:"Reference: '{{ref}}' can not be resolved"},SCALAR_PROHIBITED:{code:"SCALAR_PROHIBITED",message:"Property '{{propName}}' can not have scalar value"},UNKNOWN_NODE:{code:"UNKNOWN_NODE",message:"Unknown node: '{{name}}'"},RECURSIVE_DEFINITION:{code:"RECURSIVE_DEFINITION",message:"Recursive definition: '{{name}}'"},PROPERTY_ALREADY_SPECIFIED:{code:"PROPERTY_ALREADY_SPECIFIED",message:"'{{propName}}' is already specified.`"},ISSUES_IN_THE_LIBRARY:{code:"ISSUES_IN_THE_LIBRARY",message:"Issues in the used library: '{{value}}'"},INVALID_LIBRARY_PATH:{code:"INVALID_LIBRARY_PATH",message:"Can not resolve library from path: '{{path}}'"},EMPTY_FILE:{code:"EMPTY_FILE",message:"Empty file: {{path}}"},SPACES_IN_KEY:{code:"SPACES_IN_KEY",message:"Keys should not have spaces '{{value}}'"},INCLUDE_ERROR:{code:"INCLUDE_ERROR",message:"{{msg}}"},PATH_EXCEEDS_ROOT:{code:"PATH_EXCEEDS_ROOT",message:"Resolved include path exceeds file system root"},ILLEGAL_PATTERN:{code:"ILLEGAL_PATTERN",message:"Illegal pattern: '{{value}}'"},UNKNOWN_FUNCTION:{code:"UNKNOWN_FUNCTION",message:"Unknown function applied to parameter: '{{transformerName}}'"},REQUEST_BODY_DISABLED:{code:"REQUEST_BODY_DISABLED",message:"Request body is disabled for '{{methodName}}' method."},SCALAR_EXPECTED:{code:"SCALAR_EXPECTED",message:"Scalar is expected here"},STRING_EXPECTED:{code:"STRING_EXPECTED",message:"Property '{{propName}}' must be a string"},UNKNOWN_ANNOTATION:{code:"UNKNOWN_ANNOTATION",message:"Unknown annotation: '{{aName}}'"},STRING_EXPECTED_2:{code:"STRING_EXPECTED_2",message:"{{propName}} value should be a string"},SECUREDBY_LIST_08:{code:"SECUREDBY_LIST_08",message:"'securedBy' should be a list in RAML08"},INVALID_ANNOTATION_LOCATION:{code:"INVALID_ANNOTATION_LOCATION",message:"Annotation '{{aName}}' can not be placed at this location, allowed targets are: {{aValues}}"},BOOLEAN_EXPECTED:{code:"BOOLEAN_EXPECTED",message:"'true' or 'false' is expected here"},NUMBER_EXPECTED:{code:"NUMBER_EXPECTED",message:"Value of '{{propName}}' must be a number"},STRING_EXPECTED_3:{code:"STRING_EXPECTED_3",message:"'{{propName}}' must be a string"},STATUS_MUST_BE_3NUMBER:{code:"STATUS_MUST_BE_3NUMBER",message:"Status code should be 3 digits number."},EMPTY_VALUE_NOT_ALLOWED:{code:"EMPTY_VALUE_NOT_ALLOWED",message:"Empty value is not allowed here"},INVALID_VALUE_SCHEMA:{code:"INVALID_VALUE_SCHEMA",message:"Invalid value schema: '{{iValue}}'"},INVALID_VALUE:{code:"INVALID_VALUE",message:"Invalid value: '{{iValue}}'. Allowed values are: {{aValues}}"},SCHEMA_EXCEPTION:{code:"SCHEMA_EXCEPTION",message:"Schema exception: {{msg}}"},SCHEMA_ERROR:{code:"SCHEMA_ERROR",message:"{{msg}}"},MISSING_VERSION:{code:"MISSING_VERSION",message:"Missing 'version'"},URI_PARAMETER_NAME_MISSING:{code:"URI_PARAMETER_NAME_MISSING",message:"URI parameter must have name specified"},URI_EXCEPTION:{code:"URI_EXCEPTION",message:"{{msg}}"},INVALID_MEDIATYPE:{code:"INVALID_MEDIATYPE",message:"Invalid media type '{{mediaType}}'"},MEDIATYPE_EXCEPTION:{code:"MEDIATYPE_EXCEPTION",message:"{{msg}}"},FORM_IN_RESPONSE:{code:"FORM_IN_RESPONSE",message:"Form related media types can not be used in responses"},UNUSED_URL_PARAMETER:{code:"UNUSED_URL_PARAMETER",message:"Unused url parameter {{paramName}}"},UNRECOGNIZED_ELEMENT:{code:"UNRECOGNIZED_ELEMENT",message:"Unrecognized {{referencedToName}}: '{{ref}}'."},TYPES_VARIETY_RESTRICTION:{code:"TYPES_VARIETY_RESTRICTION",message:"Type can be either of: string, number, integer, file, date or boolean"},UNRECOGNIZED_SECURITY_SCHEME:{code:"UNRECOGNIZED_SECURITY_SCHEME",message:"Unrecognized security scheme type: '{{ref}}'. Allowed values are: 'OAuth 1.0', 'OAuth 2.0', 'Basic Authentication', 'DigestSecurityScheme Authentication', 'x-{other}'"},DUPLICATE_TRAIT_REFERENCE:{code:"DUPLICATE_TRAIT_REFERENCE",message:"Duplicate trait reference: '{{refValue}}'."},IS_IS_ARRAY:{code:"IS_IS_ARRAY",message:"Property 'is' must be an array"},RESOURCE_TYPE_NAME:{code:"RESOURCE_TYPE_NAME",message:"Resource type name must be provided"},MULTIPLE_RESOURCE_TYPES:{code:"MULTIPLE_RESOURCE_TYPES",message:"A resource or resourceType can inherit from a single resourceType"},UNKNOWN_RAML_VERSION:{code:"UNKNOWN_RAML_VERSION",message:"Unknown version of RAML expected to see one of '#%RAML 0.8' or '#%RAML 1.0'"},UNKNOWN_TOPL_LEVEL_TYPE:{code:"UNKNOWN_TOPL_LEVEL_TYPE",message:"Unknown top level type: '{{typeName}}'"},REDUNDANT_FRAGMENT_NAME:{code:"REDUNDANT_FRAGMENT_NAME",message:"Redundant fragment name: '{{typeName}}'"},WEB_FORMS:{code:"WEB_FORMS",message:"File type can be only used in web forms"},MISSING_REQUIRED_PROPERTY:{code:"MISSING_REQUIRED_PROPERTY",message:"Missing required property '{{propName}}'"},VALUE_NOT_PROVIDED:{code:"VALUE_NOT_PROVIDED",message:"Value is not provided for parameter: '{{propName}}'"},SUSPICIOUS_DOUBLEQUOTE:{code:"SUSPICIOUS_DOUBLEQUOTE",message:'Suspicious double quoted multiline scalar, it is likely that you forgot closing "{{value}}'},ANNOTATION_TARGET_MUST_BE_A_STRING:{code:"ANNOTATION_TARGET_MUST_BE_A_STRING",message:"Annotation target must be set by a string"},ALLOWED_TARGETS_MUST_BE_ARRAY:{code:"ALLOWED_TARGETS_MUST_BE_ARRAY",message:"'allowedTargets' property value must be an array of type names or a single type name"},UNSUPPORTED_ANNOTATION_TARGET:{code:"UNSUPPORTED_ANNOTATION_TARGET",message:"Unsupported annotation target: '{{aTarget}}'"},SCHEMA_NAME_MUST_BE_STRING:{code:"SCHEMA_NAME_MUST_BE_STRING",message:"Schema '{{name}}' must be a string"},FORM_PARAMS_IN_RESPONSE:{code:"FORM_PARAMS_IN_RESPONSE",message:"Form parameters can not be used in response"},FORM_PARAMS_WITH_EXAMPLE:{code:"FORM_PARAMS_WITH_EXAMPLE",message:"'formParameters' property cannot be used together with the 'example' or 'schema' properties"},AUTHORIZATION_GRANTS_ENUM:{code:"AUTHORIZATION_GRANTS_ENUM",message:"'authorizationGrants' value should be one of 'authorization_code', 'implicit', 'password', 'client_credentials' or to be an abolute URI"},AUTHORIZATION_URI_REQUIRED:{code:"AUTHORIZATION_URI_REQUIRED",message:"'authorizationUri' is required when `authorization_code` or `implicit` grant type are used "},REPEATING_COMPONENTS_IN_ENUM:{code:"REPEATING_COMPONENTS_IN_ENUM",message:"'enum' value contains repeating components"},INTEGER_EXPECTED:{code:"INTEGER_EXPECTED",message:"Integer is expected"},NUMBER_EXPECTED_2:{code:"NUMBER_EXPECTED_2",message:"Number is expected"},RESOURCE_TYPE_NULL:{code:"RESOURCE_TYPE_NULL",message:"Resource type can not be null"},SCALAR_PROHIBITED_2:{code:"SCALAR_PROHIBITED_2",message:"Node '{{name}}' can not be a scalar"},VERSION_NOT_ALLOWED:{code:"VERSION_NOT_ALLOWED",message:"'version' parameter not allowed here",comment:"I dont like the message, but its coming from JS 0.8 parser @Denis"},INVALID_OVERLAY_NODE:{code:"INVALID_OVERLAY_NODE",message:"The '{{nodeId}}' node does not match any node of the master api."},INVALID_OVERRIDE_IN_OVERLAY:{code:"INVALID_OVERRIDE_IN_OVERLAY",message:"Property '{{propName}}' is not allowed to be overriden or added in overlays"},KEYS_SHOULD_BE_UNIQUE:{code:"KEYS_SHOULD_BE_UNIQUE",message:"Keys should be unique"},ALREADY_EXISTS:{code:"ALREADY_EXISTS",message:"{{capitalized}} '{{name}}' already exists"},ALREADY_EXISTS_IN_CONTEXT:{code:"ALREADY_EXISTS_IN_CONTEXT",message:"{{name}}' already exists in this context"},PROPERTY_USED:{code:"PROPERTY_USED",message:"Property already used: '{{propName}}'"},PARENT_PROPERTY_USED:{code:"PARENT_PROPERTY_USED",message:"{{parent}} property already used: '{{propName}}'"},INVALID_JSON_SCHEMA:{code:"INVALID_JSON_SCHEMA",message:"Invalid JSON schema. Unexpected value '{{propName}}'"},EXAMPLE_SCHEMA_FAILURE:{code:"EXAMPLE_SCHEMA_FAILURE",message:"Example does not conform to schema: {{msg}}"},CAN_NOT_PARSE_JSON:{code:"CAN_NOT_PARSE_JSON",message:"Can not parse JSON: {{msg}}"},CAN_NOT_PARSE_XML:{code:"CAN_NOT_PARSE_XML",message:"Can not parse XML: {{msg}}"},OPTIONAL_SCLARAR_PROPERTIES_10:{code:"OPTIONAL_SCLARAR_PROPERTIES_10",message:"Optional scalar properties are not allowed in {{templateNamePlural}} and their descendants: '{{propName}}?'"},OPTIONAL_PROPERTIES_10:{code:"OPTIONAL_PROPERTIES_10",message:"Optional properties are not allowed in '{{propName}}': '{{oPropName}}'"},ONLY_METHODS_CAN_BE_OPTIONAL:{code:"ONLY_METHODS_CAN_BE_OPTIONAL",message:"Only method nodes can be optional"},PROPERTY_UNUSED:{code:"PROPERTY_UNUSED",message:"{{propName}} unused"},CYCLE_IN_DEFINITION:{code:"CYCLE_IN_DEFINITION",message:"{{typeName}} definition contains cycle: {{cycle}}"},SEQUENCE_NOT_ALLOWED_10:{code:"SEQUENCE_NOT_ALLOWED_10",message:"In RAML 1.0 {{propName}} is not allowed to have sequence as definition"},MAP_EXPECTED:{code:"MAP_EXPECTED",message:"Map is expected here"},ERROR_IN_INCLUDED_FILE:{code:"ERROR_IN_INCLUDED_FILE",message:"Error in the included file: {{msg}}"},NODE_SHOULD_HAVE_VALUE:{code:"NODE_SHOULD_HAVE_VALUE",message:"node should have at least one member value"},NAMED_PARAMETER_NEEDS_TYPE:{code:"NAMED_PARAMETER_NEEDS_TYPE",message:"named parameter needs at least one type"},ENUM_IS_EMPTY:{code:"ENUM_IS_EMPTY",message:"enum is empty"},ENUM_MUST_BE_AN_ARRAY:{code:"ENUM_MUST_BE_AN_ARRAY",message:"the value of enum must be an array"},DEFINITION_SHOULD_BE_A_MAP:{code:"DEFINITION_SHOULD_BE_A_MAP",message:"{{typeName}} definition should be a map"},RESOURCES_SHARE_SAME_URI:{code:"RESOURCES_SHARE_SAME_URI",message:"Resources share same URI"},TYPES_AND_SCHEMAS_ARE_EXCLUSIVE:{code:"TYPES_AND_SCHEMAS_ARE_EXCLUSIVE",message:"'types' and 'schemas' are mutually exclusive"},TEMPLATE_PARAMETER_NAME_MUST_CONTAIN_NONWHITESPACE_CHARACTERS:{code:"TEMPLATE_PARAMETER_NAME_MUST_CONTAIN_NONWHITESPACE_CHARACTERS",message:"Trait or resource type parameter name must contain non whitespace characters"},INVALID_SECURITY_SCHEME_SCOPE:{code:"INVALID_SECURITY_SCHEME_SCOPE",message:"The '{{invalidScope}}' scope is not allowed for the '{{securityScheme}}' security scheme. Allowed scopes are: {{allowedScopes}}."}}},function(e,t,n){"use strict";function r(e,t,n,r){return void 0===n&&(n=b.builtInRegistry()),_(e,new M(null,t,!1,r),n)}function i(e,t,n){return void 0===t&&(t=b.builtInRegistry()),u(new M(null,e,!1,n),t)}function a(e){return"?"==e.charAt(e.length-1)}function o(e,t){return void 0===t&&(t=b.builtInRegistry()),u(new M(null,e,!1,e.provider&&e.provider()),t)}function s(e){return new U(e)}function u(e,t){var n=new L;if(e.anchor){if(e.anchor().__$$)return e.anchor().__$$;e.anchor().__$$=n}var r=e.childWithKey("types");r&&r.kind()===D.ARRAY&&(r=s(r));var i=e.childWithKey("schemas");i&&i.kind()===D.ARRAY&&(i=s(i));var a=new O(r,i,t,n);r&&r.kind()!==D.SCALAR&&r.children().filter(function(e){return e.key()&&!0}).forEach(function(e){var t=b.derive(e.key(),[b.REFERENCE]);n.add(t),a.addType(t)}),i&&i.kind()!==D.SCALAR&&i.children().filter(function(e){return e.key()&&!0}).forEach(function(e){var t=b.derive(e.key(),[b.REFERENCE]);n.add(t),a.addType(t)});var o=e.childWithKey("uses");o&&o.kind()===D.ARRAY&&(o=s(o)),o&&o.kind()===D.MAP&&o.children().forEach(function(e){n.addLibrary(e.key(),u(e,t))}),r&&r.kind()!==D.SCALAR&&r.children().filter(function(e){return e.key()&&!0}).forEach(function(e){a.get(e.key())}),i&&i.kind()!==D.SCALAR&&i.children().filter(function(e){return e.key()&&!0}).forEach(function(e){a.get(e.key())}),a.types().forEach(function(e){return n.add(e)});var r=e.childWithKey("annotationTypes");return r&&r.kind()===D.ARRAY&&(r=s(r)),null!=r&&r.kind()===D.MAP&&r.children().forEach(function(e){n.addAnnotationType(_(e.key(),e,a,!1,!0,!1))}),n}function c(e,t){var n=new P,r=!1,i=e.childWithKey("required");if(i){var o=i.value();"boolean"==typeof o&&(r=!0),o===!1&&(n.optional=!0,n.id=e.key())}var s=e.key();return!r&&a(e.key())&&(s=s.substr(0,s.length-1),n.optional=!0),0==s.length||"/.*/"===s?n.additonal=!0:"/"==s.charAt(0)&&"/"==s.charAt(s.length-1)&&(s=s.substring(1,s.length-1),n.regExp=!0),n.type=_(null,e,t,!1,!1,!1),n.id=s,n}function l(e){var t=new F;t.name=e.name(),t.superTypes=e.superTypes().map(function(e){return d(e)}),t.annotations=[],t.customFacets=[],t.facetDeclarations=[],t.basicFacets=[],t.properties=[];var n={};return e.declaredMeta().forEach(function(e){if(e instanceof w.Annotation)t.annotations.push(e);else if(e instanceof w.CustomFacet)t.customFacets.push(e);else if(e instanceof w.NotScalar)t.notAScalar=!0;else if(e instanceof k.FacetDeclaration)t.facetDeclarations.push(e);else if(e instanceof T.HasProperty)if(n.hasOwnProperty(e.value()))n[e.value()].optional=!1;else{var r=new P;r.optional=!1,r.id=e.value(),r.type=b.ANY,n[e.value()]=r}else if(e instanceof T.AdditionalPropertyIs){var r=new P;r.optional=!1,r.id="/.*/",r.additonal=!0,r.type=e.value(),n["/.*/"]=r}else if(e instanceof T.MapPropertyIs){var r=new P;r.optional=!1,r.id=e.regexpValue(),r.regExp=!0,r.type=e.value(),n[e.regexpValue()]=r}else if(e instanceof T.PropertyIs)if(n.hasOwnProperty(e.propertyName()))n[e.propertyName()].type=e.value();else{var r=new P;r.optional=!0,r.id=e.propertyName(),r.type=e.value(),n[e.propertyName()]=r}else e instanceof T.KnownPropertyRestriction?t.additionalProperties=e.value():e instanceof w.DiscriminatorValue?e.isStrict()&&t.basicFacets.push(e):e instanceof w.HasPropertiesFacet||t.basicFacets.push(e)}),Object.keys(n).forEach(function(e){return t.properties.push(n[e])}),t}function p(e){return e instanceof E.AbstractType?l(e).toJSON():f(e)}function f(e){var t={},n={};e.types().forEach(function(e){n[e.name()]=p(e)}),Object.keys(n).length>0&&(t.types=n);var n={};return e.annotationTypes().forEach(function(e){n[e.name()]=p(e)}),Object.keys(n).length>0&&(t.annotationTypes=n),t}function d(e){if(e.isAnonymous()){if(e.isArray()){var t=e.oneMeta(T.ComponentShouldBeOfType);if(t){var n=t.value();return n.isAnonymous()&&n.isUnion()?"("+d(n)+")[]":d(n)+"[]"}}return e.isUnion()?e.options().map(function(e){return d(e)}).join(" | "):e.superTypes().map(function(e){return d(e)}).join(" , ")}return e.name()}function m(e,t){if(t===b.ANY||e===t||e.superTypes().some(function(e){return m(e,t)}))return!0;if(e.isUnion()&&e.options){var n=e.options();if(n.some(function(e){return m(e,t)}))return!0}if(t.isUnion()&&t.options){var n=t.options();if(n.some(function(t){return e==t}))return!0}return!1}function h(e,t){var n=e.requiredType(),r=e.requiredTypes();return r&&r.length>0?r.some(function(e){return m(t,e)}):m(t,n)}function y(e,t){for(var n=t.children(),r=0,i=n;r0&&P.filter(function(e){return e.length>0}).length>0)for(var B=0,K=P;B0&&(1==this.superTypes.length?e.type=this.superTypes[0]:e.type=this.superTypes),this.customFacets&&this.customFacets.forEach(function(t){return e[t.facetName()]=t.value()}),this.annotations&&this.annotations.forEach(function(t){return e["("+t.facetName()+")"]=t.value()}),this.facetDeclarations&&this.facetDeclarations.length>0){var t={};this.facetDeclarations.forEach(function(e){var n=e.facetName();e.isOptional()&&(n+="?");var r=null;r=e.type().isAnonymous()?e.type().isEmpty()?d(e.type()):l(e.type()).toJSON():d(e.type()),t[n]=r}),e.facets=t}if(this.properties&&this.properties.length>0){var n={};this.properties.forEach(function(e){var t=e.id;e.optional&&(t+="?"),e.additonal&&(t="/.*/"),e.regExp&&(t="/"+t+"/");var r=null;r=e.type.isAnonymous()?e.type.isEmpty()?d(e.type):l(e.type).toJSON():d(e.type),n[t]=r}),e.properties=n}return this.basicFacets&&this.basicFacets.forEach(function(t){e[t.facetName()]=t.value()}),1==Object.keys(e).length&&!this.notAScalar&&e.type?e.type:(void 0!==this.additionalProperties&&(e.additionalProperties=this.additionalProperties),e)},e}();t.TypeProto=F,t.toProto=l,t.storeAsJSON=p,t.parse=_},function(e,t,n){"use strict";(function(e){function r(e,t){var n=T(t,e),r=!!y&&g.getValue(n);if(r&&r.provider)return r;var i=new S(e,t);return g.setValue(n,i),i}function i(e,t){var n=(T(t,e),!!y&&g.getValue(e));if(n)return n;var r=new A(e,t);return y&&g.setValue(e,r),r}function a(e,t){var n=T(t,e),r=!!y&&g.getValue(n);if(r)return r;try{var i=new S(e,t);return y&&g.setValue(n,i),i}catch(r){try{var i=new A(e,t);return y&&g.setValue(n,i),i}catch(e){return y&&g.setValue(n,new f.ValidationError(d.messageRegistry.CAN_NOT_PARSE_SCHEMA)),null}}}function o(e,t,n){null==n&&(n=s(e)),n.length>0&&(n+=":");for(var r=e.getElementsByTagName(n+t),i=[],a=0;a5242880&&this.last;){var r=this.last.key;delete this.errors[r],this.size-=r.length,this.last=this.last.next}},e}(),g=new _;e.cleanCache=function(){g=new _};var v=function(){function e(){}return e.prototype.contextPath=function(){return""},e.prototype.normalizePath=function(e){return""},e.prototype.content=function(e){return""},e.prototype.hasAsyncRequests=function(){return!1},e.prototype.resolvePath=function(e,t){return""},e.prototype.isAbsolutePath=function(e){return!1},e.prototype.contentAsync=function(e){var t=this;return{then:function(n){return n(t.content(e))},resolve:function(){return null}}},e.prototype.promiseResolve=function(e){return{then:function(t){return t(e)},resolve:function(){return null}}},e}(),b=function(e,t,n){return"__EXAMPLE_"+e+t+n},S=function(){function e(e,t){if(this.schema=e,this.provider=t,this.provider=t?t:new v,!e||0==e.trim().length||"{"!=e.trim().charAt(0))throw new f.ValidationError(d.messageRegistry.INVALID_JSON_SCHEMA);var r;try{var r=JSON.parse(e)}catch(e){throw new f.ValidationError(d.messageRegistry.INVALID_JSON_SCHEMA_DETAILS,{msg:e.message})}if(r){try{var i=n(50);this.setupId(r,this.provider.contextPath());(""+r.$schema).indexOf("http://json-schema.org/draft-04/")==-1?r=i.v4(r):this.fixRequired(r)}catch(e){throw new f.ValidationError(d.messageRegistry.INVALID_JSON_SCHEMA_DETAILS,{msg:e.message})}delete r.$schema,this.jsonSchema=r}}return e.prototype.fixRequired=function(e){},e.prototype.getType=function(){return"source.json"},e.prototype.validateObject=function(e){this.validate(JSON.stringify(e))},e.prototype.getMissingReferences=function(e,t){var n=this;void 0===t&&(t=!1);var r=[],i=l.getValidator();e.forEach(function(e){return i.setRemoteReference(e.reference,e.content||{})});var a=null;if(this.jsonSchema.id&&"string"==typeof this.jsonSchema.id){a=this.jsonSchema.id;var o=a.indexOf("#");o!=-1&&(a=a.substr(0,o))}try{i.validateSchema(this.jsonSchema)}catch(e){return[]}var r=i.getMissingRemoteReferences(),s=[];return r&&(s=u.filter(r,function(e){return!i.isResourceLoaded(e)&&e!=a})),t?s.map(function(e){return n.provider.normalizePath(e)}):s},e.prototype.getSchemaPath=function(e,t){if(void 0===t&&(t=!1),!e)return"";if(!e.id)return"";var n=e.id.trim();if(n.lastIndexOf("#")!==n.length-1)return n;var r=n.substr(0,n.length-1);return t?this.provider.normalizePath(r):r},e.prototype.patchSchema=function(e){var t=this;if(!e)return e;if(!e.id)return e;var n=e.id.trim();n.lastIndexOf("#")!==n.length-1&&(n+="#",e.id=n);var r=n.substr(0,n.length-1);if(!this.provider.isAbsolutePath(r))return e;r=this.provider.normalizePath(r);var i=[];this.collectRefContainers(e,i),i.forEach(function(e){var n=e.$ref;if("string"==typeof n&&0!==n.indexOf("#")){n.indexOf("#")===-1&&(n+="#");var i=t.provider.resolvePath(r,n);e.$ref=i}})},e.prototype.collectRefContainers=function(e,t){var n=this;Object.keys(e).forEach(function(r){if("$ref"===r)return void t.push(e);e[r]&&"object"==typeof e[r]&&n.collectRefContainers(e[r],t)})},e.prototype.validate=function(e,t){var r=this;void 0===t&&(t=[]);var i=b(e,this.schema,this.provider.contextPath()),a=g.getValue(i);if(a){if(a instanceof Error)throw a}else{var o=l.getValidator();t.forEach(function(e){return o.setRemoteReference(e.reference,e.content)}),o.validate(JSON.parse(e),this.jsonSchema);var s=o.getMissingRemoteReferences().filter(function(e){return!u.find(t,function(t){return e===t.reference})});if(!s||0===s.length)return void this.acceptErrors(i,o.getLastErrors(),d.messageRegistry.CONTENT_DOES_NOT_MATCH_THE_SCHEMA,!0);var c=[];s.forEach(function(e){var t,i={reference:e};try{var a=n(50),o=JSON.parse(r.provider.content(e));r.setupId(o,r.provider.normalizePath(e)),t=a.v4(o),delete t.$schema,i.content=t}catch(e){i.error=e}finally{c.push(i)}}),this.provider.hasAsyncRequests()||(c.forEach(function(e){t.push(e)}),this.validate(e,t))}},e.prototype.validateSelf=function(e){var t=this;void 0===e&&(e=[]);var r=b("__SCHEMA_VALIDATION__",this.schema,this.provider.contextPath()),i=g.getValue(r);if(i){if(i instanceof Error)throw i}else{var a=l.getValidator();e.forEach(function(e){return a.setRemoteReference(e.reference,e.content)});try{a.validateSchema(this.jsonSchema)}catch(e){var o="Cannot assign to read only property '__$validated' of ";if(e.message&&0==e.message.indexOf(o)&&e.message.length>o.length){var s=e.message.substr(o.length,e.message.length-o.length),c="Unexpected value '"+s+"'";this.acceptErrors(r,[{message:c,params:[]}],d.messageRegistry.INVALID_JSON_SCHEMA_DETAILS,!0,!0)}throw e}var p=a.getMissingRemoteReferences().filter(function(t){return!u.find(e,function(e){return t===e.reference})});if(!p||0===p.length)return void this.acceptErrors(r,a.getLastErrors(),d.messageRegistry.INVALID_JSON_SCHEMA_DETAILS,!0,!0);var f=[];p.forEach(function(e){var r,i={reference:e};try{var a=n(50),o=JSON.parse(t.provider.content(e));t.setupId(o,t.provider.normalizePath(e)),r=a.v4(o),delete r.$schema,i.content=r}catch(e){i.error=e}finally{f.push(i)}}),this.provider.hasAsyncRequests()||(f.forEach(function(t){e.push(t)}),this.validateSelf(e))}},e.prototype.setupId=function(e,t){if(t&&e){if(e.id)return e.id=e.id.trim(),void(e.id.indexOf("#")<0&&(e.id=e.id+"#"));e.id=t.replace(/\\/g,"/")+"#",this.patchSchema(e)}},e.prototype.acceptErrors=function(e,t,n,r,i){if(void 0===r&&(r=!1),void 0===i&&(i=!1),t&&t.length>0){var a=t.map(function(e){return e.message+" "+e.params}).join(", "),o=new f.ValidationError(n,{msg:a});if(o.isWarning=i,o.errors=t,g.setValue(e,o),r)throw o}else g.setValue(e,1)},e.prototype.contentAsync=function(e){var t,r=this,i=n(50),a=this.provider.contentAsync(e);return a?a.then(function(n){var a={reference:e};try{var o=JSON.parse(n);r.setupId(o,r.provider.normalizePath(e)),t=i.v4(o),delete t.$schema,a.content=t}catch(e){a.error=e}return a}):this.provider.promiseResolve({reference:e,content:null,error:new f.ValidationError(d.messageRegistry.REFERENCE_NOT_FOUND,{ref:e})})},e}();t.JSONSchemaObject=S;var A=function(){function e(e,t){if(this.schema=e,this.provider=t,this.extraElementData=null,this.references={},this.contentToResult={},t||(this.provider=new v),"<"!=e.charAt(0))throw new f.ValidationError(d.messageRegistry.INVALID_XML_SCHEMA);this.schemaString=this.handleReferenceElement(e)}return e.prototype.getType=function(){return"text.xml"},e.prototype.validateObject=function(e){if(this.extraElementData){var t=Object.keys(e)[0],n=new f.ValidationError(d.messageRegistry.EXTERNAL_TYPE_ERROR,{typeName:this.extraElementData.requestedName,objectName:t});if(!this.extraElementData.type&&!this.extraElementData.originalName)return void this.acceptErrors("key",[n],!0);if(this.extraElementData.originalName&&t!==this.extraElementData.originalName)return void this.acceptErrors("key",[n],!0);if(this.extraElementData.type){var r=e[t];delete e[t],e[this.extraElementData.name]=r}}this.validate(c.jsonToXml(e))},e.prototype.collectReferences=function(e,t,n){var r,i=this;r=new p(h).parseFromString(e);var a=o(r,"schema",this.namspacePrefix)[0],s=o(a,"import",this.namspacePrefix),u=o(a,"include",this.namspacePrefix);return s.concat(u).forEach(function(e){var r=e.getAttribute("schemaLocation");if(r){var a=i.provider.resolvePath(t,r),o=n[a];if(!o){var s,u=Object.keys(n).length,l=i.provider.content(a);try{s=i.collectReferences(l,a,n)}catch(e){s=l}o=c.createXmlSchemaReference(a,u,s),n[a]=o}e.setAttribute("schemaLocation","file_"+o.virtualIndex+".xsd")}}),r.toString()},e.prototype.getMissingReferences=function(){var e,t=this;e=new p(h).parseFromString(this.schemaString);var n=o(e,"schema",this.namspacePrefix)[0],r=o(n,"import",this.namspacePrefix),i=o(n,"include",this.namspacePrefix),a=r.concat(i),s=[];return a.forEach(function(e){var n=e.getAttribute("schemaLocation");if(n){var r=t.provider.resolvePath(t.provider.contextPath(),n);s.push(r)}}),s},e.prototype.collectReferencesAsync=function(e,t,n){var r,i=this;r=new p(h).parseFromString(e);var a=o(r,"schema",this.namspacePrefix)[0],s=o(a,"import",this.namspacePrefix),u=o(a,"include",this.namspacePrefix),l=s.concat(u);return Promise.all(l.map(function(e){var r=e.getAttribute("schemaLocation");if(r){var a=i.provider.resolvePath(t,r),o=n[a];return o?(e.setAttribute("schemaLocation","file_"+o.virtualIndex+".xsd"),{}):i.provider.contentAsync(a).then(function(t){return i.collectReferencesAsync(t,a,n).then(function(e){return e},function(e){return t}).then(function(t){var r=Object.keys(n).length;return o=c.createXmlSchemaReference(a,r,t),n[a]=o,e.setAttribute("schemaLocation","file_"+o.virtualIndex+".xsd"),{}})})}return{}})).then(function(e){return Promise.resolve(r.toString())})},e.prototype.loadSchemaReferencesAsync=function(){return this.collectReferencesAsync(this.schemaString,this.provider.contextPath(),{})},e.prototype.validate=function(e){try{var t=this.contentToResult[e];if(t===!1)return;if(t)throw t;var n={},r=this.collectReferences(this.schemaString,this.provider.contextPath(),n),i=c.getValidator(r);if(this.provider.hasAsyncRequests())return;var a=i.validate(e,Object.keys(n).map(function(e){return n[e]}));this.acceptErrors("key",a,!0),this.contentToResult[e]=!1,Object.keys(this.contentToResult).length>10&&(this.contentToResult={})}catch(t){throw this.contentToResult[e]=t,t}},e.prototype.handleReferenceElement=function(e){var t=new p(h).parseFromString(e);this.namspacePrefix=s(t);var n=o(t,"schema",this.namspacePrefix)[0],r=o(n,"element",this.namspacePrefix),i=u.find(r,function(e){return"true"===e.getAttribute("extraelement")});if(!i)return e;var a={};return a.name=i.getAttribute("name"),a.type=i.getAttribute("type"),a.originalName=i.getAttribute("originalname"),a.requestedName=i.getAttribute("requestedname"),a.type||n.removeChild(i),i.removeAttribute("originalname"),i.removeAttribute("requestedname"),i.removeAttribute("extraelement"),this.extraElementData=a,t.toString()},e.prototype.acceptErrors=function(e,t,n){if(void 0===n&&(n=!1),t&&t.length>0){var r=t.map(function(e){return e.message}).join(", "),i=new f.ValidationError(d.messageRegistry.CONTENT_DOES_NOT_MATCH_THE_SCHEMA,{msg:r});if(i.errors=t,g.setValue(e,i),n)throw i}else;},e}();t.XMLSchemaObject=A,t.getJSONSchema=r;var T=function(e,t){var n="";return e&&(n=e.contextPath()),"__SCHEMA_"+t+n};t.getXMLSchema=i,t.createSchema=a}).call(t,n(13))},function(e,t,n){"use strict";function r(e){this.afterTransform=function(t,n){return i(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i(t);var a=e._readableState;a.reading=!1,(a.needReadable||a.length-1?r:C;s.WritableState=o;var w=n(39);w.inherits=n(26);var k,x={deprecate:n(362)};!function(){try{k=n(66)}catch(e){}finally{k||(k=n(40).EventEmitter)}}();var R=n(16).Buffer,I=n(69);w.inherits(s,k),o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:x.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var D;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(D=Function.prototype[Symbol.hasInstance],Object.defineProperty(s,Symbol.hasInstance,{value:function(e){return!!D.call(this,e)||e&&e._writableState instanceof o}})):D=function(e){return e instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(e,t,n){var r=this._writableState,a=!1,o=R.isBuffer(e);return"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=i),r.ended?u(this,n):(o||c(this,r,e,n))&&(r.pendingcb++,a=p(this,r,o,e,t,n)),a},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||g(this,e))},s.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},s.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||A(this,r,n)}}).call(t,n(23),n(96).setImmediate)},function(e,t,n){function r(e){if(e&&!u(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function a(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var s=n(16).Buffer,u=s.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},c=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=i)}this.charBuffer=new s(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),e.copy(this.charBuffer,0,0,a),t.substring(0,i)}return t},c.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},c.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},function(e,t,n){function r(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(354),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){(function(t,r,i,a){/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var o,s=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)};!function(e){!function(e){e[e.Unknown=0]="Unknown",e[e.EndOfFileToken=1]="EndOfFileToken",e[e.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",e[e.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",e[e.NewLineTrivia=4]="NewLineTrivia",e[e.WhitespaceTrivia=5]="WhitespaceTrivia",e[e.ShebangTrivia=6]="ShebangTrivia",e[e.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",e[e.NumericLiteral=8]="NumericLiteral",e[e.StringLiteral=9]="StringLiteral",e[e.RegularExpressionLiteral=10]="RegularExpressionLiteral",e[e.NoSubstitutionTemplateLiteral=11]="NoSubstitutionTemplateLiteral",e[e.TemplateHead=12]="TemplateHead",e[e.TemplateMiddle=13]="TemplateMiddle",e[e.TemplateTail=14]="TemplateTail",e[e.OpenBraceToken=15]="OpenBraceToken",e[e.CloseBraceToken=16]="CloseBraceToken",e[e.OpenParenToken=17]="OpenParenToken",e[e.CloseParenToken=18]="CloseParenToken",e[e.OpenBracketToken=19]="OpenBracketToken",e[e.CloseBracketToken=20]="CloseBracketToken",e[e.DotToken=21]="DotToken",e[e.DotDotDotToken=22]="DotDotDotToken",e[e.SemicolonToken=23]="SemicolonToken",e[e.CommaToken=24]="CommaToken",e[e.LessThanToken=25]="LessThanToken",e[e.LessThanSlashToken=26]="LessThanSlashToken",e[e.GreaterThanToken=27]="GreaterThanToken",e[e.LessThanEqualsToken=28]="LessThanEqualsToken",e[e.GreaterThanEqualsToken=29]="GreaterThanEqualsToken",e[e.EqualsEqualsToken=30]="EqualsEqualsToken",e[e.ExclamationEqualsToken=31]="ExclamationEqualsToken",e[e.EqualsEqualsEqualsToken=32]="EqualsEqualsEqualsToken",e[e.ExclamationEqualsEqualsToken=33]="ExclamationEqualsEqualsToken",e[e.EqualsGreaterThanToken=34]="EqualsGreaterThanToken",e[e.PlusToken=35]="PlusToken",e[e.MinusToken=36]="MinusToken",e[e.AsteriskToken=37]="AsteriskToken",e[e.AsteriskAsteriskToken=38]="AsteriskAsteriskToken",e[e.SlashToken=39]="SlashToken",e[e.PercentToken=40]="PercentToken",e[e.PlusPlusToken=41]="PlusPlusToken",e[e.MinusMinusToken=42]="MinusMinusToken",e[e.LessThanLessThanToken=43]="LessThanLessThanToken",e[e.GreaterThanGreaterThanToken=44]="GreaterThanGreaterThanToken",e[e.GreaterThanGreaterThanGreaterThanToken=45]="GreaterThanGreaterThanGreaterThanToken",e[e.AmpersandToken=46]="AmpersandToken",e[e.BarToken=47]="BarToken",e[e.CaretToken=48]="CaretToken",e[e.ExclamationToken=49]="ExclamationToken",e[e.TildeToken=50]="TildeToken",e[e.AmpersandAmpersandToken=51]="AmpersandAmpersandToken",e[e.BarBarToken=52]="BarBarToken",e[e.QuestionToken=53]="QuestionToken",e[e.ColonToken=54]="ColonToken",e[e.AtToken=55]="AtToken",e[e.EqualsToken=56]="EqualsToken",e[e.PlusEqualsToken=57]="PlusEqualsToken",e[e.MinusEqualsToken=58]="MinusEqualsToken",e[e.AsteriskEqualsToken=59]="AsteriskEqualsToken",e[e.AsteriskAsteriskEqualsToken=60]="AsteriskAsteriskEqualsToken",e[e.SlashEqualsToken=61]="SlashEqualsToken",e[e.PercentEqualsToken=62]="PercentEqualsToken",e[e.LessThanLessThanEqualsToken=63]="LessThanLessThanEqualsToken",e[e.GreaterThanGreaterThanEqualsToken=64]="GreaterThanGreaterThanEqualsToken",e[e.GreaterThanGreaterThanGreaterThanEqualsToken=65]="GreaterThanGreaterThanGreaterThanEqualsToken",e[e.AmpersandEqualsToken=66]="AmpersandEqualsToken",e[e.BarEqualsToken=67]="BarEqualsToken",e[e.CaretEqualsToken=68]="CaretEqualsToken",e[e.Identifier=69]="Identifier",e[e.BreakKeyword=70]="BreakKeyword",e[e.CaseKeyword=71]="CaseKeyword",e[e.CatchKeyword=72]="CatchKeyword",e[e.ClassKeyword=73]="ClassKeyword",e[e.ConstKeyword=74]="ConstKeyword",e[e.ContinueKeyword=75]="ContinueKeyword",e[e.DebuggerKeyword=76]="DebuggerKeyword",e[e.DefaultKeyword=77]="DefaultKeyword",e[e.DeleteKeyword=78]="DeleteKeyword",e[e.DoKeyword=79]="DoKeyword",e[e.ElseKeyword=80]="ElseKeyword",e[e.EnumKeyword=81]="EnumKeyword",e[e.ExportKeyword=82]="ExportKeyword",e[e.ExtendsKeyword=83]="ExtendsKeyword",e[e.FalseKeyword=84]="FalseKeyword",e[e.FinallyKeyword=85]="FinallyKeyword",e[e.ForKeyword=86]="ForKeyword",e[e.FunctionKeyword=87]="FunctionKeyword",e[e.IfKeyword=88]="IfKeyword",e[e.ImportKeyword=89]="ImportKeyword",e[e.InKeyword=90]="InKeyword",e[e.InstanceOfKeyword=91]="InstanceOfKeyword",e[e.NewKeyword=92]="NewKeyword",e[e.NullKeyword=93]="NullKeyword",e[e.ReturnKeyword=94]="ReturnKeyword",e[e.SuperKeyword=95]="SuperKeyword",e[e.SwitchKeyword=96]="SwitchKeyword",e[e.ThisKeyword=97]="ThisKeyword",e[e.ThrowKeyword=98]="ThrowKeyword",e[e.TrueKeyword=99]="TrueKeyword",e[e.TryKeyword=100]="TryKeyword",e[e.TypeOfKeyword=101]="TypeOfKeyword",e[e.VarKeyword=102]="VarKeyword",e[e.VoidKeyword=103]="VoidKeyword",e[e.WhileKeyword=104]="WhileKeyword",e[e.WithKeyword=105]="WithKeyword",e[e.ImplementsKeyword=106]="ImplementsKeyword",e[e.InterfaceKeyword=107]="InterfaceKeyword",e[e.LetKeyword=108]="LetKeyword",e[e.PackageKeyword=109]="PackageKeyword",e[e.PrivateKeyword=110]="PrivateKeyword",e[e.ProtectedKeyword=111]="ProtectedKeyword",e[e.PublicKeyword=112]="PublicKeyword",e[e.StaticKeyword=113]="StaticKeyword",e[e.YieldKeyword=114]="YieldKeyword",e[e.AbstractKeyword=115]="AbstractKeyword",e[e.AsKeyword=116]="AsKeyword",e[e.AnyKeyword=117]="AnyKeyword",e[e.AsyncKeyword=118]="AsyncKeyword",e[e.AwaitKeyword=119]="AwaitKeyword",e[e.BooleanKeyword=120]="BooleanKeyword",e[e.ConstructorKeyword=121]="ConstructorKeyword",e[e.DeclareKeyword=122]="DeclareKeyword",e[e.GetKeyword=123]="GetKeyword",e[e.IsKeyword=124]="IsKeyword",e[e.ModuleKeyword=125]="ModuleKeyword",e[e.NamespaceKeyword=126]="NamespaceKeyword",e[e.RequireKeyword=127]="RequireKeyword",e[e.NumberKeyword=128]="NumberKeyword",e[e.SetKeyword=129]="SetKeyword",e[e.StringKeyword=130]="StringKeyword",e[e.SymbolKeyword=131]="SymbolKeyword",e[e.TypeKeyword=132]="TypeKeyword",e[e.FromKeyword=133]="FromKeyword",e[e.GlobalKeyword=134]="GlobalKeyword",e[e.OfKeyword=135]="OfKeyword",e[e.QualifiedName=136]="QualifiedName",e[e.ComputedPropertyName=137]="ComputedPropertyName",e[e.TypeParameter=138]="TypeParameter",e[e.Parameter=139]="Parameter",e[e.Decorator=140]="Decorator",e[e.PropertySignature=141]="PropertySignature",e[e.PropertyDeclaration=142]="PropertyDeclaration",e[e.MethodSignature=143]="MethodSignature",e[e.MethodDeclaration=144]="MethodDeclaration",e[e.Constructor=145]="Constructor",e[e.GetAccessor=146]="GetAccessor",e[e.SetAccessor=147]="SetAccessor",e[e.CallSignature=148]="CallSignature",e[e.ConstructSignature=149]="ConstructSignature",e[e.IndexSignature=150]="IndexSignature",e[e.TypePredicate=151]="TypePredicate",e[e.TypeReference=152]="TypeReference",e[e.FunctionType=153]="FunctionType",e[e.ConstructorType=154]="ConstructorType",e[e.TypeQuery=155]="TypeQuery",e[e.TypeLiteral=156]="TypeLiteral",e[e.ArrayType=157]="ArrayType",e[e.TupleType=158]="TupleType",e[e.UnionType=159]="UnionType",e[e.IntersectionType=160]="IntersectionType",e[e.ParenthesizedType=161]="ParenthesizedType",e[e.ThisType=162]="ThisType",e[e.StringLiteralType=163]="StringLiteralType",e[e.ObjectBindingPattern=164]="ObjectBindingPattern",e[e.ArrayBindingPattern=165]="ArrayBindingPattern",e[e.BindingElement=166]="BindingElement",e[e.ArrayLiteralExpression=167]="ArrayLiteralExpression",e[e.ObjectLiteralExpression=168]="ObjectLiteralExpression",e[e.PropertyAccessExpression=169]="PropertyAccessExpression",e[e.ElementAccessExpression=170]="ElementAccessExpression",e[e.CallExpression=171]="CallExpression",e[e.NewExpression=172]="NewExpression",e[e.TaggedTemplateExpression=173]="TaggedTemplateExpression",e[e.TypeAssertionExpression=174]="TypeAssertionExpression",e[e.ParenthesizedExpression=175]="ParenthesizedExpression",e[e.FunctionExpression=176]="FunctionExpression",e[e.ArrowFunction=177]="ArrowFunction",e[e.DeleteExpression=178]="DeleteExpression",e[e.TypeOfExpression=179]="TypeOfExpression",e[e.VoidExpression=180]="VoidExpression",e[e.AwaitExpression=181]="AwaitExpression",e[e.PrefixUnaryExpression=182]="PrefixUnaryExpression",e[e.PostfixUnaryExpression=183]="PostfixUnaryExpression",e[e.BinaryExpression=184]="BinaryExpression",e[e.ConditionalExpression=185]="ConditionalExpression",e[e.TemplateExpression=186]="TemplateExpression",e[e.YieldExpression=187]="YieldExpression",e[e.SpreadElementExpression=188]="SpreadElementExpression",e[e.ClassExpression=189]="ClassExpression",e[e.OmittedExpression=190]="OmittedExpression",e[e.ExpressionWithTypeArguments=191]="ExpressionWithTypeArguments",e[e.AsExpression=192]="AsExpression",e[e.TemplateSpan=193]="TemplateSpan",e[e.SemicolonClassElement=194]="SemicolonClassElement",e[e.Block=195]="Block",e[e.VariableStatement=196]="VariableStatement",e[e.EmptyStatement=197]="EmptyStatement",e[e.ExpressionStatement=198]="ExpressionStatement",e[e.IfStatement=199]="IfStatement";e[e.DoStatement=200]="DoStatement",e[e.WhileStatement=201]="WhileStatement",e[e.ForStatement=202]="ForStatement",e[e.ForInStatement=203]="ForInStatement",e[e.ForOfStatement=204]="ForOfStatement",e[e.ContinueStatement=205]="ContinueStatement",e[e.BreakStatement=206]="BreakStatement",e[e.ReturnStatement=207]="ReturnStatement",e[e.WithStatement=208]="WithStatement",e[e.SwitchStatement=209]="SwitchStatement",e[e.LabeledStatement=210]="LabeledStatement",e[e.ThrowStatement=211]="ThrowStatement",e[e.TryStatement=212]="TryStatement",e[e.DebuggerStatement=213]="DebuggerStatement",e[e.VariableDeclaration=214]="VariableDeclaration",e[e.VariableDeclarationList=215]="VariableDeclarationList",e[e.FunctionDeclaration=216]="FunctionDeclaration",e[e.ClassDeclaration=217]="ClassDeclaration",e[e.InterfaceDeclaration=218]="InterfaceDeclaration",e[e.TypeAliasDeclaration=219]="TypeAliasDeclaration",e[e.EnumDeclaration=220]="EnumDeclaration",e[e.ModuleDeclaration=221]="ModuleDeclaration",e[e.ModuleBlock=222]="ModuleBlock",e[e.CaseBlock=223]="CaseBlock",e[e.ImportEqualsDeclaration=224]="ImportEqualsDeclaration",e[e.ImportDeclaration=225]="ImportDeclaration",e[e.ImportClause=226]="ImportClause",e[e.NamespaceImport=227]="NamespaceImport",e[e.NamedImports=228]="NamedImports",e[e.ImportSpecifier=229]="ImportSpecifier",e[e.ExportAssignment=230]="ExportAssignment",e[e.ExportDeclaration=231]="ExportDeclaration",e[e.NamedExports=232]="NamedExports",e[e.ExportSpecifier=233]="ExportSpecifier",e[e.MissingDeclaration=234]="MissingDeclaration",e[e.ExternalModuleReference=235]="ExternalModuleReference",e[e.JsxElement=236]="JsxElement",e[e.JsxSelfClosingElement=237]="JsxSelfClosingElement",e[e.JsxOpeningElement=238]="JsxOpeningElement",e[e.JsxText=239]="JsxText",e[e.JsxClosingElement=240]="JsxClosingElement",e[e.JsxAttribute=241]="JsxAttribute",e[e.JsxSpreadAttribute=242]="JsxSpreadAttribute",e[e.JsxExpression=243]="JsxExpression",e[e.CaseClause=244]="CaseClause",e[e.DefaultClause=245]="DefaultClause",e[e.HeritageClause=246]="HeritageClause",e[e.CatchClause=247]="CatchClause",e[e.PropertyAssignment=248]="PropertyAssignment",e[e.ShorthandPropertyAssignment=249]="ShorthandPropertyAssignment",e[e.EnumMember=250]="EnumMember",e[e.SourceFile=251]="SourceFile",e[e.JSDocTypeExpression=252]="JSDocTypeExpression",e[e.JSDocAllType=253]="JSDocAllType",e[e.JSDocUnknownType=254]="JSDocUnknownType",e[e.JSDocArrayType=255]="JSDocArrayType",e[e.JSDocUnionType=256]="JSDocUnionType",e[e.JSDocTupleType=257]="JSDocTupleType",e[e.JSDocNullableType=258]="JSDocNullableType",e[e.JSDocNonNullableType=259]="JSDocNonNullableType",e[e.JSDocRecordType=260]="JSDocRecordType",e[e.JSDocRecordMember=261]="JSDocRecordMember",e[e.JSDocTypeReference=262]="JSDocTypeReference",e[e.JSDocOptionalType=263]="JSDocOptionalType",e[e.JSDocFunctionType=264]="JSDocFunctionType",e[e.JSDocVariadicType=265]="JSDocVariadicType",e[e.JSDocConstructorType=266]="JSDocConstructorType",e[e.JSDocThisType=267]="JSDocThisType",e[e.JSDocComment=268]="JSDocComment",e[e.JSDocTag=269]="JSDocTag",e[e.JSDocParameterTag=270]="JSDocParameterTag",e[e.JSDocReturnTag=271]="JSDocReturnTag",e[e.JSDocTypeTag=272]="JSDocTypeTag",e[e.JSDocTemplateTag=273]="JSDocTemplateTag",e[e.SyntaxList=274]="SyntaxList",e[e.Count=275]="Count",e[e.FirstAssignment=56]="FirstAssignment",e[e.LastAssignment=68]="LastAssignment",e[e.FirstReservedWord=70]="FirstReservedWord",e[e.LastReservedWord=105]="LastReservedWord",e[e.FirstKeyword=70]="FirstKeyword",e[e.LastKeyword=135]="LastKeyword",e[e.FirstFutureReservedWord=106]="FirstFutureReservedWord",e[e.LastFutureReservedWord=114]="LastFutureReservedWord",e[e.FirstTypeNode=151]="FirstTypeNode",e[e.LastTypeNode=163]="LastTypeNode",e[e.FirstPunctuation=15]="FirstPunctuation",e[e.LastPunctuation=68]="LastPunctuation",e[e.FirstToken=0]="FirstToken",e[e.LastToken=135]="LastToken",e[e.FirstTriviaToken=2]="FirstTriviaToken",e[e.LastTriviaToken=7]="LastTriviaToken",e[e.FirstLiteralToken=8]="FirstLiteralToken",e[e.LastLiteralToken=11]="LastLiteralToken",e[e.FirstTemplateToken=11]="FirstTemplateToken",e[e.LastTemplateToken=14]="LastTemplateToken",e[e.FirstBinaryOperator=25]="FirstBinaryOperator",e[e.LastBinaryOperator=68]="LastBinaryOperator",e[e.FirstNode=136]="FirstNode"}(e.SyntaxKind||(e.SyntaxKind={}));e.SyntaxKind;!function(e){e[e.None=0]="None",e[e.Export=2]="Export",e[e.Ambient=4]="Ambient",e[e.Public=8]="Public",e[e.Private=16]="Private",e[e.Protected=32]="Protected",e[e.Static=64]="Static",e[e.Abstract=128]="Abstract",e[e.Async=256]="Async",e[e.Default=512]="Default",e[e.MultiLine=1024]="MultiLine",e[e.Synthetic=2048]="Synthetic",e[e.DeclarationFile=4096]="DeclarationFile",e[e.Let=8192]="Let",e[e.Const=16384]="Const",e[e.OctalLiteral=32768]="OctalLiteral",e[e.Namespace=65536]="Namespace",e[e.ExportContext=131072]="ExportContext",e[e.ContainsThis=262144]="ContainsThis",e[e.HasImplicitReturn=524288]="HasImplicitReturn",e[e.HasExplicitReturn=1048576]="HasExplicitReturn",e[e.GlobalAugmentation=2097152]="GlobalAugmentation",e[e.HasClassExtends=4194304]="HasClassExtends",e[e.HasDecorators=8388608]="HasDecorators",e[e.HasParamDecorators=16777216]="HasParamDecorators",e[e.HasAsyncFunctions=33554432]="HasAsyncFunctions",e[e.Modifier=1022]="Modifier",e[e.AccessibilityModifier=56]="AccessibilityModifier",e[e.BlockScoped=24576]="BlockScoped",e[e.ReachabilityCheckFlags=1572864]="ReachabilityCheckFlags",e[e.EmitHelperFlags=62914560]="EmitHelperFlags"}(e.NodeFlags||(e.NodeFlags={}));e.NodeFlags;!function(e){e[e.None=0]="None",e[e.DisallowIn=1]="DisallowIn",e[e.Yield=2]="Yield",e[e.Decorator=4]="Decorator",e[e.Await=8]="Await",e[e.ThisNodeHasError=16]="ThisNodeHasError",e[e.JavaScriptFile=32]="JavaScriptFile",e[e.ParserGeneratedFlags=31]="ParserGeneratedFlags",e[e.TypeExcludesFlags=10]="TypeExcludesFlags",e[e.ThisNodeOrAnySubNodesHasError=64]="ThisNodeOrAnySubNodesHasError",e[e.HasAggregatedChildData=128]="HasAggregatedChildData"}(e.ParserContextFlags||(e.ParserContextFlags={}));e.ParserContextFlags;!function(e){e[e.None=0]="None",e[e.IntrinsicNamedElement=1]="IntrinsicNamedElement",e[e.IntrinsicIndexedElement=2]="IntrinsicIndexedElement",e[e.ValueElement=4]="ValueElement",e[e.UnknownElement=16]="UnknownElement",e[e.IntrinsicElement=3]="IntrinsicElement"}(e.JsxFlags||(e.JsxFlags={}));e.JsxFlags;!function(e){e[e.Succeeded=1]="Succeeded",e[e.Failed=2]="Failed",e[e.FailedAndReported=3]="FailedAndReported"}(e.RelationComparisonResult||(e.RelationComparisonResult={}));var t=(e.RelationComparisonResult,function(){function e(){}return e}());e.OperationCanceledException=t,function(e){e[e.Success=0]="Success",e[e.DiagnosticsPresent_OutputsSkipped=1]="DiagnosticsPresent_OutputsSkipped",e[e.DiagnosticsPresent_OutputsGenerated=2]="DiagnosticsPresent_OutputsGenerated"}(e.ExitStatus||(e.ExitStatus={}));e.ExitStatus;!function(e){e[e.None=0]="None",e[e.WriteArrayAsGenericType=1]="WriteArrayAsGenericType",e[e.UseTypeOfFunction=2]="UseTypeOfFunction",e[e.NoTruncation=4]="NoTruncation",e[e.WriteArrowStyleSignature=8]="WriteArrowStyleSignature",e[e.WriteOwnNameForAnyLike=16]="WriteOwnNameForAnyLike",e[e.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",e[e.InElementType=64]="InElementType",e[e.UseFullyQualifiedType=128]="UseFullyQualifiedType"}(e.TypeFormatFlags||(e.TypeFormatFlags={}));e.TypeFormatFlags;!function(e){e[e.None=0]="None",e[e.WriteTypeParametersOrArguments=1]="WriteTypeParametersOrArguments",e[e.UseOnlyExternalAliasing=2]="UseOnlyExternalAliasing"}(e.SymbolFormatFlags||(e.SymbolFormatFlags={}));e.SymbolFormatFlags;!function(e){e[e.Accessible=0]="Accessible",e[e.NotAccessible=1]="NotAccessible",e[e.CannotBeNamed=2]="CannotBeNamed"}(e.SymbolAccessibility||(e.SymbolAccessibility={}));e.SymbolAccessibility;!function(e){e[e.This=0]="This",e[e.Identifier=1]="Identifier"}(e.TypePredicateKind||(e.TypePredicateKind={}));e.TypePredicateKind;!function(e){e[e.Unknown=0]="Unknown",e[e.TypeWithConstructSignatureAndValue=1]="TypeWithConstructSignatureAndValue",e[e.VoidType=2]="VoidType",e[e.NumberLikeType=3]="NumberLikeType",e[e.StringLikeType=4]="StringLikeType",e[e.BooleanType=5]="BooleanType",e[e.ArrayLikeType=6]="ArrayLikeType",e[e.ESSymbolType=7]="ESSymbolType",e[e.TypeWithCallSignature=8]="TypeWithCallSignature",e[e.ObjectType=9]="ObjectType"}(e.TypeReferenceSerializationKind||(e.TypeReferenceSerializationKind={}));e.TypeReferenceSerializationKind;!function(e){e[e.None=0]="None",e[e.FunctionScopedVariable=1]="FunctionScopedVariable",e[e.BlockScopedVariable=2]="BlockScopedVariable",e[e.Property=4]="Property",e[e.EnumMember=8]="EnumMember",e[e.Function=16]="Function",e[e.Class=32]="Class",e[e.Interface=64]="Interface",e[e.ConstEnum=128]="ConstEnum",e[e.RegularEnum=256]="RegularEnum",e[e.ValueModule=512]="ValueModule",e[e.NamespaceModule=1024]="NamespaceModule",e[e.TypeLiteral=2048]="TypeLiteral",e[e.ObjectLiteral=4096]="ObjectLiteral",e[e.Method=8192]="Method",e[e.Constructor=16384]="Constructor",e[e.GetAccessor=32768]="GetAccessor",e[e.SetAccessor=65536]="SetAccessor",e[e.Signature=131072]="Signature",e[e.TypeParameter=262144]="TypeParameter",e[e.TypeAlias=524288]="TypeAlias",e[e.ExportValue=1048576]="ExportValue",e[e.ExportType=2097152]="ExportType",e[e.ExportNamespace=4194304]="ExportNamespace",e[e.Alias=8388608]="Alias",e[e.Instantiated=16777216]="Instantiated",e[e.Merged=33554432]="Merged",e[e.Transient=67108864]="Transient",e[e.Prototype=134217728]="Prototype",e[e.SyntheticProperty=268435456]="SyntheticProperty",e[e.Optional=536870912]="Optional",e[e.ExportStar=1073741824]="ExportStar",e[e.Enum=384]="Enum",e[e.Variable=3]="Variable",e[e.Value=107455]="Value",e[e.Type=793056]="Type",e[e.Namespace=1536]="Namespace",e[e.Module=1536]="Module",e[e.Accessor=98304]="Accessor",e[e.FunctionScopedVariableExcludes=107454]="FunctionScopedVariableExcludes",e[e.BlockScopedVariableExcludes=107455]="BlockScopedVariableExcludes",e[e.ParameterExcludes=107455]="ParameterExcludes",e[e.PropertyExcludes=107455]="PropertyExcludes",e[e.EnumMemberExcludes=107455]="EnumMemberExcludes",e[e.FunctionExcludes=106927]="FunctionExcludes",e[e.ClassExcludes=899519]="ClassExcludes",e[e.InterfaceExcludes=792960]="InterfaceExcludes",e[e.RegularEnumExcludes=899327]="RegularEnumExcludes",e[e.ConstEnumExcludes=899967]="ConstEnumExcludes",e[e.ValueModuleExcludes=106639]="ValueModuleExcludes",e[e.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",e[e.MethodExcludes=99263]="MethodExcludes",e[e.GetAccessorExcludes=41919]="GetAccessorExcludes",e[e.SetAccessorExcludes=74687]="SetAccessorExcludes",e[e.TypeParameterExcludes=530912]="TypeParameterExcludes",e[e.TypeAliasExcludes=793056]="TypeAliasExcludes",e[e.AliasExcludes=8388608]="AliasExcludes",e[e.ModuleMember=8914931]="ModuleMember",e[e.ExportHasLocal=944]="ExportHasLocal",e[e.HasExports=1952]="HasExports",e[e.HasMembers=6240]="HasMembers",e[e.BlockScoped=418]="BlockScoped",e[e.PropertyOrAccessor=98308]="PropertyOrAccessor",e[e.Export=7340032]="Export",e[e.Classifiable=788448]="Classifiable"}(e.SymbolFlags||(e.SymbolFlags={}));e.SymbolFlags;!function(e){e[e.TypeChecked=1]="TypeChecked",e[e.LexicalThis=2]="LexicalThis",e[e.CaptureThis=4]="CaptureThis",e[e.SuperInstance=256]="SuperInstance",e[e.SuperStatic=512]="SuperStatic",e[e.ContextChecked=1024]="ContextChecked",e[e.AsyncMethodWithSuper=2048]="AsyncMethodWithSuper",e[e.AsyncMethodWithSuperBinding=4096]="AsyncMethodWithSuperBinding",e[e.CaptureArguments=8192]="CaptureArguments",e[e.EnumValuesComputed=16384]="EnumValuesComputed",e[e.LexicalModuleMergesWithClass=32768]="LexicalModuleMergesWithClass",e[e.LoopWithCapturedBlockScopedBinding=65536]="LoopWithCapturedBlockScopedBinding",e[e.CapturedBlockScopedBinding=131072]="CapturedBlockScopedBinding",e[e.BlockScopedBindingInLoop=262144]="BlockScopedBindingInLoop",e[e.ClassWithBodyScopedClassBinding=524288]="ClassWithBodyScopedClassBinding",e[e.BodyScopedClassBinding=1048576]="BodyScopedClassBinding",e[e.NeedsLoopOutParameter=2097152]="NeedsLoopOutParameter"}(e.NodeCheckFlags||(e.NodeCheckFlags={}));e.NodeCheckFlags;!function(e){e[e.Any=1]="Any",e[e.String=2]="String",e[e.Number=4]="Number",e[e.Boolean=8]="Boolean",e[e.Void=16]="Void",e[e.Undefined=32]="Undefined",e[e.Null=64]="Null",e[e.Enum=128]="Enum",e[e.StringLiteral=256]="StringLiteral",e[e.TypeParameter=512]="TypeParameter",e[e.Class=1024]="Class",e[e.Interface=2048]="Interface",e[e.Reference=4096]="Reference",e[e.Tuple=8192]="Tuple",e[e.Union=16384]="Union",e[e.Intersection=32768]="Intersection",e[e.Anonymous=65536]="Anonymous",e[e.Instantiated=131072]="Instantiated",e[e.FromSignature=262144]="FromSignature",e[e.ObjectLiteral=524288]="ObjectLiteral",e[e.FreshObjectLiteral=1048576]="FreshObjectLiteral",e[e.ContainsUndefinedOrNull=2097152]="ContainsUndefinedOrNull",e[e.ContainsObjectLiteral=4194304]="ContainsObjectLiteral",e[e.ContainsAnyFunctionType=8388608]="ContainsAnyFunctionType",e[e.ESSymbol=16777216]="ESSymbol",e[e.ThisType=33554432]="ThisType",e[e.ObjectLiteralPatternWithComputedProperties=67108864]="ObjectLiteralPatternWithComputedProperties",e[e.Intrinsic=16777343]="Intrinsic",e[e.Primitive=16777726]="Primitive",e[e.StringLike=258]="StringLike",e[e.NumberLike=132]="NumberLike",e[e.ObjectType=80896]="ObjectType",e[e.UnionOrIntersection=49152]="UnionOrIntersection",e[e.StructuredType=130048]="StructuredType",e[e.RequiresWidening=6291456]="RequiresWidening",e[e.PropagatingFlags=14680064]="PropagatingFlags"}(e.TypeFlags||(e.TypeFlags={}));e.TypeFlags;!function(e){e[e.Call=0]="Call",e[e.Construct=1]="Construct"}(e.SignatureKind||(e.SignatureKind={}));e.SignatureKind;!function(e){e[e.String=0]="String",e[e.Number=1]="Number"}(e.IndexKind||(e.IndexKind={}));e.IndexKind;!function(e){e[e.None=0]="None",e[e.ExportsProperty=1]="ExportsProperty",e[e.ModuleExports=2]="ModuleExports",e[e.PrototypeProperty=3]="PrototypeProperty",e[e.ThisProperty=4]="ThisProperty"}(e.SpecialPropertyAssignmentKind||(e.SpecialPropertyAssignmentKind={}));e.SpecialPropertyAssignmentKind;!function(e){e[e.Warning=0]="Warning",e[e.Error=1]="Error",e[e.Message=2]="Message"}(e.DiagnosticCategory||(e.DiagnosticCategory={}));e.DiagnosticCategory;!function(e){e[e.Classic=1]="Classic",e[e.NodeJs=2]="NodeJs"}(e.ModuleResolutionKind||(e.ModuleResolutionKind={}));e.ModuleResolutionKind;!function(e){e[e.None=0]="None",e[e.CommonJS=1]="CommonJS",e[e.AMD=2]="AMD",e[e.UMD=3]="UMD",e[e.System=4]="System",e[e.ES6=5]="ES6",e[e.ES2015=5]="ES2015"}(e.ModuleKind||(e.ModuleKind={}));e.ModuleKind;!function(e){e[e.None=0]="None",e[e.Preserve=1]="Preserve",e[e.React=2]="React"}(e.JsxEmit||(e.JsxEmit={}));e.JsxEmit;!function(e){e[e.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",e[e.LineFeed=1]="LineFeed"}(e.NewLineKind||(e.NewLineKind={}));e.NewLineKind;!function(e){e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES6=2]="ES6",e[e.ES2015=2]="ES2015",e[e.Latest=2]="Latest"}(e.ScriptTarget||(e.ScriptTarget={}));e.ScriptTarget;!function(e){e[e.Standard=0]="Standard",e[e.JSX=1]="JSX"}(e.LanguageVariant||(e.LanguageVariant={}));e.LanguageVariant;!function(e){e[e.Simple=0]="Simple",e[e.Pretty=1]="Pretty"}(e.DiagnosticStyle||(e.DiagnosticStyle={}));e.DiagnosticStyle;!function(e){e[e.nullCharacter=0]="nullCharacter",e[e.maxAsciiCharacter=127]="maxAsciiCharacter",e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.lineSeparator=8232]="lineSeparator",e[e.paragraphSeparator=8233]="paragraphSeparator",e[e.nextLine=133]="nextLine",e[e.space=32]="space",e[e.nonBreakingSpace=160]="nonBreakingSpace",e[e.enQuad=8192]="enQuad",e[e.emQuad=8193]="emQuad",e[e.enSpace=8194]="enSpace",e[e.emSpace=8195]="emSpace",e[e.threePerEmSpace=8196]="threePerEmSpace",e[e.fourPerEmSpace=8197]="fourPerEmSpace",e[e.sixPerEmSpace=8198]="sixPerEmSpace",e[e.figureSpace=8199]="figureSpace",e[e.punctuationSpace=8200]="punctuationSpace",e[e.thinSpace=8201]="thinSpace",e[e.hairSpace=8202]="hairSpace",e[e.zeroWidthSpace=8203]="zeroWidthSpace",e[e.narrowNoBreakSpace=8239]="narrowNoBreakSpace",e[e.ideographicSpace=12288]="ideographicSpace",e[e.mathematicalSpace=8287]="mathematicalSpace",e[e.ogham=5760]="ogham",e[e._=95]="_",e[e.$=36]="$",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.ampersand=38]="ampersand",e[e.asterisk=42]="asterisk",e[e.at=64]="at",e[e.backslash=92]="backslash",e[e.backtick=96]="backtick",e[e.bar=124]="bar",e[e.caret=94]="caret",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.closeParen=41]="closeParen",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.equals=61]="equals",e[e.exclamation=33]="exclamation",e[e.greaterThan=62]="greaterThan",e[e.hash=35]="hash",e[e.lessThan=60]="lessThan",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.openParen=40]="openParen",e[e.percent=37]="percent",e[e.plus=43]="plus",e[e.question=63]="question",e[e.semicolon=59]="semicolon",e[e.singleQuote=39]="singleQuote",e[e.slash=47]="slash",e[e.tilde=126]="tilde",e[e.backspace=8]="backspace",e[e.formFeed=12]="formFeed",e[e.byteOrderMark=65279]="byteOrderMark",e[e.tab=9]="tab",e[e.verticalTab=11]="verticalTab"}(e.CharacterCodes||(e.CharacterCodes={}));e.CharacterCodes}(o||(o={}));var o;!function(e){function t(e){function t(e){for(var t in u)e(t,u[t])}function n(e){return u[s(e)]}function r(e,t){u[s(e)]=t}function i(e){return g(u,s(e))}function a(e){delete u[s(e)]}function o(){u={}}function s(t){return e?e(t):t}var u={};return{get:n,set:r,contains:i,remove:a,forEachValue:t,clear:o}}function n(e,t,n){return n(G(e)?H(e):Q(e,t))}function r(e,t){if(e)for(var n=0,r=e.length;n>1),a=e[i];if(a===t)return i;a>t?r=i-1:n=i+1}return~n}function y(e,t,n){if(e){var r=e.length;if(r>0){var i=0,a=arguments.length<=2?e[i]:n;for(i++;i=0){var i=arguments.length<=2?e[r]:n;for(r--;r>=0;)i=t(i,e[r]),r--;return i}}return n}function g(e,t){return he.call(e,t)}function v(e,t){return he.call(e,t)?e[t]:void 0}function b(e){for(var t in e)if(g(e,t))return!1;return!0}function S(e){var t={};for(var n in e)t[n]=e[n];return t}function A(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)g(n,r)||(n[r]=t[r]);return n}function T(e,t){var n;for(var r in e)if(n=t(e[r]))break;return n}function E(e,t){var n;for(var r in e)if(n=t(r))break;return n}function C(e,t){return g(e,t)?e[t]:void 0}function N(e,t){for(var n in e)t[n]=e[n]}function w(e,t){var n={};return r(e,function(e){n[t(e)]=e}),n}function k(e,t,n){var r=n;if(e)for(var i in e)g(e,i)&&(r=t(r,e[i],String(i)));return r}function x(e){return Array.isArray?Array.isArray(e):e instanceof Array}function R(e){var t;return function(){return e&&(t=e(),e=void 0),t}}function I(e,t,n){return n=n||0,e.replace(/{(\d+)}/g,function(e,r){return t[+r+n]})}function D(t){return e.localizedDiagnosticMessages&&e.localizedDiagnosticMessages[t.key]?e.localizedDiagnosticMessages[t.key]:t.message}function M(e,t,n,r){var i=t+n;ge.assert(t>=0,"start must be non-negative, is "+t),ge.assert(n>=0,"length must be non-negative, is "+n),e&&(ge.assert(t<=e.text.length,"start must be within the bounds of the file. "+t+" > "+e.text.length),ge.assert(i<=e.text.length,"end must be the bounds of the file. "+i+" > "+e.text.length));var a=D(r);return arguments.length>4&&(a=I(a,arguments,4)),{file:e,start:t,length:n,messageText:a,category:r.category,code:r.code}}function P(e){var t=D(e);return arguments.length>1&&(t=I(t,arguments,1)),{file:void 0,start:void 0,length:void 0,messageText:t,category:e.category,code:e.code}}function L(e,t){var n=D(t);return arguments.length>2&&(n=I(n,arguments,2)),{messageText:n,category:t.category,code:t.code,next:e}}function O(e,t){for(var n=e;n.next;)n=n.next;return n.next=t,e}function U(e,t){return e===t?0:void 0===e?-1:void 0===t?1:e0&&".."!==m(i)?i.pop():s&&i.push(s))}return i}function H(t){t=W(t);var n=q(t),r=z(t,n);return t.substr(0,n)+r.join(e.directorySeparator)}function Y(t){return t.substr(0,Math.max(q(t),t.lastIndexOf(e.directorySeparator)))}function J(e){return e&&!G(e)&&e.indexOf("://")!==-1}function G(e){return 0!==q(e)}function X(e,t){var n=z(e,t);return[e.substr(0,t)].concat(n)}function $(e,t){e=W(e);var n=q(e);return 0===n&&(e=ie(W(t),e),n=q(e)),X(e,n)}function Q(e,t){return Z($(e,t))}function Z(t){if(t&&t.length)return t[0]+t.slice(1).join(e.directorySeparator)}function ee(t){for(var n=t.length,r=t.indexOf("://")+"://".length;r1&&""===m(s)&&s.length--;var u;for(u=0;ur&&e.substr(n-r,r)===t}function oe(t){return t&&t.allowJs?ye:e.supportedTypeScriptExtensions}function se(e,t){if(!e)return!1;for(var n=0,r=oe(t);n=e}function n(e,t,n){if(!e){var r="";throw n&&(r="\r\nVerbose Debug Information: "+n()),new Error("Debug Failure. False expression: "+(t||"")+r)}}function r(t){e.assert(!1,t)}var i=0;e.shouldAssert=t,e.assert=n,e.fail=r}(ge=e.Debug||(e.Debug={})),e.copyListRemovingItem=de,e.createGetCanonicalFileName=me}(o||(o={}));var o;!function(e){e.sys=function(){return"undefined"!=typeof WScript&&"function"==typeof ActiveXObject?function(){function t(e,t){if(o.FileExists(e)){s.Open();try{if(t)s.Charset=t,s.LoadFromFile(e);else{s.Charset="x-ansi",s.LoadFromFile(e);var n=s.ReadText(2)||"";s.Position=0,s.Charset=n.length>=2&&(255===n.charCodeAt(0)&&254===n.charCodeAt(1)||254===n.charCodeAt(0)&&255===n.charCodeAt(1))?"unicode":"utf-8"}return s.ReadText()}catch(e){throw e}finally{s.Close()}}}function n(e,t,n){s.Open(),u.Open();try{s.Charset="utf-8",s.WriteText(t),s.Position=n?0:3,s.CopyTo(u),u.SaveToFile(e,2)}finally{u.Close(),s.Close()}}function r(e){return e.toLowerCase()}function i(e){for(var t=[],n=new Enumerator(e);!n.atEnd();n.moveNext())t.push(n.item().Name);return t.sort()}function a(t,n,a){function s(t){for(var c=o.GetFolder(t||"."),l=i(c.files),p=0,f=l;p=4}function o(e,t){if(l.existsSync(e)){var n=l.readFileSync(e),r=n.length;if(r>=2&&254===n[0]&&255===n[1]){r&=-2;for(var i=0;i=2&&255===n[0]&&254===n[1]?n.toString("utf16le",2):r>=3&&239===n[0]&&187===n[1]&&191===n[2]?n.toString("utf8",3):n.toString("utf8")}}function s(e,t,n){n&&(t="\ufeff"+t);var r;try{r=l.openSync(e,"w"),l.writeSync(r,t,void 0,"utf8")}finally{void 0!==r&&l.closeSync(r)}}function u(e){return y?e:e.toLowerCase()}function c(t,n,r){function i(t){for(var o=l.readdirSync(t||".").sort(),s=[],c=0,p=o;c type."},In_ambient_enum_declarations_member_initializer_must_be_constant_expression:{code:1066,category:e.DiagnosticCategory.Error,key:"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066",message:"In ambient enum declarations member initializer must be constant expression."},Unexpected_token_A_constructor_method_accessor_or_property_was_expected:{code:1068,category:e.DiagnosticCategory.Error,key:"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068",message:"Unexpected token. A constructor, method, accessor, or property was expected."},A_0_modifier_cannot_be_used_with_an_import_declaration:{code:1079,category:e.DiagnosticCategory.Error,key:"A_0_modifier_cannot_be_used_with_an_import_declaration_1079",message:"A '{0}' modifier cannot be used with an import declaration."},Invalid_reference_directive_syntax:{code:1084,category:e.DiagnosticCategory.Error,key:"Invalid_reference_directive_syntax_1084",message:"Invalid 'reference' directive syntax."},Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher:{code:1085,category:e.DiagnosticCategory.Error,key:"Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_1085",message:"Octal literals are not available when targeting ECMAScript 5 and higher."},An_accessor_cannot_be_declared_in_an_ambient_context:{code:1086,category:e.DiagnosticCategory.Error,key:"An_accessor_cannot_be_declared_in_an_ambient_context_1086",message:"An accessor cannot be declared in an ambient context."},_0_modifier_cannot_appear_on_a_constructor_declaration:{code:1089,category:e.DiagnosticCategory.Error,key:"_0_modifier_cannot_appear_on_a_constructor_declaration_1089",message:"'{0}' modifier cannot appear on a constructor declaration."},_0_modifier_cannot_appear_on_a_parameter:{code:1090,category:e.DiagnosticCategory.Error,key:"_0_modifier_cannot_appear_on_a_parameter_1090",message:"'{0}' modifier cannot appear on a parameter."},Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:{code:1091,category:e.DiagnosticCategory.Error,key:"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091",message:"Only a single variable declaration is allowed in a 'for...in' statement."},Type_parameters_cannot_appear_on_a_constructor_declaration:{code:1092,category:e.DiagnosticCategory.Error,key:"Type_parameters_cannot_appear_on_a_constructor_declaration_1092",message:"Type parameters cannot appear on a constructor declaration."},Type_annotation_cannot_appear_on_a_constructor_declaration:{code:1093,category:e.DiagnosticCategory.Error,key:"Type_annotation_cannot_appear_on_a_constructor_declaration_1093",message:"Type annotation cannot appear on a constructor declaration."},An_accessor_cannot_have_type_parameters:{code:1094,category:e.DiagnosticCategory.Error,key:"An_accessor_cannot_have_type_parameters_1094",message:"An accessor cannot have type parameters."},A_set_accessor_cannot_have_a_return_type_annotation:{code:1095,category:e.DiagnosticCategory.Error,key:"A_set_accessor_cannot_have_a_return_type_annotation_1095",message:"A 'set' accessor cannot have a return type annotation."},An_index_signature_must_have_exactly_one_parameter:{code:1096,category:e.DiagnosticCategory.Error,key:"An_index_signature_must_have_exactly_one_parameter_1096",message:"An index signature must have exactly one parameter."},_0_list_cannot_be_empty:{code:1097,category:e.DiagnosticCategory.Error,key:"_0_list_cannot_be_empty_1097",message:"'{0}' list cannot be empty."},Type_parameter_list_cannot_be_empty:{code:1098,category:e.DiagnosticCategory.Error,key:"Type_parameter_list_cannot_be_empty_1098",message:"Type parameter list cannot be empty."},Type_argument_list_cannot_be_empty:{code:1099,category:e.DiagnosticCategory.Error,key:"Type_argument_list_cannot_be_empty_1099",message:"Type argument list cannot be empty."},Invalid_use_of_0_in_strict_mode:{code:1100,category:e.DiagnosticCategory.Error,key:"Invalid_use_of_0_in_strict_mode_1100",message:"Invalid use of '{0}' in strict mode."},with_statements_are_not_allowed_in_strict_mode:{code:1101,category:e.DiagnosticCategory.Error,key:"with_statements_are_not_allowed_in_strict_mode_1101",message:"'with' statements are not allowed in strict mode."},delete_cannot_be_called_on_an_identifier_in_strict_mode:{code:1102,category:e.DiagnosticCategory.Error,key:"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102",message:"'delete' cannot be called on an identifier in strict mode."},A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:{code:1104,category:e.DiagnosticCategory.Error,key:"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104",message:"A 'continue' statement can only be used within an enclosing iteration statement."},A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:{code:1105,category:e.DiagnosticCategory.Error,key:"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105",message:"A 'break' statement can only be used within an enclosing iteration or switch statement."},Jump_target_cannot_cross_function_boundary:{code:1107,category:e.DiagnosticCategory.Error,key:"Jump_target_cannot_cross_function_boundary_1107",message:"Jump target cannot cross function boundary."},A_return_statement_can_only_be_used_within_a_function_body:{code:1108,category:e.DiagnosticCategory.Error,key:"A_return_statement_can_only_be_used_within_a_function_body_1108",message:"A 'return' statement can only be used within a function body."},Expression_expected:{code:1109,category:e.DiagnosticCategory.Error,key:"Expression_expected_1109",message:"Expression expected."},Type_expected:{code:1110,category:e.DiagnosticCategory.Error,key:"Type_expected_1110",message:"Type expected."},A_class_member_cannot_be_declared_optional:{code:1112,category:e.DiagnosticCategory.Error,key:"A_class_member_cannot_be_declared_optional_1112",message:"A class member cannot be declared optional."},A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:{code:1113,category:e.DiagnosticCategory.Error,key:"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113",message:"A 'default' clause cannot appear more than once in a 'switch' statement."},Duplicate_label_0:{code:1114,category:e.DiagnosticCategory.Error,key:"Duplicate_label_0_1114",message:"Duplicate label '{0}'"},A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:{code:1115,category:e.DiagnosticCategory.Error,key:"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115",message:"A 'continue' statement can only jump to a label of an enclosing iteration statement."},A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:{code:1116,category:e.DiagnosticCategory.Error,key:"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116",message:"A 'break' statement can only jump to a label of an enclosing statement."},An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode:{code:1117,category:e.DiagnosticCategory.Error,key:"An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117",message:"An object literal cannot have multiple properties with the same name in strict mode."},An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:{code:1118,category:e.DiagnosticCategory.Error,key:"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118",message:"An object literal cannot have multiple get/set accessors with the same name."},An_object_literal_cannot_have_property_and_accessor_with_the_same_name:{code:1119,category:e.DiagnosticCategory.Error,key:"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119",message:"An object literal cannot have property and accessor with the same name."},An_export_assignment_cannot_have_modifiers:{code:1120,category:e.DiagnosticCategory.Error,key:"An_export_assignment_cannot_have_modifiers_1120",message:"An export assignment cannot have modifiers."},Octal_literals_are_not_allowed_in_strict_mode:{code:1121,category:e.DiagnosticCategory.Error,key:"Octal_literals_are_not_allowed_in_strict_mode_1121",message:"Octal literals are not allowed in strict mode."},A_tuple_type_element_list_cannot_be_empty:{code:1122,category:e.DiagnosticCategory.Error,key:"A_tuple_type_element_list_cannot_be_empty_1122",message:"A tuple type element list cannot be empty."},Variable_declaration_list_cannot_be_empty:{code:1123,category:e.DiagnosticCategory.Error,key:"Variable_declaration_list_cannot_be_empty_1123",message:"Variable declaration list cannot be empty."},Digit_expected:{code:1124,category:e.DiagnosticCategory.Error,key:"Digit_expected_1124",message:"Digit expected."},Hexadecimal_digit_expected:{code:1125,category:e.DiagnosticCategory.Error,key:"Hexadecimal_digit_expected_1125",message:"Hexadecimal digit expected."},Unexpected_end_of_text:{code:1126,category:e.DiagnosticCategory.Error,key:"Unexpected_end_of_text_1126",message:"Unexpected end of text."},Invalid_character:{code:1127,category:e.DiagnosticCategory.Error,key:"Invalid_character_1127",message:"Invalid character."},Declaration_or_statement_expected:{code:1128,category:e.DiagnosticCategory.Error,key:"Declaration_or_statement_expected_1128",message:"Declaration or statement expected."},Statement_expected:{code:1129,category:e.DiagnosticCategory.Error,key:"Statement_expected_1129",message:"Statement expected."},case_or_default_expected:{code:1130,category:e.DiagnosticCategory.Error,key:"case_or_default_expected_1130",message:"'case' or 'default' expected."},Property_or_signature_expected:{code:1131,category:e.DiagnosticCategory.Error,key:"Property_or_signature_expected_1131",message:"Property or signature expected."},Enum_member_expected:{code:1132,category:e.DiagnosticCategory.Error,key:"Enum_member_expected_1132",message:"Enum member expected."},Variable_declaration_expected:{code:1134,category:e.DiagnosticCategory.Error,key:"Variable_declaration_expected_1134",message:"Variable declaration expected."},Argument_expression_expected:{code:1135,category:e.DiagnosticCategory.Error,key:"Argument_expression_expected_1135",message:"Argument expression expected."},Property_assignment_expected:{code:1136,category:e.DiagnosticCategory.Error,key:"Property_assignment_expected_1136",message:"Property assignment expected."},Expression_or_comma_expected:{code:1137,category:e.DiagnosticCategory.Error,key:"Expression_or_comma_expected_1137",message:"Expression or comma expected."},Parameter_declaration_expected:{code:1138,category:e.DiagnosticCategory.Error,key:"Parameter_declaration_expected_1138",message:"Parameter declaration expected."},Type_parameter_declaration_expected:{code:1139,category:e.DiagnosticCategory.Error,key:"Type_parameter_declaration_expected_1139",message:"Type parameter declaration expected."},Type_argument_expected:{code:1140,category:e.DiagnosticCategory.Error,key:"Type_argument_expected_1140",message:"Type argument expected."},String_literal_expected:{code:1141,category:e.DiagnosticCategory.Error,key:"String_literal_expected_1141",message:"String literal expected."},Line_break_not_permitted_here:{code:1142,category:e.DiagnosticCategory.Error,key:"Line_break_not_permitted_here_1142",message:"Line break not permitted here."},or_expected:{code:1144,category:e.DiagnosticCategory.Error,key:"or_expected_1144",message:"'{' or ';' expected."},Modifiers_not_permitted_on_index_signature_members:{code:1145,category:e.DiagnosticCategory.Error,key:"Modifiers_not_permitted_on_index_signature_members_1145",message:"Modifiers not permitted on index signature members."},Declaration_expected:{code:1146,category:e.DiagnosticCategory.Error,key:"Declaration_expected_1146",message:"Declaration expected."},Import_declarations_in_a_namespace_cannot_reference_a_module:{code:1147,category:e.DiagnosticCategory.Error,key:"Import_declarations_in_a_namespace_cannot_reference_a_module_1147",message:"Import declarations in a namespace cannot reference a module."},Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file:{code:1148,category:e.DiagnosticCategory.Error,key:"Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting__1148",message:"Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file."},File_name_0_differs_from_already_included_file_name_1_only_in_casing:{code:1149,category:e.DiagnosticCategory.Error,key:"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149",message:"File name '{0}' differs from already included file name '{1}' only in casing"},new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead:{code:1150,category:e.DiagnosticCategory.Error,key:"new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150",message:"'new T[]' cannot be used to create an array. Use 'new Array()' instead."},const_declarations_must_be_initialized:{code:1155,category:e.DiagnosticCategory.Error,key:"const_declarations_must_be_initialized_1155",message:"'const' declarations must be initialized"},const_declarations_can_only_be_declared_inside_a_block:{code:1156,category:e.DiagnosticCategory.Error,key:"const_declarations_can_only_be_declared_inside_a_block_1156",message:"'const' declarations can only be declared inside a block."},let_declarations_can_only_be_declared_inside_a_block:{code:1157,category:e.DiagnosticCategory.Error,key:"let_declarations_can_only_be_declared_inside_a_block_1157",message:"'let' declarations can only be declared inside a block."},Unterminated_template_literal:{code:1160,category:e.DiagnosticCategory.Error,key:"Unterminated_template_literal_1160",message:"Unterminated template literal."},Unterminated_regular_expression_literal:{code:1161,category:e.DiagnosticCategory.Error,key:"Unterminated_regular_expression_literal_1161",message:"Unterminated regular expression literal."},An_object_member_cannot_be_declared_optional:{code:1162,category:e.DiagnosticCategory.Error,key:"An_object_member_cannot_be_declared_optional_1162",message:"An object member cannot be declared optional."},A_yield_expression_is_only_allowed_in_a_generator_body:{code:1163,category:e.DiagnosticCategory.Error,key:"A_yield_expression_is_only_allowed_in_a_generator_body_1163",message:"A 'yield' expression is only allowed in a generator body."},Computed_property_names_are_not_allowed_in_enums:{code:1164,category:e.DiagnosticCategory.Error,key:"Computed_property_names_are_not_allowed_in_enums_1164",message:"Computed property names are not allowed in enums."},A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol:{code:1165,category:e.DiagnosticCategory.Error,key:"A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol_1165",message:"A computed property name in an ambient context must directly refer to a built-in symbol."},A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol:{code:1166,category:e.DiagnosticCategory.Error,key:"A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol_1166",message:"A computed property name in a class property declaration must directly refer to a built-in symbol."},A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol:{code:1168,category:e.DiagnosticCategory.Error,key:"A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol_1168",message:"A computed property name in a method overload must directly refer to a built-in symbol."},A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol:{code:1169,category:e.DiagnosticCategory.Error,key:"A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol_1169",message:"A computed property name in an interface must directly refer to a built-in symbol."},A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol:{code:1170,category:e.DiagnosticCategory.Error,key:"A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol_1170",message:"A computed property name in a type literal must directly refer to a built-in symbol."},A_comma_expression_is_not_allowed_in_a_computed_property_name:{code:1171,category:e.DiagnosticCategory.Error,key:"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171",message:"A comma expression is not allowed in a computed property name."},extends_clause_already_seen:{code:1172,category:e.DiagnosticCategory.Error,key:"extends_clause_already_seen_1172",message:"'extends' clause already seen."},extends_clause_must_precede_implements_clause:{code:1173,category:e.DiagnosticCategory.Error,key:"extends_clause_must_precede_implements_clause_1173",message:"'extends' clause must precede 'implements' clause."},Classes_can_only_extend_a_single_class:{code:1174,category:e.DiagnosticCategory.Error,key:"Classes_can_only_extend_a_single_class_1174",message:"Classes can only extend a single class."},implements_clause_already_seen:{code:1175,category:e.DiagnosticCategory.Error,key:"implements_clause_already_seen_1175",message:"'implements' clause already seen."},Interface_declaration_cannot_have_implements_clause:{code:1176,category:e.DiagnosticCategory.Error,key:"Interface_declaration_cannot_have_implements_clause_1176",message:"Interface declaration cannot have 'implements' clause."},Binary_digit_expected:{code:1177,category:e.DiagnosticCategory.Error,key:"Binary_digit_expected_1177",message:"Binary digit expected."},Octal_digit_expected:{code:1178,category:e.DiagnosticCategory.Error,key:"Octal_digit_expected_1178",message:"Octal digit expected."},Unexpected_token_expected:{code:1179,category:e.DiagnosticCategory.Error,key:"Unexpected_token_expected_1179",message:"Unexpected token. '{' expected."},Property_destructuring_pattern_expected:{code:1180,category:e.DiagnosticCategory.Error,key:"Property_destructuring_pattern_expected_1180",message:"Property destructuring pattern expected."},Array_element_destructuring_pattern_expected:{code:1181,category:e.DiagnosticCategory.Error,key:"Array_element_destructuring_pattern_expected_1181",message:"Array element destructuring pattern expected."},A_destructuring_declaration_must_have_an_initializer:{code:1182,category:e.DiagnosticCategory.Error,key:"A_destructuring_declaration_must_have_an_initializer_1182",message:"A destructuring declaration must have an initializer."},An_implementation_cannot_be_declared_in_ambient_contexts:{code:1183,category:e.DiagnosticCategory.Error,key:"An_implementation_cannot_be_declared_in_ambient_contexts_1183",message:"An implementation cannot be declared in ambient contexts."},Modifiers_cannot_appear_here:{code:1184,category:e.DiagnosticCategory.Error,key:"Modifiers_cannot_appear_here_1184",message:"Modifiers cannot appear here."},Merge_conflict_marker_encountered:{code:1185,category:e.DiagnosticCategory.Error,key:"Merge_conflict_marker_encountered_1185",message:"Merge conflict marker encountered."},A_rest_element_cannot_have_an_initializer:{code:1186,category:e.DiagnosticCategory.Error,key:"A_rest_element_cannot_have_an_initializer_1186",message:"A rest element cannot have an initializer."},A_parameter_property_may_not_be_a_binding_pattern:{code:1187,category:e.DiagnosticCategory.Error,key:"A_parameter_property_may_not_be_a_binding_pattern_1187",message:"A parameter property may not be a binding pattern."},Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:{code:1188,category:e.DiagnosticCategory.Error,key:"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188",message:"Only a single variable declaration is allowed in a 'for...of' statement."},The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:{code:1189,category:e.DiagnosticCategory.Error,key:"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189",message:"The variable declaration of a 'for...in' statement cannot have an initializer."},The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:{code:1190,category:e.DiagnosticCategory.Error,key:"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190",message:"The variable declaration of a 'for...of' statement cannot have an initializer."},An_import_declaration_cannot_have_modifiers:{code:1191,category:e.DiagnosticCategory.Error,key:"An_import_declaration_cannot_have_modifiers_1191",message:"An import declaration cannot have modifiers."},Module_0_has_no_default_export:{code:1192,category:e.DiagnosticCategory.Error,key:"Module_0_has_no_default_export_1192",message:"Module '{0}' has no default export."},An_export_declaration_cannot_have_modifiers:{code:1193,category:e.DiagnosticCategory.Error,key:"An_export_declaration_cannot_have_modifiers_1193",message:"An export declaration cannot have modifiers."},Export_declarations_are_not_permitted_in_a_namespace:{code:1194,category:e.DiagnosticCategory.Error,key:"Export_declarations_are_not_permitted_in_a_namespace_1194",message:"Export declarations are not permitted in a namespace."},Catch_clause_variable_name_must_be_an_identifier:{code:1195,category:e.DiagnosticCategory.Error,key:"Catch_clause_variable_name_must_be_an_identifier_1195",message:"Catch clause variable name must be an identifier."},Catch_clause_variable_cannot_have_a_type_annotation:{code:1196,category:e.DiagnosticCategory.Error,key:"Catch_clause_variable_cannot_have_a_type_annotation_1196",message:"Catch clause variable cannot have a type annotation."},Catch_clause_variable_cannot_have_an_initializer:{code:1197,category:e.DiagnosticCategory.Error,key:"Catch_clause_variable_cannot_have_an_initializer_1197",message:"Catch clause variable cannot have an initializer."},An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:{code:1198,category:e.DiagnosticCategory.Error,key:"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198",message:"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."},Unterminated_Unicode_escape_sequence:{code:1199,category:e.DiagnosticCategory.Error,key:"Unterminated_Unicode_escape_sequence_1199",message:"Unterminated Unicode escape sequence."},Line_terminator_not_permitted_before_arrow:{code:1200,category:e.DiagnosticCategory.Error,key:"Line_terminator_not_permitted_before_arrow_1200",message:"Line terminator not permitted before arrow."},Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:{code:1202,category:e.DiagnosticCategory.Error,key:"Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_modules_Consider_using_import_Asterisk__1202",message:"Import assignment cannot be used when targeting ECMAScript 6 modules. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"', or another module format instead."},Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_modules_Consider_using_export_default_or_another_module_format_instead:{code:1203,category:e.DiagnosticCategory.Error,key:"Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_modules_Consider_using_export_default_o_1203",message:"Export assignment cannot be used when targeting ECMAScript 6 modules. Consider using 'export default' or another module format instead."},Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower:{code:1204,category:e.DiagnosticCategory.Error,key:"Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower_1204",message:"Cannot compile modules into 'es2015' when targeting 'ES5' or lower."},Decorators_are_not_valid_here:{code:1206,category:e.DiagnosticCategory.Error,key:"Decorators_are_not_valid_here_1206",message:"Decorators are not valid here."},Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:{code:1207,category:e.DiagnosticCategory.Error,key:"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207",message:"Decorators cannot be applied to multiple get/set accessors of the same name."},Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided:{code:1208,category:e.DiagnosticCategory.Error,key:"Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208",message:"Cannot compile namespaces when the '--isolatedModules' flag is provided."},Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided:{code:1209,category:e.DiagnosticCategory.Error,key:"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209",message:"Ambient const enums are not allowed when the '--isolatedModules' flag is provided."},Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode:{code:1210,category:e.DiagnosticCategory.Error,key:"Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210",message:"Invalid use of '{0}'. Class definitions are automatically in strict mode."},A_class_declaration_without_the_default_modifier_must_have_a_name:{code:1211,category:e.DiagnosticCategory.Error,key:"A_class_declaration_without_the_default_modifier_must_have_a_name_1211",message:"A class declaration without the 'default' modifier must have a name"},Identifier_expected_0_is_a_reserved_word_in_strict_mode:{code:1212,category:e.DiagnosticCategory.Error,key:"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212",message:"Identifier expected. '{0}' is a reserved word in strict mode"},Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:{code:1213,category:e.DiagnosticCategory.Error,key:"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213",message:"Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."},Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:{code:1214,category:e.DiagnosticCategory.Error,key:"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214",message:"Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."},Invalid_use_of_0_Modules_are_automatically_in_strict_mode:{code:1215,category:e.DiagnosticCategory.Error,key:"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215",message:"Invalid use of '{0}'. Modules are automatically in strict mode."},Export_assignment_is_not_supported_when_module_flag_is_system:{code:1218,category:e.DiagnosticCategory.Error,key:"Export_assignment_is_not_supported_when_module_flag_is_system_1218",message:"Export assignment is not supported when '--module' flag is 'system'."},Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning:{code:1219,category:e.DiagnosticCategory.Error,key:"Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219",message:"Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning."},Generators_are_only_available_when_targeting_ECMAScript_6_or_higher:{code:1220,category:e.DiagnosticCategory.Error,key:"Generators_are_only_available_when_targeting_ECMAScript_6_or_higher_1220",message:"Generators are only available when targeting ECMAScript 6 or higher."},Generators_are_not_allowed_in_an_ambient_context:{code:1221,category:e.DiagnosticCategory.Error,key:"Generators_are_not_allowed_in_an_ambient_context_1221",message:"Generators are not allowed in an ambient context."},An_overload_signature_cannot_be_declared_as_a_generator:{code:1222,category:e.DiagnosticCategory.Error,key:"An_overload_signature_cannot_be_declared_as_a_generator_1222",message:"An overload signature cannot be declared as a generator."},_0_tag_already_specified:{code:1223,category:e.DiagnosticCategory.Error,key:"_0_tag_already_specified_1223",message:"'{0}' tag already specified."},Signature_0_must_have_a_type_predicate:{code:1224,category:e.DiagnosticCategory.Error,key:"Signature_0_must_have_a_type_predicate_1224",message:"Signature '{0}' must have a type predicate."},Cannot_find_parameter_0:{code:1225,category:e.DiagnosticCategory.Error,key:"Cannot_find_parameter_0_1225",message:"Cannot find parameter '{0}'."},Type_predicate_0_is_not_assignable_to_1:{code:1226,category:e.DiagnosticCategory.Error,key:"Type_predicate_0_is_not_assignable_to_1_1226",message:"Type predicate '{0}' is not assignable to '{1}'."},Parameter_0_is_not_in_the_same_position_as_parameter_1:{code:1227,category:e.DiagnosticCategory.Error,key:"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227",message:"Parameter '{0}' is not in the same position as parameter '{1}'."},A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:{code:1228,category:e.DiagnosticCategory.Error,key:"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228",message:"A type predicate is only allowed in return type position for functions and methods."},A_type_predicate_cannot_reference_a_rest_parameter:{code:1229,category:e.DiagnosticCategory.Error,key:"A_type_predicate_cannot_reference_a_rest_parameter_1229",message:"A type predicate cannot reference a rest parameter."},A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:{code:1230,category:e.DiagnosticCategory.Error,key:"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230",message:"A type predicate cannot reference element '{0}' in a binding pattern."},An_export_assignment_can_only_be_used_in_a_module:{code:1231,category:e.DiagnosticCategory.Error,key:"An_export_assignment_can_only_be_used_in_a_module_1231",message:"An export assignment can only be used in a module."},An_import_declaration_can_only_be_used_in_a_namespace_or_module:{code:1232,category:e.DiagnosticCategory.Error,key:"An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232",message:"An import declaration can only be used in a namespace or module."},An_export_declaration_can_only_be_used_in_a_module:{code:1233,category:e.DiagnosticCategory.Error,key:"An_export_declaration_can_only_be_used_in_a_module_1233",message:"An export declaration can only be used in a module."},An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:{code:1234,category:e.DiagnosticCategory.Error,key:"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234",message:"An ambient module declaration is only allowed at the top level in a file."},A_namespace_declaration_is_only_allowed_in_a_namespace_or_module:{code:1235,category:e.DiagnosticCategory.Error,key:"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235",message:"A namespace declaration is only allowed in a namespace or module."},The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:{code:1236,category:e.DiagnosticCategory.Error,key:"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236",message:"The return type of a property decorator function must be either 'void' or 'any'."},The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:{code:1237,category:e.DiagnosticCategory.Error,key:"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237",message:"The return type of a parameter decorator function must be either 'void' or 'any'."},Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:{code:1238,category:e.DiagnosticCategory.Error,key:"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238",message:"Unable to resolve signature of class decorator when called as an expression."},Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:{code:1239,category:e.DiagnosticCategory.Error,key:"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239",message:"Unable to resolve signature of parameter decorator when called as an expression."},Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:{code:1240,category:e.DiagnosticCategory.Error,key:"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240",message:"Unable to resolve signature of property decorator when called as an expression."},Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:{code:1241,category:e.DiagnosticCategory.Error,key:"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241",message:"Unable to resolve signature of method decorator when called as an expression."},abstract_modifier_can_only_appear_on_a_class_or_method_declaration:{code:1242,category:e.DiagnosticCategory.Error,key:"abstract_modifier_can_only_appear_on_a_class_or_method_declaration_1242",message:"'abstract' modifier can only appear on a class or method declaration."},_0_modifier_cannot_be_used_with_1_modifier:{code:1243,category:e.DiagnosticCategory.Error,key:"_0_modifier_cannot_be_used_with_1_modifier_1243",message:"'{0}' modifier cannot be used with '{1}' modifier."},Abstract_methods_can_only_appear_within_an_abstract_class:{code:1244,category:e.DiagnosticCategory.Error,key:"Abstract_methods_can_only_appear_within_an_abstract_class_1244",message:"Abstract methods can only appear within an abstract class."},Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:{code:1245,category:e.DiagnosticCategory.Error,key:"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245",message:"Method '{0}' cannot have an implementation because it is marked abstract."},An_interface_property_cannot_have_an_initializer:{code:1246,category:e.DiagnosticCategory.Error,key:"An_interface_property_cannot_have_an_initializer_1246",message:"An interface property cannot have an initializer."},A_type_literal_property_cannot_have_an_initializer:{code:1247,category:e.DiagnosticCategory.Error,key:"A_type_literal_property_cannot_have_an_initializer_1247",message:"A type literal property cannot have an initializer."},A_class_member_cannot_have_the_0_keyword:{code:1248,category:e.DiagnosticCategory.Error,key:"A_class_member_cannot_have_the_0_keyword_1248",message:"A class member cannot have the '{0}' keyword."},A_decorator_can_only_decorate_a_method_implementation_not_an_overload:{code:1249,category:e.DiagnosticCategory.Error,key:"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249",message:"A decorator can only decorate a method implementation, not an overload."},with_statements_are_not_allowed_in_an_async_function_block:{code:1300,category:e.DiagnosticCategory.Error,key:"with_statements_are_not_allowed_in_an_async_function_block_1300",message:"'with' statements are not allowed in an async function block."},await_expression_is_only_allowed_within_an_async_function:{code:1308,category:e.DiagnosticCategory.Error,key:"await_expression_is_only_allowed_within_an_async_function_1308",message:"'await' expression is only allowed within an async function."},Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher:{code:1311,category:e.DiagnosticCategory.Error,key:"Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher_1311",message:"Async functions are only available when targeting ECMAScript 6 and higher."},can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment:{code:1312,category:e.DiagnosticCategory.Error,key:"can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment_1312",message:"'=' can only be used in an object literal property inside a destructuring assignment."},The_body_of_an_if_statement_cannot_be_the_empty_statement:{code:1313,category:e.DiagnosticCategory.Error,key:"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313",message:"The body of an 'if' statement cannot be the empty statement."},Duplicate_identifier_0:{code:2300,category:e.DiagnosticCategory.Error,key:"Duplicate_identifier_0_2300",message:"Duplicate identifier '{0}'."},Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:{code:2301,category:e.DiagnosticCategory.Error,key:"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301",message:"Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."},Static_members_cannot_reference_class_type_parameters:{code:2302,category:e.DiagnosticCategory.Error,key:"Static_members_cannot_reference_class_type_parameters_2302",message:"Static members cannot reference class type parameters."},Circular_definition_of_import_alias_0:{code:2303,category:e.DiagnosticCategory.Error,key:"Circular_definition_of_import_alias_0_2303",message:"Circular definition of import alias '{0}'."},Cannot_find_name_0:{code:2304,category:e.DiagnosticCategory.Error,key:"Cannot_find_name_0_2304",message:"Cannot find name '{0}'."},Module_0_has_no_exported_member_1:{code:2305,category:e.DiagnosticCategory.Error,key:"Module_0_has_no_exported_member_1_2305",message:"Module '{0}' has no exported member '{1}'."},File_0_is_not_a_module:{code:2306,category:e.DiagnosticCategory.Error,key:"File_0_is_not_a_module_2306",message:"File '{0}' is not a module."},Cannot_find_module_0:{code:2307,category:e.DiagnosticCategory.Error,key:"Cannot_find_module_0_2307",message:"Cannot find module '{0}'."},Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:{code:2308,category:e.DiagnosticCategory.Error,key:"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308",message:"Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."},An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:{code:2309,category:e.DiagnosticCategory.Error,key:"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309",message:"An export assignment cannot be used in a module with other exported elements."},Type_0_recursively_references_itself_as_a_base_type:{code:2310,category:e.DiagnosticCategory.Error,key:"Type_0_recursively_references_itself_as_a_base_type_2310",message:"Type '{0}' recursively references itself as a base type."},A_class_may_only_extend_another_class:{code:2311,category:e.DiagnosticCategory.Error,key:"A_class_may_only_extend_another_class_2311",message:"A class may only extend another class."},An_interface_may_only_extend_a_class_or_another_interface:{code:2312,category:e.DiagnosticCategory.Error,key:"An_interface_may_only_extend_a_class_or_another_interface_2312",message:"An interface may only extend a class or another interface."},Type_parameter_0_has_a_circular_constraint:{code:2313,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_has_a_circular_constraint_2313",message:"Type parameter '{0}' has a circular constraint."},Generic_type_0_requires_1_type_argument_s:{code:2314,category:e.DiagnosticCategory.Error,key:"Generic_type_0_requires_1_type_argument_s_2314",message:"Generic type '{0}' requires {1} type argument(s)."},Type_0_is_not_generic:{code:2315,category:e.DiagnosticCategory.Error,key:"Type_0_is_not_generic_2315",message:"Type '{0}' is not generic."},Global_type_0_must_be_a_class_or_interface_type:{code:2316,category:e.DiagnosticCategory.Error,key:"Global_type_0_must_be_a_class_or_interface_type_2316",message:"Global type '{0}' must be a class or interface type."},Global_type_0_must_have_1_type_parameter_s:{code:2317,category:e.DiagnosticCategory.Error,key:"Global_type_0_must_have_1_type_parameter_s_2317",message:"Global type '{0}' must have {1} type parameter(s)."},Cannot_find_global_type_0:{code:2318,category:e.DiagnosticCategory.Error,key:"Cannot_find_global_type_0_2318",message:"Cannot find global type '{0}'."},Named_property_0_of_types_1_and_2_are_not_identical:{code:2319,category:e.DiagnosticCategory.Error,key:"Named_property_0_of_types_1_and_2_are_not_identical_2319",message:"Named property '{0}' of types '{1}' and '{2}' are not identical."},Interface_0_cannot_simultaneously_extend_types_1_and_2:{code:2320,category:e.DiagnosticCategory.Error,key:"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320",message:"Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."},Excessive_stack_depth_comparing_types_0_and_1:{code:2321,category:e.DiagnosticCategory.Error,key:"Excessive_stack_depth_comparing_types_0_and_1_2321",message:"Excessive stack depth comparing types '{0}' and '{1}'."},Type_0_is_not_assignable_to_type_1:{code:2322,category:e.DiagnosticCategory.Error,key:"Type_0_is_not_assignable_to_type_1_2322",message:"Type '{0}' is not assignable to type '{1}'."},Cannot_redeclare_exported_variable_0:{code:2323,category:e.DiagnosticCategory.Error,key:"Cannot_redeclare_exported_variable_0_2323",message:"Cannot redeclare exported variable '{0}'."},Property_0_is_missing_in_type_1:{code:2324,category:e.DiagnosticCategory.Error,key:"Property_0_is_missing_in_type_1_2324",message:"Property '{0}' is missing in type '{1}'."},Property_0_is_private_in_type_1_but_not_in_type_2:{code:2325,category:e.DiagnosticCategory.Error,key:"Property_0_is_private_in_type_1_but_not_in_type_2_2325",message:"Property '{0}' is private in type '{1}' but not in type '{2}'."},Types_of_property_0_are_incompatible:{code:2326,category:e.DiagnosticCategory.Error,key:"Types_of_property_0_are_incompatible_2326",message:"Types of property '{0}' are incompatible."},Property_0_is_optional_in_type_1_but_required_in_type_2:{code:2327,category:e.DiagnosticCategory.Error,key:"Property_0_is_optional_in_type_1_but_required_in_type_2_2327",message:"Property '{0}' is optional in type '{1}' but required in type '{2}'."},Types_of_parameters_0_and_1_are_incompatible:{code:2328,category:e.DiagnosticCategory.Error,key:"Types_of_parameters_0_and_1_are_incompatible_2328",message:"Types of parameters '{0}' and '{1}' are incompatible."},Index_signature_is_missing_in_type_0:{code:2329,category:e.DiagnosticCategory.Error,key:"Index_signature_is_missing_in_type_0_2329",message:"Index signature is missing in type '{0}'."},Index_signatures_are_incompatible:{code:2330,category:e.DiagnosticCategory.Error,key:"Index_signatures_are_incompatible_2330",message:"Index signatures are incompatible."},this_cannot_be_referenced_in_a_module_or_namespace_body:{code:2331,category:e.DiagnosticCategory.Error,key:"this_cannot_be_referenced_in_a_module_or_namespace_body_2331",message:"'this' cannot be referenced in a module or namespace body."},this_cannot_be_referenced_in_current_location:{code:2332,category:e.DiagnosticCategory.Error,key:"this_cannot_be_referenced_in_current_location_2332",message:"'this' cannot be referenced in current location."},this_cannot_be_referenced_in_constructor_arguments:{code:2333,category:e.DiagnosticCategory.Error,key:"this_cannot_be_referenced_in_constructor_arguments_2333",message:"'this' cannot be referenced in constructor arguments."},this_cannot_be_referenced_in_a_static_property_initializer:{code:2334,category:e.DiagnosticCategory.Error,key:"this_cannot_be_referenced_in_a_static_property_initializer_2334",message:"'this' cannot be referenced in a static property initializer."},super_can_only_be_referenced_in_a_derived_class:{code:2335,category:e.DiagnosticCategory.Error,key:"super_can_only_be_referenced_in_a_derived_class_2335",message:"'super' can only be referenced in a derived class."},super_cannot_be_referenced_in_constructor_arguments:{code:2336,category:e.DiagnosticCategory.Error,key:"super_cannot_be_referenced_in_constructor_arguments_2336",message:"'super' cannot be referenced in constructor arguments."},Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:{code:2337,category:e.DiagnosticCategory.Error,key:"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337",message:"Super calls are not permitted outside constructors or in nested functions inside constructors."},super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:{code:2338,category:e.DiagnosticCategory.Error,key:"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338",message:"'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."},Property_0_does_not_exist_on_type_1:{code:2339,category:e.DiagnosticCategory.Error,key:"Property_0_does_not_exist_on_type_1_2339",message:"Property '{0}' does not exist on type '{1}'."},Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:{code:2340,category:e.DiagnosticCategory.Error,key:"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340",message:"Only public and protected methods of the base class are accessible via the 'super' keyword."},Property_0_is_private_and_only_accessible_within_class_1:{code:2341,category:e.DiagnosticCategory.Error,key:"Property_0_is_private_and_only_accessible_within_class_1_2341",message:"Property '{0}' is private and only accessible within class '{1}'."},An_index_expression_argument_must_be_of_type_string_number_symbol_or_any:{code:2342,category:e.DiagnosticCategory.Error,key:"An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342",message:"An index expression argument must be of type 'string', 'number', 'symbol', or 'any'."},Type_0_does_not_satisfy_the_constraint_1:{code:2344,category:e.DiagnosticCategory.Error,key:"Type_0_does_not_satisfy_the_constraint_1_2344",message:"Type '{0}' does not satisfy the constraint '{1}'."},Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:{code:2345,category:e.DiagnosticCategory.Error,key:"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345",message:"Argument of type '{0}' is not assignable to parameter of type '{1}'."},Supplied_parameters_do_not_match_any_signature_of_call_target:{code:2346,category:e.DiagnosticCategory.Error,key:"Supplied_parameters_do_not_match_any_signature_of_call_target_2346",message:"Supplied parameters do not match any signature of call target."},Untyped_function_calls_may_not_accept_type_arguments:{code:2347,category:e.DiagnosticCategory.Error,key:"Untyped_function_calls_may_not_accept_type_arguments_2347",message:"Untyped function calls may not accept type arguments."},Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:{code:2348,category:e.DiagnosticCategory.Error,key:"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348",message:"Value of type '{0}' is not callable. Did you mean to include 'new'?"},Cannot_invoke_an_expression_whose_type_lacks_a_call_signature:{code:2349,category:e.DiagnosticCategory.Error,key:"Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_2349",message:"Cannot invoke an expression whose type lacks a call signature."},Only_a_void_function_can_be_called_with_the_new_keyword:{code:2350,category:e.DiagnosticCategory.Error,key:"Only_a_void_function_can_be_called_with_the_new_keyword_2350",message:"Only a void function can be called with the 'new' keyword."},Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature:{code:2351,category:e.DiagnosticCategory.Error,key:"Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature_2351",message:"Cannot use 'new' with an expression whose type lacks a call or construct signature."},Neither_type_0_nor_type_1_is_assignable_to_the_other:{code:2352,category:e.DiagnosticCategory.Error,key:"Neither_type_0_nor_type_1_is_assignable_to_the_other_2352",message:"Neither type '{0}' nor type '{1}' is assignable to the other."},Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:{code:2353,category:e.DiagnosticCategory.Error,key:"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353",message:"Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."},No_best_common_type_exists_among_return_expressions:{code:2354,category:e.DiagnosticCategory.Error,key:"No_best_common_type_exists_among_return_expressions_2354",message:"No best common type exists among return expressions."},A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value:{code:2355,category:e.DiagnosticCategory.Error,key:"A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355",message:"A function whose declared type is neither 'void' nor 'any' must return a value."},An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type:{code:2356,category:e.DiagnosticCategory.Error,key:"An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356",message:"An arithmetic operand must be of type 'any', 'number' or an enum type."},The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer:{code:2357,category:e.DiagnosticCategory.Error,key:"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer_2357",message:"The operand of an increment or decrement operator must be a variable, property or indexer."},The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:{code:2358,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358",message:"The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."},The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type:{code:2359,category:e.DiagnosticCategory.Error,key:"The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359",message:"The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."},The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol:{code:2360,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360",message:"The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'."},The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:{code:2361,category:e.DiagnosticCategory.Error,key:"The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361",message:"The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter"},The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type:{code:2362,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362",message:"The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type."},The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type:{code:2363,category:e.DiagnosticCategory.Error,key:"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363",message:"The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type."},Invalid_left_hand_side_of_assignment_expression:{code:2364,category:e.DiagnosticCategory.Error,key:"Invalid_left_hand_side_of_assignment_expression_2364",message:"Invalid left-hand side of assignment expression."},Operator_0_cannot_be_applied_to_types_1_and_2:{code:2365,category:e.DiagnosticCategory.Error,key:"Operator_0_cannot_be_applied_to_types_1_and_2_2365",message:"Operator '{0}' cannot be applied to types '{1}' and '{2}'."},Type_parameter_name_cannot_be_0:{code:2368,category:e.DiagnosticCategory.Error,key:"Type_parameter_name_cannot_be_0_2368",message:"Type parameter name cannot be '{0}'"},A_parameter_property_is_only_allowed_in_a_constructor_implementation:{code:2369,category:e.DiagnosticCategory.Error,key:"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369",message:"A parameter property is only allowed in a constructor implementation."},A_rest_parameter_must_be_of_an_array_type:{code:2370,category:e.DiagnosticCategory.Error,key:"A_rest_parameter_must_be_of_an_array_type_2370",message:"A rest parameter must be of an array type."},A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:{code:2371,category:e.DiagnosticCategory.Error,key:"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371",message:"A parameter initializer is only allowed in a function or constructor implementation."},Parameter_0_cannot_be_referenced_in_its_initializer:{code:2372,category:e.DiagnosticCategory.Error,key:"Parameter_0_cannot_be_referenced_in_its_initializer_2372",message:"Parameter '{0}' cannot be referenced in its initializer."},Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it:{code:2373,category:e.DiagnosticCategory.Error,key:"Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373",message:"Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it."},Duplicate_string_index_signature:{code:2374,category:e.DiagnosticCategory.Error,key:"Duplicate_string_index_signature_2374",message:"Duplicate string index signature."},Duplicate_number_index_signature:{code:2375,category:e.DiagnosticCategory.Error,key:"Duplicate_number_index_signature_2375",message:"Duplicate number index signature."},A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties:{code:2376,category:e.DiagnosticCategory.Error,key:"A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_proper_2376",message:"A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties."},Constructors_for_derived_classes_must_contain_a_super_call:{code:2377,category:e.DiagnosticCategory.Error,key:"Constructors_for_derived_classes_must_contain_a_super_call_2377",message:"Constructors for derived classes must contain a 'super' call."},A_get_accessor_must_return_a_value:{code:2378,category:e.DiagnosticCategory.Error,key:"A_get_accessor_must_return_a_value_2378",message:"A 'get' accessor must return a value."},Getter_and_setter_accessors_do_not_agree_in_visibility:{code:2379,category:e.DiagnosticCategory.Error,key:"Getter_and_setter_accessors_do_not_agree_in_visibility_2379",message:"Getter and setter accessors do not agree in visibility."},get_and_set_accessor_must_have_the_same_type:{code:2380,category:e.DiagnosticCategory.Error,key:"get_and_set_accessor_must_have_the_same_type_2380",message:"'get' and 'set' accessor must have the same type."},A_signature_with_an_implementation_cannot_use_a_string_literal_type:{code:2381,category:e.DiagnosticCategory.Error,key:"A_signature_with_an_implementation_cannot_use_a_string_literal_type_2381",message:"A signature with an implementation cannot use a string literal type."},Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature:{code:2382,category:e.DiagnosticCategory.Error,key:"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382",message:"Specialized overload signature is not assignable to any non-specialized signature."},Overload_signatures_must_all_be_exported_or_not_exported:{code:2383,category:e.DiagnosticCategory.Error,key:"Overload_signatures_must_all_be_exported_or_not_exported_2383",message:"Overload signatures must all be exported or not exported."},Overload_signatures_must_all_be_ambient_or_non_ambient:{code:2384,category:e.DiagnosticCategory.Error,key:"Overload_signatures_must_all_be_ambient_or_non_ambient_2384",message:"Overload signatures must all be ambient or non-ambient."},Overload_signatures_must_all_be_public_private_or_protected:{code:2385,category:e.DiagnosticCategory.Error,key:"Overload_signatures_must_all_be_public_private_or_protected_2385",message:"Overload signatures must all be public, private or protected."},Overload_signatures_must_all_be_optional_or_required:{code:2386,category:e.DiagnosticCategory.Error,key:"Overload_signatures_must_all_be_optional_or_required_2386",message:"Overload signatures must all be optional or required."},Function_overload_must_be_static:{code:2387,category:e.DiagnosticCategory.Error,key:"Function_overload_must_be_static_2387",message:"Function overload must be static."},Function_overload_must_not_be_static:{code:2388,category:e.DiagnosticCategory.Error,key:"Function_overload_must_not_be_static_2388",message:"Function overload must not be static."},Function_implementation_name_must_be_0:{code:2389,category:e.DiagnosticCategory.Error,key:"Function_implementation_name_must_be_0_2389",message:"Function implementation name must be '{0}'."},Constructor_implementation_is_missing:{code:2390,category:e.DiagnosticCategory.Error,key:"Constructor_implementation_is_missing_2390",message:"Constructor implementation is missing."},Function_implementation_is_missing_or_not_immediately_following_the_declaration:{code:2391,category:e.DiagnosticCategory.Error,key:"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391",message:"Function implementation is missing or not immediately following the declaration."},Multiple_constructor_implementations_are_not_allowed:{code:2392,category:e.DiagnosticCategory.Error,key:"Multiple_constructor_implementations_are_not_allowed_2392",message:"Multiple constructor implementations are not allowed."},Duplicate_function_implementation:{code:2393,category:e.DiagnosticCategory.Error,key:"Duplicate_function_implementation_2393",message:"Duplicate function implementation."},Overload_signature_is_not_compatible_with_function_implementation:{code:2394,category:e.DiagnosticCategory.Error,key:"Overload_signature_is_not_compatible_with_function_implementation_2394",message:"Overload signature is not compatible with function implementation."},Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:{code:2395,category:e.DiagnosticCategory.Error,key:"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395",message:"Individual declarations in merged declaration '{0}' must be all exported or all local."},Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:{code:2396,category:e.DiagnosticCategory.Error,key:"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396",message:"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."},Declaration_name_conflicts_with_built_in_global_identifier_0:{code:2397,category:e.DiagnosticCategory.Error,key:"Declaration_name_conflicts_with_built_in_global_identifier_0_2397",message:"Declaration name conflicts with built-in global identifier '{0}'."},Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:{code:2399,category:e.DiagnosticCategory.Error,key:"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399",message:"Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."},Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:{code:2400,category:e.DiagnosticCategory.Error,key:"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400",message:"Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."},Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference:{code:2401,category:e.DiagnosticCategory.Error,key:"Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference_2401",message:"Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference."},Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:{code:2402,category:e.DiagnosticCategory.Error,key:"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402",message:"Expression resolves to '_super' that compiler uses to capture base class reference."},Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:{code:2403,category:e.DiagnosticCategory.Error,key:"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403",message:"Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."},The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:{code:2404,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404",message:"The left-hand side of a 'for...in' statement cannot use a type annotation."},The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:{code:2405,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405",message:"The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."},Invalid_left_hand_side_in_for_in_statement:{code:2406,category:e.DiagnosticCategory.Error,key:"Invalid_left_hand_side_in_for_in_statement_2406",message:"Invalid left-hand side in 'for...in' statement."},The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter:{code:2407,category:e.DiagnosticCategory.Error,key:"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407",message:"The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter."},Setters_cannot_return_a_value:{code:2408,category:e.DiagnosticCategory.Error,key:"Setters_cannot_return_a_value_2408",message:"Setters cannot return a value."},Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:{code:2409,category:e.DiagnosticCategory.Error,key:"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409",message:"Return type of constructor signature must be assignable to the instance type of the class"},All_symbols_within_a_with_block_will_be_resolved_to_any:{code:2410,category:e.DiagnosticCategory.Error,key:"All_symbols_within_a_with_block_will_be_resolved_to_any_2410",message:"All symbols within a 'with' block will be resolved to 'any'."},Property_0_of_type_1_is_not_assignable_to_string_index_type_2:{code:2411,category:e.DiagnosticCategory.Error,key:"Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411",message:"Property '{0}' of type '{1}' is not assignable to string index type '{2}'."},Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2:{code:2412,category:e.DiagnosticCategory.Error,key:"Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412",message:"Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'."},Numeric_index_type_0_is_not_assignable_to_string_index_type_1:{code:2413,category:e.DiagnosticCategory.Error,key:"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413",message:"Numeric index type '{0}' is not assignable to string index type '{1}'."},Class_name_cannot_be_0:{code:2414,category:e.DiagnosticCategory.Error,key:"Class_name_cannot_be_0_2414",message:"Class name cannot be '{0}'"},Class_0_incorrectly_extends_base_class_1:{code:2415,category:e.DiagnosticCategory.Error,key:"Class_0_incorrectly_extends_base_class_1_2415",message:"Class '{0}' incorrectly extends base class '{1}'."},Class_static_side_0_incorrectly_extends_base_class_static_side_1:{code:2417,category:e.DiagnosticCategory.Error,key:"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417",message:"Class static side '{0}' incorrectly extends base class static side '{1}'."},Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0:{code:2419,category:e.DiagnosticCategory.Error,key:"Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0_2419",message:"Type name '{0}' in extends clause does not reference constructor function for '{0}'."},Class_0_incorrectly_implements_interface_1:{code:2420,category:e.DiagnosticCategory.Error,key:"Class_0_incorrectly_implements_interface_1_2420",message:"Class '{0}' incorrectly implements interface '{1}'."},A_class_may_only_implement_another_class_or_interface:{code:2422,category:e.DiagnosticCategory.Error,key:"A_class_may_only_implement_another_class_or_interface_2422",message:"A class may only implement another class or interface."},Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:{code:2423,category:e.DiagnosticCategory.Error,key:"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423",message:"Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."},Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property:{code:2424,category:e.DiagnosticCategory.Error,key:"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424",message:"Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property."},Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:{code:2425,category:e.DiagnosticCategory.Error,key:"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425",message:"Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."},Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:{code:2426,category:e.DiagnosticCategory.Error,key:"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426",message:"Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."},Interface_name_cannot_be_0:{code:2427,category:e.DiagnosticCategory.Error,key:"Interface_name_cannot_be_0_2427",message:"Interface name cannot be '{0}'"},All_declarations_of_an_interface_must_have_identical_type_parameters:{code:2428,category:e.DiagnosticCategory.Error,key:"All_declarations_of_an_interface_must_have_identical_type_parameters_2428",message:"All declarations of an interface must have identical type parameters."},Interface_0_incorrectly_extends_interface_1:{code:2430,category:e.DiagnosticCategory.Error,key:"Interface_0_incorrectly_extends_interface_1_2430",message:"Interface '{0}' incorrectly extends interface '{1}'."},Enum_name_cannot_be_0:{code:2431,category:e.DiagnosticCategory.Error,key:"Enum_name_cannot_be_0_2431",message:"Enum name cannot be '{0}'"},In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:{code:2432,category:e.DiagnosticCategory.Error,key:"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432",message:"In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."},A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:{code:2433,category:e.DiagnosticCategory.Error,key:"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433",message:"A namespace declaration cannot be in a different file from a class or function with which it is merged"},A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:{code:2434,category:e.DiagnosticCategory.Error,key:"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434",message:"A namespace declaration cannot be located prior to a class or function with which it is merged"},Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:{code:2435,category:e.DiagnosticCategory.Error,key:"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435",message:"Ambient modules cannot be nested in other modules or namespaces."},Ambient_module_declaration_cannot_specify_relative_module_name:{code:2436,category:e.DiagnosticCategory.Error,key:"Ambient_module_declaration_cannot_specify_relative_module_name_2436",message:"Ambient module declaration cannot specify relative module name."},Module_0_is_hidden_by_a_local_declaration_with_the_same_name:{code:2437,category:e.DiagnosticCategory.Error,key:"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437",message:"Module '{0}' is hidden by a local declaration with the same name"},Import_name_cannot_be_0:{code:2438,category:e.DiagnosticCategory.Error,key:"Import_name_cannot_be_0_2438",message:"Import name cannot be '{0}'"},Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:{code:2439,category:e.DiagnosticCategory.Error,key:"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439",message:"Import or export declaration in an ambient module declaration cannot reference module through relative module name."},Import_declaration_conflicts_with_local_declaration_of_0:{code:2440,category:e.DiagnosticCategory.Error,key:"Import_declaration_conflicts_with_local_declaration_of_0_2440",message:"Import declaration conflicts with local declaration of '{0}'"},Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:{code:2441,category:e.DiagnosticCategory.Error,key:"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441",message:"Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."},Types_have_separate_declarations_of_a_private_property_0:{code:2442,category:e.DiagnosticCategory.Error,key:"Types_have_separate_declarations_of_a_private_property_0_2442",message:"Types have separate declarations of a private property '{0}'."},Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:{code:2443,category:e.DiagnosticCategory.Error,key:"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443",message:"Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."},Property_0_is_protected_in_type_1_but_public_in_type_2:{code:2444,category:e.DiagnosticCategory.Error,key:"Property_0_is_protected_in_type_1_but_public_in_type_2_2444",message:"Property '{0}' is protected in type '{1}' but public in type '{2}'."},Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:{code:2445,category:e.DiagnosticCategory.Error,key:"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445",message:"Property '{0}' is protected and only accessible within class '{1}' and its subclasses."},Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1:{code:2446,category:e.DiagnosticCategory.Error,key:"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446",message:"Property '{0}' is protected and only accessible through an instance of class '{1}'."},The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:{code:2447,category:e.DiagnosticCategory.Error,key:"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447",message:"The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."},Block_scoped_variable_0_used_before_its_declaration:{code:2448,category:e.DiagnosticCategory.Error,key:"Block_scoped_variable_0_used_before_its_declaration_2448",message:"Block-scoped variable '{0}' used before its declaration."},The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant:{code:2449,category:e.DiagnosticCategory.Error,key:"The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant_2449",message:"The operand of an increment or decrement operator cannot be a constant."},Left_hand_side_of_assignment_expression_cannot_be_a_constant:{code:2450,category:e.DiagnosticCategory.Error,key:"Left_hand_side_of_assignment_expression_cannot_be_a_constant_2450",message:"Left-hand side of assignment expression cannot be a constant."},Cannot_redeclare_block_scoped_variable_0:{code:2451,category:e.DiagnosticCategory.Error,key:"Cannot_redeclare_block_scoped_variable_0_2451",message:"Cannot redeclare block-scoped variable '{0}'."},An_enum_member_cannot_have_a_numeric_name:{code:2452,category:e.DiagnosticCategory.Error,key:"An_enum_member_cannot_have_a_numeric_name_2452",message:"An enum member cannot have a numeric name."},The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly:{code:2453,category:e.DiagnosticCategory.Error,key:"The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453",message:"The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly."},Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0:{code:2455,category:e.DiagnosticCategory.Error,key:"Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455",message:"Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'."},Type_alias_0_circularly_references_itself:{code:2456,category:e.DiagnosticCategory.Error,key:"Type_alias_0_circularly_references_itself_2456",message:"Type alias '{0}' circularly references itself."},Type_alias_name_cannot_be_0:{code:2457,category:e.DiagnosticCategory.Error,key:"Type_alias_name_cannot_be_0_2457",message:"Type alias name cannot be '{0}'"},An_AMD_module_cannot_have_multiple_name_assignments:{code:2458,category:e.DiagnosticCategory.Error,key:"An_AMD_module_cannot_have_multiple_name_assignments_2458",message:"An AMD module cannot have multiple name assignments."},Type_0_has_no_property_1_and_no_string_index_signature:{code:2459,category:e.DiagnosticCategory.Error,key:"Type_0_has_no_property_1_and_no_string_index_signature_2459",message:"Type '{0}' has no property '{1}' and no string index signature."},Type_0_has_no_property_1:{code:2460,category:e.DiagnosticCategory.Error,key:"Type_0_has_no_property_1_2460",message:"Type '{0}' has no property '{1}'."},Type_0_is_not_an_array_type:{code:2461,category:e.DiagnosticCategory.Error,key:"Type_0_is_not_an_array_type_2461",message:"Type '{0}' is not an array type."},A_rest_element_must_be_last_in_an_array_destructuring_pattern:{code:2462,category:e.DiagnosticCategory.Error,key:"A_rest_element_must_be_last_in_an_array_destructuring_pattern_2462",message:"A rest element must be last in an array destructuring pattern"},A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:{code:2463,category:e.DiagnosticCategory.Error,key:"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463",message:"A binding pattern parameter cannot be optional in an implementation signature."},A_computed_property_name_must_be_of_type_string_number_symbol_or_any:{code:2464,category:e.DiagnosticCategory.Error,key:"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464",message:"A computed property name must be of type 'string', 'number', 'symbol', or 'any'."},this_cannot_be_referenced_in_a_computed_property_name:{code:2465,category:e.DiagnosticCategory.Error,key:"this_cannot_be_referenced_in_a_computed_property_name_2465",message:"'this' cannot be referenced in a computed property name."},super_cannot_be_referenced_in_a_computed_property_name:{code:2466,category:e.DiagnosticCategory.Error,key:"super_cannot_be_referenced_in_a_computed_property_name_2466",message:"'super' cannot be referenced in a computed property name."},A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:{code:2467,category:e.DiagnosticCategory.Error,key:"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467",message:"A computed property name cannot reference a type parameter from its containing type."},Cannot_find_global_value_0:{code:2468,category:e.DiagnosticCategory.Error,key:"Cannot_find_global_value_0_2468",message:"Cannot find global value '{0}'."},The_0_operator_cannot_be_applied_to_type_symbol:{code:2469,category:e.DiagnosticCategory.Error,key:"The_0_operator_cannot_be_applied_to_type_symbol_2469",message:"The '{0}' operator cannot be applied to type 'symbol'."},Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object:{code:2470,category:e.DiagnosticCategory.Error,key:"Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470",message:"'Symbol' reference does not refer to the global Symbol constructor object."},A_computed_property_name_of_the_form_0_must_be_of_type_symbol:{code:2471,category:e.DiagnosticCategory.Error,key:"A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471",message:"A computed property name of the form '{0}' must be of type 'symbol'."},Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:{code:2472,category:e.DiagnosticCategory.Error,key:"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472",message:"Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."},Enum_declarations_must_all_be_const_or_non_const:{code:2473,category:e.DiagnosticCategory.Error,key:"Enum_declarations_must_all_be_const_or_non_const_2473",message:"Enum declarations must all be const or non-const."},In_const_enum_declarations_member_initializer_must_be_constant_expression:{code:2474,category:e.DiagnosticCategory.Error,key:"In_const_enum_declarations_member_initializer_must_be_constant_expression_2474",message:"In 'const' enum declarations member initializer must be constant expression."},const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment:{code:2475,category:e.DiagnosticCategory.Error,key:"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475",message:"'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."},A_const_enum_member_can_only_be_accessed_using_a_string_literal:{code:2476,category:e.DiagnosticCategory.Error,key:"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476",message:"A const enum member can only be accessed using a string literal."},const_enum_member_initializer_was_evaluated_to_a_non_finite_value:{code:2477,category:e.DiagnosticCategory.Error,key:"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477",message:"'const' enum member initializer was evaluated to a non-finite value."},const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:{code:2478,category:e.DiagnosticCategory.Error,key:"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478",message:"'const' enum member initializer was evaluated to disallowed value 'NaN'."},Property_0_does_not_exist_on_const_enum_1:{code:2479,category:e.DiagnosticCategory.Error,key:"Property_0_does_not_exist_on_const_enum_1_2479",message:"Property '{0}' does not exist on 'const' enum '{1}'."},let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:{code:2480,category:e.DiagnosticCategory.Error,key:"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480",message:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:{code:2481,category:e.DiagnosticCategory.Error,key:"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481",message:"Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."},The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:{code:2483,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483",message:"The left-hand side of a 'for...of' statement cannot use a type annotation."},Export_declaration_conflicts_with_exported_declaration_of_0:{code:2484,category:e.DiagnosticCategory.Error,key:"Export_declaration_conflicts_with_exported_declaration_of_0_2484",message:"Export declaration conflicts with exported declaration of '{0}'"},The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant:{code:2485,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant_2485",message:"The left-hand side of a 'for...of' statement cannot be a previously defined constant."},The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant:{code:2486,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant_2486",message:"The left-hand side of a 'for...in' statement cannot be a previously defined constant."},Invalid_left_hand_side_in_for_of_statement:{code:2487,category:e.DiagnosticCategory.Error,key:"Invalid_left_hand_side_in_for_of_statement_2487",message:"Invalid left-hand side in 'for...of' statement."},Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator:{code:2488,category:e.DiagnosticCategory.Error,key:"Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488",message:"Type must have a '[Symbol.iterator]()' method that returns an iterator."},An_iterator_must_have_a_next_method:{code:2489,category:e.DiagnosticCategory.Error,key:"An_iterator_must_have_a_next_method_2489",message:"An iterator must have a 'next()' method."},The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property:{code:2490,category:e.DiagnosticCategory.Error,key:"The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490",message:"The type returned by the 'next()' method of an iterator must have a 'value' property."},The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:{code:2491,category:e.DiagnosticCategory.Error,key:"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491",message:"The left-hand side of a 'for...in' statement cannot be a destructuring pattern."},Cannot_redeclare_identifier_0_in_catch_clause:{code:2492,category:e.DiagnosticCategory.Error,key:"Cannot_redeclare_identifier_0_in_catch_clause_2492",message:"Cannot redeclare identifier '{0}' in catch clause"},Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2:{code:2493,category:e.DiagnosticCategory.Error,key:"Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493",message:"Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'."},Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:{code:2494,category:e.DiagnosticCategory.Error,key:"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494",message:"Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."},Type_0_is_not_an_array_type_or_a_string_type:{code:2495,category:e.DiagnosticCategory.Error,key:"Type_0_is_not_an_array_type_or_a_string_type_2495",message:"Type '{0}' is not an array type or a string type."},The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression:{code:2496,category:e.DiagnosticCategory.Error,key:"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496",message:"The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."},Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct:{code:2497,category:e.DiagnosticCategory.Error,key:"Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct_2497",message:"Module '{0}' resolves to a non-module entity and cannot be imported using this construct."},Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:{code:2498,category:e.DiagnosticCategory.Error,key:"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498",message:"Module '{0}' uses 'export =' and cannot be used with 'export *'."},An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:{code:2499,category:e.DiagnosticCategory.Error,key:"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499",message:"An interface can only extend an identifier/qualified-name with optional type arguments."},A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:{code:2500,category:e.DiagnosticCategory.Error,key:"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500",message:"A class can only implement an identifier/qualified-name with optional type arguments."},A_rest_element_cannot_contain_a_binding_pattern:{code:2501,category:e.DiagnosticCategory.Error,key:"A_rest_element_cannot_contain_a_binding_pattern_2501",message:"A rest element cannot contain a binding pattern."},_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:{code:2502,category:e.DiagnosticCategory.Error,key:"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502",message:"'{0}' is referenced directly or indirectly in its own type annotation."},Cannot_find_namespace_0:{code:2503,category:e.DiagnosticCategory.Error,key:"Cannot_find_namespace_0_2503",message:"Cannot find namespace '{0}'."},No_best_common_type_exists_among_yield_expressions:{code:2504,category:e.DiagnosticCategory.Error,key:"No_best_common_type_exists_among_yield_expressions_2504",message:"No best common type exists among yield expressions."},A_generator_cannot_have_a_void_type_annotation:{code:2505,category:e.DiagnosticCategory.Error,key:"A_generator_cannot_have_a_void_type_annotation_2505",message:"A generator cannot have a 'void' type annotation."},_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:{code:2506,category:e.DiagnosticCategory.Error,key:"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506",message:"'{0}' is referenced directly or indirectly in its own base expression."},Type_0_is_not_a_constructor_function_type:{code:2507,category:e.DiagnosticCategory.Error,key:"Type_0_is_not_a_constructor_function_type_2507",message:"Type '{0}' is not a constructor function type."},No_base_constructor_has_the_specified_number_of_type_arguments:{code:2508,category:e.DiagnosticCategory.Error,key:"No_base_constructor_has_the_specified_number_of_type_arguments_2508",message:"No base constructor has the specified number of type arguments."},Base_constructor_return_type_0_is_not_a_class_or_interface_type:{code:2509,category:e.DiagnosticCategory.Error,key:"Base_constructor_return_type_0_is_not_a_class_or_interface_type_2509",message:"Base constructor return type '{0}' is not a class or interface type."},Base_constructors_must_all_have_the_same_return_type:{code:2510,category:e.DiagnosticCategory.Error,key:"Base_constructors_must_all_have_the_same_return_type_2510",message:"Base constructors must all have the same return type."},Cannot_create_an_instance_of_the_abstract_class_0:{code:2511,category:e.DiagnosticCategory.Error,key:"Cannot_create_an_instance_of_the_abstract_class_0_2511",message:"Cannot create an instance of the abstract class '{0}'."},Overload_signatures_must_all_be_abstract_or_not_abstract:{code:2512,category:e.DiagnosticCategory.Error,key:"Overload_signatures_must_all_be_abstract_or_not_abstract_2512",message:"Overload signatures must all be abstract or not abstract."},Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:{code:2513,category:e.DiagnosticCategory.Error,key:"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513",message:"Abstract method '{0}' in class '{1}' cannot be accessed via super expression."},Classes_containing_abstract_methods_must_be_marked_abstract:{code:2514,category:e.DiagnosticCategory.Error,key:"Classes_containing_abstract_methods_must_be_marked_abstract_2514",message:"Classes containing abstract methods must be marked abstract."},Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:{code:2515,category:e.DiagnosticCategory.Error,key:"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515",message:"Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."},All_declarations_of_an_abstract_method_must_be_consecutive:{code:2516,category:e.DiagnosticCategory.Error,key:"All_declarations_of_an_abstract_method_must_be_consecutive_2516",message:"All declarations of an abstract method must be consecutive."},Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:{code:2517,category:e.DiagnosticCategory.Error,key:"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517",message:"Cannot assign an abstract constructor type to a non-abstract constructor type."},A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:{code:2518,category:e.DiagnosticCategory.Error,key:"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518",message:"A 'this'-based type guard is not compatible with a parameter-based type guard."},Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:{code:2520,category:e.DiagnosticCategory.Error,key:"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520",message:"Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."},Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions:{code:2521,category:e.DiagnosticCategory.Error,key:"Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521",message:"Expression resolves to variable declaration '{0}' that compiler uses to support async functions."},The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression:{code:2522,category:e.DiagnosticCategory.Error,key:"The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522",message:"The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression."},yield_expressions_cannot_be_used_in_a_parameter_initializer:{code:2523,category:e.DiagnosticCategory.Error,key:"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523",message:"'yield' expressions cannot be used in a parameter initializer."},await_expressions_cannot_be_used_in_a_parameter_initializer:{code:2524,category:e.DiagnosticCategory.Error,key:"await_expressions_cannot_be_used_in_a_parameter_initializer_2524",message:"'await' expressions cannot be used in a parameter initializer."},Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value:{code:2525,category:e.DiagnosticCategory.Error,key:"Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525",message:"Initializer provides no value for this binding element and the binding element has no default value."},A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:{code:2526,category:e.DiagnosticCategory.Error,key:"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526",message:"A 'this' type is available only in a non-static member of a class or interface."},The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary:{code:2527,category:e.DiagnosticCategory.Error,key:"The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary_2527",message:"The inferred type of '{0}' references an inaccessible 'this' type. A type annotation is necessary."},A_module_cannot_have_multiple_default_exports:{code:2528,category:e.DiagnosticCategory.Error,key:"A_module_cannot_have_multiple_default_exports_2528",message:"A module cannot have multiple default exports."},Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:{code:2529,category:e.DiagnosticCategory.Error,key:"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529",message:"Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."},JSX_element_attributes_type_0_may_not_be_a_union_type:{code:2600,category:e.DiagnosticCategory.Error,key:"JSX_element_attributes_type_0_may_not_be_a_union_type_2600",message:"JSX element attributes type '{0}' may not be a union type."},The_return_type_of_a_JSX_element_constructor_must_return_an_object_type:{code:2601,category:e.DiagnosticCategory.Error,key:"The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601",message:"The return type of a JSX element constructor must return an object type."},JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:{code:2602,category:e.DiagnosticCategory.Error,key:"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602",message:"JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."},Property_0_in_type_1_is_not_assignable_to_type_2:{code:2603,category:e.DiagnosticCategory.Error,key:"Property_0_in_type_1_is_not_assignable_to_type_2_2603",message:"Property '{0}' in type '{1}' is not assignable to type '{2}'"},JSX_element_type_0_does_not_have_any_construct_or_call_signatures:{code:2604,category:e.DiagnosticCategory.Error,key:"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604",message:"JSX element type '{0}' does not have any construct or call signatures."},JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements:{code:2605,category:e.DiagnosticCategory.Error,key:"JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605",message:"JSX element type '{0}' is not a constructor function for JSX elements."},Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:{code:2606,category:e.DiagnosticCategory.Error,key:"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606",message:"Property '{0}' of JSX spread attribute is not assignable to target property."},JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:{code:2607,category:e.DiagnosticCategory.Error,key:"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607",message:"JSX element class does not support attributes because it does not have a '{0}' property"},The_global_type_JSX_0_may_not_have_more_than_one_property:{code:2608,category:e.DiagnosticCategory.Error,key:"The_global_type_JSX_0_may_not_have_more_than_one_property_2608",message:"The global type 'JSX.{0}' may not have more than one property"},Cannot_emit_namespaced_JSX_elements_in_React:{code:2650,category:e.DiagnosticCategory.Error,key:"Cannot_emit_namespaced_JSX_elements_in_React_2650",message:"Cannot emit namespaced JSX elements in React"},A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:{code:2651,category:e.DiagnosticCategory.Error,key:"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651",message:"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."},Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:{code:2652,category:e.DiagnosticCategory.Error,key:"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652",message:"Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."},Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:{code:2653,category:e.DiagnosticCategory.Error,key:"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653",message:"Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."},Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition:{code:2654,category:e.DiagnosticCategory.Error,key:"Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654",message:"Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition."},Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition:{code:2656,category:e.DiagnosticCategory.Error,key:"Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656",message:"Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition."},JSX_expressions_must_have_one_parent_element:{code:2657,category:e.DiagnosticCategory.Error,key:"JSX_expressions_must_have_one_parent_element_2657",message:"JSX expressions must have one parent element"},Type_0_provides_no_match_for_the_signature_1:{code:2658,category:e.DiagnosticCategory.Error,key:"Type_0_provides_no_match_for_the_signature_1_2658",message:"Type '{0}' provides no match for the signature '{1}'"},super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:{code:2659,category:e.DiagnosticCategory.Error,key:"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659",message:"'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."},super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:{code:2660,category:e.DiagnosticCategory.Error,key:"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660",message:"'super' can only be referenced in members of derived classes or object literal expressions."},Cannot_re_export_name_that_is_not_defined_in_the_module:{code:2661,category:e.DiagnosticCategory.Error,key:"Cannot_re_export_name_that_is_not_defined_in_the_module_2661",message:"Cannot re-export name that is not defined in the module."},Cannot_find_name_0_Did_you_mean_the_static_member_1_0:{code:2662,category:e.DiagnosticCategory.Error,key:"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662",message:"Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"},Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:{code:2663,category:e.DiagnosticCategory.Error,key:"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663",message:"Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"},Invalid_module_name_in_augmentation_module_0_cannot_be_found:{code:2664,category:e.DiagnosticCategory.Error,key:"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664",message:"Invalid module name in augmentation, module '{0}' cannot be found."},Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope:{code:2665,category:e.DiagnosticCategory.Error,key:"Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope_2665",message:"Module augmentation cannot introduce new names in the top level scope."},Exports_and_export_assignments_are_not_permitted_in_module_augmentations:{code:2666,category:e.DiagnosticCategory.Error,key:"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666",message:"Exports and export assignments are not permitted in module augmentations."},Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:{code:2667,category:e.DiagnosticCategory.Error,key:"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667",message:"Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."},export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:{code:2668,category:e.DiagnosticCategory.Error,key:"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668",message:"'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."},Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:{code:2669,category:e.DiagnosticCategory.Error,key:"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669",message:"Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."},Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:{code:2670,category:e.DiagnosticCategory.Error,key:"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670",message:"Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."},Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:{code:2671,category:e.DiagnosticCategory.Error,key:"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671",message:"Cannot augment module '{0}' because it resolves to a non-module entity."},Import_declaration_0_is_using_private_name_1:{code:4e3,category:e.DiagnosticCategory.Error,key:"Import_declaration_0_is_using_private_name_1_4000",message:"Import declaration '{0}' is using private name '{1}'."},Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:{code:4002,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002",message:"Type parameter '{0}' of exported class has or is using private name '{1}'."},Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:{code:4004,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004",message:"Type parameter '{0}' of exported interface has or is using private name '{1}'."},Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:{code:4006,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006",message:"Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."},Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:{code:4008,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008",message:"Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."},Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:{code:4010,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010",message:"Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."},Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:{code:4012,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012",message:"Type parameter '{0}' of public method from exported class has or is using private name '{1}'."},Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:{code:4014,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014",message:"Type parameter '{0}' of method from exported interface has or is using private name '{1}'."},Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:{code:4016,category:e.DiagnosticCategory.Error,key:"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016",message:"Type parameter '{0}' of exported function has or is using private name '{1}'."},Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:{code:4019,category:e.DiagnosticCategory.Error,key:"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019",message:"Implements clause of exported class '{0}' has or is using private name '{1}'."},Extends_clause_of_exported_class_0_has_or_is_using_private_name_1:{code:4020,category:e.DiagnosticCategory.Error,key:"Extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020",message:"Extends clause of exported class '{0}' has or is using private name '{1}'."},Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:{code:4022,category:e.DiagnosticCategory.Error,key:"Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022",message:"Extends clause of exported interface '{0}' has or is using private name '{1}'."},Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:{code:4023,category:e.DiagnosticCategory.Error,key:"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023",message:"Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."},Exported_variable_0_has_or_is_using_name_1_from_private_module_2:{code:4024,category:e.DiagnosticCategory.Error,key:"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024",message:"Exported variable '{0}' has or is using name '{1}' from private module '{2}'."},Exported_variable_0_has_or_is_using_private_name_1:{code:4025,category:e.DiagnosticCategory.Error,key:"Exported_variable_0_has_or_is_using_private_name_1_4025",message:"Exported variable '{0}' has or is using private name '{1}'."},Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:{code:4026,category:e.DiagnosticCategory.Error,key:"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026",message:"Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."},Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:{code:4027,category:e.DiagnosticCategory.Error,key:"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027",message:"Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."},Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:{code:4028,category:e.DiagnosticCategory.Error,key:"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028",message:"Public static property '{0}' of exported class has or is using private name '{1}'."},Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:{code:4029,category:e.DiagnosticCategory.Error,key:"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029",message:"Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."},Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:{code:4030,category:e.DiagnosticCategory.Error,key:"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030",message:"Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."},Public_property_0_of_exported_class_has_or_is_using_private_name_1:{code:4031,category:e.DiagnosticCategory.Error,key:"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031",message:"Public property '{0}' of exported class has or is using private name '{1}'."},Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:{code:4032,category:e.DiagnosticCategory.Error,key:"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032",message:"Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."},Property_0_of_exported_interface_has_or_is_using_private_name_1:{code:4033,category:e.DiagnosticCategory.Error,key:"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033",message:"Property '{0}' of exported interface has or is using private name '{1}'."},Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2:{code:4034,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_4034",message:"Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'."},Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1:{code:4035,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1_4035",message:"Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'."},Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2:{code:4036,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_4036",message:"Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'."},Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1:{code:4037,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1_4037",message:"Parameter '{0}' of public property setter from exported class has or is using private name '{1}'."},Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:{code:4038,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_externa_4038",message:"Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named."},Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1:{code:4039,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_4039",message:"Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'."},Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0:{code:4040,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0_4040",message:"Return type of public static property getter from exported class has or is using private name '{0}'."},Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:{code:4041,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_modul_4041",message:"Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named."},Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1:{code:4042,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_4042",message:"Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'."},Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0:{code:4043,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0_4043",message:"Return type of public property getter from exported class has or is using private name '{0}'."},Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:{code:4044,category:e.DiagnosticCategory.Error,key:"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044",message:"Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."},Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:{code:4045,category:e.DiagnosticCategory.Error,key:"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045",message:"Return type of constructor signature from exported interface has or is using private name '{0}'."},Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:{code:4046,category:e.DiagnosticCategory.Error,key:"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046",message:"Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."},Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:{code:4047,category:e.DiagnosticCategory.Error,key:"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047",message:"Return type of call signature from exported interface has or is using private name '{0}'."},Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:{code:4048,category:e.DiagnosticCategory.Error,key:"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048",message:"Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."},Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:{code:4049,category:e.DiagnosticCategory.Error,key:"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049",message:"Return type of index signature from exported interface has or is using private name '{0}'."},Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:{code:4050,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050",message:"Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."},Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:{code:4051,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051",message:"Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."},Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:{code:4052,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052",message:"Return type of public static method from exported class has or is using private name '{0}'."},Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:{code:4053,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053",message:"Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."},Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:{code:4054,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054",message:"Return type of public method from exported class has or is using name '{0}' from private module '{1}'."},Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:{code:4055,category:e.DiagnosticCategory.Error,key:"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055",message:"Return type of public method from exported class has or is using private name '{0}'."},Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:{code:4056,category:e.DiagnosticCategory.Error,key:"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056",message:"Return type of method from exported interface has or is using name '{0}' from private module '{1}'."},Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:{code:4057,category:e.DiagnosticCategory.Error,key:"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057",message:"Return type of method from exported interface has or is using private name '{0}'."},Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:{code:4058,category:e.DiagnosticCategory.Error,key:"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058",message:"Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."},Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:{code:4059,category:e.DiagnosticCategory.Error,key:"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059",message:"Return type of exported function has or is using name '{0}' from private module '{1}'."},Return_type_of_exported_function_has_or_is_using_private_name_0:{code:4060,category:e.DiagnosticCategory.Error,key:"Return_type_of_exported_function_has_or_is_using_private_name_0_4060",message:"Return type of exported function has or is using private name '{0}'."},Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:{code:4061,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061",message:"Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."},Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:{code:4062,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062",message:"Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."},Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:{code:4063,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063",message:"Parameter '{0}' of constructor from exported class has or is using private name '{1}'."},Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:{code:4064,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064",message:"Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."},Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:{code:4065,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065",message:"Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."},Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:{code:4066,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066",message:"Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."},Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:{code:4067,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067",message:"Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."},Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:{code:4068,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068",message:"Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."},Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:{code:4069,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069",message:"Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."},Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:{code:4070,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070",message:"Parameter '{0}' of public static method from exported class has or is using private name '{1}'."},Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:{code:4071,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071",message:"Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."},Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:{code:4072,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072",message:"Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."},Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:{code:4073,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073",message:"Parameter '{0}' of public method from exported class has or is using private name '{1}'."},Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:{code:4074,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074",message:"Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."},Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:{code:4075,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075",message:"Parameter '{0}' of method from exported interface has or is using private name '{1}'."},Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:{code:4076,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076",message:"Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."},Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:{code:4077,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077",message:"Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."},Parameter_0_of_exported_function_has_or_is_using_private_name_1:{code:4078,category:e.DiagnosticCategory.Error,key:"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078",message:"Parameter '{0}' of exported function has or is using private name '{1}'."},Exported_type_alias_0_has_or_is_using_private_name_1:{code:4081,category:e.DiagnosticCategory.Error,key:"Exported_type_alias_0_has_or_is_using_private_name_1_4081",message:"Exported type alias '{0}' has or is using private name '{1}'."},Default_export_of_the_module_has_or_is_using_private_name_0:{code:4082,category:e.DiagnosticCategory.Error,key:"Default_export_of_the_module_has_or_is_using_private_name_0_4082",message:"Default export of the module has or is using private name '{0}'."},The_current_host_does_not_support_the_0_option:{code:5001,category:e.DiagnosticCategory.Error,key:"The_current_host_does_not_support_the_0_option_5001",message:"The current host does not support the '{0}' option."},Cannot_find_the_common_subdirectory_path_for_the_input_files:{code:5009,category:e.DiagnosticCategory.Error,key:"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009",message:"Cannot find the common subdirectory path for the input files."},Cannot_read_file_0_Colon_1:{code:5012,category:e.DiagnosticCategory.Error,key:"Cannot_read_file_0_Colon_1_5012",message:"Cannot read file '{0}': {1}"},Unsupported_file_encoding:{code:5013,category:e.DiagnosticCategory.Error,key:"Unsupported_file_encoding_5013",message:"Unsupported file encoding."},Failed_to_parse_file_0_Colon_1:{code:5014,category:e.DiagnosticCategory.Error,key:"Failed_to_parse_file_0_Colon_1_5014",message:"Failed to parse file '{0}': {1}."},Unknown_compiler_option_0:{code:5023,category:e.DiagnosticCategory.Error,key:"Unknown_compiler_option_0_5023",message:"Unknown compiler option '{0}'."},Compiler_option_0_requires_a_value_of_type_1:{code:5024,category:e.DiagnosticCategory.Error,key:"Compiler_option_0_requires_a_value_of_type_1_5024",message:"Compiler option '{0}' requires a value of type {1}."},Could_not_write_file_0_Colon_1:{code:5033,category:e.DiagnosticCategory.Error,key:"Could_not_write_file_0_Colon_1_5033",message:"Could not write file '{0}': {1}"},Option_project_cannot_be_mixed_with_source_files_on_a_command_line:{code:5042,category:e.DiagnosticCategory.Error,key:"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042",message:"Option 'project' cannot be mixed with source files on a command line."},Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:{code:5047,category:e.DiagnosticCategory.Error,key:"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047",message:"Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."},Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:{code:5051,category:e.DiagnosticCategory.Error,key:"Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_prov_5051",message:"Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."},Option_0_cannot_be_specified_without_specifying_option_1:{code:5052,category:e.DiagnosticCategory.Error,key:"Option_0_cannot_be_specified_without_specifying_option_1_5052",message:"Option '{0}' cannot be specified without specifying option '{1}'."},Option_0_cannot_be_specified_with_option_1:{code:5053,category:e.DiagnosticCategory.Error,key:"Option_0_cannot_be_specified_with_option_1_5053",message:"Option '{0}' cannot be specified with option '{1}'."},A_tsconfig_json_file_is_already_defined_at_Colon_0:{code:5054,category:e.DiagnosticCategory.Error,key:"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054",message:"A 'tsconfig.json' file is already defined at: '{0}'."},Cannot_write_file_0_because_it_would_overwrite_input_file:{code:5055,category:e.DiagnosticCategory.Error,key:"Cannot_write_file_0_because_it_would_overwrite_input_file_5055",message:"Cannot write file '{0}' because it would overwrite input file."},Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:{code:5056,category:e.DiagnosticCategory.Error,key:"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056",message:"Cannot write file '{0}' because it would be overwritten by multiple input files."},Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:{code:5057,category:e.DiagnosticCategory.Error,key:"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057",message:"Cannot find a tsconfig.json file at the specified directory: '{0}'"},The_specified_path_does_not_exist_Colon_0:{code:5058,category:e.DiagnosticCategory.Error,key:"The_specified_path_does_not_exist_Colon_0_5058",message:"The specified path does not exist: '{0}'"},Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier:{code:5059,category:e.DiagnosticCategory.Error,key:"Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier_5059",message:"Invalide value for '--reactNamespace'. '{0}' is not a valid identifier."},Concatenate_and_emit_output_to_single_file:{code:6001,category:e.DiagnosticCategory.Message,key:"Concatenate_and_emit_output_to_single_file_6001",message:"Concatenate and emit output to single file."},Generates_corresponding_d_ts_file:{code:6002,category:e.DiagnosticCategory.Message,key:"Generates_corresponding_d_ts_file_6002",message:"Generates corresponding '.d.ts' file."},Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:{code:6003,category:e.DiagnosticCategory.Message,key:"Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003",message:"Specifies the location where debugger should locate map files instead of generated locations."},Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:{code:6004,category:e.DiagnosticCategory.Message,key:"Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004",message:"Specifies the location where debugger should locate TypeScript files instead of source locations."},Watch_input_files:{code:6005,category:e.DiagnosticCategory.Message,key:"Watch_input_files_6005",message:"Watch input files."},Redirect_output_structure_to_the_directory:{code:6006,category:e.DiagnosticCategory.Message,key:"Redirect_output_structure_to_the_directory_6006",message:"Redirect output structure to the directory."},Do_not_erase_const_enum_declarations_in_generated_code:{code:6007,category:e.DiagnosticCategory.Message,key:"Do_not_erase_const_enum_declarations_in_generated_code_6007",message:"Do not erase const enum declarations in generated code."},Do_not_emit_outputs_if_any_errors_were_reported:{code:6008,category:e.DiagnosticCategory.Message,key:"Do_not_emit_outputs_if_any_errors_were_reported_6008",message:"Do not emit outputs if any errors were reported."},Do_not_emit_comments_to_output:{code:6009,category:e.DiagnosticCategory.Message,key:"Do_not_emit_comments_to_output_6009",message:"Do not emit comments to output."},Do_not_emit_outputs:{code:6010,category:e.DiagnosticCategory.Message,key:"Do_not_emit_outputs_6010",message:"Do not emit outputs."},Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:{code:6011,category:e.DiagnosticCategory.Message,key:"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011",message:"Allow default imports from modules with no default export. This does not affect code emit, just typechecking."},Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental:{code:6015,category:e.DiagnosticCategory.Message,key:"Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental_6015",message:"Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015' (experimental)"},Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015:{code:6016,category:e.DiagnosticCategory.Message,key:"Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016",message:"Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'"},Print_this_message:{code:6017,category:e.DiagnosticCategory.Message,key:"Print_this_message_6017",message:"Print this message."},Print_the_compiler_s_version:{code:6019,category:e.DiagnosticCategory.Message,key:"Print_the_compiler_s_version_6019",message:"Print the compiler's version."},Compile_the_project_in_the_given_directory:{code:6020,category:e.DiagnosticCategory.Message,key:"Compile_the_project_in_the_given_directory_6020",message:"Compile the project in the given directory."},Syntax_Colon_0:{code:6023,category:e.DiagnosticCategory.Message,key:"Syntax_Colon_0_6023",message:"Syntax: {0}"},options:{code:6024,category:e.DiagnosticCategory.Message,key:"options_6024",message:"options"},file:{code:6025,category:e.DiagnosticCategory.Message,key:"file_6025",message:"file"},Examples_Colon_0:{code:6026,category:e.DiagnosticCategory.Message,key:"Examples_Colon_0_6026",message:"Examples: {0}"},Options_Colon:{code:6027,category:e.DiagnosticCategory.Message,key:"Options_Colon_6027",message:"Options:"},Version_0:{code:6029,category:e.DiagnosticCategory.Message,key:"Version_0_6029",message:"Version {0}"},Insert_command_line_options_and_files_from_a_file:{code:6030,category:e.DiagnosticCategory.Message,key:"Insert_command_line_options_and_files_from_a_file_6030",message:"Insert command line options and files from a file."},File_change_detected_Starting_incremental_compilation:{code:6032,category:e.DiagnosticCategory.Message,key:"File_change_detected_Starting_incremental_compilation_6032",message:"File change detected. Starting incremental compilation..."},KIND:{code:6034,category:e.DiagnosticCategory.Message,key:"KIND_6034",message:"KIND"},FILE:{code:6035,category:e.DiagnosticCategory.Message,key:"FILE_6035",message:"FILE"},VERSION:{code:6036,category:e.DiagnosticCategory.Message,key:"VERSION_6036",message:"VERSION"},LOCATION:{code:6037,category:e.DiagnosticCategory.Message,key:"LOCATION_6037",message:"LOCATION"},DIRECTORY:{code:6038,category:e.DiagnosticCategory.Message,key:"DIRECTORY_6038",message:"DIRECTORY"},Compilation_complete_Watching_for_file_changes:{code:6042,category:e.DiagnosticCategory.Message,key:"Compilation_complete_Watching_for_file_changes_6042",message:"Compilation complete. Watching for file changes."},Generates_corresponding_map_file:{code:6043,category:e.DiagnosticCategory.Message,key:"Generates_corresponding_map_file_6043",message:"Generates corresponding '.map' file."},Compiler_option_0_expects_an_argument:{code:6044,category:e.DiagnosticCategory.Error,key:"Compiler_option_0_expects_an_argument_6044",message:"Compiler option '{0}' expects an argument."},Unterminated_quoted_string_in_response_file_0:{code:6045,category:e.DiagnosticCategory.Error,key:"Unterminated_quoted_string_in_response_file_0_6045",message:"Unterminated quoted string in response file '{0}'."},Argument_for_module_option_must_be_commonjs_amd_system_umd_es2015_or_none:{code:6046,category:e.DiagnosticCategory.Error,key:"Argument_for_module_option_must_be_commonjs_amd_system_umd_es2015_or_none_6046",message:"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'none'."},Argument_for_target_option_must_be_ES3_ES5_or_ES2015:{code:6047,category:e.DiagnosticCategory.Error,key:"Argument_for_target_option_must_be_ES3_ES5_or_ES2015_6047",message:"Argument for '--target' option must be 'ES3', 'ES5', or 'ES2015'."},Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:{code:6048,category:e.DiagnosticCategory.Error,key:"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048",message:"Locale must be of the form or -. For example '{0}' or '{1}'."},Unsupported_locale_0:{code:6049,category:e.DiagnosticCategory.Error,key:"Unsupported_locale_0_6049",message:"Unsupported locale '{0}'."},Unable_to_open_file_0:{code:6050,category:e.DiagnosticCategory.Error,key:"Unable_to_open_file_0_6050",message:"Unable to open file '{0}'."},Corrupted_locale_file_0:{code:6051,category:e.DiagnosticCategory.Error,key:"Corrupted_locale_file_0_6051",message:"Corrupted locale file {0}."},Raise_error_on_expressions_and_declarations_with_an_implied_any_type:{code:6052,category:e.DiagnosticCategory.Message,key:"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052",message:"Raise error on expressions and declarations with an implied 'any' type."},File_0_not_found:{code:6053,category:e.DiagnosticCategory.Error,key:"File_0_not_found_6053",message:"File '{0}' not found."},File_0_has_unsupported_extension_The_only_supported_extensions_are_1:{code:6054,category:e.DiagnosticCategory.Error,key:"File_0_has_unsupported_extension_The_only_supported_extensions_are_1_6054",message:"File '{0}' has unsupported extension. The only supported extensions are {1}."},Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:{code:6055,category:e.DiagnosticCategory.Message,key:"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055",message:"Suppress noImplicitAny errors for indexing objects lacking index signatures."},Do_not_emit_declarations_for_code_that_has_an_internal_annotation:{code:6056,category:e.DiagnosticCategory.Message,key:"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056",message:"Do not emit declarations for code that has an '@internal' annotation."},Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:{code:6058,category:e.DiagnosticCategory.Message,key:"Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDi_6058",message:"Specifies the root directory of input files. Use to control the output directory structure with --outDir."},File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:{code:6059,category:e.DiagnosticCategory.Error,key:"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059",message:"File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."},Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:{code:6060,category:e.DiagnosticCategory.Message,key:"Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060",message:"Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."},NEWLINE:{code:6061,category:e.DiagnosticCategory.Message,key:"NEWLINE_6061",message:"NEWLINE"},Argument_for_newLine_option_must_be_CRLF_or_LF:{code:6062,category:e.DiagnosticCategory.Error,key:"Argument_for_newLine_option_must_be_CRLF_or_LF_6062",message:"Argument for '--newLine' option must be 'CRLF' or 'LF'."},Argument_for_moduleResolution_option_must_be_node_or_classic:{code:6063,category:e.DiagnosticCategory.Error,key:"Argument_for_moduleResolution_option_must_be_node_or_classic_6063",message:"Argument for '--moduleResolution' option must be 'node' or 'classic'."},Enables_experimental_support_for_ES7_decorators:{code:6065,category:e.DiagnosticCategory.Message,key:"Enables_experimental_support_for_ES7_decorators_6065",message:"Enables experimental support for ES7 decorators."},Enables_experimental_support_for_emitting_type_metadata_for_decorators:{code:6066,category:e.DiagnosticCategory.Message,key:"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066",message:"Enables experimental support for emitting type metadata for decorators."},Enables_experimental_support_for_ES7_async_functions:{code:6068,category:e.DiagnosticCategory.Message,key:"Enables_experimental_support_for_ES7_async_functions_6068",message:"Enables experimental support for ES7 async functions."},Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6:{code:6069,category:e.DiagnosticCategory.Message,key:"Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069",message:"Specifies module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."},Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:{code:6070,category:e.DiagnosticCategory.Message,key:"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070",message:"Initializes a TypeScript project and creates a tsconfig.json file."},Successfully_created_a_tsconfig_json_file:{code:6071,category:e.DiagnosticCategory.Message,key:"Successfully_created_a_tsconfig_json_file_6071",message:"Successfully created a tsconfig.json file."},Suppress_excess_property_checks_for_object_literals:{code:6072,category:e.DiagnosticCategory.Message,key:"Suppress_excess_property_checks_for_object_literals_6072",message:"Suppress excess property checks for object literals."},Stylize_errors_and_messages_using_color_and_context_experimental:{code:6073,category:e.DiagnosticCategory.Message,key:"Stylize_errors_and_messages_using_color_and_context_experimental_6073",message:"Stylize errors and messages using color and context. (experimental)"},Do_not_report_errors_on_unused_labels:{code:6074,category:e.DiagnosticCategory.Message,key:"Do_not_report_errors_on_unused_labels_6074",message:"Do not report errors on unused labels."},Report_error_when_not_all_code_paths_in_function_return_a_value:{code:6075,category:e.DiagnosticCategory.Message,key:"Report_error_when_not_all_code_paths_in_function_return_a_value_6075",message:"Report error when not all code paths in function return a value."},Report_errors_for_fallthrough_cases_in_switch_statement:{code:6076,category:e.DiagnosticCategory.Message,key:"Report_errors_for_fallthrough_cases_in_switch_statement_6076",message:"Report errors for fallthrough cases in switch statement."},Do_not_report_errors_on_unreachable_code:{code:6077,category:e.DiagnosticCategory.Message,key:"Do_not_report_errors_on_unreachable_code_6077",message:"Do not report errors on unreachable code."},Disallow_inconsistently_cased_references_to_the_same_file:{code:6078,category:e.DiagnosticCategory.Message,key:"Disallow_inconsistently_cased_references_to_the_same_file_6078",message:"Disallow inconsistently-cased references to the same file."},Specify_JSX_code_generation_Colon_preserve_or_react:{code:6080,category:e.DiagnosticCategory.Message,key:"Specify_JSX_code_generation_Colon_preserve_or_react_6080",message:"Specify JSX code generation: 'preserve' or 'react'"},Argument_for_jsx_must_be_preserve_or_react:{code:6081,category:e.DiagnosticCategory.Message,key:"Argument_for_jsx_must_be_preserve_or_react_6081",message:"Argument for '--jsx' must be 'preserve' or 'react'."},Only_amd_and_system_modules_are_supported_alongside_0:{code:6082,category:e.DiagnosticCategory.Error,key:"Only_amd_and_system_modules_are_supported_alongside_0_6082",message:"Only 'amd' and 'system' modules are supported alongside --{0}."},Allow_javascript_files_to_be_compiled:{code:6083,category:e.DiagnosticCategory.Message,key:"Allow_javascript_files_to_be_compiled_6083",message:"Allow javascript files to be compiled."},Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit:{code:6084,category:e.DiagnosticCategory.Message,key:"Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084",message:"Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit"},Do_not_emit_use_strict_directives_in_module_output:{code:6112,category:e.DiagnosticCategory.Message,key:"Do_not_emit_use_strict_directives_in_module_output_6112",message:"Do not emit 'use strict' directives in module output."},Variable_0_implicitly_has_an_1_type:{code:7005,category:e.DiagnosticCategory.Error,key:"Variable_0_implicitly_has_an_1_type_7005",message:"Variable '{0}' implicitly has an '{1}' type."},Parameter_0_implicitly_has_an_1_type:{code:7006,category:e.DiagnosticCategory.Error,key:"Parameter_0_implicitly_has_an_1_type_7006",message:"Parameter '{0}' implicitly has an '{1}' type."},Member_0_implicitly_has_an_1_type:{code:7008,category:e.DiagnosticCategory.Error,key:"Member_0_implicitly_has_an_1_type_7008",message:"Member '{0}' implicitly has an '{1}' type."},new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:{code:7009,category:e.DiagnosticCategory.Error,key:"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009",message:"'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."},_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:{code:7010,category:e.DiagnosticCategory.Error,key:"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010",message:"'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."},Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:{code:7011,category:e.DiagnosticCategory.Error,key:"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011",message:"Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."},Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:{code:7013,category:e.DiagnosticCategory.Error,key:"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013",message:"Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."},Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:{code:7015,category:e.DiagnosticCategory.Error,key:"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015",message:"Element implicitly has an 'any' type because index expression is not of type 'number'."},Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation:{code:7016,category:e.DiagnosticCategory.Error,key:"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation_7016",message:"Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation."},Index_signature_of_object_type_implicitly_has_an_any_type:{code:7017,category:e.DiagnosticCategory.Error,key:"Index_signature_of_object_type_implicitly_has_an_any_type_7017",message:"Index signature of object type implicitly has an 'any' type."},Object_literal_s_property_0_implicitly_has_an_1_type:{code:7018,category:e.DiagnosticCategory.Error,key:"Object_literal_s_property_0_implicitly_has_an_1_type_7018",message:"Object literal's property '{0}' implicitly has an '{1}' type."},Rest_parameter_0_implicitly_has_an_any_type:{code:7019,category:e.DiagnosticCategory.Error,key:"Rest_parameter_0_implicitly_has_an_any_type_7019",message:"Rest parameter '{0}' implicitly has an 'any[]' type."},Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:{code:7020,category:e.DiagnosticCategory.Error,key:"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020",message:"Call signature, which lacks return-type annotation, implicitly has an 'any' return type."},_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:{code:7022,category:e.DiagnosticCategory.Error,key:"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022",message:"'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."},_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:{code:7023,category:e.DiagnosticCategory.Error,key:"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023",message:"'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."},Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:{code:7024,category:e.DiagnosticCategory.Error,key:"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024",message:"Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."},Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type:{code:7025,category:e.DiagnosticCategory.Error,key:"Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025",message:"Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type."},JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:{code:7026,category:e.DiagnosticCategory.Error,key:"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026",message:"JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists"},Unreachable_code_detected:{code:7027,category:e.DiagnosticCategory.Error,key:"Unreachable_code_detected_7027",message:"Unreachable code detected."},Unused_label:{code:7028,category:e.DiagnosticCategory.Error,key:"Unused_label_7028",message:"Unused label."},Fallthrough_case_in_switch:{code:7029,category:e.DiagnosticCategory.Error,key:"Fallthrough_case_in_switch_7029",message:"Fallthrough case in switch."},Not_all_code_paths_return_a_value:{code:7030,category:e.DiagnosticCategory.Error,key:"Not_all_code_paths_return_a_value_7030",message:"Not all code paths return a value."},You_cannot_rename_this_element:{code:8e3,category:e.DiagnosticCategory.Error,key:"You_cannot_rename_this_element_8000",message:"You cannot rename this element."},You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:{code:8001,category:e.DiagnosticCategory.Error,key:"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001",message:"You cannot rename elements that are defined in the standard TypeScript library."},import_can_only_be_used_in_a_ts_file:{code:8002,category:e.DiagnosticCategory.Error,key:"import_can_only_be_used_in_a_ts_file_8002",message:"'import ... =' can only be used in a .ts file."},export_can_only_be_used_in_a_ts_file:{code:8003,category:e.DiagnosticCategory.Error,key:"export_can_only_be_used_in_a_ts_file_8003",message:"'export=' can only be used in a .ts file."},type_parameter_declarations_can_only_be_used_in_a_ts_file:{code:8004,category:e.DiagnosticCategory.Error,key:"type_parameter_declarations_can_only_be_used_in_a_ts_file_8004",message:"'type parameter declarations' can only be used in a .ts file."},implements_clauses_can_only_be_used_in_a_ts_file:{code:8005,category:e.DiagnosticCategory.Error,key:"implements_clauses_can_only_be_used_in_a_ts_file_8005",message:"'implements clauses' can only be used in a .ts file."},interface_declarations_can_only_be_used_in_a_ts_file:{code:8006,category:e.DiagnosticCategory.Error,key:"interface_declarations_can_only_be_used_in_a_ts_file_8006",message:"'interface declarations' can only be used in a .ts file."},module_declarations_can_only_be_used_in_a_ts_file:{code:8007,category:e.DiagnosticCategory.Error,key:"module_declarations_can_only_be_used_in_a_ts_file_8007",message:"'module declarations' can only be used in a .ts file."},type_aliases_can_only_be_used_in_a_ts_file:{code:8008,category:e.DiagnosticCategory.Error,key:"type_aliases_can_only_be_used_in_a_ts_file_8008",message:"'type aliases' can only be used in a .ts file."},_0_can_only_be_used_in_a_ts_file:{code:8009,category:e.DiagnosticCategory.Error,key:"_0_can_only_be_used_in_a_ts_file_8009",message:"'{0}' can only be used in a .ts file."},types_can_only_be_used_in_a_ts_file:{code:8010,category:e.DiagnosticCategory.Error,key:"types_can_only_be_used_in_a_ts_file_8010",message:"'types' can only be used in a .ts file."},type_arguments_can_only_be_used_in_a_ts_file:{code:8011,category:e.DiagnosticCategory.Error,key:"type_arguments_can_only_be_used_in_a_ts_file_8011",message:"'type arguments' can only be used in a .ts file."},parameter_modifiers_can_only_be_used_in_a_ts_file:{code:8012,category:e.DiagnosticCategory.Error,key:"parameter_modifiers_can_only_be_used_in_a_ts_file_8012",message:"'parameter modifiers' can only be used in a .ts file."},property_declarations_can_only_be_used_in_a_ts_file:{code:8014,category:e.DiagnosticCategory.Error,key:"property_declarations_can_only_be_used_in_a_ts_file_8014",message:"'property declarations' can only be used in a .ts file."},enum_declarations_can_only_be_used_in_a_ts_file:{code:8015,category:e.DiagnosticCategory.Error,key:"enum_declarations_can_only_be_used_in_a_ts_file_8015",message:"'enum declarations' can only be used in a .ts file."},type_assertion_expressions_can_only_be_used_in_a_ts_file:{code:8016,category:e.DiagnosticCategory.Error,key:"type_assertion_expressions_can_only_be_used_in_a_ts_file_8016",message:"'type assertion expressions' can only be used in a .ts file."},Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses:{code:9002,category:e.DiagnosticCategory.Error,key:"Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002",message:"Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses."},class_expressions_are_not_currently_supported:{code:9003,category:e.DiagnosticCategory.Error,key:"class_expressions_are_not_currently_supported_9003",message:"'class' expressions are not currently supported."},JSX_attributes_must_only_be_assigned_a_non_empty_expression:{code:17e3,category:e.DiagnosticCategory.Error,key:"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000",message:"JSX attributes must only be assigned a non-empty 'expression'."},JSX_elements_cannot_have_multiple_attributes_with_the_same_name:{code:17001,category:e.DiagnosticCategory.Error,key:"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001",message:"JSX elements cannot have multiple attributes with the same name."},Expected_corresponding_JSX_closing_tag_for_0:{code:17002,category:e.DiagnosticCategory.Error,key:"Expected_corresponding_JSX_closing_tag_for_0_17002",message:"Expected corresponding JSX closing tag for '{0}'."},JSX_attribute_expected:{code:17003,category:e.DiagnosticCategory.Error,key:"JSX_attribute_expected_17003",message:"JSX attribute expected."},Cannot_use_JSX_unless_the_jsx_flag_is_provided:{code:17004,category:e.DiagnosticCategory.Error,key:"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004",message:"Cannot use JSX unless the '--jsx' flag is provided."},A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:{code:17005,category:e.DiagnosticCategory.Error,key:"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005",message:"A constructor cannot contain a 'super' call when its class extends 'null'"},An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:{code:17006,category:e.DiagnosticCategory.Error,key:"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006",message:"An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."},A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:{code:17007,category:e.DiagnosticCategory.Error,key:"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007",message:"A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."},JSX_element_0_has_no_corresponding_closing_tag:{code:17008,category:e.DiagnosticCategory.Error,key:"JSX_element_0_has_no_corresponding_closing_tag_17008",message:"JSX element '{0}' has no corresponding closing tag."},super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:{code:17009,category:e.DiagnosticCategory.Error,key:"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009",message:"'super' must be called before accessing 'this' in the constructor of a derived class."}}}(o||(o={}));var o;!function(e){function t(e){return e>=69}function n(e,t){if(e=1?n(e,P):n(e,D)}function i(e,t){return t>=1?n(e,L):n(e,M)}function a(e){return O[e]}function o(e){return I[e]}function s(e){for(var t=new Array,n=0,r=0;n127&&m(i)&&(t.push(r),r=n)}}return t.push(r),t}function u(e,t,n){return c(l(e),t,n)}function c(t,n,r){return e.Debug.assert(n>=0&&n=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function m(e){return 10===e||13===e||8232===e||8233===e}function h(e){return e>=48&&e<=57}function y(e){return e>=48&&e<=55}function _(e,t){var n=e.charCodeAt(t);switch(n){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 61:case 62:return!0;case 35:return 0===t;default:return n>127}}function g(e,t,n){if(!(t>=0))return t;for(;;){var r=e.charCodeAt(t);switch(r){case 13:10===e.charCodeAt(t+1)&&t++;case 10:if(t++,n)return t;continue;case 9:case 11:case 12:case 32:t++;continue;case 47:if(47===e.charCodeAt(t+1)){for(t+=2;t127&&(d(r)||m(r))){t++;continue}}return t}}function v(t,n){if(e.Debug.assert(n>=0),0===n||m(t.charCodeAt(n-1))){var r=t.charCodeAt(n);if(n+F127&&(d(o)||m(o))){i&&i.length&&m(o)&&(e.lastOrUndefined(i).hasTrailingNewLine=!0),n++;continue}}return i}return i}function E(e,t){return T(e,t,!1)}function C(e,t){return T(e,t,!0)}function N(e){return B.test(e)?B.exec(e)[0]:void 0}function w(e,t){return e>=65&&e<=90||e>=97&&e<=122||36===e||95===e||e>127&&r(e,t)}function k(e,t){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||36===e||95===e||e>127&&i(e,t)}function x(e,t){if(!w(e.charCodeAt(0),t))return!1;for(var n=1,r=e.length;n=48&&i<=57)r=16*r+i-48;else if(i>=65&&i<=70)r=16*r+i-65+10;else{if(!(i>=97&&i<=102))break;r=16*r+i-97+10}ee++,n++}return n=te){n+=a.substring(r,ee),ue=!0,c(e.Diagnostics.Unterminated_string_literal);break}var i=a.charCodeAt(ee);if(i===t){n+=a.substring(r,ee),ee++;break}if(92!==i){if(m(i)){n+=a.substring(r,ee),ue=!0,c(e.Diagnostics.Unterminated_string_literal);break}ee++}else n+=a.substring(r,ee),n+=C(),r=ee}return n}function E(){var t=96===a.charCodeAt(ee);ee++;for(var n,r=ee,i="";;){if(ee>=te){i+=a.substring(r,ee),ue=!0,c(e.Diagnostics.Unterminated_template_literal),n=t?11:14;break}var o=a.charCodeAt(ee);if(96===o){i+=a.substring(r,ee),ee++,n=t?11:14;break}if(36===o&&ee+1=te)return c(e.Diagnostics.Unexpected_end_of_text),"";var t=a.charCodeAt(ee);switch(ee++,t){case 48:return"\0";case 98:return"\b";case 116:return"\t";case 110:return"\n";case 118:return"\v";case 102:return"\f";case 114:return"\r";case 39:return"'";case 34:return'"';case 117:return ee=0?String.fromCharCode(n):(c(e.Diagnostics.Hexadecimal_digit_expected),"")}function x(){var t=_(1),n=!1;return t<0?(c(e.Diagnostics.Hexadecimal_digit_expected),n=!0):t>1114111&&(c(e.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive),n=!0),ee>=te?(c(e.Diagnostics.Unexpected_end_of_text),n=!0):125===a.charCodeAt(ee)?ee++:(c(e.Diagnostics.Unterminated_Unicode_escape_sequence),n=!0),n?"":R(t)}function R(t){if(e.Debug.assert(0<=t&&t<=1114111),t<=65535)return String.fromCharCode(t);var n=Math.floor((t-65536)/1024)+55296,r=(t-65536)%1024+56320;return String.fromCharCode(n,r)}function D(){if(ee+5=0&&k(r,n)))break;e+=a.substring(t,ee),e+=String.fromCharCode(r),ee+=6,t=ee}}return e+=a.substring(t,ee)}function P(){var e=ae.length;if(e>=2&&e<=11){var t=ae.charCodeAt(0);if(t>=97&&t<=122&&U.call(I,ae))return ie=I[ae]}return ie=69}function L(t){e.Debug.assert(2!==t||8!==t,"Expected either base 2 or base 8");for(var n=0,r=0;;){var i=a.charCodeAt(ee),o=i-48;if(!h(i)||o>=t)break;n=n*t+o,ee++,r++}return 0===r?-1:n}function O(){for(ne=ee,se=!1,oe=!1,ue=!1;;){if(re=ee,ee>=te)return ie=1;var t=a.charCodeAt(ee);if(35===t&&0===ee&&S(a,ee)){if(ee=A(a,ee),r)continue;return ie=6}switch(t){case 10:case 13:if(oe=!0,r){ee++;continue}return 13===t&&ee+1=0&&w(f,n)?(ee+=6,ae=String.fromCharCode(f)+M(),ie=P()):(c(e.Diagnostics.Invalid_character),ee++,ie=0);default:if(w(t,n)){for(ee++;ee=te){ue=!0,c(e.Diagnostics.Unterminated_regular_expression_literal);break}var o=a.charCodeAt(t);if(m(o)){ue=!0,c(e.Diagnostics.Unterminated_regular_expression_literal);break}if(r)r=!1;else{if(47===o&&!i){t++;break}91===o?i=!0:92===o?r=!0:93===o&&(i=!1)}t++}for(;t=te)return ie=1;var e=a.charCodeAt(ee);if(60===e)return 47===a.charCodeAt(ee+1)?(ee+=2,ie=26):(ee++,ie=25);if(123===e)return ee++,ie=15;for(;ee=te)return ie=1;ne=ee;for(var e=a.charCodeAt(ee);ee=0),ee=t,ne=t,re=t,ie=0,oe=!1,ae=void 0,se=!1,ue=!1}void 0===i&&(i=0);var ee,te,ne,re,ie,ae,oe,se,ue;return G(a,s,u),{getStartPos:function(){return ne},getTextPos:function(){return ee},getToken:function(){return ie},getTokenPos:function(){return re},getTokenText:function(){return a.substring(re,ee)},getTokenValue:function(){return ae},hasExtendedUnicodeEscape:function(){return se},hasPrecedingLineBreak:function(){return oe},isIdentifier:function(){return 69===ie||ie>105},isReservedWord:function(){return ie>=70&&ie<=105},isUnterminated:function(){return ue},reScanGreaterToken:F,reScanSlashToken:B,reScanTemplateToken:K,scanJsxIdentifier:W,reScanJsxToken:V,scanJsxToken:j,scanJSDocToken:q,scan:O,setText:G,setScriptTarget:$,setLanguageVariant:Q,setOnError:X,setTextPos:Z,tryScan:J,lookAhead:Y,scanRange:H}}e.tokenIsIdentifierOrKeyword=t;var I={abstract:115,any:117,as:116,boolean:120,break:70,case:71,catch:72,class:73,continue:75,const:74,constructor:121,debugger:76,declare:122,default:77,delete:78,do:79,else:80,enum:81,export:82,extends:83,false:84,finally:85,for:86,from:133,function:87,get:123,if:88,implements:106,import:89,in:90,instanceof:91,interface:107,is:124,let:108,module:125,namespace:126,new:92,null:93,number:128,package:109,private:110,protected:111,public:112,require:127,global:134,return:94,set:129,static:113,string:130,super:95,switch:96,symbol:131,this:97,throw:98,true:99,try:100,type:132,typeof:101,var:102,void:103,while:104,with:105,yield:114,async:118,await:119,of:135,"{":15,"}":16,"(":17,")":18,"[":19,"]":20,".":21,"...":22,";":23,",":24,"<":25,">":27,"<=":28,">=":29,"==":30,"!=":31,"===":32,"!==":33,"=>":34,"+":35,"-":36,"**":38,"*":37,"/":39,"%":40,"++":41,"--":42,"<<":43,">":44,">>>":45,"&":46,"|":47,"^":48,"!":49,"~":50,"&&":51,"||":52,"?":53,":":54,"=":56,"+=":57,"-=":58,"*=":59,"**=":60,"/=":61,"%=":62,"<<=":63,">>=":64,">>>=":65,"&=":66,"|=":67,"^=":68,"@":55},D=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1569,1594,1600,1610,1649,1747,1749,1749,1765,1766,1786,1788,1808,1808,1810,1836,1920,1957,2309,2361,2365,2365,2384,2384,2392,2401,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2784,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2877,2908,2909,2911,2913,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3294,3294,3296,3297,3333,3340,3342,3344,3346,3368,3370,3385,3424,3425,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3946,3976,3979,4096,4129,4131,4135,4137,4138,4176,4181,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6067,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12329,12337,12341,12344,12346,12353,12436,12445,12446,12449,12538,12540,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65138,65140,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],M=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,768,846,864,866,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1155,1158,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1425,1441,1443,1465,1467,1469,1471,1471,1473,1474,1476,1476,1488,1514,1520,1522,1569,1594,1600,1621,1632,1641,1648,1747,1749,1756,1759,1768,1770,1773,1776,1788,1808,1836,1840,1866,1920,1968,2305,2307,2309,2361,2364,2381,2384,2388,2392,2403,2406,2415,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2524,2525,2527,2531,2534,2545,2562,2562,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2649,2652,2654,2654,2662,2676,2689,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2784,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2876,2883,2887,2888,2891,2893,2902,2903,2908,2909,2911,2913,2918,2927,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3010,3014,3016,3018,3021,3031,3031,3047,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3134,3140,3142,3144,3146,3149,3157,3158,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3395,3398,3400,3402,3405,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3805,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3946,3953,3972,3974,3979,3984,3991,3993,4028,4038,4038,4096,4129,4131,4135,4137,4138,4140,4146,4150,4153,4160,4169,4176,4185,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4969,4977,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6099,6112,6121,6160,6169,6176,6263,6272,6313,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8319,8319,8400,8412,8417,8417,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12335,12337,12341,12344,12346,12353,12436,12441,12442,12445,12446,12449,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65056,65059,65075,65076,65101,65103,65136,65138,65140,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500],P=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],L=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500];e.isUnicodeIdentifierStart=r;var O=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(I);e.tokenToString=a,e.stringToToken=o,e.computeLineStarts=s,e.getPositionOfLineAndCharacter=u,e.computePositionOfLineAndCharacter=c,e.getLineStarts=l,e.computeLineAndCharacterOfPosition=p,e.getLineAndCharacterOfPosition=f;var U=Object.prototype.hasOwnProperty;e.isWhiteSpace=d,e.isLineBreak=m,e.isOctalDigit=y,e.couldStartTrivia=_,e.skipTrivia=g;var F="<<<<<<<".length,B=/^#!.*/;e.getLeadingCommentRanges=E,e.getTrailingCommentRanges=C,e.getShebang=N,e.isIdentifierStart=w,e.isIdentifierPart=k,e.isIdentifier=x,e.createScanner=R}(o||(o={}));var o;!function(e){function t(e,t){var n=e.declarations;if(n)for(var r=0,i=n;r=0),e.getLineStarts(n)[t]}function m(t){var n=p(t),r=e.getLineAndCharacterOfPosition(n,t.pos);return n.fileName+"("+(r.line+1)+","+(r.character+1)+")"}function h(e){return e.pos}function y(e){return!e||e.pos===e.end&&e.pos>=0&&1!==e.kind}function _(e){return!y(e)}function g(t,n){return y(t)?t.pos:e.skipTrivia((n||p(t)).text,t.pos)}function v(t,n){return y(t)||!t.decorators?g(t,n):e.skipTrivia((n||p(t)).text,t.decorators.end)}function b(t,n,r){if(void 0===r&&(r=!1),y(n))return"";var i=t.text;return i.substring(r?n.pos:e.skipTrivia(i,n.pos),n.end)}function S(t,n){return y(n)?"":t.substring(e.skipTrivia(t,n.pos),n.end)}function A(e,t){return void 0===t&&(t=!1),b(p(e),e,t)}function T(e){return e.length>=2&&95===e.charCodeAt(0)&&95===e.charCodeAt(1)?"_"+e:e}function E(e){return e.length>=3&&95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&95===e.charCodeAt(2)?e.substr(1):e}function C(t){return e.getBaseFileName(t).replace(/^(\d)/,"_$1").replace(/\W/g,"_")}function N(e){return 0!=(24576&W(e))||D(e)}function w(e){return e&&221===e.kind&&(9===e.name.kind||x(e))}function k(e){return 251===e.kind||221===e.kind||ie(e)||ue(e)}function x(e){return!!(2097152&e.flags)}function R(e){if(!e||!w(e))return!1;switch(e.parent.kind){case 251:return F(e.parent);case 222:return w(e.parent.parent)&&!F(e.parent.parent.parent)}return!1}function I(e){for(var t=e.parent;t;){if(ie(t))return t;switch(t.kind){case 251:case 223:case 247:case 221:case 202:case 203:case 204:return t;case 195:if(!ie(t.parent))return t}t=t.parent}}function D(e){return e&&214===e.kind&&e.parent&&247===e.parent.kind}function M(e){return 0===i(e)?"(Missing)":A(e)}function P(t,n,r,i,a){var o=p(t),s=U(o,t);return e.createFileDiagnostic(o,s.start,s.length,n,r,i,a)}function L(e,t){var n=p(e),r=U(n,e);return{file:n,start:r.start,length:r.length,code:t.code,category:t.category,messageText:t.next?t:t.messageText}}function O(t,n){var r=e.createScanner(t.languageVersion,!0,t.languageVariant,t.text,void 0,n);r.scan();var i=r.getTokenPos();return e.createTextSpanFromBounds(i,r.getTextPos())}function U(t,n){var r=n;switch(n.kind){case 251:var i=e.skipTrivia(t.text,0,!1);return i===t.text.length?e.createTextSpan(0,0):O(t,i);case 214:case 166:case 217:case 189:case 218:case 221:case 220:case 250:case 216:case 176:case 144:case 219:r=n.name}if(void 0===r)return O(t,n.pos);var a=y(r)?r.pos:e.skipTrivia(t.text,r.pos);return e.createTextSpanFromBounds(a,r.end)}function F(e){return void 0!==e.externalModuleIndicator}function B(e){return void 0!==(e.externalModuleIndicator||e.commonJsModuleIndicator)}function K(e){return 0!=(4096&e.flags)}function V(e){return 220===e.kind&&q(e)}function j(e){for(;e&&(166===e.kind||Ye(e));)e=e.parent;return e}function W(e){e=j(e);var t=e.flags;return 214===e.kind&&(e=e.parent),e&&215===e.kind&&(t|=e.flags,e=e.parent),e&&196===e.kind&&(t|=e.flags),t}function q(e){return!!(16384&W(e))}function z(e){return!!(8192&W(e))}function H(e){return 171===e.kind&&95===e.expression.kind}function Y(e){return 198===e.kind&&9===e.expression.kind}function J(t,n){return e.getLeadingCommentRanges(n.text,t.pos)}function G(t,n){return e.getLeadingCommentRanges(n,t.pos)}function X(e,t){return $(e,t.text)}function $(t,n){function r(e){return 42===n.charCodeAt(e.pos+1)&&42===n.charCodeAt(e.pos+2)&&47!==n.charCodeAt(e.pos+3)}var i=139===t.kind||138===t.kind?e.concatenate(e.getTrailingCommentRanges(n,t.pos),e.getLeadingCommentRanges(n,t.pos)):G(t,n);return e.filter(i,r)}function Q(t){if(151<=t.kind&&t.kind<=163)return!0;switch(t.kind){case 117:case 128:case 130:case 120:case 131:return!0;case 103:return 180!==t.parent.kind;case 191:return!an(t);case 69:136===t.parent.kind&&t.parent.right===t?t=t.parent:169===t.parent.kind&&t.parent.name===t&&(t=t.parent),e.Debug.assert(69===t.kind||136===t.kind||169===t.kind,"'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'.");case 136:case 169:case 97:var n=t.parent;if(155===n.kind)return!1;if(151<=n.kind&&n.kind<=163)return!0;switch(n.kind){case 191:return!an(n);case 138:return t===n.constraint;case 142:case 141:case 139:case 214:return t===n.type;case 216:case 176:case 177:case 145:case 144:case 143:case 146:case 147:return t===n.type;case 148:case 149:case 150:return t===n.type;case 174:return t===n.type;case 171:case 172:return n.typeArguments&&e.indexOf(n.typeArguments,t)>=0;case 173:return!1}}return!1}function Z(t,n){function r(t){switch(t.kind){case 207:return n(t);case 223:case 195:case 199:case 200:case 201:case 202:case 203:case 204:case 208:case 209:case 244:case 245:case 210:case 212:case 247:return e.forEachChild(t,r)}}return r(t)}function ee(t,n){function r(t){switch(t.kind){case 187:n(t);var i=t.expression;i&&r(i);case 220:case 218:case 221:case 219:case 217:case 189:return;default:if(ie(t)){var a=t.name;if(a&&137===a.kind)return void r(a.expression)}else Q(t)||e.forEachChild(t,r)}}return r(t)}function te(e){if(e)switch(e.kind){case 166:case 250:case 139:case 248:case 142:case 141:case 249:case 214:return!0}return!1}function ne(e){return e&&(146===e.kind||147===e.kind)}function re(e){return e&&(217===e.kind||189===e.kind)}function ie(e){return e&&ae(e.kind)}function ae(e){switch(e){case 145:case 176:case 216:case 177:case 144:case 143:case 146:case 147:case 148:case 149:case 150:case 153:case 154:return!0}}function oe(e){switch(e.kind){case 144:case 143:case 145:case 146:case 147:case 216:case 176:return!0}return!1}function se(e,t){switch(e.kind){case 202:case 203:case 204:case 200:case 201:return!0;case 210:return t&&se(e.statement,t)}return!1}function ue(e){return e&&195===e.kind&&ie(e.parent)}function ce(e){return e&&144===e.kind&&168===e.parent.kind}function le(e){return e&&1===e.kind}function pe(e){return e&&0===e.kind}function fe(e){for(;;)if(!(e=e.parent)||ie(e))return e}function de(e){for(;;)if(!(e=e.parent)||re(e))return e}function me(e,t){for(;;){if(!(e=e.parent))return;switch(e.kind){case 137:if(re(e.parent.parent))return e;e=e.parent;break;case 140:139===e.parent.kind&&Qe(e.parent.parent)?e=e.parent.parent:Qe(e.parent)&&(e=e.parent);break;case 177:if(!t)continue;case 216:case 176:case 221:case 142:case 141:case 144:case 143:case 145:case 146:case 147:case 148:case 149:case 150:case 220:case 251:return e}}}function he(e,t){for(;;){if(!(e=e.parent))return e;switch(e.kind){case 137:e=e.parent;break;case 216:case 176:case 177:if(!t)continue;case 142:case 141:case 144:case 143:case 145:case 146:case 147:return e;case 140:139===e.parent.kind&&Qe(e.parent.parent)?e=e.parent.parent:Qe(e.parent)&&(e=e.parent)}}}function ye(e){return(169===e.kind||170===e.kind)&&95===e.expression.kind}function _e(e){if(e)switch(e.kind){case 152:return e.typeName;case 191:return e.expression;case 69:case 136:return e}}function ge(e){return 173===e.kind?e.tag:e.expression}function ve(e){switch(e.kind){case 217:return!0;case 142:return 217===e.parent.kind;case 146:case 147:case 144:return void 0!==e.body&&217===e.parent.kind;case 139:return void 0!==e.parent.body&&(145===e.parent.kind||144===e.parent.kind||147===e.parent.kind)&&217===e.parent.parent.kind}return!1}function be(e){return void 0!==e.decorators&&ve(e)}function Se(e){return 169===e.kind}function Ae(e){return 170===e.kind}function Te(e){switch(e.kind){case 95:case 93:case 99:case 84:case 10:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 192:case 174:case 175:case 176:case 189:case 177:case 180:case 178:case 179:case 182:case 183:case 184:case 185:case 188:case 186:case 11:case 190:case 236:case 237:case 187:case 181:return!0;case 136:for(;136===e.parent.kind;)e=e.parent;return 155===e.parent.kind;case 69:if(155===e.parent.kind)return!0;case 8:case 9:case 97:var t=e.parent;switch(t.kind){case 214:case 139:case 142:case 141:case 250:case 248:case 166:return t.initializer===e;case 198:case 199:case 200:case 201:case 207:case 208:case 209:case 244:case 211:case 209:return t.expression===e;case 202:var n=t;return n.initializer===e&&215!==n.initializer.kind||n.condition===e||n.incrementor===e;case 203:case 204:var r=t;return r.initializer===e&&215!==r.initializer.kind||r.expression===e;case 174:case 192:return e===t.expression;case 193:return e===t.expression;case 137:return e===t.expression;case 140:case 243:case 242:return!0;case 191:return t.expression===e&&an(t);default:if(Te(t))return!0}}return!1}function Ee(e){return"./"===e.substr(0,2)||"../"===e.substr(0,3)||".\\"===e.substr(0,2)||"..\\"===e.substr(0,3)}function Ce(t,n){var r=e.getModuleInstanceState(t);return 1===r||n&&2===r}function Ne(e){return 224===e.kind&&235===e.moduleReference.kind}function we(t){return e.Debug.assert(Ne(t)),t.moduleReference.expression}function ke(e){return 224===e.kind&&235!==e.moduleReference.kind}function xe(e){return Re(e)}function Re(e){return e&&!!(32&e.parserContextFlags)}function Ie(e,t){return 171===e.kind&&69===e.expression.kind&&"require"===e.expression.text&&1===e.arguments.length&&(!t||9===e.arguments[0].kind)}function De(e){if(184!==e.kind)return 0;var t=e;if(56!==t.operatorToken.kind||169!==t.left.kind)return 0;var n=t.left;if(69===n.expression.kind){var r=n.expression;if("exports"===r.text)return 1;if("module"===r.text&&"exports"===n.name.text)return 2}else{if(97===n.expression.kind)return 4;if(169===n.expression.kind){var i=n.expression;if(69===i.expression.kind&&"prototype"===i.name.text)return 3}}return 0}function Me(e){if(225===e.kind)return e.moduleSpecifier;if(224===e.kind){var t=e.moduleReference;if(235===t.kind)return t.expression}return 231===e.kind?e.moduleSpecifier:221===e.kind&&9===e.name.kind?e.name:void 0}function Pe(e){if(e)switch(e.kind){case 139:case 144:case 143:case 249:case 248:case 142:case 141:return void 0!==e.questionToken}return!1}function Le(e){return 264===e.kind&&e.parameters.length>0&&266===e.parameters[0].type.kind}function Oe(e,t,n){if(e){var r=Ue(e,n);if(r)for(var i=0,a=r.tags;i0?t.types[0]:void 0}function rt(e){var t=at(e.heritageClauses,106);return t?t.types:void 0}function it(e){var t=at(e.heritageClauses,83);return t?t.types:void 0}function at(e,t){if(e)for(var n=0,r=e;n/gim;if(r.test(t)){if(i.test(t))return{isNoDefaultLib:!0};var a=e.fullTripleSlashReferencePathRegEx.exec(t);if(a){return{fileReference:{pos:n.pos,end:n.end,fileName:a[3]},isNoDefaultLib:!1}}return{diagnosticMessage:e.Diagnostics.Invalid_reference_directive_syntax,isNoDefaultLib:!1}}}function ct(e){return 70<=e&&e<=135}function lt(e){return 2<=e&&e<=7}function pt(e){return ie(e)&&0!=(256&e.flags)&&!ne(e)}function ft(e){return 9===e||8===e}function dt(e){return e.name&&mt(e.name)}function mt(e){return 137===e.kind&&!ft(e.expression.kind)&&!ht(e.expression)}function ht(e){return Se(e)&>(e.expression)}function yt(e){if(69===e.kind||9===e.kind||8===e.kind)return e.text;if(137===e.kind){var t=e.expression;if(ht(t)){return _t(t.name.text)}}}function _t(e){return"__@"+e}function gt(e){return 69===e.kind&&"Symbol"===e.text}function vt(e){switch(e){case 115:case 118:case 74:case 122:case 77:case 82:case 112:case 110:case 111:case 113:return!0}return!1}function bt(e){return 139===St(e).kind}function St(e){for(;166===e.kind;)e=e.parent.parent;return e}function At(e){return ie(e)||221===e.kind||251===e.kind}function Tt(t,n,r,i){var a=void 0!==n?e.createNode(t.kind,n.pos,n.end):wt(t.kind);for(var o in t)!a.hasOwnProperty(o)&&t.hasOwnProperty(o)&&(a[o]=t[o]);return void 0!==r&&(a.flags=r),void 0!==i&&(a.parent=i),a}function Et(e,t){var n=Tt(e,e,e.flags,t);if(Ct(n)){var r=n.left,i=n.right;n.left=Et(r,n),n.right=Tt(i,i,i.flags,t)}return n}function Ct(e){return 136===e.kind}function Nt(e){return e.pos===-1}function wt(t,n){var r=e.createNode(t,-1,-1);return r.startsOnNewLine=n,r}function kt(){var e=[];return e.pos=-1,e.end=-1,e}function xt(){function t(){return l}function n(t){if(e.hasProperty(u,t.fileName))for(var n=0,r=u[t.fileName];n1&&(p=p+r.length-1,f=u.length-t.length+e.lastOrUndefined(r))}}function o(){l||(u+=t,p++,f=u.length,l=!0)}function s(e,t){n(S(e,t))}var u,c,l,p,f;return r(),{write:n,rawWrite:i,writeTextOfNode:s,writeLiteral:a,writeLine:o,increaseIndent:function(){c++},decreaseIndent:function(){c--},getIndent:function(){return c},getTextPos:function(){return u.length},getLine:function(){return p+1},getColumn:function(){return l?c*Lt()+1:u.length-f+1},getText:function(){return u},reset:r}}function Ut(t,n){var r=function(e){return t.getCanonicalFileName(e)},i=e.toPath(t.getCommonSourceDirectory(),t.getCurrentDirectory(),r),a=e.getNormalizedAbsolutePath(n,t.getCurrentDirectory()),o=e.getRelativePathToDirectoryOrUrl(i,a,i,r,!1);return e.removeFileExtension(o)}function Ft(t,n,r){var i=n.getCompilerOptions();return(i.outDir?e.removeFileExtension(jt(t,n,i.outDir)):e.removeFileExtension(t.fileName))+r}function Bt(e){return e.target||0}function Kt(e){return"number"==typeof e.module?e.module:2===Bt(e)?5:1}function Vt(t,n,r){function i(e,t){return t.sourceMap?e+".map":void 0}function a(t,n){return n.declaration?e.removeFileExtension(t)+".d.ts":void 0}var o=t.getCompilerOptions();if(o.outFile||o.out)!function(t){var r=e.filter(t.getSourceFiles(),function(e){return!K(e)&&(!F(e)||Kt(o)&&F(e))});if(r.length){var s=o.outFile||o.out;n({jsFilePath:s,sourceMapFilePath:i(s,o),declarationFilePath:a(s,o)},r,!0)}}(t);else for(var s=void 0===r?t.getSourceFiles():[r],u=0,c=s;u0&&e.parameters[0].type}function Jt(t,n){var r,i,a,o;return dt(n)?(r=n,146===n.kind?a=n:147===n.kind?o=n:e.Debug.fail("Accessor has wrong kind")):e.forEach(t,function(e){if((146===e.kind||147===e.kind)&&(64&e.flags)==(64&n.flags)){yt(e.name)===yt(n.name)&&(r?i||(i=e):r=e,146!==e.kind||a||(a=e),147!==e.kind||o||(o=e))}}),{firstAccessor:r,secondAccessor:i,getAccessor:a,setAccessor:o}}function Gt(e,t,n,r){r&&r.length&&n.pos!==r[0].pos&&zt(e,n.pos)!==zt(e,r[0].pos)&&t.writeLine()}function Xt(t,n,r,i,a,o,s){var u=!a;e.forEach(i,function(e){u&&(r.write(" "),u=!1),s(t,n,r,e,o),e.hasTrailingNewLine?r.writeLine():a?r.write(" "):u=!0})}function $t(t,n,r,i,a,o,s){function u(e){return 42===t.charCodeAt(e.pos+1)&&33===t.charCodeAt(e.pos+2)}var c,l;if(s?0===a.pos&&(c=e.filter(e.getLeadingCommentRanges(t,a.pos),u)):c=e.getLeadingCommentRanges(t,a.pos),c){for(var p=[],f=void 0,d=0,m=c;d=y+2)break}p.push(h),f=h}if(p.length){var y=zt(n,e.lastOrUndefined(p).end);zt(n,e.skipTrivia(t,a.pos))>=y+2&&(Gt(n,r,a,c),Xt(t,n,r,p,!0,o,i),l={nodePos:a.pos,detachedCommentEndPos:e.lastOrUndefined(p).end})}}return l}function Qt(t,n,r,i,a){if(42===t.charCodeAt(i.pos+1))for(var o=e.computeLineAndCharacterOfPosition(n,i.pos),s=n.length,u=void 0,c=i.pos,l=o.line;c0){var m=d%Lt(),h=Pt((d-m)/Lt());for(r.rawWrite(h);m;)r.rawWrite(" "),m--}else r.rawWrite("")}Zt(t,i,r,a,c,p),c=p}else r.write(t.substring(i.pos,i.end))}function Zt(e,t,n,r,i,a){var o=Math.min(t.end,a-1),s=e.substring(i,o).replace(/^\s+|\s+$/g,"");s?(n.write(s),o!==t.end&&n.writeLine()):n.writeLiteral(r)}function en(t,n,r){for(var i=0;n=56&&e<=68}function an(e){return 191===e.kind&&83===e.parent.token&&re(e.parent.parent)}function on(e){return sn(e.expression)}function sn(e){return 69===e.kind||!!Se(e)&&sn(e.expression)}function un(e){return 136===e.parent.kind&&e.parent.right===e||169===e.parent.kind&&e.parent.name===e}function cn(e){var t=e.kind;return 168===t?0===e.properties.length:167===t&&0===e.elements.length}function ln(e){return e&&e.valueDeclaration&&512&e.valueDeclaration.flags?e.valueDeclaration.localSymbol:void 0}function pn(t){return e.forEach(e.supportedJavascriptExtensions,function(n){return e.fileExtensionIs(t,n)})}function fn(t){for(var n=[],r=t.length,i=0;i>6|192),n.push(63&a|128)):a<65536?(n.push(a>>12|224),n.push(a>>6&63|128),n.push(63&a|128)):a<131072?(n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(63&a|128)):e.Debug.assert(!1,"Unexpected code point")}return n}function dn(e){return void 0===e?void 0:mn(e)}function mn(t){return"string"==typeof t?'"'+Rt(t)+'"':"number"==typeof t?isFinite(t)?String(t):"null":"boolean"==typeof t?t?"true":"false":"object"==typeof t&&t?e.isArray(t)?hn(yn,t):hn(gn,t):"null"}function hn(t,n){e.Debug.assert(!n.hasOwnProperty("__cycle"),"Converting circular structure to JSON"),n.__cycle=!0;var r=t(n);return delete n.__cycle,r}function yn(t){return"["+e.reduceLeft(t,_n,"")+"]"}function _n(e,t){return(e?e+",":e)+mn(t)}function gn(t){return"{"+e.reduceProperties(t,vn,"")+"}"}function vn(e,t,n){return void 0===t||"function"==typeof t||"__cycle"===n?e:(e?e+",":e)+'"'+Rt(n)+'":'+mn(t)}function bn(e){for(var t,n,r,i,a="",o=fn(e),s=0,u=o.length;s>2,n=(3&o[s])<<4|o[s+1]>>4,r=(15&o[s+1])<<2|o[s+2]>>6,i=63&o[s+2],s+1>=u?r=i=64:s+2>=u&&(i=64),a+=kn.charAt(t)+kn.charAt(n)+kn.charAt(r)+kn.charAt(i),s+=3;return a}function Sn(t,n,r){return e.isRootedDiskPath(t)?e.getRelativePathToDirectoryOrUrl(n,t,n,r,!1):t}function An(t){return 0===t.newLine?xn:1===t.newLine?Rn:e.sys?e.sys.newLine:xn}e.getDeclarationOfKind=t;var Tn=[];e.getSingleLineStringWriter=n,e.releaseStringWriter=r,e.getFullWidth=i,e.arrayIsEqualTo=a,e.hasResolvedModule=o,e.getResolvedModule=s,e.setResolvedModule=u,e.containsParseError=c,e.getSourceFileOfNode=p,e.isStatementWithLocals=f,e.getStartPositionOfLine=d,e.nodePosToString=m,e.getStartPosOfNode=h,e.nodeIsMissing=y,e.nodeIsPresent=_,e.getTokenPosOfNode=g,e.getNonDecoratorTokenPosOfNode=v,e.getSourceTextOfNodeFromSourceFile=b,e.getTextOfNodeFromSourceText=S,e.getTextOfNode=A,e.escapeIdentifier=T,e.unescapeIdentifier=E,e.makeIdentifierFromModuleName=C,e.isBlockOrCatchScoped=N,e.isAmbientModule=w,e.isBlockScopedContainerTopLevel=k,e.isGlobalScopeAugmentation=x,e.isExternalModuleAugmentation=R,e.getEnclosingBlockScopeContainer=I,e.isCatchClauseVariableDeclaration=D,e.declarationNameToString=M,e.createDiagnosticForNode=P,e.createDiagnosticForNodeFromMessageChain=L,e.getSpanOfTokenAtPosition=O,e.getErrorSpanForNode=U,e.isExternalModule=F,e.isExternalOrCommonJsModule=B,e.isDeclarationFile=K,e.isConstEnumDeclaration=V,e.getCombinedNodeFlags=W,e.isConst=q,e.isLet=z,e.isSuperCallExpression=H,e.isPrologueDirective=Y,e.getLeadingCommentRangesOfNode=J,e.getLeadingCommentRangesOfNodeFromText=G,e.getJsDocComments=X,e.getJsDocCommentsFromText=$,e.fullTripleSlashReferencePathRegEx=/^(\/\/\/\s*/,e.fullTripleSlashAMDReferencePathRegEx=/^(\/\/\/\s*/,e.isTypeNode=Q,e.forEachReturnStatement=Z,e.forEachYieldExpression=ee,e.isVariableLike=te,e.isAccessor=ne,e.isClassLike=re,e.isFunctionLike=ie,e.isFunctionLikeKind=ae,e.introducesArgumentsExoticObject=oe,e.isIterationStatement=se,e.isFunctionBlock=ue,e.isObjectLiteralMethod=ce,e.isIdentifierTypePredicate=le,e.isThisTypePredicate=pe,e.getContainingFunction=fe,e.getContainingClass=de,e.getThisContainer=me,e.getSuperContainer=he,e.isSuperPropertyOrElementAccess=ye,e.getEntityNameFromTypeNode=_e,e.getInvokedExpression=ge,e.nodeCanBeDecorated=ve,e.nodeIsDecorated=be,e.isPropertyAccessExpression=Se,e.isElementAccessExpression=Ae,e.isExpression=Te,e.isExternalModuleNameRelative=Ee,e.isInstantiatedModule=Ce,e.isExternalModuleImportEqualsDeclaration=Ne,e.getExternalModuleImportEqualsDeclarationExpression=we,e.isInternalModuleImportEqualsDeclaration=ke,e.isSourceFileJavaScript=xe,e.isInJavaScriptFile=Re,e.isRequireCall=Ie,e.getSpecialPropertyAssignmentKind=De,e.getExternalModuleName=Me,e.hasQuestionToken=Pe,e.isJSDocConstructSignature=Le,e.getJSDocTypeTag=Fe,e.getJSDocReturnTag=Be,e.getJSDocTemplateTag=Ke,e.getCorrespondingJSDocParameterTag=Ve,e.hasRestParameter=je,e.isRestParameter=We,e.isLiteralKind=qe,e.isTextualLiteralKind=ze,e.isTemplateLiteralKind=He,e.isBindingPattern=Ye,e.isNodeDescendentOf=Je,e.isInAmbientContext=Ge,e.isDeclaration=Xe,e.isStatement=$e,e.isClassElement=Qe,e.isDeclarationName=Ze,e.isIdentifierName=et,e.isAliasSymbolDeclaration=tt,e.getClassExtendsHeritageClauseElement=nt,e.getClassImplementsHeritageClauseElements=rt,e.getInterfaceBaseTypeNodes=it,e.getHeritageClause=at,e.tryResolveScriptReference=ot,e.getAncestor=st,e.getFileReferenceFromReferencePath=ut,e.isKeyword=ct,e.isTrivia=lt,e.isAsyncFunctionLike=pt,e.isStringOrNumericLiteral=ft,e.hasDynamicName=dt,e.isDynamicName=mt,e.isWellKnownSymbolSyntactically=ht,e.getPropertyNameForPropertyNameNode=yt,e.getPropertyNameForKnownSymbolName=_t,e.isESSymbolIdentifier=gt,e.isModifierKind=vt,e.isParameterDeclaration=bt,e.getRootDeclaration=St,e.nodeStartsNewLexicalEnvironment=At,e.cloneNode=Tt,e.cloneEntityName=Et,e.isQualifiedName=Ct,e.nodeIsSynthesized=Nt,e.createSynthesizedNode=wt,e.createSynthesizedNodeArray=kt,e.createDiagnosticCollection=xt;var En=/[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Cn={"\0":"\\0","\t":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"\u2028":"\\u2028","\u2029":"\\u2029","…":"\\u0085"};e.escapeString=Rt,e.isIntrinsicJsxName=It;var Nn=/[^\u0000-\u007F]/g;e.escapeNonAsciiCharacters=Mt;var wn=[""," "];e.getIndentString=Pt,e.getIndentSize=Lt,e.createTextWriter=Ot,e.getExternalModuleNameFromPath=Ut,e.getOwnEmitOutputFilePath=Ft,e.getEmitScriptTarget=Bt,e.getEmitModuleKind=Kt,e.forEachExpectedEmitFile=Vt,e.getSourceFilePathInNewDir=jt,e.writeFile=Wt,e.getLineOfLocalPosition=qt,e.getLineOfLocalPositionFromLineMap=zt,e.getFirstConstructorWithBody=Ht,e.getSetAccessorTypeAnnotationNode=Yt,e.getAllAccessorDeclarations=Jt,e.emitNewLineBeforeLeadingComments=Gt,e.emitComments=Xt,e.emitDetachedComments=$t,e.writeCommentRange=Qt,e.modifierToFlag=tn,e.isLeftHandSideExpression=nn,e.isAssignmentOperator=rn,e.isExpressionWithTypeArgumentsInClassExtendsClause=an,e.isSupportedExpressionWithTypeArguments=on,e.isRightSideOfQualifiedNameOrPropertyAccess=un,e.isEmptyObjectLiteralOrArrayLiteral=cn,e.getLocalSymbolForExportDefault=ln,e.hasJavaScriptFileExtension=pn,e.stringify="undefined"!=typeof JSON&&JSON.stringify?JSON.stringify:dn;var kn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.convertToBase64=bn,e.convertToRelativePath=Sn;var xn="\r\n",Rn="\n";e.getNewLineCharacter=An}(o||(o={}));var o;!function(e){function t(e){return 2===e.target?"lib.es6.d.ts":"lib.d.ts"}function n(e){return e.start+e.length}function r(e){return 0===e.length}function i(e,t){return t>=e.start&&t=e.start&&n(t)<=n(e)}function o(e,t){return Math.max(e.start,t.start)=e.start}function c(e,t,r){var i=t+r;return t<=n(e)&&i>=e.start}function l(e,t,n,r){var i=e+t,a=n+r;return n<=i&&a>=e}function p(e,t){return t<=n(e)&&t>=e.start}function f(e,t){var r=Math.max(e.start,t.start),i=Math.min(n(e),n(t));if(r<=i)return m(r,i)}function d(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return{start:e,length:t}}function m(e,t){return d(e,t-e)}function h(e){return d(e.span.start,e.newLength)}function y(e){return r(e.span)&&0===e.newLength}function _(e,t){if(t<0)throw new Error("newLength < 0");return{span:e,newLength:t}}function g(t){if(0===t.length)return e.unchangedTextChangeRange;if(1===t.length)return t[0];for(var r=t[0],i=r.span.start,a=n(r.span),o=i+r.newLength,s=1;s105)}function z(t,n,r){return void 0===r&&(r=!0),ji===t?(r&&L(),!0):(n?R(n):R(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}function H(e){return ji===e&&(L(),!0)}function Y(e){if(ji===e)return G()}function J(e,t,n,r){return Y(e)||ee(e,t,n,r)}function G(){var e=Q(ji);return L(),Z(e)}function X(){return 23===ji||(16===ji||1===ji||Gi.hasPrecedingLineBreak())}function $(){return X()?(23===ji&&L(),!0):z(23)}function Q(e,t){return qi++,t>=0||(t=Gi.getStartPos()),new Ui(e,t,t)}function Z(e,t){return e.end=void 0===t?Gi.getStartPos():t,Ji&&(e.parserContextFlags=Ji),$i&&($i=!1,e.parserContextFlags|=16),e}function ee(e,t,n,r){t?I(Gi.getStartPos(),0,n,r):R(n,r);var i=Q(e,Gi.getStartPos());return i.text="",Z(i)}function te(t){return t=e.escapeIdentifier(t),e.hasProperty(zi,t)?zi[t]:zi[t]=t}function ne(t,n){if(Hi++,t){var r=Q(69);return 69!==ji&&(r.originalKeywordKind=ji),r.text=te(Gi.getTokenValue()),L(),Z(r)}return ee(69,!1,n||e.Diagnostics.Identifier_expected)}function re(e){return ne(q(),e)}function ie(){return ne(e.tokenIsIdentifierOrKeyword(ji))}function ae(){return e.tokenIsIdentifierOrKeyword(ji)||9===ji||8===ji}function oe(e){return 9===ji||8===ji?Je(!0):e&&19===ji?le():ie()}function se(){return oe(!0)}function ue(){return oe(!1)}function ce(){return 9===ji||8===ji||e.tokenIsIdentifierOrKeyword(ji)}function le(){var e=Q(137);return z(19),e.expression=g(Ht),z(20),Z(e)}function pe(e){return ji===e&&W(de)}function fe(){return L(),!Gi.hasPrecedingLineBreak()&&he()}function de(){return 74===ji?81===L():82===ji?(L(),77===ji?j(ye):37!==ji&&15!==ji&&he()):77===ji?ye():113===ji?(L(),he()):fe()}function me(){return e.isModifierKind(ji)&&W(de)}function he(){return 19===ji||15===ji||37===ji||ae()}function ye(){return L(),73===ji||87===ji}function _e(t,n){if(ke(t))return!0;switch(t){case 0:case 1:case 3:return!(23===ji&&n)&&Nr();case 2:return 71===ji||77===ji;case 4:return _t();case 5:return j($r)||23===ji&&!n;case 6:return 19===ji||ae();case 12:return 19===ji||37===ji||ae();case 9:return 19===ji||ae();case 7:return 15===ji?j(ge):n?q()&&!Se():Wt()&&!Se();case 8:return Ur();case 10:return 24===ji||22===ji||Ur();case 17:return q();case 11:case 15:return 24===ji||22===ji||qt();case 16:return it();case 18:case 19:return 24===ji||Rt();case 20:return li();case 21:return e.tokenIsIdentifierOrKeyword(ji);case 13:return e.tokenIsIdentifierOrKeyword(ji)||15===ji;case 14:return!0;case 22:case 23:case 25:return ea.isJSDocType();case 24:return ce()}e.Debug.fail("Non-exhaustive case in 'isListElement'.")}function ge(){if(e.Debug.assert(15===ji),16===L()){var t=L();return 24===t||15===t||83===t||106===t}return!0}function ve(){return L(),q()}function be(){return L(),e.tokenIsIdentifierOrKeyword(ji)}function Se(){return(106===ji||83===ji)&&j(Ae)}function Ae(){return L(),qt()}function Te(e){if(1===ji)return!0;switch(e){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 21:return 16===ji;case 3:return 16===ji||71===ji||77===ji;case 7:return 15===ji||83===ji||106===ji;case 8:return Ee();case 17:return 27===ji||17===ji||15===ji||83===ji||106===ji;case 11:return 18===ji||23===ji;case 15:case 19:case 10:return 20===ji;case 16:return 18===ji||20===ji;case 18:return 27===ji||17===ji;case 20:return 15===ji||16===ji;case 13:return 27===ji||39===ji;case 14:return 25===ji&&j(Ai);case 22:return 18===ji||54===ji||16===ji;case 23:return 27===ji||16===ji;case 25:return 20===ji||16===ji;case 24:return 16===ji}}function Ee(){return!!X()||(!!un(ji)||34===ji)}function Ce(){for(var e=0;e<26;e++)if(Yi&1<=0&&(i.hasTrailingComma=!0),i.end=P(),Yi=r,i}function Ve(){var e=M(),t=[];return t.pos=e,t.end=e,t}function je(e,t,n,r){if(z(n)){var i=Ke(e,t);return z(r),i}return Ve()}function We(e,t){for(var n=re(t);H(21);){var r=Q(136,n.pos);r.left=n,r.right=qe(e),n=Z(r)}return n}function qe(t){if(Gi.hasPrecedingLineBreak()&&e.tokenIsIdentifierOrKeyword(ji)){if(j(Sr))return ee(69,!0,e.Diagnostics.Identifier_expected)}return t?ie():re()}function ze(){var t=Q(186);t.head=Ge(),e.Debug.assert(12===t.head.kind,"Template head has wrong token kind");var n=[];n.pos=M();do{n.push(He())}while(13===e.lastOrUndefined(n).literal.kind);return n.end=P(),t.templateSpans=n,Z(t)}function He(){var t=Q(193);t.expression=g(Ht);var n;return 16===ji?(F(),n=Ge()):n=J(14,!1,e.Diagnostics._0_expected,e.tokenToString(16)),t.literal=n,Z(t)}function Ye(){return Xe(163,!0)}function Je(e){return Xe(ji,e)}function Ge(){return Xe(ji,!1)}function Xe(t,n){var r=Q(t),i=Gi.getTokenValue();r.text=n?te(i):i,Gi.hasExtendedUnicodeEscape()&&(r.hasExtendedUnicodeEscape=!0),Gi.isUnterminated()&&(r.isUnterminated=!0);var a=Gi.getTokenPos();return L(),Z(r),8===r.kind&&48===Wi.charCodeAt(a)&&e.isOctalDigit(Wi.charCodeAt(a+1))&&(r.flags|=32768),r}function $e(){var t=We(!1,e.Diagnostics.Type_expected),n=Q(152,t.pos);return n.typeName=t,Gi.hasPrecedingLineBreak()||25!==ji||(n.typeArguments=je(18,Kt,25,27)),Z(n)}function Qe(e){L();var t=Q(151,e.pos);return t.parameterName=e,t.type=Kt(),Z(t)}function Ze(){var e=Q(162);return L(),Z(e)}function et(){var e=Q(155);return z(101),e.exprName=We(!0),Z(e)}function tt(){var e=Q(138);return e.name=re(),H(83)&&(Rt()||!qt()?e.constraint=Kt():e.expression=bn()),Z(e)}function nt(){if(25===ji)return je(17,tt,25,27)}function rt(){if(H(54))return Kt()}function it(){return 22===ji||Ur()||e.isModifierKind(ji)||55===ji}function at(e,t){t&&(e.flags|=t.flags,e.modifiers=t)}function ot(){var t=Q(139);return t.decorators=Qr(),at(t,Zr()),t.dotDotDotToken=Y(22),t.name=Fr(),0===e.getFullWidth(t.name)&&0===t.flags&&e.isModifierKind(ji)&&L(),t.questionToken=Y(53),t.type=rt(),t.initializer=st(!0),u(Z(t))}function st(e){return e?ut():Jr()}function ut(){return Yt(!0)}function ct(e,t,n,r,i){var a=34===e;i.typeParameters=nt(),i.parameters=lt(t,n,r),a?(z(e),i.type=Ft()):H(e)&&(i.type=Ft())}function lt(e,t,n){if(z(17)){var r=N(),i=x();d(e),h(t);var a=Ke(16,ot);if(d(r),h(i),!z(18)&&n)return;return a}return n?void 0:Ve()}function pt(){H(24)||$()}function ft(e){var t=Q(e);return 149===e&&z(92),ct(54,!1,!1,!1,t),pt(),Z(t)}function dt(){return 19===ji&&j(mt)}function mt(){if(L(),22===ji||20===ji)return!0;if(e.isModifierKind(ji)){if(L(),q())return!0}else{if(!q())return!1;L()}return 54===ji||24===ji||53===ji&&(L(),54===ji||24===ji||20===ji)}function ht(e,t,n){var r=Q(150,e);return r.decorators=t,at(r,n),r.parameters=je(16,ot,19,20),r.type=jt(),pt(),Z(r)}function yt(){var e=Gi.getStartPos(),t=se(),n=Y(53);if(17===ji||25===ji){var r=Q(143,e);return r.name=t,r.questionToken=n,ct(54,!1,!1,!1,r),pt(),Z(r)}var i=Q(141,e);return i.name=t,i.questionToken=n,i.type=jt(),56===ji&&(i.initializer=Jr()),pt(),Z(i)}function _t(){switch(ji){case 17:case 25:case 19:return!0;default:if(e.isModifierKind(ji)){var t=j(gt);if(t)return t}return ae()&&j(vt)}}function gt(){for(;e.isModifierKind(ji);)L();return dt()}function vt(){return L(),17===ji||25===ji||53===ji||54===ji||X()}function bt(){switch(ji){case 17:case 25:return ft(148);case 19:return dt()?ht(Gi.getStartPos(),void 0,void 0):yt();case 92:if(j(At))return ft(149);case 9:case 8:return yt();default:if(e.isModifierKind(ji)){var t=W(St);if(t)return t}if(e.tokenIsIdentifierOrKeyword(ji))return yt()}}function St(){var e=Gi.getStartPos(),t=Qr(),n=Zr();return dt()?ht(e,t,n):void 0}function At(){return L(),17===ji||25===ji}function Tt(){var e=Q(156);return e.members=Et(),Z(e)}function Et(){var e;return z(15)?(e=Ne(4,bt),z(16)):e=Ve(),e}function Ct(){var e=Q(158);return e.elementTypes=je(19,Kt,19,20),Z(e)}function Nt(){var e=Q(161);return z(17),e.type=Kt(),z(18),Z(e)}function wt(e){var t=Q(e);return 154===e&&z(92),ct(34,!1,!1,!1,t),Z(t)}function kt(){var e=G();return 21===ji?void 0:e}function xt(){switch(ji){case 117:case 130:case 128:case 120:case 131:return W(kt)||$e();case 9:return Ye();case 103:return G();case 97:var e=Ze();return 124!==ji||Gi.hasPrecedingLineBreak()?e:Qe(e);case 101:return et();case 15:return Tt();case 19:return Ct();case 17:return Nt();default:return $e()}}function Rt(){switch(ji){case 117:case 130:case 128:case 120:case 131:case 103:case 97:case 101:case 15:case 19:case 25:case 92:case 9:return!0;case 17:return j(It);default:return q()}}function It(){return L(),18===ji||it()||Rt()}function Dt(){for(var e=xt();!Gi.hasPrecedingLineBreak()&&H(19);){z(20);var t=Q(157,e.pos);t.elementType=e,e=Z(t)}return e}function Mt(e,t,n){var r=t();if(ji===n){var i=[r];for(i.pos=r.pos;H(n);)i.push(t());i.end=P();var a=Q(e,r.pos);a.types=i,r=Z(a)}return r}function Pt(){return Mt(160,Dt,46)}function Lt(){return Mt(159,Pt,47)}function Ot(){return 25===ji||17===ji&&j(Ut)}function Ut(){if(L(),18===ji||22===ji)return!0;if(q()||e.isModifierKind(ji)){if(L(),54===ji||24===ji||53===ji||56===ji||q()||e.isModifierKind(ji))return!0;if(18===ji&&(L(),34===ji))return!0}return!1}function Ft(){var e=q()&&W(Bt),t=Kt();if(e){var n=Q(151,e.pos);return n.parameterName=e,n.type=t,Z(n)}return t}function Bt(){var e=re();if(124===ji&&!Gi.hasPrecedingLineBreak())return L(),e}function Kt(){return y(10,Vt)}function Vt(){return Ot()?wt(153):92===ji?wt(154):Lt()}function jt(){return H(54)?Kt():void 0}function Wt(){switch(ji){case 97:case 95:case 93:case 99:case 84:case 8:case 9:case 11:case 12:case 17:case 19:case 15:case 87:case 73:case 92:case 39:case 61:case 69:return!0;default:return q()}}function qt(){if(Wt())return!0;switch(ji){case 35:case 36:case 50:case 49:case 78:case 101:case 103:case 41:case 42:case 25:case 119:case 114:return!0;default:return!!ln()||q()}}function zt(){return 15!==ji&&87!==ji&&73!==ji&&55!==ji&&qt()}function Ht(){var e=k();e&&m(!1);for(var t,n=Jt();t=Y(24);)n=fn(n,t,Jt());return e&&m(!0),n}function Yt(e){if(56===ji||!(Gi.hasPrecedingLineBreak()||e&&15===ji)&&qt())return z(56),Jt()}function Jt(){if(Gt())return $t();var t=Zt();if(t)return t;var n=sn(0);return 69===n.kind&&34===ji?Qt(n):e.isLeftHandSideExpression(n)&&e.isAssignmentOperator(O())?fn(n,G(),Jt()):on(n)}function Gt(){return 114===ji&&(!!N()||j(Tr))}function Xt(){return L(),!Gi.hasPrecedingLineBreak()&&q()}function $t(){var e=Q(187);return L(),Gi.hasPrecedingLineBreak()||37!==ji&&!qt()?Z(e):(e.asteriskToken=Y(37),e.expression=Jt(),Z(e))}function Qt(t){e.Debug.assert(34===ji,"parseSimpleArrowFunctionExpression should only have been called if we had a =>");var n=Q(177,t.pos),r=Q(139,t.pos);return r.name=t,Z(r),n.parameters=[r],n.parameters.pos=r.pos,n.parameters.end=r.end,n.equalsGreaterThanToken=J(34,!1,e.Diagnostics._0_expected,"=>"),n.body=an(!1),Z(n)}function Zt(){var t=en();if(0!==t){var n=1===t?rn(!0):W(nn);if(n){var r=!!(256&n.flags),i=ji;return n.equalsGreaterThanToken=J(34,!1,e.Diagnostics._0_expected,"=>"),n.body=34===i||15===i?an(r):re(),Z(n)}}}function en(){return 17===ji||25===ji||118===ji?j(tn):34===ji?1:0}function tn(){if(118===ji){if(L(),Gi.hasPrecedingLineBreak())return 0;if(17!==ji&&25!==ji)return 0}var t=ji,n=L();if(17===t){if(18===n){switch(L()){case 34:case 54:case 15:return 1;default:return 0}}return 19===n||15===n?2:22===n?1:q()?54===L()?1:2:0}if(e.Debug.assert(25===t),!q())return 0;if(1===Bi.languageVariant){return j(function(){var e=L();if(83===e){switch(L()){case 56:case 27:return!1;default:return!0}}else if(24===e)return!0;return!1})?1:0}return 2}function nn(){return rn(!1)}function rn(e){var t=Q(177);if(at(t,ei()),ct(54,!1,!!(256&t.flags),!e,t),t.parameters&&(e||34===ji||15===ji))return t}function an(e){return 15===ji?rr(!1,e,!1):23!==ji&&87!==ji&&73!==ji&&Nr()&&!zt()?rr(!1,e,!0):e?A(Jt):T(Jt)}function on(t){var n=Y(53);if(!n)return t;var r=Q(185,t.pos);return r.condition=t,r.questionToken=n,r.whenTrue=y(Xi,Jt),r.colonToken=J(54,!1,e.Diagnostics._0_expected,e.tokenToString(54)),r.whenFalse=Jt(),Z(r)}function sn(e){return cn(e,bn())}function un(e){return 90===e||135===e}function cn(e,t){for(;;){O();var n=pn();if(!(38===ji?n>=e:n>e))break;if(90===ji&&w())break;if(116===ji){if(Gi.hasPrecedingLineBreak())break;L(),t=dn(t,Kt())}else t=fn(t,G(),sn(n))}return t}function ln(){return(!w()||90!==ji)&&pn()>0}function pn(){switch(ji){case 52:return 1;case 51:return 2;case 47:return 3;case 48:return 4;case 46:return 5;case 30:case 31:case 32:case 33:return 6;case 25:case 27:case 28:case 29:case 91:case 90:case 116:return 7;case 43:case 44:case 45:return 8;case 35:case 36:return 9;case 37:case 39:case 40:return 10;case 38:return 11}return-1}function fn(e,t,n){var r=Q(184,e.pos);return r.left=e,r.operatorToken=t,r.right=n,Z(r)}function dn(e,t){var n=Q(192,e.pos);return n.expression=e,n.type=t,Z(n)}function mn(){var e=Q(182);return e.operator=ji,L(),e.operand=Sn(),Z(e)}function hn(){var e=Q(178);return L(),e.expression=Sn(),Z(e)}function yn(){var e=Q(179);return L(),e.expression=Sn(),Z(e)}function _n(){var e=Q(180);return L(),e.expression=Sn(),Z(e)}function gn(){return 119===ji&&(!!x()||j(Xt))}function vn(){var e=Q(181);return L(),e.expression=Sn(),Z(e)}function bn(){if(gn())return vn();if(An()){var t=Tn();return 38===ji?cn(pn(),t):t}var n=ji,r=Sn();if(38===ji){var i=e.skipTrivia(Wi,r.pos);174===r.kind?I(i,r.end-i,e.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):I(i,r.end-i,e.Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,e.tokenToString(n))}return r}function Sn(){switch(ji){case 35:case 36:case 50:case 49:return mn();case 78:return hn();case 101:return yn();case 103:return _n();case 25:return Fn();default:return Tn()}}function An(){switch(ji){case 35:case 36:case 50:case 49:case 78:case 101:case 103:return!1;case 25:if(1!==Bi.languageVariant)return!1;default:return!0}}function Tn(){if(41===ji||42===ji){var t=Q(182);return t.operator=ji,L(),t.operand=En(),Z(t)}if(1===Bi.languageVariant&&25===ji&&j(be))return kn(!0);var n=En();if(e.Debug.assert(e.isLeftHandSideExpression(n)),(41===ji||42===ji)&&!Gi.hasPrecedingLineBreak()){var t=Q(183,n.pos);return t.operand=n,t.operator=ji,L(),Z(t)}return n}function En(){return Kn(95===ji?Nn():Cn())}function Cn(){return Bn(qn())}function Nn(){var t=G();if(17===ji||21===ji||19===ji)return t;var n=Q(169,t.pos);return n.expression=t,n.dotToken=J(21,!1,e.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access),n.name=qe(!0),Z(n)}function wn(e,t){return e.kind===t.kind&&(69===e.kind?e.text===t.text:e.right.text===t.right.text&&wn(e.left,t.left))}function kn(t){var n,r=Dn(t);if(238===r.kind){var i=Q(236,r.pos);i.openingElement=r,i.children=In(i.openingElement.tagName),i.closingElement=Un(t),wn(i.openingElement.tagName,i.closingElement.tagName)||I(i.closingElement.pos,i.closingElement.end-i.closingElement.pos,e.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0,e.getTextOfNodeFromSourceText(Wi,i.openingElement.tagName)),n=Z(i)}else e.Debug.assert(237===r.kind),n=r;if(t&&25===ji){var a=W(function(){return kn(!0)});if(a){R(e.Diagnostics.JSX_expressions_must_have_one_parent_element);var o=Q(184,n.pos);return o.end=a.end,o.left=n,o.right=a,o.operatorToken=ee(24,!1,void 0),o.operatorToken.pos=o.operatorToken.end=o.right.pos,o}}return n}function xn(){var e=Q(239,Gi.getStartPos());return ji=Gi.scanJsxToken(),Z(e)}function Rn(){switch(ji){case 239:return xn();case 15:return Pn(!1);case 25:return kn(!1)}e.Debug.fail("Unknown JSX child kind "+ji)}function In(t){var n=[];n.pos=Gi.getStartPos();var r=Yi;for(Yi|=16384;;){if(26===(ji=Gi.reScanJsxToken()))break;if(1===ji){I(t.pos,t.end-t.pos,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(Wi,t));break}n.push(Rn())}return n.end=Gi.getTokenPos(),Yi=r,n}function Dn(e){var t=Gi.getStartPos();z(25);var n,r=Mn(),i=Ne(13,Ln);return 27===ji?(n=Q(238,t),K()):(z(39),e?z(27):(z(27,void 0,!1),K()),n=Q(237,t)),n.tagName=r,n.attributes=i,Z(n)}function Mn(){B();for(var e=ie();H(21);){B();var t=Q(136,e.pos);t.left=e,t.right=ie(),e=Z(t)}return e}function Pn(e){var t=Q(243);return z(15),16!==ji&&(t.expression=Jt()),e?z(16):(z(16,void 0,!1),K()),Z(t)}function Ln(){if(15===ji)return On();B();var e=Q(241);if(e.name=ie(),H(56))switch(ji){case 9:e.initializer=Je();break;default:e.initializer=Pn(!0)}return Z(e)}function On(){var e=Q(242);return z(15),z(22),e.expression=Ht(),z(16),Z(e)}function Un(e){var t=Q(240);return z(26),t.tagName=Mn(),e?z(27):(z(27,void 0,!1),K()),Z(t)}function Fn(){var e=Q(174);return z(25),e.type=Kt(),z(27),e.expression=Sn(),Z(e)}function Bn(e){for(;;){var t=Y(21);if(t){var n=Q(169,e.pos);n.expression=e,n.dotToken=t,n.name=qe(!0),e=Z(n)}else if(k()||!H(19)){if(11!==ji&&12!==ji)return e;var r=Q(173,e.pos);r.tag=e,r.template=11===ji?Je():ze(),e=Z(r)}else{var i=Q(170,e.pos);if(i.expression=e,20!==ji&&(i.argumentExpression=g(Ht),9===i.argumentExpression.kind||8===i.argumentExpression.kind)){var a=i.argumentExpression;a.text=te(a.text)}z(20),e=Z(i)}}}function Kn(e){for(;;)if(e=Bn(e),25!==ji){if(17!==ji)return e;var t=Q(171,e.pos);t.expression=e,t.arguments=Vn(),e=Z(t)}else{var n=W(jn);if(!n)return e;var t=Q(171,e.pos);t.expression=e,t.typeArguments=n,t.arguments=Vn(),e=Z(t)}}function Vn(){z(17);var e=Ke(11,Jn);return z(18),e}function jn(){if(H(25)){var e=Ke(18,Kt);if(z(27))return e&&Wn()?e:void 0}}function Wn(){switch(ji){case 17:case 21:case 18:case 20:case 54:case 23:case 53:case 30:case 32:case 31:case 33:case 51:case 52:case 48:case 46:case 47:case 16:case 1:return!0;case 24:case 15:default:return!1}}function qn(){switch(ji){case 8:case 9:case 11:return Je();case 97:case 95:case 93:case 99:case 84:return G();case 17:return zn();case 19:return Gn();case 15:return Qn();case 118:if(!j(Ar))break;return Zn();case 73:return ni();case 87:return Zn();case 92:return tr();case 39:case 61:if(10===U())return Je();break;case 12:return ze()}return re(e.Diagnostics.Expression_expected)}function zn(){var e=Q(175);return z(17),e.expression=g(Ht),z(18),Z(e)}function Hn(){var e=Q(188);return z(22),e.expression=Jt(),Z(e)}function Yn(){return 22===ji?Hn():24===ji?Q(190):Jt()}function Jn(){return y(Xi,Yn)}function Gn(){var e=Q(167);return z(19),Gi.hasPrecedingLineBreak()&&(e.flags|=1024),e.elements=Ke(15,Yn),z(20),Z(e)}function Xn(e,t,n){return pe(123)?Gr(146,e,t,n):pe(129)?Gr(147,e,t,n):void 0}function $n(){var e=Gi.getStartPos(),t=Qr(),n=Zr(),r=Xn(e,t,n);if(r)return r;var i=Y(37),a=q(),o=se(),s=Y(53);if(i||17===ji||25===ji)return zr(e,t,n,i,o,s);if(a&&(24===ji||16===ji||56===ji)){var c=Q(249,e);c.name=o,c.questionToken=s;var l=Y(56);return l&&(c.equalsToken=l,c.objectAssignmentInitializer=g(Jt)),u(Z(c))}var p=Q(248,e);return p.modifiers=n,p.name=o,p.questionToken=s,z(54),p.initializer=g(Jt),u(Z(p))}function Qn(){var e=Q(168);return z(15),Gi.hasPrecedingLineBreak()&&(e.flags|=1024),e.properties=Ke(12,$n,!0),z(16),Z(e)}function Zn(){var e=k();e&&m(!1);var t=Q(176);at(t,Zr()),z(87),t.asteriskToken=Y(37);var n=!!t.asteriskToken,r=!!(256&t.flags);return t.name=n&&r?E(er):n?b(er):r?A(er):er(),ct(54,n,r,!1,t),t.body=rr(n,r,!1),e&&m(!0),u(Z(t))}function er(){return q()?re():void 0}function tr(){var e=Q(172);return z(92),e.expression=Cn(),e.typeArguments=W(jn),(e.typeArguments||17===ji)&&(e.arguments=Vn()),Z(e)}function nr(e,t){var n=Q(195);return z(15,t)||e?(n.statements=Ne(1,xr),z(16)):n.statements=Ve(),Z(n)}function rr(e,t,n,r){var i=N();d(e);var a=x();h(t);var o=k();o&&m(!1);var s=nr(n,r);return o&&m(!0),d(i),h(a),s}function ir(){var e=Q(197);return z(23),Z(e)}function ar(){var e=Q(199);return z(88),z(17),e.expression=g(Ht),z(18),e.thenStatement=xr(),e.elseStatement=H(80)?xr():void 0,Z(e)}function or(){var e=Q(200);return z(79),e.statement=xr(),z(104),z(17),e.expression=g(Ht),z(18),H(23),Z(e)}function sr(){var e=Q(201);return z(104),z(17),e.expression=g(Ht),z(18),e.statement=xr(),Z(e)}function ur(){var e=M();z(86),z(17);var t=void 0;23!==ji&&(t=102===ji||108===ji||74===ji?Kr(!0):v(Ht));var n;if(H(90)){var r=Q(203,e);r.initializer=t,r.expression=g(Ht),z(18),n=r}else if(H(135)){var i=Q(204,e);i.initializer=t,i.expression=g(Jt),z(18),n=i}else{var a=Q(202,e);a.initializer=t,z(23),23!==ji&&18!==ji&&(a.condition=g(Ht)),z(23),18!==ji&&(a.incrementor=g(Ht)),z(18),n=a}return n.statement=xr(),Z(n)}function cr(e){var t=Q(e);return z(206===e?70:75),X()||(t.label=re()),$(),Z(t)}function lr(){var e=Q(207);return z(94),X()||(e.expression=g(Ht)),$(),Z(e)}function pr(){var e=Q(208);return z(105),z(17),e.expression=g(Ht),z(18),e.statement=xr(),Z(e)}function fr(){var e=Q(244);return z(71),e.expression=g(Ht),z(54),e.statements=Ne(3,xr),Z(e)}function dr(){var e=Q(245);return z(77),z(54),e.statements=Ne(3,xr),Z(e)}function mr(){return 71===ji?fr():dr()}function hr(){var e=Q(209);z(96),z(17),e.expression=g(Ht),z(18);var t=Q(223,Gi.getStartPos());return z(15),t.clauses=Ne(2,mr),z(16),e.caseBlock=Z(t),Z(e)}function yr(){var e=Q(211);return z(98),e.expression=Gi.hasPrecedingLineBreak()?void 0:g(Ht),$(),Z(e)}function _r(){var e=Q(212);return z(100),e.tryBlock=nr(!1),e.catchClause=72===ji?gr():void 0,e.catchClause&&85!==ji||(z(85),e.finallyBlock=nr(!1)),Z(e)}function gr(){var e=Q(247);return z(72),z(17)&&(e.variableDeclaration=Br()),z(18),e.block=nr(!1),Z(e)}function vr(){var e=Q(213);return z(76),$(),Z(e)}function br(){var e=Gi.getStartPos(),t=g(Ht);if(69===t.kind&&H(54)){var n=Q(210,e);return n.label=t,n.statement=xr(),u(Z(n))}var r=Q(198,e);return r.expression=t,$(),u(Z(r))}function Sr(){return L(),e.tokenIsIdentifierOrKeyword(ji)&&!Gi.hasPrecedingLineBreak()}function Ar(){return L(),87===ji&&!Gi.hasPrecedingLineBreak()}function Tr(){return L(),(e.tokenIsIdentifierOrKeyword(ji)||8===ji)&&!Gi.hasPrecedingLineBreak()}function Er(){for(;;)switch(ji){case 102:case 108:case 74:case 87:case 73:case 81:return!0;case 107:case 132:return Xt();case 125:case 126:return Ir();case 115:case 118:case 122:case 110:case 111:case 112:if(L(),Gi.hasPrecedingLineBreak())return!1;continue;case 134:return 15===L();case 89:return L(),9===ji||37===ji||15===ji||e.tokenIsIdentifierOrKeyword(ji);case 82:if(L(),56===ji||37===ji||15===ji||77===ji)return!0;continue;case 113:L();continue;default:return!1}}function Cr(){return j(Er)}function Nr(){switch(ji){case 55:case 23:case 15:case 102:case 108:case 87:case 73:case 81:case 88:case 79:case 104:case 86:case 75:case 70:case 94:case 105:case 96:case 98:case 100:case 76:case 72:case 85:return!0;case 74:case 82:case 89:return Cr();case 118:case 122:case 107:case 125:case 126:case 132:case 134:return!0;case 112:case 110:case 111:case 113:return Cr()||!j(Sr);default:return qt()}}function wr(){return L(),q()||15===ji||19===ji}function kr(){return j(wr)}function xr(){switch(ji){case 23:return ir();case 15:return nr(!1);case 102:return jr(Gi.getStartPos(),void 0,void 0);case 108:if(kr())return jr(Gi.getStartPos(),void 0,void 0);break;case 87:return Wr(Gi.getStartPos(),void 0,void 0);case 73:return ri(Gi.getStartPos(),void 0,void 0);case 88:return ar();case 79:return or();case 104:return sr();case 86:return ur();case 75:return cr(205);case 70:return cr(206);case 94:return lr();case 105:return pr();case 96:return hr();case 98:return yr();case 100:case 72:case 85:return _r();case 76:return vr();case 55:return Rr();case 118:case 107:case 132:case 125:case 126:case 122:case 74:case 81:case 82:case 89:case 110:case 111:case 112:case 115:case 113:case 134:if(Cr())return Rr()}return br()}function Rr(){var t=M(),n=Qr(),r=Zr();switch(ji){case 102:case 108:case 74:return jr(t,n,r);case 87:return Wr(t,n,r);case 73:return ri(t,n,r);case 107:return fi(t,n,r);case 132:return di(t,n,r);case 81:return hi(t,n,r);case 134:case 125:case 126:return vi(t,n,r);case 89:return Ti(t,n,r);case 82:return L(),77===ji||56===ji?Pi(t,n,r):Mi(t,n,r);default:if(n||r){var i=ee(234,!0,e.Diagnostics.Declaration_expected);return i.pos=t,i.decorators=n,at(i,r),Z(i)}}}function Ir(){return L(),!Gi.hasPrecedingLineBreak()&&(q()||9===ji)}function Dr(e,t,n){return 15!==ji&&X()?void $():rr(e,t,!1,n)}function Mr(){if(24===ji)return Q(190);var e=Q(166);return e.dotDotDotToken=Y(22),e.name=Fr(),e.initializer=st(!1),Z(e)}function Pr(){var e=Q(166),t=q(),n=se();return t&&54!==ji?e.name=n:(z(54),e.propertyName=n,e.name=Fr()),e.initializer=st(!1),Z(e)}function Lr(){var e=Q(164);return z(15),e.elements=Ke(9,Pr),z(16),Z(e)}function Or(){var e=Q(165);return z(19),e.elements=Ke(10,Mr),z(20),Z(e)}function Ur(){return 15===ji||19===ji||q()}function Fr(){return 19===ji?Or():15===ji?Lr():re()}function Br(){var e=Q(214);return e.name=Fr(),e.type=jt(),un(ji)||(e.initializer=Yt(!1)),Z(e)}function Kr(t){var n=Q(215);switch(ji){case 102:break;case 108:n.flags|=8192;break;case 74:n.flags|=16384;break;default:e.Debug.fail()}if(L(),135===ji&&j(Vr))n.declarations=Ve();else{var r=w();f(t),n.declarations=Ke(8,Br),f(r)}return Z(n)}function Vr(){return ve()&&18===L()}function jr(e,t,n){var r=Q(196,e);return r.decorators=t,at(r,n),r.declarationList=Kr(!1),$(),u(Z(r))}function Wr(t,n,r){var i=Q(216,t);i.decorators=n,at(i,r),z(87),i.asteriskToken=Y(37),i.name=512&i.flags?er():re();var a=!!i.asteriskToken,o=!!(256&i.flags);return ct(54,a,o,!1,i),i.body=Dr(a,o,e.Diagnostics.or_expected),u(Z(i))}function qr(t,n,r){var i=Q(145,t);return i.decorators=n,at(i,r),z(121),ct(54,!1,!1,!1,i),i.body=Dr(!1,!1,e.Diagnostics.or_expected),u(Z(i))}function zr(e,t,n,r,i,a,o){var s=Q(144,e);s.decorators=t,at(s,n),s.asteriskToken=r,s.name=i,s.questionToken=a;var c=!!r,l=!!(256&s.flags);return ct(54,c,l,!1,s),s.body=Dr(c,l,o),u(Z(s))}function Hr(e,t,n,r,i){var a=Q(142,e);return a.decorators=t,at(a,n),a.name=r,a.questionToken=i,a.type=jt(),a.initializer=n&&64&n.flags?g(Jr):y(3,Jr),$(),Z(a)}function Yr(t,n,r){var i=Y(37),a=se(),o=Y(53);return i||17===ji||25===ji?zr(t,n,r,i,a,o,e.Diagnostics.or_expected):Hr(t,n,r,a,o)}function Jr(){return Yt(!1)}function Gr(e,t,n,r){var i=Q(e,t);return i.decorators=n,at(i,r),i.name=se(),ct(54,!1,!1,!1,i),i.body=Dr(!1,!1),Z(i)}function Xr(e){switch(e){case 112:case 110:case 111:case 113:return!0;default:return!1}}function $r(){var t;if(55===ji)return!0;for(;e.isModifierKind(ji);){if(t=ji,Xr(t))return!0;L()}if(37===ji)return!0;if(ae()&&(t=ji,L()),19===ji)return!0;if(void 0!==t){if(!e.isKeyword(t)||129===t||123===t)return!0;switch(ji){case 17:case 25:case 54:case 56:case 53:return!0;default:return X()}}return!1}function Qr(){for(var e;;){var t=M();if(!H(55))break;e||(e=[],e.pos=t);var n=Q(140,t);n.expression=S(En),e.push(Z(n))}return e&&(e.end=P()),e}function Zr(t){for(var n,r=0;;){var i=Gi.getStartPos(),a=ji;if(74===ji&&t){if(!W(fe))break}else if(!me())break;n||(n=[],n.pos=i),r|=e.modifierToFlag(a),n.push(Z(Q(a,i)))}return n&&(n.flags=r,n.end=Gi.getStartPos()),n}function ei(){var t,n=0;if(118===ji){var r=Gi.getStartPos(),i=ji;L(),t=[],t.pos=r,n|=e.modifierToFlag(i),t.push(Z(Q(i,r))),t.flags=n,t.end=Gi.getStartPos()}return t}function ti(){if(23===ji){var t=Q(194);return L(),Z(t)}var n=M(),r=Qr(),i=Zr(!0),a=Xn(n,r,i);if(a)return a;if(121===ji)return qr(n,r,i);if(dt())return ht(n,r,i);if(e.tokenIsIdentifierOrKeyword(ji)||9===ji||8===ji||37===ji||19===ji)return Yr(n,r,i);if(r||i){return Hr(n,r,i,ee(69,!0,e.Diagnostics.Declaration_expected),void 0)}e.Debug.fail("Should not have attempted to parse class member declaration.")}function ni(){return ii(Gi.getStartPos(),void 0,void 0,189)}function ri(e,t,n){return ii(e,t,n,217)}function ii(e,t,n,r){var i=Q(r,e);return i.decorators=t,at(i,n),z(73),i.name=ai(),i.typeParameters=nt(),i.heritageClauses=si(!0),z(15)?(i.members=pi(),z(16)):i.members=Ve(),Z(i)}function ai(){return q()&&!oi()?re():void 0}function oi(){return 106===ji&&j(be)}function si(e){if(li())return Ne(20,ui)}function ui(){if(83===ji||106===ji){var e=Q(246);return e.token=ji,L(),e.types=Ke(7,ci),Z(e)}}function ci(){var e=Q(191);return e.expression=En(),25===ji&&(e.typeArguments=je(18,Kt,25,27)),Z(e)}function li(){return 83===ji||106===ji}function pi(){return Ne(5,ti)}function fi(e,t,n){var r=Q(218,e);return r.decorators=t,at(r,n),z(107),r.name=re(),r.typeParameters=nt(),r.heritageClauses=si(!1),r.members=Et(),Z(r)}function di(e,t,n){var r=Q(219,e);return r.decorators=t,at(r,n),z(132),r.name=re(),r.typeParameters=nt(),z(56),r.type=Kt(),$(),Z(r)}function mi(){var e=Q(250,Gi.getStartPos());return e.name=se(),e.initializer=g(Jr),Z(e)}function hi(e,t,n){var r=Q(220,e);return r.decorators=t,at(r,n),z(81),r.name=re(),z(15)?(r.members=Ke(6,mi),z(16)):r.members=Ve(),Z(r)}function yi(){var e=Q(222,Gi.getStartPos());return z(15)?(e.statements=Ne(1,xr),z(16)):e.statements=Ve(),Z(e)}function _i(e,t,n,r){var i=Q(221,e),a=65536&r;return i.decorators=t,at(i,n),i.flags|=r,i.name=re(),i.body=H(21)?_i(M(),void 0,void 0,2|a):yi(),Z(i)}function gi(e,t,n){var r=Q(221,e);return r.decorators=t,at(r,n),134===ji?(r.name=re(),r.flags|=2097152):r.name=Je(!0),r.body=yi(),Z(r)}function vi(e,t,n){var r=n?n.flags:0;if(134===ji)return gi(e,t,n);if(H(126))r|=65536;else if(z(125),9===ji)return gi(e,t,n);return _i(e,t,n,r)}function bi(){return 127===ji&&j(Si)}function Si(){return 17===L()}function Ai(){return 39===L()}function Ti(e,t,n){z(89);var r,i=Gi.getStartPos();if(q()&&(r=re(),24!==ji&&133!==ji)){var a=Q(224,e);return a.decorators=t,at(a,n),a.name=r,z(56),a.moduleReference=Ci(),$(),Z(a)}var o=Q(225,e);return o.decorators=t,at(o,n),(r||37===ji||15===ji)&&(o.importClause=Ei(r,i),z(133)),o.moduleSpecifier=wi(),$(),Z(o)}function Ei(e,t){var n=Q(226,t);return e&&(n.name=e),n.name&&!H(24)||(n.namedBindings=37===ji?ki():xi(228)),Z(n)}function Ci(){return bi()?Ni():We(!1)}function Ni(){var e=Q(235);return z(127),z(17),e.expression=wi(),z(18),Z(e)}function wi(){if(9===ji){var e=Je();return te(e.text),e}return Ht()}function ki(){var e=Q(227);return z(37),z(116),e.name=re(),Z(e)}function xi(e){var t=Q(e);return t.elements=je(21,228===e?Ii:Ri,15,16),Z(t)}function Ri(){return Di(233)}function Ii(){return Di(229)}function Di(t){var n=Q(t),r=e.isKeyword(ji)&&!q(),i=Gi.getTokenPos(),a=Gi.getTextPos(),o=ie();return 116===ji?(n.propertyName=o,z(116),r=e.isKeyword(ji)&&!q(),i=Gi.getTokenPos(),a=Gi.getTextPos(),n.name=ie()):n.name=o,229===t&&r&&I(i,a-i,e.Diagnostics.Identifier_expected),Z(n)}function Mi(e,t,n){var r=Q(231,e);return r.decorators=t,at(r,n),H(37)?(z(133),r.moduleSpecifier=wi()):(r.exportClause=xi(232),(133===ji||9===ji&&!Gi.hasPrecedingLineBreak())&&(z(133),r.moduleSpecifier=wi())),$(),Z(r)}function Pi(e,t,n){var r=Q(230,e);return r.decorators=t,at(r,n),H(56)?r.isExportEquals=!0:z(77),r.expression=Jt(),$(),Z(r)}function Li(t){for(var n,r=e.createScanner(t.languageVersion,!1,0,Wi),i=[],a=[];;){var o=r.scan();if(2!==o){if(e.isTrivia(o))continue;break}var s={pos:r.getTokenPos(),end:r.getTextPos(),kind:r.getToken()},u=Wi.substring(s.pos,s.end),c=e.getFileReferenceFromReferencePath(u,s);if(c){var l=c.fileReference;t.hasNoDefaultLib=c.isNoDefaultLib;var p=c.diagnosticMessage;l&&i.push(l),p&&Ki.push(e.createFileDiagnostic(t,s.pos,s.end-s.pos,p))}else{var f=/^\/\/\/\s*".length-n,e.Diagnostics.Type_argument_list_cannot_be_empty)}}function v(e){var t=Q(136,e.pos);return t.left=e,t.right=ie(),Z(t)}function b(){var e=Q(260);return L(),e.members=Ke(24,S),E(e.members),z(16),Z(e)}function S(){var e=Q(261);return e.name=ue(),54===ji&&(L(),e.type=u()),Z(e)}function A(){var e=Q(259);return L(),e.type=u(),Z(e)}function T(){var e=Q(257);return L(),e.types=Ke(25,u),E(e.types),z(20),Z(e)}function E(t){if(0===Ki.length&&t.hasTrailingComma){I(t.end-",".length,",".length,e.Diagnostics.Trailing_comma_not_allowed)}}function C(){var e=Q(256);return L(),e.types=N(u()),z(18),Z(e)}function N(t){e.Debug.assert(!!t);var n=[];for(n.pos=t.pos,n.push(t);H(47);)n.push(u());return n.end=Gi.getStartPos(),n}function w(){var e=Q(253);return L(),Z(e)}function k(){var e=Gi.getStartPos();if(L(),24===ji||16===ji||18===ji||27===ji||56===ji||47===ji){var t=Q(254,e);return Z(t)}var t=Q(258,e);return t.type=u(),Z(t)}function x(e,t,n){i("file.js",e,2,!0,void 0),Bi={languageVariant:0,text:e};var r=M(t,n),a=Ki;return o(),r?{jsDocComment:r,diagnostics:a}:void 0}function D(e,t,n){var r=ji,i=Ki.length,a=$i,o=M(t,n);return o&&(o.parent=e),ji=r,Ki.length=i,$i=a,o}function M(t,n){function r(){if(v){var e=Q(268,t);return e.tags=v,Z(e,g)}}function i(){for(;5===ji||4===ji;)h()}function o(){e.Debug.assert(55===ji);var t=Q(55,Gi.getTokenPos());t.end=Gi.getTextPos(),h();var n=y();if(n){c(s(t,n)||u(t,n))}}function s(e,t){if(t)switch(t.text){case"param":return p(e,t);case"return":case"returns":return f(e,t);case"template":return m(e,t);case"type":return d(e,t)}}function u(e,t){var n=Q(269,e.pos);return n.atToken=e,n.tagName=t,Z(n)}function c(e){e&&(v||(v=[],v.pos=e.pos),v.push(e),v.end=e.end)}function l(){if(15===ji){return a()}}function p(t,n){var r=l();i();var a,o;if(Y(19)?(a=y(),o=!0,Y(56)&&Ht(),z(20)):69===ji&&(a=y()),!a)return void I(Gi.getStartPos(),0,e.Diagnostics.Identifier_expected);var s,u;r?u=a:s=a,r||(r=l());var c=Q(270,t.pos);return c.atToken=t,c.tagName=n,c.preParameterName=s,c.typeExpression=r,c.postParameterName=u,c.isBracketed=o,Z(c)}function f(t,n){e.forEach(v,function(e){return 271===e.kind})&&I(n.pos,Gi.getTokenPos()-n.pos,e.Diagnostics._0_tag_already_specified,n.text);var r=Q(271,t.pos);return r.atToken=t,r.tagName=n,r.typeExpression=l(),Z(r)}function d(t,n){e.forEach(v,function(e){return 272===e.kind})&&I(n.pos,Gi.getTokenPos()-n.pos,e.Diagnostics._0_tag_already_specified,n.text);var r=Q(272,t.pos);return r.atToken=t,r.tagName=n,r.typeExpression=l(),Z(r)}function m(t,n){e.forEach(v,function(e){return 273===e.kind})&&I(n.pos,Gi.getTokenPos()-n.pos,e.Diagnostics._0_tag_already_specified,n.text);var r=[];for(r.pos=Gi.getStartPos();;){var i=y();if(!i)return void I(Gi.getStartPos(),0,e.Diagnostics.Identifier_expected);var a=Q(138,i.pos);if(a.name=i,Z(a),r.push(a),24!==ji)break;h()}var o=Q(273,t.pos);return o.atToken=t,o.tagName=n,o.typeParameters=r,Z(o),r.end=o.end,o}function h(){return ji=Gi.scanJSDocToken()}function y(){if(69!==ji)return void R(e.Diagnostics.Identifier_expected);var t=Gi.getTokenPos(),n=Gi.getTextPos(),r=Q(69,t);return r.text=_.substring(t,n),Z(r,n),h(),r}var _=Wi;t=t||0;var g=void 0===n?_.length:t+n;n=g-t,e.Debug.assert(t>=0),e.Debug.assert(t<=g),e.Debug.assert(g<=_.length);var v,b;return 47===_.charCodeAt(t)&&42===_.charCodeAt(t+1)&&42===_.charCodeAt(t+2)&&42!==_.charCodeAt(t+3)&&Gi.scanRange(t+3,n-5,function(){var e=!0,t=!0;for(h();1!==ji;){switch(ji){case 55:e&&o(),t=!1;break;case 4:e=!0,t=!1;break;case 37:t&&(e=!1),t=!0;break;case 69:e=!1;break;case 1:}h()}b=r()}),b}t.isJSDocType=n,t.parseJSDocTypeExpressionForTests=r,t.parseJSDocTypeExpression=a,t.parseIsolatedJSDocComment=x,t.parseJSDocComment=D,t.parseJSDocCommentWorker=M}(ea=t.JSDocParser||(t.JSDocParser={}))}(f||(f={}));var d;!function(t){function n(t,n,r,i){if(i=i||e.Debug.shouldAssert(2),p(t,n,r,i),e.textChangeRangeIsUnchanged(r))return t;if(0===t.statements.length)return f.parseSourceFile(t.fileName,n,t.languageVersion,void 0,!0);var a=t;e.Debug.assert(!a.hasBeenIncrementallyParsed),a.hasBeenIncrementallyParsed=!0;var o=t.text,s=d(t),l=c(t,r);p(t,n,l,i),e.Debug.assert(l.span.start<=r.span.start),e.Debug.assert(e.textSpanEnd(l.span)===e.textSpanEnd(r.span)),e.Debug.assert(e.textSpanEnd(e.textChangeRangeNewSpan(l))===e.textSpanEnd(e.textChangeRangeNewSpan(r)));var m=e.textChangeRangeNewSpan(l).length-l.span.length;return u(a,l.span.start,e.textSpanEnd(l.span),e.textSpanEnd(e.textChangeRangeNewSpan(l)),m,o,n,i),f.parseSourceFile(t.fileName,n,t.languageVersion,s,!0)}function r(t,n,r,o,u,c){function l(t){var n="";c&&i(t)&&(n=o.substring(t.pos,t.end)),t._children&&(t._children=void 0),t.jsDocComment&&(t.jsDocComment=void 0),t.pos+=r,t.end+=r,c&&i(t)&&e.Debug.assert(n===u.substring(t.pos,t.end)),a(t,l,p),s(t,c)}function p(e){e._children=void 0,e.pos+=r,e.end+=r;for(var t=0,n=e;t=n,"Adjusting an element that was entirely before the change range"),e.Debug.assert(t.pos<=r,"Adjusting an element that was entirely after the change range"),e.Debug.assert(t.pos<=t.end),t.pos=Math.min(t.pos,i),t.end>=r?t.end+=a:t.end=Math.min(t.end,i),e.Debug.assert(t.pos<=t.end),t.parent&&(e.Debug.assert(t.pos>=t.parent.pos),e.Debug.assert(t.end<=t.parent.end))}function s(t,n){if(n){var r=t.pos;a(t,function(t){e.Debug.assert(t.pos>=r),r=t.end}),e.Debug.assert(r<=t.end)}}function u(t,n,i,u,c,l,p,f){function d(t){if(e.Debug.assert(t.pos<=t.end),t.pos>i)return void r(t,!1,c,l,p,f);var h=t.end;if(h>=n)return t.intersectsChange=!0,t._children=void 0,o(t,n,i,u,c),a(t,d,m),void s(t,f);e.Debug.assert(hi)return void r(t,!0,c,l,p,f);var a=t.end;if(a>=n){t.intersectsChange=!0,t._children=void 0,o(t,n,i,u,c);for(var s=0,m=t;s0&&i<=1;i++){var a=l(t,r);e.Debug.assert(a.pos<=r);var o=a.pos;r=Math.max(0,o-1)}var s=e.createTextSpanFromBounds(r,e.textSpanEnd(n.span)),u=n.newLength+(n.span.start-r);return e.createTextChangeRange(s,u)}function l(t,n){function r(t){var n=void 0;return a(t,function(t){e.nodeIsPresent(t)&&(n=t)}),n}function i(t){if(!e.nodeIsMissing(t))return t.pos<=n?(t.pos>=s.pos&&(s=t),nn),!0)}var o,s=t;if(a(t,i),o){var u=function(e){for(;;){var t=r(e);if(!t)return e;e=t}}(o);u.pos>s.pos&&(s=u)}return s}function p(t,n,r,i){var a=t.text;if(r&&(e.Debug.assert(a.length-r.span.length+r.newLength===n.length),i||e.Debug.shouldAssert(3))){var o=a.substr(0,r.span.start),s=n.substr(0,r.span.start);e.Debug.assert(o===s);var u=a.substring(e.textSpanEnd(r.span),a.length),c=n.substring(e.textSpanEnd(e.textChangeRangeNewSpan(r)),n.length);e.Debug.assert(u===c)}}function d(t){function n(e){function n(t){return e>=t.pos&&e=t.pos&&e=106&&t.originalKeywordKind<=114&&!e.isIdentifierName(t)&&(Re.parseDiagnostics.length||Re.bindDiagnostics.push(e.createDiagnosticForNode(t,F(t),e.declarationNameToString(t))))}function F(t){return e.getContainingClass(t)?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:Re.externalModuleIndicator?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode}function B(t){He&&e.isLeftHandSideExpression(t.left)&&e.isAssignmentOperator(t.operatorToken.kind)&&W(t,t.left)}function K(e){He&&e.variableDeclaration&&W(e,e.variableDeclaration.name)}function V(t){if(He&&69===t.expression.kind){var n=e.getErrorSpanForNode(Re,t.expression);Re.bindDiagnostics.push(e.createFileDiagnostic(Re,n.start,n.length,e.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode))}}function j(e){return 69===e.kind&&("eval"===e.text||"arguments"===e.text)}function W(t,n){if(n&&69===n.kind){var r=n;if(j(r)){var i=e.getErrorSpanForNode(Re,n);Re.bindDiagnostics.push(e.createFileDiagnostic(Re,i.start,i.length,q(t),r.text))}}}function q(t){return e.getContainingClass(t)?e.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode:Re.externalModuleIndicator?e.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode:e.Diagnostics.Invalid_use_of_0_in_strict_mode}function z(e){He&&W(e,e.name)}function H(t){He&&32768&t.flags&&Re.bindDiagnostics.push(e.createDiagnosticForNode(t,e.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode))}function Y(e){He&&W(e,e.operand)}function J(e){He&&(41!==e.operator&&42!==e.operator||W(e,e.operand))}function G(t){He&&X(t,e.Diagnostics.with_statements_are_not_allowed_in_strict_mode)}function X(t,n,r,i,a){var o=e.getSpanOfTokenAtPosition(Re,t.pos);Re.bindDiagnostics.push(e.createFileDiagnostic(Re,o.start,o.length,n,r,i,a))}function $(t){return"__"+e.indexOf(t.parent.parameters,t)}function Q(e){if(e){e.parent=De;var t=He;t||Z(e),ne(e),l(e),He=t}}function Z(t){switch(t.kind){case 251:case 222:return void ee(t.statements);case 195:return void(e.isFunctionLike(t.parent)&&ee(t.statements));case 217:case 189:return void(He=!0)}}function ee(t){for(var n=0,r=t;n1);if(e.isGlobalScopeAugmentation(n))m(Jf,n.symbol.exports);else{var r=J(t,t,e.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found);if(!r)return;r=G(r),1536&r.flags?(r=33554432&r.flags?r:p(r),f(r,n.symbol)):s(t,e.Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity,t.text)}}function y(t,n,r){for(var i in n)e.hasProperty(n,i)&&(e.hasProperty(t,i)?e.forEach(t[i].declarations,function(t,n){return function(r){return sd.add(e.createDiagnosticForNode(r,n,t))}}(i,r)):t[i]=n[i])}function _(e){if(67108864&e.flags)return e;var t=n(e);return rd[t]||(rd[t]={})}function g(e){var n=t(e);return id[n]||(id[n]={})}function v(t){return 251===t.kind&&!e.isExternalOrCommonJsModule(t)}function b(t,n,r){if(r&&e.hasProperty(t,n)){var i=t[n];if(e.Debug.assert(0==(16777216&i.flags),"Should never get an instantiated symbol here."),i.flags&r)return i;if(8388608&i.flags){var a=V(i);if(a===Qp||a.flags&r)return i}}}function S(t,n){var r=t.parent,i=t.parent.parent,a=b(r.locals,n,107455),o=b(i.symbol.members,n,107455);if(a&&o)return[a,o];e.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}function A(t,n){var i=e.getSourceFileOfNode(t),a=e.getSourceFileOfNode(n);if(i!==a){if(Hp||!qp.outFile&&!qp.out)return!0;var o=r.getSourceFiles();return e.indexOf(o,i)<=e.indexOf(o,a)}return t.pos<=n.pos?214!==t.kind||!function(t,n){var r=e.getEnclosingBlockScopeContainer(t);if(196===t.parent.parent.kind||202===t.parent.parent.kind)return N(n,t,r);if(204===t.parent.parent.kind||203===t.parent.parent.kind){return N(n,t.parent.parent.expression,r)}}(t,n):function(t,n){for(var r=e.getEnclosingBlockScopeContainer(t),i=n;i;){if(i===r)return!1;if(e.isFunctionLike(i))return!0;if(i.parent&&142===i.parent.kind&&0==(64&i.parent.flags)&&i.parent.initializer===i)return!0;i=i.parent}return!1}(t,n)}function T(t,n,r,i,a){var o,u,c,l,p=t;e:for(;t;){if(t.locals&&!v(t)&&(o=b(t.locals,n,r))){var f=!0;if(e.isFunctionLike(t)&&u&&u!==t.body&&(r&o.flags&793056&&268!==u.kind&&(f=!!(262144&o.flags)&&(u===t.type||139===u.kind||138===u.kind)),107455&r&&1&o.flags&&(f=139===u.kind||u===t.type&&139===o.valueDeclaration.kind)),f)break e;o=void 0}switch(t.kind){case 251:if(!e.isExternalOrCommonJsModule(t))break;case 221:var d=ie(t).exports;if(251===t.kind||e.isAmbientModule(t)){if(o=d.default){var m=e.getLocalSymbolForExportDefault(o);if(m&&o.flags&r&&m.name===n)break e;o=void 0}if(e.hasProperty(d,n)&&8388608===d[n].flags&&e.getDeclarationOfKind(d[n],233))break}if(o=b(d,n,8914931&r))break e;break;case 220:if(o=b(ie(t).exports,n,8&r))break e;break;case 142:case 141:if(e.isClassLike(t.parent)&&!(64&t.flags)){var h=ue(t.parent);h&&h.locals&&b(h.locals,n,107455&r)&&(c=t)}break;case 217:case 189:case 218:if(o=b(ie(t).members,n,793056&r)){if(u&&64&u.flags)return void s(p,e.Diagnostics.Static_members_cannot_reference_class_type_parameters);break e}if(189===t.kind&&32&r){var y=t.name;if(y&&n===y.text){o=t.symbol;break e}}break;case 137:if(l=t.parent.parent,(e.isClassLike(l)||218===l.kind)&&(o=b(ie(l).members,n,793056&r)))return void s(p,e.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);break;case 144:case 143:case 145:case 146:case 147:case 216:case 177:if(3&r&&"arguments"===n){o=Xp;break e}break;case 176:if(3&r&&"arguments"===n){o=Xp;break e}if(16&r){var _=t.name;if(_&&n===_.text){o=t.symbol;break e}}break;case 140:t.parent&&139===t.parent.kind&&(t=t.parent),t.parent&&e.isClassElement(t.parent)&&(t=t.parent)}u=t,t=t.parent}if(o||(o=b(Jf,n,r)),!o)return void(i&&(E(p,n,a)||s(p,i,"string"==typeof a?a:e.declarationNameToString(a))));if(i){if(c){var g=c.name;return void s(p,e.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,e.declarationNameToString(g),"string"==typeof a?a:e.declarationNameToString(a))}if(2&r){var S=oe(o);2&S.flags&&C(S,p)}}return o}function E(t,n,r){if(!t||69===t.kind&&rl(t)||Vi(t))return!1;for(var i=e.getThisContainer(t,!0),a=i;a;){if(e.isClassLike(a.parent)){var o=ie(a.parent);if(!o)break;if(hn(ct(o),n))return s(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,"string"==typeof r?r:e.declarationNameToString(r),we(o)),!0;if(a===i&&!(64&a.flags)){if(hn(Dt(o).thisType,n))return s(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,"string"==typeof r?r:e.declarationNameToString(r)),!0}}a=a.parent}return!1}function C(t,n){e.Debug.assert(0!=(2&t.flags));var r=e.forEach(t.declarations,function(t){return e.isBlockOrCatchScoped(t)?t:void 0});e.Debug.assert(void 0!==r,"Block-scoped variable declaration is undefined"),A(e.getAncestor(r,214),n)||s(n,e.Diagnostics.Block_scoped_variable_0_used_before_its_declaration,e.declarationNameToString(r.name))}function N(t,n,r){if(!n)return!1;for(var i=t;i&&i!==r&&!e.isFunctionLike(i);i=i.parent)if(i===n)return!0;return!1}function w(t){if(e.isAliasSymbolDeclaration(t)){if(224===t.kind)return t;for(;t&&225!==t.kind;)t=t.parent;return t}}function k(t){return e.forEach(t.declarations,function(t){return e.isAliasSymbolDeclaration(t)?t:void 0})}function x(t){return 235===t.moduleReference.kind?G(Y(t,e.getExternalModuleImportEqualsDeclarationExpression(t))):q(t.moduleReference,t)}function R(t){var n=Y(t,t.parent.moduleSpecifier);if(n){var r=K(n.exports.default);if(r||Yp){if(!r&&Yp)return G(n)||K(n)}else s(t.name,e.Diagnostics.Module_0_has_no_default_export,we(n));return r}}function I(e){var t=e.parent.parent.moduleSpecifier;return X(Y(e,t),t)}function D(t,n){if(794592&t.flags)return t;var r=u(t.flags|n.flags,t.name);return r.declarations=e.concatenate(t.declarations,n.declarations),r.parent=t.parent||n.parent,t.valueDeclaration&&(r.valueDeclaration=t.valueDeclaration),n.members&&(r.members=n.members),t.exports&&(r.exports=t.exports),r}function M(t,n){if(1536&t.flags){var r=Z(t);if(e.hasProperty(r,n))return K(r[n])}}function P(e,t){if(3&e.flags){var n=e.valueDeclaration.type;if(n)return K(hn(Rr(n),t))}}function L(t,n){var r=Y(t,t.moduleSpecifier),i=X(r,t.moduleSpecifier);if(i){var a=n.propertyName||n.name;if(a.text){var o=M(i,a.text),u=P(i,a.text),c=o&&u?D(u,o):o||u;return c||s(a,e.Diagnostics.Module_0_has_no_exported_member_1,z(r),e.declarationNameToString(a)),c}}}function O(e){return L(e.parent.parent.parent,e)}function U(e){return e.parent.parent.moduleSpecifier?L(e.parent.parent,e):H(e.propertyName||e.name,901119)}function F(e){return H(e.expression,901119)}function B(e){switch(e.kind){case 224:return x(e);case 226:return R(e);case 227:return I(e);case 229:return O(e);case 233:return U(e);case 230:return F(e)}}function K(e){return e&&8388608&e.flags&&!(901119&e.flags)?V(e):e}function V(t){e.Debug.assert(0!=(8388608&t.flags),"Should only get Alias here.");var n=_(t);if(n.target)n.target===Zp&&(n.target=Qp);else{n.target=Zp;var r=k(t),i=B(r);n.target===Zp?n.target=i||Qp:s(r,e.Diagnostics.Circular_definition_of_import_alias_0,we(t))}return n.target}function j(e){var t=ie(e),n=V(t);if(n){(n===Qp&&qp.isolatedModules||n!==Qp&&107455&n.flags&&!Nl(n))&&W(t)}}function W(t){var n=_(t);if(!n.referenced){n.referenced=!0;var r=k(t);230===r.kind?Ds(r.expression):233===r.kind?Ds(r.propertyName||r.name):e.isInternalModuleImportEqualsDeclaration(r)&&Ds(r.moduleReference)}}function q(t,n){return n||(n=e.getAncestor(t,224),e.Debug.assert(void 0!==n)),69===t.kind&&e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),69===t.kind||136===t.parent.kind?H(t,1536):(e.Debug.assert(224===t.parent.kind),H(t,901119))}function z(e){return e.parent?z(e.parent)+"."+we(e):we(e)}function H(t,n,r){if(!e.nodeIsMissing(t)){var i;if(69===t.kind){var a=1536===n?e.Diagnostics.Cannot_find_namespace_0:e.Diagnostics.Cannot_find_name_0;if(!(i=T(t,t.text,n,r?void 0:a,t)))return}else if(136===t.kind||169===t.kind){var o=136===t.kind?t.left:t.expression,u=136===t.kind?t.right:t.name,c=H(o,1536,r);if(!c||c===Qp||e.nodeIsMissing(u))return;if(!(i=b(Z(c),u.text,n)))return void(r||s(u,e.Diagnostics.Module_0_has_no_exported_member_1,z(c),e.declarationNameToString(u)))}else e.Debug.fail("Unknown entity name kind.");return e.Debug.assert(0==(16777216&i.flags),"Should never get an instantiated symbol here."),i.flags&n?i:V(i)}}function Y(t,n){return J(t,n,e.Diagnostics.Cannot_find_module_0)}function J(t,n,i){if(9===n.kind){var a=n,o=e.escapeIdentifier(a.text);if(void 0!==o){if(!e.isExternalModuleNameRelative(o)){var u=b(Jf,'"'+o+'"',512);if(u)return re(u)}var c=e.getResolvedModule(e.getSourceFileOfNode(t),a.text),l=c&&r.getSourceFile(c.resolvedFileName);if(l)return l.symbol?re(l.symbol):void(i&&s(a,e.Diagnostics.File_0_is_not_a_module,l.fileName));i&&s(a,i,o)}}}function G(e){return e&&re(K(e.exports["export="]))||e}function X(t,n){var r=G(t);return!r||1539&r.flags||(s(n,e.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct,we(t)),r=void 0),r}function $(e){return void 0!==e.exports["export="]}function Q(e){return An(ee(e))}function Z(e){return 1536&e.flags?ee(e):e.exports||Wp}function ee(e){var t=_(e);return t.resolvedExports||(t.resolvedExports=ne(e))}function te(t,n,r,i){for(var a in n)"default"===a||e.hasProperty(t,a)?r&&i&&"default"!==a&&e.hasProperty(t,a)&&K(t[a])!==K(n[a])&&(r[a].exportsWithDuplicate?r[a].exportsWithDuplicate.push(i):r[a].exportsWithDuplicate=[i]):(t[a]=n[a],r&&i&&(r[a]={specifierText:e.getTextOfNode(i.moduleSpecifier)}))}function ne(t){function n(t){if(t&&1952&t.flags&&!e.contains(r,t)){r.push(t);var i=d(t.exports),a=t.exports.__export;if(a){for(var o={},s={},u=0,c=a.declarations;u=o&&(a=a.substr(0,o-"...".length)+"..."),a}function Re(t,n,r){var i=e.getSingleLineStringWriter();Me().buildTypePredicateDisplay(t,i,n,r);var a=i.string();return e.releaseStringWriter(i),a}function Ie(e){if(e.symbol&&2048&e.symbol.flags){for(var t=e.symbol.declarations[0].parent;161===t.kind;)t=t.parent;if(219===t.kind)return ie(t)}}function De(t){return t&&t.parent&&222===t.parent.kind&&e.isExternalModuleAugmentation(t.parent.parent)}function Me(){function t(t){if(t.declarations&&t.declarations.length){var n=t.declarations[0];if(n.name)return e.declarationNameToString(n.name);switch(n.kind){case 189:return"(Anonymous class)";case 176:case 177:return"(Anonymous function)"}}return t.name}function n(e,n){n.writeSymbol(t(e),e)}function r(t,r,i,o,s,u){function l(e){f&&(1&s&&(16777216&e.flags?c(yt(f),e.mapper,r,i):a(f,r,i)),Ce(r,21)),f=e,n(e,r)}function p(t,n){if(t){var r=ge(t,i,n,!!(2&s));if(r&&!ve(r[0],i,1===r.length?n:_e(n))||p(ae(r?r[0]:t),_e(n)),r)for(var a=0,o=r;a0&&(24!==t&&Ne(n),Ce(n,t),Ne(n)),s(e[r],24===t?0:64)}function c(e,t,a,o,u){if((32&e.flags||!fe(e.name))&&r(e,n,i,793056,0,u),a0&&(Ce(t,24),Ne(t)),o(e[a],t,n,r,i);Ce(t,27)}}function c(e,t,n,r,a,o){if(e&&e.length){Ce(n,25);for(var s=0;s0&&(Ce(n,24),Ne(n)),i(t(e[s]),n,r,0);Ce(n,27)}}function l(e,t,n,r,i){Ce(t,17);for(var a=0;a0&&(Ce(t,24),Ne(t)),s(e[a],t,n,r,i);Ce(t,18)}function p(t,n,r,a,o){e.isIdentifierTypePredicate(t)?n.writeParameter(t.parameterName):Ee(n,97),Ne(n),Ee(n,124),Ne(n),i(t.type,n,r,a,o)}function f(e,t,n,r,a){if(8&r?(Ne(t),Ce(t,34)):Ce(t,54),Ne(t),e.typePredicate)p(e.typePredicate,t,n,r,a);else{i(kn(e),t,n,r,a)}}function d(e,t,n,r,i,a){1===i&&(Ee(t,92),Ne(t)),e.target&&32&r?c(e.target.typeParameters,e.mapper,t,n):u(e.typeParameters,t,n,r,a),l(e.parameters,t,n,r,a),f(e,t,n,r,a)}return Wf||(Wf={buildSymbolDisplay:r,buildTypeDisplay:i,buildTypeParameterDisplay:o,buildTypePredicateDisplay:p,buildParameterDisplay:s,buildDisplayForParametersAndDelimiters:l,buildDisplayForTypeParametersAndDelimiters:u,buildTypeParameterDisplayFromSymbol:a,buildSignatureDisplay:d,buildReturnTypeDisplay:f})}function Pe(t){if(t){var n=g(t);return void 0===n.isVisible&&(n.isVisible=!!function(){switch(t.kind){case 166:return Pe(t.parent.parent);case 214:if(e.isBindingPattern(t.name)&&!t.name.elements.length)return!1;case 221:case 217:case 218:case 219:case 216:case 220:case 224:if(e.isExternalModuleAugmentation(t))return!0;var n=Ke(t);return 2&e.getCombinedNodeFlags(t)||224!==t.kind&&251!==n.kind&&e.isInAmbientContext(n)?Pe(n):v(n);case 142:case 141:case 146:case 147:case 144:case 143:if(48&t.flags)return!1;case 145:case 149:case 148:case 150:case 139:case 222:case 153:case 154:case 156:case 152:case 157:case 158:case 159:case 160:case 161:return Pe(t.parent);case 226:case 227:case 229:return!1;case 138:case 251:return!0;case 230:return!1;default:e.Debug.fail("isDeclarationVisible unknown: SyntaxKind: "+t.kind)}}()),n.isVisible}return!1}function Le(t){function n(t){e.forEach(t,function(t){g(t).isVisible=!0;var r=w(t)||t;if(e.contains(a,r)||a.push(r),e.isInternalModuleImportEqualsDeclaration(t)){var i=t.moduleReference,o=Dc(i),s=T(t,o.text,901119,e.Diagnostics.Cannot_find_name_0,o);s&&n(s.declarations)}})}var r;if(t.parent&&230===t.parent.kind)r=T(t.parent,t.text,9289727,e.Diagnostics.Cannot_find_name_0,t);else if(233===t.parent.kind){var i=t.parent;r=i.parent.parent.moduleSpecifier?L(i.parent.parent,i):H(i.propertyName||i.name,9289727)}var a=[];return r&&n(r.declarations),a}function Oe(e,t){var n=Ue(e,t);if(n>=0){for(var r=Zf.length,i=n;i=0;n--){if(Fe(Zf[n],td[n]))return-1;if(Zf[n]===e&&td[n]===t)return n}return-1}function Fe(t,n){return 0===n?_(t).type:2===n?_(t).declaredType:1===n?(e.Debug.assert(!!(1024&t.flags)),t.resolvedBaseConstructorType):3===n?t.resolvedReturnType:void e.Debug.fail("Unhandled TypeSystemPropertyName "+n)}function Be(){return Zf.pop(),td.pop(),ed.pop()}function Ke(t){for(t=e.getRootDeclaration(t);t;)switch(t.kind){case 214:case 215:case 229:case 228:case 227:case 226:t=t.parent;break;default:return t.parent}}function Ve(t){var n=Dt(ae(t));return n.typeParameters?jn(n,e.map(n.typeParameters,function(e){return ef})):n}function je(e,t){var n=hn(e,t);return n?ct(n):void 0}function We(e){return e&&0!=(1&e.flags)}function qe(e){var t=ie(e);return t&&_(t).type||Xe(e)}function ze(t){switch(t.kind){case 69:return t.text;case 9:case 8:return t.text;case 137:if(e.isStringOrNumericLiteral(t.expression.kind))return t.expression.text}}function He(t){return 137===t.kind&&!e.isStringOrNumericLiteral(t.expression.kind)}function Ye(t){var n=t.parent,r=qe(n.parent);if(r===cf)return cf;if(!r||We(r))return t.initializer?Ds(t.initializer):r;var i;if(164===n.kind){var a=t.propertyName||t.name;if(He(a))return ef;var o=ze(a);if(!(i=je(r,o)||Fa(o)&&vn(r,1)||vn(r,0)))return s(a,e.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature,xe(r),e.declarationNameToString(a)),cf}else{var u=$u(r,n,!1);if(t.dotDotDotToken)i=ur(u);else{var c=""+e.indexOf(n.elements,t);if(!(i=Ai(r)?je(r,c):u))return Ei(r)?s(t,e.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2,xe(r),r.elementTypes.length,n.elements.length):s(t,e.Diagnostics.Type_0_has_no_property_1,xe(r),c),cf}}return i}function Je(e){var t=Ge(e);if(t)return Rr(t)}function Ge(t){var n=e.getJSDocTypeTag(t);if(n&&n.typeExpression)return n.typeExpression.type;if(214===t.kind&&215===t.parent.kind&&196===t.parent.parent.kind){var r=e.getJSDocTypeTag(t.parent.parent);if(r&&r.typeExpression)return r.typeExpression.type}else if(139===t.kind){var i=e.getCorrespondingJSDocParameterTag(t);if(i&&i.typeExpression)return i.typeExpression.type}}function Xe(t){if(32&t.parserContextFlags){var n=Je(t);if(n&&n!==cf)return n}if(203===t.parent.parent.kind)return tf;if(204===t.parent.parent.kind)return Xu(t.parent.parent.expression)||ef;if(e.isBindingPattern(t.parent))return Ye(t);if(t.type)return Rr(t.type);if(139===t.kind){var r=t.parent;if(147===r.kind&&!e.hasDynamicName(r)){var i=e.getDeclarationOfKind(t.parent.symbol,146);if(i)return kn(Cn(i))}var n=ia(t);if(n)return n}return t.initializer?Ds(t.initializer):249===t.kind?Hi(t.name):e.isBindingPattern(t.name)?et(t.name,!1):void 0}function $e(t,n){return t.initializer?wi(Ds(t.initializer)):e.isBindingPattern(t.name)?et(t.name,n):ef}function Qe(t,n){var r={},i=!1;e.forEach(t.elements,function(e){var t=e.propertyName||e.name;if(He(t))return void(i=!0);var a=ze(t),o=67108868|(e.initializer?536870912:0),s=u(o,a);s.type=$e(e,n),s.bindingElement=e,r[s.name]=s});var a=he(void 0,r,jp,jp,void 0,void 0);return n&&(a.pattern=t),i&&(a.flags|=67108864),a}function Ze(t,n){var r=t.elements;if(0===r.length||r[r.length-1].dotDotDotToken)return zp>=2?or(ef):kf;var i=e.map(r,function(e){return 190===e.kind?ef:$e(e,n)});if(n){var a=pr(i);return a.pattern=t,a}return lr(i)}function et(e,t){return 164===e.kind?Qe(e,t):Ze(e,t)}function tt(t,n){var r=Xe(t);if(r)return n&&Ri(t,r),248===t.kind?r:wi(r);if(r=t.dotDotDotToken?kf:ef,n&&qp.noImplicitAny){var i=e.getRootDeclaration(t);su(i)||139===i.kind&&su(i.parent)||xi(t,r)}return r}function nt(t){var n=_(t);if(!n.type){if(134217728&t.flags)return n.type=Ve(t);var r=t.valueDeclaration;if(247===r.parent.kind)return n.type=ef;if(230===r.kind)return n.type=Os(r.expression);if(184===r.kind)return n.type=vr(e.map(t.declarations,function(e){return Ds(e.right)}));if(169===r.kind&&184===r.parent.kind)return n.type=Ds(r.parent.right);if(!Oe(t,0))return cf;var i=tt(r,!0);Be()||(t.valueDeclaration.type?(i=cf,s(t.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,we(t))):(i=ef,qp.noImplicitAny&&s(t.valueDeclaration,e.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,we(t)))),n.type=i}return n.type}function rt(t){if(t){if(146===t.kind)return t.type&&Rr(t.type);var n=e.getSetAccessorTypeAnnotationNode(t);return n&&Rr(n)}}function it(t){var n=_(t);if(!n.type){if(!Oe(t,0))return cf;var r=e.getDeclarationOfKind(t,146),i=e.getDeclarationOfKind(t,147),a=void 0,o=rt(r);if(o)a=o;else{var u=rt(i);u?a=u:r&&r.body?a=es(r):(qp.noImplicitAny&&s(i,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation,we(t)),a=ef)}if(!Be()&&(a=ef,qp.noImplicitAny)){s(e.getDeclarationOfKind(t,146),e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,we(t))}n.type=a}return n.type}function at(e){var t=_(e);return t.type||(t.type=pe(65536,e)),t.type}function ot(e){var t=_(e);return t.type||(t.type=xt(ae(e))),t.type}function st(e){var t=_(e);if(!t.type){var n=V(e);t.type=107455&n.flags?ct(n):cf}return t.type}function ut(e){var t=_(e);return t.type||(t.type=Hr(ct(t.target),t.mapper)),t.type}function ct(e){return 16777216&e.flags?ut(e):7&e.flags?nt(e):9136&e.flags?at(e):8&e.flags?ot(e):98304&e.flags?it(e):8388608&e.flags?st(e):cf}function lt(e){return 4096&e.flags?e.target:e}function pt(t,n){function r(t){var i=lt(t);return i===n||e.forEach(At(i),r)}return r(t)}function ft(t,n){for(var r=0,i=n;r0}function gt(t){return e.getClassExtendsHeritageClauseElement(t.symbol.valueDeclaration)}function vt(t,n){var r=n?n.length:0;return e.filter(_n(t,1),function(e){return(e.typeParameters?e.typeParameters.length:0)===r})}function bt(t,n){var r=vt(t,n);if(n){var i=e.map(n,Rr);r=e.map(r,function(e){return Rn(e,i)})}return r}function St(t){if(!t.resolvedBaseConstructorType){var n=gt(t);if(!n)return t.resolvedBaseConstructorType=sf;if(!Oe(t,1))return cf;var r=Os(n.expression);if(80896&r.flags&&on(r),!Be())return s(t.symbol.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,we(t.symbol)),t.resolvedBaseConstructorType=cf;if(r!==cf&&r!==uf&&!_t(r))return s(n.expression,e.Diagnostics.Type_0_is_not_a_constructor_function_type,xe(r)),t.resolvedBaseConstructorType=cf;t.resolvedBaseConstructorType=r}return t.resolvedBaseConstructorType}function At(t){var n=32&t.symbol.flags,r=64&t.symbol.flags;return t.resolvedBaseTypes||(n||r||e.Debug.fail("type must be class or interface"),n&&Tt(t),r&&Ct(t)),t.resolvedBaseTypes}function Tt(t){t.resolvedBaseTypes=t.resolvedBaseTypes||jp;var n=St(t);if(80896&n.flags){var r,i=gt(t),a=n&&n.symbol?Dt(n.symbol):void 0;if(n.symbol&&32&n.symbol.flags&&Et(a))r=Wn(i,n.symbol);else{var o=bt(n,i.typeArguments);if(!o.length)return void s(i.expression,e.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments);r=kn(o[0])}if(r!==cf)return 3072<(r).flags?t===r||pt(r,t)?void s(t.symbol.valueDeclaration,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,xe(t,void 0,1)):void(t.resolvedBaseTypes===jp?t.resolvedBaseTypes=[r]:t.resolvedBaseTypes.push(r)):void s(i.expression,e.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type,xe(r))}}function Et(e){var t=e.outerTypeParameters;if(t){var n=t.length-1,r=e.typeArguments;return t[n].symbol!==r[n].symbol}return!0}function Ct(t){t.resolvedBaseTypes=t.resolvedBaseTypes||jp;for(var n=0,r=t.symbol.declarations;n0)return;for(var i=1;i1&&(l=Yt(u),l.resolvedReturnType=void 0,l.unionSignatures=c),(i||(i=[])).push(l)}}}return i||jp}function en(e,t){for(var n=[],r=0,i=e;r=0),a>=i.minArgumentCount}return!1}function En(e){if(69===e.parameterName.kind){var t=e.parameterName;return{kind:1,parameterName:t?t.text:void 0,parameterIndex:t?js(e.parent.parameters,t):void 0,type:Rr(e.type)}}return{kind:0,type:Rr(e.type)}}function Cn(t){var n=g(t);if(!n.resolvedSignature){for(var r=145===t.kind?wt(re(t.parent.symbol)):void 0,i=r?r.localTypeParameters:t.typeParameters?Sn(t.typeParameters):bn(t),a=[],o=!1,s=-1,u=e.isJSDocConstructSignature(t),c=void 0,l=void 0,p=u?1:0,f=t.parameters.length;p0&&i.body){var a=e.declarations[n-1];if(i.parent===a.parent&&i.kind===a.kind&&i.pos===a.end)break}t.push(Cn(i))}}return t}function wn(e){var t=Y(e,e);if(t){var n=G(t);if(n)return ct(n)}return ef}function kn(t){if(!t.resolvedReturnType){if(!Oe(t,3))return cf;var n=void 0;if(n=t.target?Hr(kn(t.target),t.mapper):t.unionSignatures?vr(e.map(t.unionSignatures,kn)):es(t.declaration),!Be()&&(n=ef,qp.noImplicitAny)){var r=t.declaration;r.name?s(r.name,e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,e.declarationNameToString(r.name)):s(r,e.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions)}t.resolvedReturnType=n}return t.resolvedReturnType}function xn(t){if(t.hasRestParameter){var n=ct(e.lastOrUndefined(t.parameters));if(4096&n.flags&&n.target===gf)return n.typeArguments[0]}return ef}function Rn(e,t){return Wr(e,Pr(e.typeParameters,t),!0)}function In(e){return e.typeParameters?(e.erasedSignatureCache||(e.target?e.erasedSignatureCache=Wr(In(e.target),e.mapper):e.erasedSignatureCache=Wr(e,Ur(e.typeParameters),!0)),e.erasedSignatureCache):e}function Dn(e){if(!e.isolatedSignatureType){var t=145===e.declaration.kind||149===e.declaration.kind,n=pe(327680);n.members=Wp,n.properties=jp,n.callSignatures=t?jp:[e],n.constructSignatures=t?[e]:jp,e.isolatedSignatureType=n}return e.isolatedSignatureType}function Mn(e){return e.members.__index}function Pn(e,t){var n=1===t?128:130,r=Mn(e);if(r)for(var i=0,a=r.declarations;i0&&(t+=","),t+=e[n].id;return t}return""}function Vn(e){for(var t=0,n=0,r=e;n0;)t--,hr(e[t],e)&&e.splice(t,1)}function _r(e){for(var t=0,n=e;t0&&e.length>1;)n--,e[n]===t&&e.splice(n,1)}function vr(e,t){if(0===e.length)return pf;var n=[];if(mr(n,e,16384),_r(n))return ef;if(t?(gr(n,sf),gr(n,uf)):yr(n),1===n.length)return n[0];var r=Kn(n),i=Xf[r];return i||(i=Xf[r]=pe(16384|Vn(n)),i.types=n),i}function br(t){var n=g(t);return n.resolvedType||(n.resolvedType=vr(e.map(t.types,Rr),!0)),n.resolvedType}function Sr(e){if(0===e.length)return lf;var t=[];if(mr(t,e,32768),_r(t))return ef;if(1===t.length)return t[0];var n=Kn(t),r=$f[n];return r||(r=$f[n]=pe(32768|Vn(t)),r.types=t),r}function Ar(t){var n=g(t);return n.resolvedType||(n.resolvedType=Sr(e.map(t.types,Rr))),n.resolvedType}function Tr(e){var t=g(e);return t.resolvedType||(t.resolvedType=pe(65536,e.symbol)),t.resolvedType}function Er(t){if(e.hasProperty(Qf,t))return Qf[t];var n=Qf[t]=ce(256);return n.text=t,n}function Cr(e){var t=g(e);return t.resolvedType||(t.resolvedType=Er(e.text)),t.resolvedType}function Nr(e){var t=g(e);if(!t.resolvedType){var n=Rr(e.type);t.resolvedType=n?ur(n):cf}return t.resolvedType}function wr(t){var n=g(t);if(!n.resolvedType){var r=e.map(t.types,Rr);n.resolvedType=lr(r)}return n.resolvedType}function kr(t){var n=e.getThisContainer(t,!1),r=n&&n.parent;return!r||!e.isClassLike(r)&&218!==r.kind||64&n.flags||145===n.kind&&!e.isNodeDescendentOf(t,n.body)?(s(t,e.Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface),cf):wt(ie(r)).thisType}function xr(e){var t=g(e);return t.resolvedType||(t.resolvedType=kr(e)),t.resolvedType}function Rr(e){switch(e.kind){case 117:case 253:case 254:return ef;case 130:return tf;case 128:return nf;case 120:return rf;case 131:return af;case 103:return of;case 162:return xr(e);case 163:return Cr(e);case 152:case 262:return Gn(e);case 151:return rf;case 191:return Gn(e);case 155:return Xn(e);case 157:case 255:return cr(e);case 158:return fr(e);case 159:case 256:return br(e);case 160:return Ar(e);case 161:case 258:case 259:case 266:case 267:case 263:return Rr(e.type);case 153:case 154:case 156:case 264:case 260:return Tr(e);case 69:case 136:var t=ul(e);return t&&Dt(t);case 257:return wr(e);case 265:return Nr(e);default:return cf}}function Ir(e,t,n){if(e&&e.length){for(var r=[],i=0,a=e;in.parameters.length)return 0;t=In(t),n=In(n);for(var s=-1,u=si(t),c=si(n),l=ui(t,u,n,c),p=t.parameters,f=n.parameters,d=0;d0){for(var u=0;u=5)for(var r=e.symbol,i=0,a=0;a=5)return!0}return!1}function fi(e,t){return 0!==di(e,t,$r)}function di(e,t,n){if(e===t)return-1;var r=48&ao(e);if(r!==(48&ao(t)))return 0;if(r){if(gc(e)!==gc(t))return 0}else if((536870912&e.flags)!=(536870912&t.flags))return 0;return n(ct(e),ct(t))}function mi(e,t,n){return e.parameters.length===t.parameters.length&&e.minArgumentCount===t.minArgumentCount&&e.hasRestParameter===t.hasRestParameter||!!(n&&e.minArgumentCount<=t.minArgumentCount&&(e.hasRestParameter&&!t.hasRestParameter||e.hasRestParameter===t.hasRestParameter&&e.parameters.length>=t.parameters.length))}function hi(e,t,n,r,i){if(e===t)return-1;if(!mi(e,t,n))return 0;if((e.typeParameters?e.typeParameters.length:0)!==(t.typeParameters?t.typeParameters.length:0))return 0;e=In(e),t=In(t);for(var a=-1,o=t.parameters.length,s=0;s=e.parameters.length-1}function _i(e,t){for(var n=0,r=t;no&&(i=t[s],a=c,o=u),o===t.length-1)break}ti(a,i,n,e.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0,r)}function bi(e){return 4096&e.flags&&e.target===gf}function Si(e){return!(96&e.flags)&&ei(e,kf)}function Ai(e){return!!hn(e,"0")}function Ti(e){return 256&e.flags}function Ei(e){return!!(8192&e.flags)}function Ci(e){if(1048576&e.flags){var t=e.regularType;return t||(t=ce(e.flags&-1048577),t.symbol=e.symbol,t.members=e.members,t.properties=e.properties,t.callSignatures=e.callSignatures,t.constructSignatures=e.constructSignatures,t.stringIndexType=e.stringIndexType,t.numberIndexType=e.numberIndexType,e.regularType=t),t}return e}function Ni(t){var n=sn(t),r={};e.forEach(n,function(e){var t=ct(e),n=wi(t);if(t!==n){var i=u(67108864|e.flags,e.name);i.declarations=e.declarations,i.parent=e.parent,i.type=n,i.target=e,e.valueDeclaration&&(i.valueDeclaration=e.valueDeclaration),e=i}r[e.name]=e});var i=vn(t,0),a=vn(t,1);return i&&(i=wi(i)),a&&(a=wi(a)),he(t.symbol,r,jp,jp,i,a)}function wi(t){if(6291456&t.flags){if(96&t.flags)return ef;if(524288&t.flags)return Ni(t);if(16384&t.flags)return vr(e.map(t.types,wi),!0);if(bi(t))return ur(wi(t.typeArguments[0]));if(Ei(t))return lr(e.map(t.elementTypes,wi))}return t}function ki(t){var n=!1;if(16384&t.flags)for(var r=0,i=t.types;ra?i:a,i--,a--):e.hasRestParameter?(i--,r=a):t.hasRestParameter?(a--,r=i):r=it)&&(e.failedTypeParameterIndex=t)}return r}function Bi(e){for(var t=0;t=56&&n.operatorToken.kind<=68){var r=zi(n.left);if(69===r.kind&&Ki(r)===t)return!0}return e.forEachChild(n,a)}function i(n){return!(e.isBindingPattern(n.name)||ie(n)!==t||!ji(n))||e.forEachChild(n,a)}function a(t){switch(t.kind){case 184:return r(t);case 214:case 166:return i(t);case 164:case 165:case 167:case 168:case 169:case 170:case 171:case 172:case 174:case 192:case 175:case 182:case 178:case 181:case 179:case 180:case 183:case 187:case 185:case 188:case 195:case 196:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 207:case 208:case 209:case 244:case 245:case 210:case 211:case 212:case 247:case 236:case 237:case 241:case 242:case 238:case 243:return e.forEachChild(t,a)}return!1}var o=g(n);if(o.assignmentChecks){var s=o.assignmentChecks[t.id];if(void 0!==s)return s}else o.assignmentChecks={};return o.assignmentChecks[t.id]=a(n)}function qi(t,n){function r(n,r,i){function a(e){return i===!!(e.flags&c)}if(179!==r.left.kind||9!==r.right.kind)return n;var o=r.left,s=r.right;if(69!==o.expression.kind||Ki(o.expression)!==t)return n;33===r.operatorToken.kind&&(i=!i);var u=ud[s.text];if(u&&u.type===sf)return n;var c;return u?c=u.flags:(i=!i,c=16777614),16384&n.flags?vr(e.filter(n.types,a),!0):i&&u&&Zr(u.type,n)?u.type:a(n)?n:pf}function i(e,t,n){return n?p(p(e,t.left,!0),t.right,!0):vr([p(e,t.left,!1),p(e,t.right,!1)])}function a(e,t,n){return n?vr([p(e,t.left,!0),p(e,t.right,!0)]):p(p(e,t.left,!1),t.right,!1)}function o(n,r,i){if(We(n)||69!==r.left.kind||Ki(r.left)!==t)return n;var a=Os(r.right);if(!Zr(a,_f))return n;var o,u=hn(a,"prototype");if(u){var c=ct(u);We(c)||(o=c)}if(!o){var l=void 0;2048&a.flags?l=Vt(a).declaredConstructSignatures:65536&a.flags&&(l=_n(a,1)),l&&l.length&&(o=vr(e.map(l,function(e){return kn(In(e))})))}return o?s(n,o,i):n}function s(t,n,r){if(!r)return 16384&t.flags?vr(e.filter(t.types,function(e){return!Zr(e,n)})):t;if(16384&t.flags){var i=e.filter(t.types,function(e){return ei(e,n)});if(i.length)return vr(i)}return ei(n,t)?n:t}function u(n,r,i){if(1&n.flags)return n;var a=Wo(r),o=a.typePredicate;if(!o)return n;if(!e.isIdentifierTypePredicate(o)){return c(n,o,zi(r.expression),i)}return r.arguments[o.parameterIndex]&&l(r.arguments[o.parameterIndex])===t?s(n,o.type,i):n}function c(e,n,r,i){if(170===r.kind||169===r.kind){var a=r,o=zi(a.expression);if(69===o.kind&&l(o)===t)return s(e,n.type,i)}return e}function l(e){switch(e=zi(e),e.kind){case 69:case 169:return sl(e)}}function p(e,t,n){switch(t.kind){case 171:return u(e,t,n);case 175:return p(e,t.expression,n);case 184:var s=t.operatorToken.kind;if(32===s||33===s)return r(e,t,n);if(51===s)return i(e,t,n);if(52===s)return a(e,t,n);if(91===s)return o(e,t,n);break;case 182:if(49===t.operator)return p(e,t.operand,!n)}return e}var f=ct(t);if(n&&3&t.flags&&(We(f)||97792&f.flags)){var d=e.getDeclarationOfKind(t,214),m=d&&Ke(d),h=f,y=[];e:for(;n.parent;){var _=n;switch(n=n.parent,n.kind){case 199:case 185:case 184:y.push({node:n,child:_});break;case 251:case 221:break e}if(n===m)break}for(var g=void 0;g=y.pop();){var v=g.node,_=g.child;switch(v.kind){case 199:_!==v.expression&&(f=p(f,v.expression,_===v.thenStatement));break;case 185:_!==v.condition&&(f=p(f,v.condition,_===v.whenTrue));break;case 184:_===v.right&&(51===v.operatorToken.kind?f=p(f,v.left,!0):52===v.operatorToken.kind&&(f=p(f,v.left,!1)));break;default:e.Debug.fail("Unreachable!")}f!==h&&Wi(t,v)&&(f=h)}f===pf&&(f=h)}return f}function zi(e){for(;175===e.kind;)e=e.expression;return e}function Hi(t){var n=Ki(t);if(n===Xp){var r=e.getContainingFunction(t);177===r.kind&&zp<2&&s(t,e.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression),8&t.parserContextFlags&&(g(r).flags|=8192)}8388608&n.flags&&!Vi(t)&&!Nl(V(n))&&W(n);var i=oe(n);if(2===zp&&32&i.flags&&217===i.valueDeclaration.kind&&e.nodeIsDecorated(i.valueDeclaration))for(var r=e.getContainingClass(t);void 0!==r;){if(r===i.valueDeclaration&&r.name!==t){g(r).flags|=524288,g(t).flags|=1048576;break}r=e.getContainingClass(r)}return Du(t,t),Ru(t,t),Ji(t,n),qi(i,t)}function Yi(t,n){for(var r=t;r&&r!==n;){if(e.isFunctionLike(r))return!0;r=r.parent}return!1}function Ji(t,n){if(!(zp>=2||0==(34&n.flags)||247===n.valueDeclaration.parent.kind)){for(var r=e.getEnclosingBlockScopeContainer(n.valueDeclaration),i=Yi(t.parent,r),a=r,o=!1;a&&!e.nodeStartsNewLexicalEnvironment(a);){if(e.isIterationStatement(a,!1)){o=!0;break}a=a.parent}o&&(i&&(g(a).flags|=65536),202===r.kind&&e.getAncestor(n.valueDeclaration,215).parent===r&&Gi(t,r)&&(g(n.valueDeclaration).flags|=2097152),g(n.valueDeclaration).flags|=262144),i&&(g(n.valueDeclaration).flags|=131072)}}function Gi(t,n){for(var r=t;175===r.parent.kind;)r=r.parent;var i=!1;if(184===r.parent.kind&&(i=r.parent.left===r&&e.isAssignmentOperator(r.parent.operatorToken.kind)),182===r.parent.kind||183===r.parent.kind){var a=r.parent;i=41===a.operator||42===a.operator}if(!i)return!1;for(;r!==n;){if(r===n.statement)return!0;r=r.parent}return!1}function Xi(e,t){if(g(e).flags|=2,142===t.kind||145===t.kind){g(t.parent).flags|=4}else g(t).flags|=4}function $i(t){if(e.isSuperCallExpression(t))return t;if(!e.isFunctionLike(t))return e.forEachChild(t,$i)}function Qi(e){var t=g(e);return void 0===t.hasSuperCall&&(t.superCall=$i(e.body),t.hasSuperCall=!!t.superCall),t.superCall}function Zi(e){return St(Dt(ie(e)))===uf}function ea(t){var n=e.getThisContainer(t,!0),r=!1;if(145===n.kind){var i=n.parent;if(e.getClassExtendsHeritageClauseElement(i)&&!Zi(i)){var a=Qi(n);(!a||a.end>t.pos)&&s(t,e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class)}}switch(177===n.kind&&(n=e.getThisContainer(n,!1),r=zp<2),n.kind){case 221:s(t,e.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 220:s(t,e.Diagnostics.this_cannot_be_referenced_in_current_location);break;case 145:na(t,n)&&s(t,e.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);break;case 142:case 141:64&n.flags&&s(t,e.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);break;case 137:s(t,e.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name)}if(r&&Xi(t,n),e.isClassLike(n.parent)){var o=ie(n.parent);return 64&n.flags?ct(o):Dt(o).thisType}if(e.isInJavaScriptFile(t)){var u=ta(n);if(u&&u!==cf)return u;if(176===n.kind&&3===e.getSpecialPropertyAssignmentKind(n.parent)){var c=n.parent.left.expression.expression,l=Os(c).symbol;if(l&&l.members&&16&l.flags)return qo(l)}}return ef}function ta(t){var n=e.getJSDocTypeTag(t);if(n&&n.typeExpression&&n.typeExpression.type&&264===n.typeExpression.type.kind){var r=n.typeExpression.type;if(r.parameters.length>0&&267===r.parameters[0].type.kind)return Rr(r.parameters[0].type)}}function na(e,t){for(var n=e;n&&n!==t;n=n.parent)if(139===n.kind)return!0;return!1}function ra(t){var n=171===t.parent.kind&&t.parent.expression===t,r=e.getSuperContainer(t,!0),i=!1;if(!n)for(;r&&177===r.kind;)r=e.getSuperContainer(r,!0),i=zp<2;var a=function(t){return!!t&&(n?145===t.kind:!(!e.isClassLike(t.parent)&&168!==t.parent.kind)&&(64&t.flags?144===t.kind||143===t.kind||146===t.kind||147===t.kind:144===t.kind||143===t.kind||146===t.kind||147===t.kind||142===t.kind||141===t.kind||145===t.kind))}(r),o=0;if(!a){for(var u=t;u&&u!==r&&137!==u.kind;)u=u.parent;return u&&137===u.kind?s(t,e.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name):n?s(t,e.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors):r&&r.parent&&(e.isClassLike(r.parent)||168===r.parent.kind)?s(t,e.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class):s(t,e.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions),cf}if(o=64&r.flags||n?512:256,g(t).flags|=o,144===r.kind&&256&r.flags&&(e.isSuperPropertyOrElementAccess(t.parent)&&Ia(t.parent)?g(r).flags|=4096:g(r).flags|=2048),i&&Xi(t.parent,r),168===r.parent.kind)return zp<2?(s(t,e.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher),cf):ef;var c=r.parent,l=Dt(ie(c)),p=l&&At(l)[0];return p?145===r.kind&&na(t,r)?(s(t,e.Diagnostics.super_cannot_be_referenced_in_constructor_arguments),cf):512===o?St(l):p:(e.getClassExtendsHeritageClauseElement(c)||s(t,e.Diagnostics.super_can_only_be_referenced_in_a_derived_class),cf)}function ia(t){var n=t.parent;if((wa(n)||e.isObjectLiteralMethod(n))&&Yr(n)){var r=xa(n);if(r){var i=e.hasRestParameter(n),a=n.parameters.length-(i?1:0),o=e.indexOf(n.parameters,t);if(o=0){return Jo(Wo(t),i)}}function pa(e,t){if(173===e.parent.kind)return la(e.parent,t)}function fa(e){var t=e.parent,n=t.operatorToken.kind;if(n>=56&&n<=68){if(e===t.right)return Os(t.left)}else{if(52===n){var r=Ca(t);return r||e!==t.right||(r=Os(t.left)),r}if((51===n||24===n)&&e===t.right)return Ca(t)}}function da(e,t){if(!(16384&e.flags))return t(e);for(var n,r,i=e.types,a=0,o=i;a=2?Zu(r,void 0):void 0)}}function Aa(e){var t=e.parent;return e===t.whenTrue||e===t.whenFalse?Ca(t):void 0}function Ta(t){var n=t.kind,r=t.parent,i=$a(r);if(241===t.kind){if(!i||We(i))return;return je(i,t.name.text)}if(242===t.kind)return i;e.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind["+n+"]")}function Ea(e){var t=Ca(e);return t&&fn(t)}function Ca(t){if(!Zc(t)){if(t.contextualType)return t.contextualType;var n=t.parent;switch(n.kind){case 214:case 139:case 142:case 141:case 166:return aa(t);case 177:case 207:return oa(t);case 187:return sa(n);case 171:case 172:return la(n,t);case 174:case 192:return Rr(n.type);case 184:return fa(t);case 248:return ba(n);case 167:return Sa(t);case 185:return Aa(t);case 193:return e.Debug.assert(186===n.parent.kind),pa(n.parent,t);case 175:return Ca(n);case 243:return Ca(n);case 241:case 242:return Ta(n)}}}function Na(e){var t=yn(e,0);if(1===t.length){var n=t[0];if(!n.typeParameters)return n}}function wa(e){return 176===e.kind||177===e.kind}function ka(t){return wa(t)||e.isObjectLiteralMethod(t)?xa(t):void 0}function xa(t){e.Debug.assert(144!==t.kind||e.isObjectLiteralMethod(t));var n=e.isObjectLiteralMethod(t)?va(t):Ea(t);if(n){if(!(16384&n.flags))return Na(n);for(var r,i=n.types,a=0,o=i;a=2?Zu(p,void 0):void 0);f&&a.push(f)}else{var d=Os(l,n);a.push(d)}i=i||188===l.kind}if(!i){if(o&&a.length){var d=pr(a);return d.pattern=t,d}var m=Ea(t);if(m&&_a(m)){var h=m.pattern;if(h&&(165===h.kind||167===h.kind))for(var y=h.elements,_=a.length;_0&&u[0],l=c&&kn(c),p=l&&(0===c.parameters.length?lf:ct(c.parameters[0]));if(l&&ei(l,jf)){var f=Ya(ld.IntrinsicAttributes);return f!==cf&&(p=nn(f,p)),n.resolvedJsxType=p}}if(a&&ci(i,a,fd,t,e.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements),We(i))return n.resolvedJsxType=i;var d=Xa();if(void 0===d)return n.resolvedJsxType=ef;if(""===d)return n.resolvedJsxType=i;var m=je(i,d);if(m){if(We(m)||m===cf)return n.resolvedJsxType=m;if(16384&m.flags)return s(t.tagName,e.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type,xe(m)),n.resolvedJsxType=ef;var h=m,y=Ya(ld.IntrinsicClassAttributes);if(y!==cf){var _=ht(y.symbol);_?1===_.length&&(h=nn(jn(y,[i]),h)):h=nn(m,y)}var v=Ya(ld.IntrinsicAttributes);return v!==cf&&(h=nn(v,h)),n.resolvedJsxType=h}return n.resolvedJsxType=lf}return 1&n.jsxFlags?n.resolvedJsxType=ct(r):2&n.jsxFlags?n.resolvedJsxType=Ln(r,0):n.resolvedJsxType=ef}return n.resolvedJsxType}function Qa(e){return hn($a(e.parent),e.name.text)||Qp}function Za(){return Kf||(Kf=nr(ld.JSX,ld.ElementClass)),Kf}function eo(){var e=Ya(ld.IntrinsicElements);return e?ln(e):jp}function to(t){0===(qp.jsx||0)&&s(t,e.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided),void 0===jf&&qp.noImplicitAny&&s(t,e.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist)}function no(t){pp(t),to(t);var n=2===qp.jsx?e.Diagnostics.Cannot_find_name_0:void 0,r=qp.reactNamespace?qp.reactNamespace:"React",i=T(t.tagName,r,107455,n,r);i&&(_(i).referenced=!0);for(var a=$a(t),o={},u=!1,c=t.attributes.length-1;c>=0;c--)if(241===t.attributes[c].kind)za(t.attributes[c],a,o);else{e.Debug.assert(242===t.attributes[c].kind);var l=Ha(t.attributes[c],a,o);We(l)&&(u=!0)}if(a&&!u)for(var p=ln(a),c=0;c=0)return yi(r,s);if(!r.hasRestParameter&&i>r.parameters.length)return!1;var d=i>=r.minArgumentCount;return o||d}function To(e){if(80896&e.flags){var t=on(e);if(1===t.callSignatures.length&&0===t.constructSignatures.length&&0===t.properties.length&&!t.stringIndexType&&!t.numberIndexType)return t.callSignatures[0]}}function Eo(e,t,n){var r=Di(e.typeParameters,!0);return Ii(t,e,function(e,t){Pi(r,Hr(e,n),t)}),Rn(e,Bi(r))}function Co(e,t,n,r,i){for(var a=t.typeParameters,o=Fr(i),s=0;s=3?3:2;case 139:return 3}}function Ro(t){if(217===t.kind){var n=ie(t);return ct(n)}if(139===t.kind&&(t=t.parent,145===t.kind)){var n=ie(t);return ct(n)}return 142===t.kind||144===t.kind||146===t.kind||147===t.kind?dl(t):(e.Debug.fail("Unsupported decorator target."),cf)}function Io(t){if(217===t.kind)return e.Debug.fail("Class decorators should not have a second synthetic argument."),cf;if(139===t.kind&&(t=t.parent,145===t.kind))return ef;if(142===t.kind||144===t.kind||146===t.kind||147===t.kind){var n=t;switch(n.name.kind){case 69:case 8:case 9:return Er(n.name.text);case 137:var r=Ba(n.name);return hs(r,16777216)?r:tf;default:return e.Debug.fail("Unsupported property name."),cf}}return e.Debug.fail("Unsupported decorator target."),cf}function Do(t){if(217===t.kind)return e.Debug.fail("Class decorators should not have a third synthetic argument."),cf;if(139===t.kind)return nf;if(142===t.kind)return e.Debug.fail("Property decorators should not have a third synthetic argument."),cf;if(144===t.kind||146===t.kind||147===t.kind){return ir(pl(t))}return e.Debug.fail("Unsupported decorator target."),cf}function Mo(t,n){return 0===n?Ro(t.parent):1===n?Io(t.parent):2===n?Do(t.parent):(e.Debug.fail("Decorators should not have a fourth synthetic argument."),cf)}function Po(e,t,n){return 140===e.kind?Mo(e,t):0===t&&173===e.kind?Tf:void 0}function Lo(e,t,n){if(140!==e.kind&&(0!==n||173!==e.kind))return t[n]}function Oo(e,t,n){return 140===e.kind?e.expression:0===t&&173===e.kind?e.template:n}function Uo(t,n,r,a){function o(n,r,i,o){var s;s=e.chainDiagnosticMessages(s,n,r,i,o),a&&(s=e.chainDiagnosticMessages(s,a)),sd.add(e.createDiagnosticForNodeFromMessageChain(t,s))}function s(n,r){for(var i=0,a=n;i1&&(g=s(p,pd)),g||(h=void 0,y=void 0,_=void 0,g=s(p,fd)),g)return g;if(h)wo(t,d,h,fd,void 0,!0);else if(y)if(c||l||!u){e.Debug.assert(_.failedTypeParameterIndex>=0);var v=y.typeParameters[_.failedTypeParameterIndex],b=Ui(_,_.failedTypeParameterIndex),S=e.chainDiagnosticMessages(void 0,e.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly,xe(v));a&&(S=e.chainDiagnosticMessages(S,a)),vi(b,t.expression||t.tag,S)}else{var A=t.typeArguments;No(y,A,e.map(A,Rr),!0,a)}else o(e.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target);if(!i)for(var T=0,E=p;T=0&&s(t.arguments[r],e.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher)}var i=Os(t.expression);if((i=fn(i))===cf)return vo(t);var a=i.symbol&&vc(i.symbol);if(a&&128&a.flags)return s(t,e.Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0,e.declarationNameToString(a.name)),vo(t);if(We(i))return t.typeArguments&&s(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),go(t);var o=_n(i,1);if(o.length)return Uo(t,o,n);var u=_n(i,0);if(u.length){var c=Uo(t,u,n);return kn(c)!==of&&s(t,e.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword),c}return s(t,e.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature),vo(t)}function Ko(t,n){var r=Os(t.tag),i=fn(r);if(i===cf)return vo(t);var a=_n(i,0);return We(r)||!a.length&&!(16384&r.flags)&&ei(r,_f)?go(t):a.length?Uo(t,a,n):(s(t,e.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature),vo(t))}function Vo(t){switch(t.parent.kind){case 217:case 189:return e.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;case 139:return e.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;case 142:return e.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;case 144:case 146:case 147:return e.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression}}function jo(t,n){var r=Os(t.expression),i=fn(r);if(i===cf)return vo(t);var a=_n(i,0);if(r===ef||!a.length&&!(16384&r.flags)&&ei(r,_f))return go(t);var o=Vo(t);if(!a.length){var s=void 0;return s=e.chainDiagnosticMessages(s,e.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature),s=e.chainDiagnosticMessages(s,o),sd.add(e.createDiagnosticForNodeFromMessageChain(t,s)),vo(t)}return Uo(t,a,n,o)}function Wo(t,n){var r=g(t);return r.resolvedSignature&&!n||(r.resolvedSignature=Hf,171===t.kind?r.resolvedSignature=Fo(t,n):172===t.kind?r.resolvedSignature=Bo(t,n):173===t.kind?r.resolvedSignature=Ko(t,n):140===t.kind?r.resolvedSignature=jo(t,n):e.Debug.fail("Branch in 'getResolvedSignature' should be unreachable.")),r.resolvedSignature}function qo(e){var t=_(e);return t.inferredClassType||(t.inferredClassType=he(void 0,e.members,jp,jp,void 0,void 0)),t.inferredClassType}function zo(t){tp(t,t.typeArguments)||rp(t,t.arguments);var n=Wo(t);if(95===t.expression.kind)return of;if(172===t.kind){var r=n.declaration;if(r&&145!==r.kind&&149!==r.kind&&154!==r.kind&&!e.isJSDocConstructSignature(r)){var i=Os(t.expression).symbol;return i&&i.members&&16&i.flags?qo(i):(qp.noImplicitAny&&s(t,e.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type),ef)}}return e.isInJavaScriptFile(t)&&e.isRequireCall(t,!0)?wn(t.arguments[0]):kn(n)}function Ho(e){return kn(Wo(e))}function Yo(t){var n=Ci(Os(t.expression)),r=Rr(t.type);if(i&&r!==cf){var a=wi(n);ms(r,258)&&ms(a,258)||ei(r,a)||ni(n,r,t,e.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other)}return r}function Jo(e,t){return e.hasRestParameter?t=56&&p<=68){ss(t,e.Diagnostics.Invalid_left_hand_side_of_assignment_expression,e.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant)&&ni(n,f,t,void 0)}}function l(){s(o||n,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2,e.tokenToString(n.kind),xe(f),xe(d))}var p=n.kind;if(56===p&&(168===t.kind||167===t.kind))return As(t,Os(r,a),a);var f=Os(t,a),d=Os(r,a);switch(p){case 37:case 38:case 59:case 60:case 39:case 61:case 40:case 62:case 36:case 58:case 43:case 63:case 44:case 64:case 45:case 65:case 47:case 67:case 48:case 68:case 46:case 66:96&f.flags&&(f=d),96&d.flags&&(d=f);var m=void 0;if(8&f.flags&&8&d.flags&&void 0!==(m=function(e){switch(e){case 47:case 67:return 52;case 48:case 68:return 33;case 46:case 66:return 51;default:return}}(n.kind)))s(o||n,e.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead,e.tokenToString(n.kind),e.tokenToString(m));else{var h=os(t,f,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type),y=os(r,d,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type);h&&y&&c(nf)}return nf;case 35:case 57:96&f.flags&&(f=d),96&d.flags&&(d=f);var _=void 0;if(hs(f,132)&&hs(d,132))_=nf;else if(hs(f,258)||hs(d,258)?_=tf:(We(f)||We(d))&&(_=f===cf||d===cf?cf:ef),_&&!u(p))return _;return _?(57===p&&c(_),_):(l(),ef);case 25:case 27:case 28:case 29:if(!u(p))return rf;case 30:case 31:case 32:case 33:return ms(f,258)&&ms(d,258)?rf:(ei(f,d)||ei(d,f)||l(),rf);case 91:return gs(t,r,f,d);case 90:return vs(t,r,f,d);case 51:return d;case 52:return vr([f,d]);case 56:return c(d),Ci(d);case 24:return d}}function Ns(t){for(var n=t,r=t.parent;r;){if(e.isFunctionLike(r)&&n===r.body)return!1;if(e.isClassLike(n))return!0;n=r,r=r.parent}return!1}function ws(t){if(i&&(2&t.parserContextFlags&&!Ns(t)||Ep(t,e.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body),ua(t)&&s(t,e.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer)),t.expression){var n=e.getContainingFunction(t);if(n&&n.asteriskToken){var r=Ds(t.expression,void 0),a=void 0,o=!!t.asteriskToken;if(o&&(a=Qu(r,t.expression)),n.type){var u=tc(Rr(n.type))||ef;o?ni(a,u,t.expression,void 0):ni(r,u,t.expression,void 0)}}}return ef}function ks(e,t){return Os(e.condition),vr([Os(e.whenTrue,t),Os(e.whenFalse,t)])}function xs(e){var t=Ca(e);return t&&ya(t)?Er(e.text):tf}function Rs(t){return e.forEach(t.templateSpans,function(e){Os(e.expression)}),tf}function Is(e,t,n){var r=e.contextualType;e.contextualType=t;var i=Os(e,n);return e.contextualType=r,i}function Ds(e,t){var n=g(e);return n.resolvedType||(n.resolvedType=Os(e,t)),n.resolvedType}function Ms(e,t){return 137===e.name.kind&&Ba(e.name),Os(e.initializer,t)}function Ps(e,t){return hp(e),137===e.name.kind&&Ba(e.name),Ls(e,is(e,t),t)}function Ls(e,t,n){if(Ra(n)){var r=To(t);if(r&&r.typeParameters){var i=Ea(e);if(i){var a=To(i);if(a&&!a.typeParameters)return Dn(Eo(r,a,n))}}}return t}function Os(t,n){var r;if(136===t.kind)r=uo(t);else{r=Ls(t,Fs(t,n),n)}if(ys(r)){169===t.parent.kind&&t.parent.expression===t||170===t.parent.kind&&t.parent.expression===t||(69===t.kind||136===t.kind)&&ol(t)||s(t,e.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment)}return r}function Us(e){return Pp(e),nf}function Fs(t,n){switch(t.kind){case 69:return Hi(t);case 97:return ea(t);case 95:return ra(t);case 93:return uf;case 99:case 84:return rf;case 8:return Us(t);case 186:return Rs(t);case 9:return xs(t);case 11:return tf;case 10:return Af;case 167:return Pa(t,n);case 168:return Ka(t,n);case 169:return so(t);case 170:return ho(t);case 171:case 172:return zo(t);case 173:return Ho(t);case 175:return Os(t.expression,n);case 189:return mc(t);case 176:case 177:return is(t,n);case 179:return cs(t);case 174:case 192:return Yo(t);case 178:return us(t);case 180:return ls(t);case 181:return ps(t);case 182:return fs(t);case 183:return ds(t);case 184:return Es(t,n);case 185:return ks(t,n);case 188:return Da(t,n);case 190:return sf;case 187:return ws(t);case 243:return ro(t);case 236:return ja(t);case 237:return Va(t);case 238:e.Debug.fail("Shouldn't ever directly check a JsxOpeningElement")}return cf}function Bs(t){t.expression&&Ep(t.expression,e.Diagnostics.Type_expected),qc(t.constraint),Fn(Rt(ie(t))),i&&fc(t.name,e.Diagnostics.Type_parameter_name_cannot_be_0)}function Ks(t){Wl(t)||ql(t),Uu(t);var n=e.getContainingFunction(t);56&t.flags&&(n=e.getContainingFunction(t),145===n.kind&&e.nodeIsPresent(n.body)||s(t,e.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation)),t.questionToken&&e.isBindingPattern(t.name)&&n.body&&s(t,e.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature),!t.dotDotDotToken||e.isBindingPattern(t.name)||bi(ct(t.symbol))||s(t,e.Diagnostics.A_rest_parameter_must_be_of_an_array_type)}function Vs(e){return!(!e.asteriskToken||!e.body)&&(144===e.kind||216===e.kind||176===e.kind)}function js(e,t){if(e)for(var n=0;n=0)n.parameters[r.parameterIndex].dotDotDotToken?s(i,e.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter):ni(r.type,pl(n.parameters[r.parameterIndex]),t.type);else if(i){for(var a=!1,o=0,u=n.parameters;o=2&&Vs(t)){var n=Rr(t.type);if(n===of)s(t.type,e.Diagnostics.A_generator_cannot_have_a_void_type_annotation);else{var r=tc(n)||ef,a=sr(r);ni(a,n,t.type)}}else e.isAsyncFunctionLike(t)&&gu(t)}uu(t)}function Ys(t){if(218===t.kind){var n=ie(t);if(n.declarations.length>0&&n.declarations[0]!==t)return}var r=Mn(ie(t));if(r)for(var i=!1,a=!1,o=0,u=r.declarations;o=0)return n&&s(n,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method,we(t.symbol)),cf;od.push(t.id);var p=i(l);return od.pop(),p}return i(t)}function _u(t,n){if(t===cf)return cf;var r=Pf();return r===ff||r===lt(t)?yu(t,n,e.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type):(s(n,e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type),cf)}function gu(t){if(qp.noCustomAsyncPromise&&zp>=2){return _u(Rr(t.type),t.type)}var n=Ff();if(n===lf)return cf;var r=Rr(t.type);if(r===cf&&qp.isolatedModules)return cf;var i=g(t.type).resolvedSymbol;if(!i||!se(i)){var a=i?we(i):xe(r);return s(t,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type,a),cf}if(Au(t),!ni(ct(i),n,t,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type))return cf;var o=e.getEntityNameFromTypeNode(t.type),u=Dc(o),c=b(t.locals,u.text,107455);return c?(s(c.valueDeclaration,e.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,u.text,z(i)),cf):yu(r,t,e.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type)}function vu(t){var n=Wo(t),r=kn(n);if(!(1&r.flags)){var i,a,o=Vo(t);switch(t.parent.kind){case 217:i=vr([ct(ie(t.parent)),of]);break;case 139:i=of,a=e.chainDiagnosticMessages(a,e.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);break;case 142:i=of,a=e.chainDiagnosticMessages(a,e.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);break;case 144:case 146:case 147:i=vr([ir(pl(t.parent)),of])}ni(r,i,t,o,a)}}function bu(e){if(e&&152===e.kind){var t=Dc(e.typeName),n=152===t.parent.kind?793056:1536,r=T(t,t.text,8388608|n,void 0,void 0);if(r&&8388608&r.flags){107455&V(r).flags&&!Nl(V(r))&&W(r)}}}function Su(e){bu(e.type)}function Au(e){bu(e.type)}function Tu(e){for(var t=0,n=e.parameters;t1)return Ep(t,e.Diagnostics.Modifiers_cannot_appear_here)}}function ju(e){Mp(e),Os(e.expression)}function Wu(t){Mp(t),Os(t.expression),qc(t.thenStatement),197===t.thenStatement.kind&&s(t.thenStatement,e.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement),qc(t.elseStatement)}function qu(e){Mp(e),qc(e.statement),Os(e.expression)}function zu(e){Mp(e),Os(e.expression),qc(e.statement)}function Hu(t){Mp(t)||t.initializer&&215===t.initializer.kind&&bp(t.initializer),t.initializer&&(215===t.initializer.kind?e.forEach(t.initializer.declarations,Fu):Os(t.initializer)),t.condition&&Os(t.condition),t.incrementor&&Os(t.incrementor),qc(t.statement)}function Yu(t){if(fp(t),215===t.initializer.kind)Gu(t);else{var n=t.initializer,r=Xu(t.expression);if(167===n.kind||168===n.kind)As(n,r||cf);else{var i=Os(n);ss(n,e.Diagnostics.Invalid_left_hand_side_in_for_of_statement,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant),r&&ni(r,i,n,void 0)}}qc(t.statement)}function Ju(t){if(fp(t),215===t.initializer.kind){var n=t.initializer.declarations[0];n&&e.isBindingPattern(n.name)&&s(n.name,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern),Gu(t)}else{var r=t.initializer,i=Os(r);167===r.kind||168===r.kind?s(r,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern):Ua(i,258)?ss(r,e.Diagnostics.Invalid_left_hand_side_in_for_in_statement,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant):s(r,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any)}Ua(Os(t.expression),81408)||s(t.expression,e.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter),qc(t.statement)}function Gu(e){var t=e.initializer;if(t.declarations.length>=1){Fu(t.declarations[0])}}function Xu(e){return $u(fl(e),e,!0)}function $u(t,n,r){if(We(t))return t;if(zp>=2)return Qu(t,n);if(r)return nc(t,n);if(Si(t)){var i=vn(t,1);if(i)return i}return s(n,e.Diagnostics.Type_0_is_not_an_array_type,xe(t)),cf}function Qu(e,t){var n=Zu(e,t);return t&&n&&ni(e,or(n),t),n||ef}function Zu(t,n){if(!We(t)){var r=t;if(!r.iterableElementType)if(4096&t.flags&&t.target===Cf)r.iterableElementType=t.typeArguments[0];else{var i=je(t,e.getPropertyNameForKnownSymbolName("iterator"));if(We(i))return;var a=i?_n(i,0):jp;if(0===a.length)return void(n&&s(n,e.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator));r.iterableElementType=ec(vr(e.map(a,kn)),n)}return r.iterableElementType}}function ec(t,n){if(!We(t)){var r=t;if(!r.iteratorElementType)if(4096&t.flags&&t.target===Nf)r.iteratorElementType=t.typeArguments[0];else{var i=je(t,"next");if(We(i))return;var a=i?_n(i,0):jp;if(0===a.length)return void(n&&s(n,e.Diagnostics.An_iterator_must_have_a_next_method));var o=vr(e.map(a,kn));if(We(o))return;var u=je(o,"value");if(!u)return void(n&&s(n,e.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property));r.iteratorElementType=u}return r.iteratorElementType}}function tc(e){if(!We(e))return 4096&e.flags&&e.target===wf?e.typeArguments[0]:Zu(e,void 0)||ec(e,void 0)}function nc(t,n){e.Debug.assert(zp<2);var r=t;16384&t.flags?r=vr(e.filter(t.types,function(e){return!(258&e.flags)})):258&t.flags&&(r=pf);var i=t!==r,a=!1;if(i&&(zp<1&&(s(n,e.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher),a=!0),r===lf))return tf;if(!Si(r)){if(!a){s(n,i?e.Diagnostics.Type_0_is_not_an_array_type:e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type,xe(r))}return i?tf:cf}var o=vn(r,1)||cf;return i?258&o.flags?tf:vr([o,tf]):o}function rc(e){Mp(e)||yp(e)}function ic(t){return!(146!==t.kind||!e.getSetAccessorTypeAnnotationNode(e.getDeclarationOfKind(t.symbol,147)))}function ac(t){if(!Mp(t)){e.getContainingFunction(t)||Ep(t,e.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body)}if(t.expression){var n=e.getContainingFunction(t);if(n){var r=Cn(n),i=kn(r),a=Ds(t.expression);if(n.asteriskToken)return;if(147===n.kind)s(t.expression,e.Diagnostics.Setters_cannot_return_a_value);else if(145===n.kind)ni(a,i,t.expression)||s(t.expression,e.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);else if(n.type||ic(n))if(e.isAsyncFunctionLike(n)){var o=du(i),u=yu(a,t.expression,e.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);o&&ni(u,o,t.expression)}else ni(a,i,t.expression)}}}function oc(t){Mp(t)||8&t.parserContextFlags&&Ep(t,e.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block),Os(t.expression),s(t.expression,e.Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any)}function sc(t){Mp(t);var n,r=!1,a=Os(t.expression),o=ms(a,258);e.forEach(t.caseBlock.clauses,function(s){if(245===s.kind&&!r)if(void 0===n)n=s;else{var u=e.getSourceFileOfNode(t),c=e.skipTrivia(u.text,s.pos),l=s.statements.length>0?s.statements[0].pos:s.end;Cp(u,c,l-c,e.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement),r=!0}if(i&&244===s.kind){var p=s,f=Os(p.expression);o&&ms(f,258)||ei(a,f)||ni(f,a,p.expression,void 0)}e.forEach(s.statements,qc)})}function uc(t){if(!Mp(t))for(var n=t.parent;n&&!e.isFunctionLike(n);){if(210===n.kind&&n.label.text===t.label.text){var r=e.getSourceFileOfNode(t);Np(t.label,e.Diagnostics.Duplicate_label_0,e.getTextOfNodeFromSourceText(r.text,t.label));break}n=n.parent}qc(t.statement)}function cc(t){Mp(t)||void 0===t.expression&&Lp(t,e.Diagnostics.Line_break_not_permitted_here),t.expression&&Os(t.expression)}function lc(t){Mp(t),wu(t.tryBlock);var n=t.catchClause;if(n){if(n.variableDeclaration)if(69!==n.variableDeclaration.name.kind)Ep(n.variableDeclaration.name,e.Diagnostics.Catch_clause_variable_name_must_be_an_identifier);else if(n.variableDeclaration.type)Ep(n.variableDeclaration.type,e.Diagnostics.Catch_clause_variable_cannot_have_a_type_annotation);else if(n.variableDeclaration.initializer)Ep(n.variableDeclaration.initializer,e.Diagnostics.Catch_clause_variable_cannot_have_an_initializer);else{var r=n.variableDeclaration.name.text,i=n.block.locals;if(i&&e.hasProperty(i,r)){var a=i[r];a&&0!=(2&a.flags)&&Np(a.valueDeclaration,e.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause,r)}}wu(n.block)}t.finallyBlock&&wu(t.finallyBlock)}function pc(t){function n(t,n,r,i,a,o){if(a&&(1!==o||La(t.valueDeclaration.name))){var u;if(137===t.valueDeclaration.name.kind||t.parent===r.symbol)u=t.valueDeclaration;else if(i)u=i;else if(2048&r.flags){var c=e.forEach(At(r),function(e){return un(e,t.name)&&vn(e,o)});u=c?void 0:r.symbol.declarations[0]}if(u&&!ei(n,a)){s(u,0===o?e.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2:e.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2,we(t),xe(n),xe(a))}}}var r=Pn(t.symbol,1),i=Pn(t.symbol,0),a=vn(t,0),o=vn(t,1);if((a||o)&&(e.forEach(sn(t),function(e){var s=ct(e);n(e,s,t,i,a,0),n(e,s,t,r,o,1)}),1024&t.flags&&e.isClassLike(t.symbol.valueDeclaration)))for(var u=t.symbol.valueDeclaration,c=0,l=u.members;c1&&(t===r||Ac(r.typeParameters,t.typeParameters)||s(t.name,e.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters)),t===r){var a=Dt(n),o=jt(a);if(Tc(a,t.name)){for(var u=0,c=At(a);u>u;case 45:return i>>>u;case 43:return i<1&&e.forEach(r.declarations,function(t){e.isConstEnumDeclaration(t)!==n&&s(t.name,e.Diagnostics.Enum_declarations_must_all_be_const_or_non_const)});var a=!1;e.forEach(r.declarations,function(t){if(220!==t.kind)return!1;var n=t;if(!n.members.length)return!1;var r=n.members[0];r.initializer||(a?s(r.name,e.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element):a=!0)})}}}function kc(t){for(var n=t.declarations,r=0,i=n;r1&&!r&&e.isInstantiatedModule(t,qp.preserveConstEnums||qp.isolatedModules)){var u=kc(o);u&&(e.getSourceFileOfNode(t)!==e.getSourceFileOfNode(u)?s(t.name,e.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged):t.pos1){var d=e.filter(p,n);if(d.length>1)for(var m=0,h=d;m1||1===r.length&&r[0].declaration!==t}return!1}function xl(e){return g(e).flags}function Rl(e){return Nc(e.parent),g(e).enumMemberValue}function Il(t){if(250===t.kind)return Rl(t);var n=g(t).resolvedSymbol;return n&&8&n.flags&&e.isConstEnumDeclaration(n.valueDeclaration.parent)?Rl(n.valueDeclaration):void 0}function Dl(e){return 80896&e.flags&&_n(e,0).length>0}function Ml(t){var n=H(t,107455,!0),r=n?ct(n):void 0;if(r&&_t(r))return e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue;var i=H(t,793056,!0);if(!i)return e.TypeReferenceSerializationKind.ObjectType;var a=Dt(i);return a===cf?e.TypeReferenceSerializationKind.Unknown:1&a.flags?e.TypeReferenceSerializationKind.ObjectType:hs(a,16)?e.TypeReferenceSerializationKind.VoidType:hs(a,8)?e.TypeReferenceSerializationKind.BooleanType:hs(a,132)?e.TypeReferenceSerializationKind.NumberLikeType:hs(a,258)?e.TypeReferenceSerializationKind.StringLikeType:hs(a,8192)?e.TypeReferenceSerializationKind.ArrayLikeType:hs(a,16777216)?e.TypeReferenceSerializationKind.ESSymbolType:Dl(a)?e.TypeReferenceSerializationKind.TypeWithCallSignature:bi(a)?e.TypeReferenceSerializationKind.ArrayLikeType:e.TypeReferenceSerializationKind.ObjectType}function Pl(e,t,n,r){var i=ie(e),a=!i||133120&i.flags?cf:ct(i);Me().buildTypeDisplay(a,r,t,n)}function Ll(e,t,n,r){var i=Cn(e);Me().buildTypeDisplay(kn(i),r,t,n)}function Ol(e,t,n,r){var i=fl(e);Me().buildTypeDisplay(i,r,t,n)}function Ul(t){return e.hasProperty(Jf,t)}function Fl(e){return g(e).resolvedSymbol||T(e,e.text,9544639,void 0,void 0)}function Bl(t){e.Debug.assert(!e.nodeIsSynthesized(t));var n=Fl(t);return n&&oe(n).valueDeclaration}function Kl(t){var n=e.getExternalModuleName(t),r=J(n,n,void 0);if(r)return e.getDeclarationOfKind(r,251)}function Vl(){var e=Of();return e!==ff?jn(e,[ef]):lf}function jl(){var e=u(67108868,"then");_(e).type=_f;var t=pe(65536);return t.properties=[e],t.members=Ft(t.properties),t.callSignatures=[],t.constructSignatures=[],t}function Wl(t){if(!t.decorators)return!1;if(!e.nodeCanBeDecorated(t))return 144!==t.kind||e.nodeIsPresent(t.body)?Ep(t,e.Diagnostics.Decorators_are_not_valid_here):Ep(t,e.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);if(146===t.kind||147===t.kind){var n=e.getAllAccessorDeclarations(t.parent.members,t);if(n.firstAccessor.decorators&&t===n.secondAccessor)return Ep(t,e.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}return!1}function ql(t){switch(t.kind){case 146:case 147:case 145:case 142:case 141:case 144:case 143:case 150:case 221:case 225:case 224:case 231:case 230:case 139:break;case 216:if(t.modifiers&&(t.modifiers.length>1||118!==t.modifiers[0].kind)&&222!==t.parent.kind&&251!==t.parent.kind)return Ep(t,e.Diagnostics.Modifiers_cannot_appear_here);break;case 217:case 218:case 196:case 219:if(t.modifiers&&222!==t.parent.kind&&251!==t.parent.kind)return Ep(t,e.Diagnostics.Modifiers_cannot_appear_here);break;case 220:if(t.modifiers&&(t.modifiers.length>1||74!==t.modifiers[0].kind)&&222!==t.parent.kind&&251!==t.parent.kind)return Ep(t,e.Diagnostics.Modifiers_cannot_appear_here);break;default:return!1}if(t.modifiers){for(var n,r,i,a,o,s=0,u=0,c=t.modifiers;u".length-i,e.Diagnostics.Type_parameter_list_cannot_be_empty)}}function Jl(t){if(Hl(t))return!0;for(var n=!1,r=t.length,i=0;i".length-i,e.Diagnostics.Type_argument_list_cannot_be_empty)}}function tp(e,t){return Hl(t)||ep(e,t)}function np(t,n){if(n)for(var r=e.getSourceFileOfNode(t),i=0,a=n;i1)return Ep(o.types[1],e.Diagnostics.Classes_can_only_extend_a_single_class);n=!0}else{if(e.Debug.assert(106===o.token),r)return Ep(o,e.Diagnostics.implements_clause_already_seen);r=!0}ip(o)}}function op(t){var n=!1;if(t.heritageClauses)for(var r=0,i=t.heritageClauses;r1){var i=203===t.kind?e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;return Ep(n.declarations[1],i)}var a=r[0];if(a.initializer){var i=203===t.kind?e.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:e.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return Np(a.name,i)}if(a.type){var i=203===t.kind?e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:e.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;return Np(a,i)}}}return!1}function dp(t){var n=t.kind;if(zp<1)return Np(t.name,e.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);if(e.isInAmbientContext(t))return Np(t.name,e.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context);if(void 0===t.body)return Cp(e.getSourceFileOfNode(t),t.end-1,";".length,e.Diagnostics._0_expected,"{");if(t.typeParameters)return Np(t.name,e.Diagnostics.An_accessor_cannot_have_type_parameters);if(146===n&&t.parameters.length)return Np(t.name,e.Diagnostics.A_get_accessor_cannot_have_parameters);if(147===n){if(t.type)return Np(t.name,e.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);if(1!==t.parameters.length)return Np(t.name,e.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);var r=t.parameters[0];if(r.dotDotDotToken)return Np(r.dotDotDotToken,e.Diagnostics.A_set_accessor_cannot_have_rest_parameter);if(1022&r.flags)return Np(t.name,e.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);if(r.questionToken)return Np(r.questionToken,e.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter);if(r.initializer)return Np(t.name,e.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer)}}function mp(t,n){if(e.isDynamicName(t))return Np(t,n)}function hp(t){if(Vu(t)||Gl(t)||up(t))return!0;if(168===t.parent.kind){if(cp(t,t.questionToken,e.Diagnostics.A_class_member_cannot_be_declared_optional))return!0;if(void 0===t.body)return Cp(e.getSourceFileOfNode(t),t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(e.isClassLike(t.parent)){if(cp(t,t.questionToken,e.Diagnostics.A_class_member_cannot_be_declared_optional))return!0;if(e.isInAmbientContext(t))return mp(t.name,e.Diagnostics.A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol);if(!t.body)return mp(t.name,e.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol)}else{if(218===t.parent.kind)return mp(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol);if(156===t.parent.kind)return mp(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)}}function yp(t){for(var n=t;n;){if(e.isFunctionLike(n))return Np(t,e.Diagnostics.Jump_target_cannot_cross_function_boundary);switch(n.kind){case 210:if(t.label&&n.label.text===t.label.text){return!!(205===t.kind&&!e.isIterationStatement(n.statement,!0))&&Np(t,e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement)}break;case 209:if(206===t.kind&&!t.label)return!1;break;default:if(e.isIterationStatement(n,!1)&&!t.label)return!1}n=n.parent}if(t.label){var r=206===t.kind?e.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;return Np(t,r)}var r=206===t.kind?e.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:e.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;return Np(t,r)}function _p(t){if(t.dotDotDotToken){var n=t.parent.elements;if(t!==e.lastOrUndefined(n))return Np(t,e.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern);if(165===t.name.kind||164===t.name.kind)return Np(t.name,e.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);if(t.initializer)return Cp(e.getSourceFileOfNode(t),t.initializer.pos-1,1,e.Diagnostics.A_rest_element_cannot_have_an_initializer)}}function gp(t){if(203!==t.parent.parent.kind&&204!==t.parent.parent.kind)if(e.isInAmbientContext(t)){if(t.initializer){var n="=".length;return Cp(e.getSourceFileOfNode(t),t.initializer.pos-n,n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts)}}else if(!t.initializer){if(e.isBindingPattern(t.name)&&!e.isBindingPattern(t.parent))return Np(t,e.Diagnostics.A_destructuring_declaration_must_have_an_initializer);if(e.isConst(t))return Np(t,e.Diagnostics.const_declarations_must_be_initialized)}return(e.isLet(t)||e.isConst(t))&&vp(t.name)}function vp(t){if(69===t.kind){if(108===t.originalKeywordKind)return Np(t,e.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations)}else for(var n=t.elements,r=0,i=n;r0}function Ep(t,n,r,i,a){var o=e.getSourceFileOfNode(t);if(!Tp(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);return sd.add(e.createFileDiagnostic(o,s.start,s.length,n,r,i,a)),!0}}function Cp(t,n,r,i,a,o,s){if(!Tp(t))return sd.add(e.createFileDiagnostic(t,n,r,i,a,o,s)),!0}function Np(t,n,r,i,a){if(!Tp(e.getSourceFileOfNode(t)))return sd.add(e.createDiagnosticForNode(t,n,r,i,a)),!0}function wp(t){if(t.typeParameters)return Cp(e.getSourceFileOfNode(t),t.typeParameters.pos,t.typeParameters.end-t.typeParameters.pos,e.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration)}function kp(t){if(t.type)return Np(t.type,e.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration)}function xp(t){if(e.isClassLike(t.parent)){if(cp(t,t.questionToken,e.Diagnostics.A_class_member_cannot_be_declared_optional)||mp(t.name,e.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol))return!0}else if(218===t.parent.kind){if(mp(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol))return!0;if(t.initializer)return Np(t.initializer,e.Diagnostics.An_interface_property_cannot_have_an_initializer)}else if(156===t.parent.kind){if(mp(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol))return!0;if(t.initializer)return Np(t.initializer,e.Diagnostics.A_type_literal_property_cannot_have_an_initializer)}if(e.isInAmbientContext(t)&&t.initializer)return Ep(t.initializer,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts)}function Rp(t){return!(218===t.kind||219===t.kind||225===t.kind||224===t.kind||231===t.kind||230===t.kind||4&t.flags||514&t.flags)&&Ep(t,e.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file)}function Ip(t){for(var n=0,r=t.statements;n=1)return Np(t,e.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher)}function Lp(t,n,r,i,a){var o=e.getSourceFileOfNode(t);if(!Tp(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);return sd.add(e.createFileDiagnostic(o,e.textSpanEnd(s),0,n,r,i,a)),!0}}var Op,Up=e.objectAllocator.getSymbolConstructor(),Fp=e.objectAllocator.getTypeConstructor(),Bp=e.objectAllocator.getSignatureConstructor(),Kp=0,Vp=0,jp=[],Wp={},qp=r.getCompilerOptions(),zp=qp.target||0,Hp=e.getEmitModuleKind(qp),Yp=void 0!==qp.allowSyntheticDefaultImports?qp.allowSyntheticDefaultImports:4===Hp,Jp=function(){return{getReferencedExportContainer:gl,getReferencedImportDeclaration:vl,getReferencedDeclarationWithCollidingName:Sl,isDeclarationWithCollidingName:Al,isValueAliasDeclaration:Tl,hasGlobalName:Ul,isReferencedAliasDeclaration:wl,getNodeCheckFlags:xl,isTopLevelValueImportEqualsWithEntityName:El,isDeclarationVisible:Pe,isImplementationOfOverload:kl,writeTypeOfDeclaration:Pl,writeReturnTypeOfSignatureDeclaration:Ll,writeTypeOfExpression:Ol,isSymbolAccessible:be,isEntityNameVisible:Te,getConstantValue:Il,collectLinkedAliases:Le,getReferencedValueDeclaration:Bl,getTypeReferenceSerializationKind:Ml,isOptionalParameter:Tn,moduleExportsSomeValue:_l,isArgumentsLocalBinding:yl,getExternalModuleFileFromDeclaration:Kl}}(),Gp=u(67108868,"undefined");Gp.declarations=[];var Xp=u(67108868,"arguments"),$p={getNodeCount:function(){return e.sum(r.getSourceFiles(),"nodeCount")},getIdentifierCount:function(){return e.sum(r.getSourceFiles(),"identifierCount")},getSymbolCount:function(){return e.sum(r.getSourceFiles(),"symbolCount")+Vp},getTypeCount:function(){return Kp},isUndefinedSymbol:function(e){return e===Gp},isArgumentsSymbol:function(e){return e===Xp},isUnknownSymbol:function(e){return e===Qp},getDiagnostics:Gc,getGlobalDiagnostics:$c,getTypeOfSymbolAtLocation:qi,getSymbolsOfParameterPropertyDeclaration:S,getDeclaredTypeOfSymbol:Dt,getPropertiesOfType:ln,getPropertyOfType:hn,getSignaturesOfType:_n,getIndexTypeOfType:vn,getBaseTypes:At,getReturnTypeOfSignature:kn,getSymbolsInScope:el,getSymbolAtLocation:ul,getShorthandAssignmentValueSymbol:cl,getExportSpecifierLocalTargetSymbol:ll,getTypeAtLocation:pl,typeToString:xe,getSymbolDisplayBuilder:Me,symbolToString:we,getAugmentedPropertiesOfType:ml,getRootSymbols:hl,getContextualType:Ca,getFullyQualifiedName:z,getResolvedSignature:Wo,getConstantValue:Il,isValidPropertyAccess:lo,getSignatureFromDeclaration:Cn,isImplementationOfOverload:kl,getAliasedSymbol:V,getEmitResolver:a,getExportsOfModule:Q,getJsxElementAttributesType:$a,getJsxIntrinsicTagNames:eo,isOptionalParameter:Tn},Qp=u(67108868,"unknown"),Zp=u(67108864,"__resolving__"),ef=le(1,"any"),tf=le(2,"string"),nf=le(4,"number"),rf=le(8,"boolean"),af=le(16777216,"symbol"),of=le(16,"void"),sf=le(2097184,"undefined"),uf=le(2097216,"null"),cf=le(1,"unknown"),lf=he(void 0,Wp,jp,jp,void 0,void 0),pf=lf,ff=he(void 0,Wp,jp,jp,void 0,void 0);ff.instantiations={};var df=he(void 0,Wp,jp,jp,void 0,void 0);df.flags|=8388608;var mf,hf,yf,_f,gf,vf,bf,Sf,Af,Tf,Ef,Cf,Nf,wf,kf,xf,Rf,If,Df,Mf,Pf,Lf,Of,Uf,Ff,Bf,Kf,Vf,jf,Wf,qf,zf=he(void 0,Wp,jp,jp,void 0,void 0),Hf=Ht(void 0,void 0,jp,ef,void 0,0,!1,!1),Yf=Ht(void 0,void 0,jp,cf,void 0,0,!1,!1),Jf={},Gf={},Xf={},$f={},Qf={},Zf=[],ed=[],td=[],nd=[],rd=[],id=[],ad=[],od=[],sd=e.createDiagnosticCollection(),ud={string:{type:tf,flags:258},number:{type:nf,flags:132},boolean:{type:rf,flags:8},symbol:{type:af,flags:16777216},undefined:{type:sf,flags:2097152}},cd={},ld={JSX:"JSX",IntrinsicElements:"IntrinsicElements",ElementClass:"ElementClass",ElementAttributesPropertyNameContainer:"ElementAttributesProperty",Element:"Element",IntrinsicAttributes:"IntrinsicAttributes",IntrinsicClassAttributes:"IntrinsicClassAttributes"},pd={},fd={},dd={};!function(e){e[e.Type=0]="Type",e[e.ResolvedBaseConstructorType=1]="ResolvedBaseConstructorType",e[e.DeclaredType=2]="DeclaredType",e[e.ResolvedReturnType=3]="ResolvedReturnType"}(qf||(qf={}));var md=(hd={},hd[Gp.name]=Gp,hd);return function(){e.forEach(r.getSourceFiles(),function(t){e.bindSourceFile(t,qp)});var t;if(e.forEach(r.getSourceFiles(),function(n){e.isExternalOrCommonJsModule(n)||m(Jf,n.locals),n.moduleAugmentations.length&&(t||(t=[])).push(n.moduleAugmentations)}),t)for(var n=0,i=t;n=2?(Tf=tr("TemplateStringsArray"),Ef=tr("Symbol"),mf=Qn("Symbol"),Cf=tr("Iterable",1),Nf=tr("Iterator",1),wf=tr("IterableIterator",1)):(Tf=cf,Ef=he(void 0,Wp,jp,jp,void 0,void 0),mf=void 0,Cf=ff,Nf=ff,wf=ff),kf=ur(ef)}(),$p;var hd}var i=1,a=1,o=1;e.getNodeId=t,e.checkTime=0,e.getSymbolId=n,e.createTypeChecker=r}(o||(o={}));var o;!function(e){function t(){return void 0===a&&(a={getSourceMapData:function(){},setSourceFile:function(e){},emitStart:function(e){},emitEnd:function(e,t){},emitPos:function(e){},changeEmitSourcePos:function(){},getText:function(){},getSourceMappingURL:function(){},initialize:function(e,t,n,r){},reset:function(){}}),a}function n(t,n){function r(n,r,i,s){T&&a(),_=void 0,v=-1,b=void 0,S=o,A=0,T={sourceMapFilePath:r,jsSourceMappingURL:E.inlineSourceMap?void 0:e.getBaseFileName(e.normalizeSlashes(r)),sourceMapFile:e.getBaseFileName(e.normalizeSlashes(n)),sourceMapSourceRoot:E.sourceRoot||"",sourceMapSources:[],inputSourceFileNames:[],sourceMapNames:[],sourceMapMappings:"",sourceMapSourcesContent:E.inlineSources?[]:void 0,sourceMapDecodedMappings:[]},T.sourceMapSourceRoot=e.normalizeSlashes(T.sourceMapSourceRoot),T.sourceMapSourceRoot.length&&47!==T.sourceMapSourceRoot.charCodeAt(T.sourceMapSourceRoot.length-1)&&(T.sourceMapSourceRoot+=e.directorySeparator),E.mapRoot?(g=e.normalizeSlashes(E.mapRoot),s||(e.Debug.assert(1===i.length),g=e.getDirectoryPath(e.getSourceFilePathInNewDir(i[0],t,g))),e.isRootedDiskPath(g)||e.isUrl(g)?T.jsSourceMappingURL=e.combinePaths(g,T.jsSourceMappingURL):(g=e.combinePaths(t.getCommonSourceDirectory(),g),T.jsSourceMappingURL=e.getRelativePathToDirectoryOrUrl(e.getDirectoryPath(e.normalizePath(n)),e.combinePaths(g,T.jsSourceMappingURL),t.getCurrentDirectory(),t.getCanonicalFileName,!0))):g=e.getDirectoryPath(e.normalizePath(n))}function a(){_=void 0,g=void 0,v=void 0,b=void 0,S=void 0,A=void 0,T=void 0}function s(){if(N){N=!1,b.emittedLine=S.emittedLine,b.emittedColumn=S.emittedColumn,T.sourceMapDecodedMappings.pop(),S=T.sourceMapDecodedMappings.length?T.sourceMapDecodedMappings[T.sourceMapDecodedMappings.length-1]:o;for(var e=T.sourceMapMappings,t=e.length-1;t>=0;t--){var n=e.charAt(t);if(","===n)break;if(";"===n&&0!==t&&";"!==e.charAt(t-1))break}T.sourceMapMappings=e.substr(0,Math.max(0,t))}}function u(){if(b&&b!==S){var t=S.emittedColumn;if(S.emittedLine===b.emittedLine)T.sourceMapMappings&&(T.sourceMapMappings+=",");else{for(var n=S.emittedLine;n=0&&(e.Debug.assert(!1,"We do not support name index right now, Make sure to update updateLastEncodedAndRecordedSpans when we start using this"),T.sourceMapMappings+=i(b.nameIndex-A),A=b.nameIndex),S=b,T.sourceMapDecodedMappings.push(S)}}function c(t){if(t!==-1){var r=e.getLineAndCharacterOfPosition(_,t);r.line++,r.character++;var i=n.getLine(),a=n.getColumn();!b||b.emittedLine!==i||b.emittedColumn!==a||b.sourceIndex===v&&(b.sourceLine>r.line||b.sourceLine===r.line&&b.sourceColumn>r.character)?(u(),b={emittedLine:i,emittedColumn:a,sourceLine:r.line,sourceColumn:r.character,sourceIndex:v},C=!1):C||(b.sourceLine=r.line,b.sourceColumn=r.character,b.sourceIndex=v),s()}}function l(t){var n=!!t.decorators;return t.pos!==-1?e.skipTrivia(_.text,n?t.decorators.end:t.pos):-1}function p(e){c(l(e))}function f(e,t){c(e.end),C=t}function d(){e.Debug.assert(!N),N=!0}function m(n){_=n;var r=E.sourceRoot?t.getCommonSourceDirectory():g,i=e.getRelativePathToDirectoryOrUrl(r,_.fileName,t.getCurrentDirectory(),t.getCanonicalFileName,!0);(v=e.indexOf(T.sourceMapSources,i))===-1&&(v=T.sourceMapSources.length,T.sourceMapSources.push(i),T.inputSourceFileNames.push(n.fileName),E.inlineSources&&T.sourceMapSourcesContent.push(n.text))}function h(){return u(),e.stringify({version:3,file:T.sourceMapFile,sourceRoot:T.sourceMapSourceRoot,sources:T.sourceMapSources,names:T.sourceMapNames,mappings:T.sourceMapMappings,sourcesContent:T.sourceMapSourcesContent})}function y(){if(E.inlineSourceMap){var t=e.convertToBase64(h());return T.jsSourceMappingURL="data:application/json;base64,"+t}return T.jsSourceMappingURL}var _,g,v,b,S,A,T,E=t.getCompilerOptions(),C=!1,N=!1;return{getSourceMapData:function(){return T},setSourceFile:m,emitPos:c,emitStart:p,emitEnd:f,changeEmitSourcePos:d,getText:h,getSourceMappingURL:y,initialize:r,reset:a}}function r(e){if(e<64)return s.charAt(e);throw TypeError(e+": not a 64 based value")}function i(e){e<0?e=1+(-e<<1):e<<=1;var t="";do{var n=31&e;e>>=5,e>0&&(n|=32),t+=r(n)}while(e>0);return t}var a,o={emittedLine:1,emittedColumn:1,sourceLine:1,sourceColumn:1,sourceIndex:0};e.getNullSourceMapWriter=t,e.createSourceMapWriter=n;var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}(o||(o={}));var o;!function(e){function t(t,r,i){function a(e,i,a){n(t,r,o,e.declarationFilePath,i,a)}var o=e.createDiagnosticCollection();return e.forEachExpectedEmitFile(t,a,i),o.getDiagnostics(i?i.fileName:void 0)}function n(t,n,r,i,a,o){function s(e){return fe.substring(e.pos,e.end).indexOf("@internal")>=0}function u(t){if(t){var n=e.getLeadingCommentRanges(fe,t.pos);if(e.forEach(n,s))return;re(t)}}function c(){var t=e.createTextWriter(ve);return t.trackSymbol=d,t.reportInaccessibleThisError=m,t.writeKeyword=t.write,t.writeOperator=t.write,t.writePunctuation=t.write,t.writeSpace=t.write,t.writeStringLiteral=t.writeLiteral,t.writeParameter=t.write,t.writeSymbol=t.write,l(t),t}function l(e){Se=e,ae=e.write,ce=e.writeTextOfNode,oe=e.writeLine,se=e.increaseIndent,ue=e.decreaseIndent}function p(t){var n=Se;e.forEach(t,function(t){var n;214===t.kind?n=t.parent.parent:228===t.kind||229===t.kind||226===t.kind?e.Debug.fail("We should be getting ImportDeclaration instead to write"):n=t;var r=e.forEach(Ce,function(e){return e.node===n?e:void 0});if(!r&&ge&&(r=e.forEach(ge,function(e){return e.node===n?e:void 0})),r)if(225===r.node.kind)r.isVisible=!0;else{c();for(var i=r.indent;i;i--)se();221===n.kind&&(e.Debug.assert(void 0===ge),ge=[]),k(n),221===n.kind&&(r.subModuleElementDeclarationEmitInfo=ge,ge=void 0),r.asynchronousOutput=Se.getText()}}),l(n)}function f(t){if(0===t.accessibility)t&&t.aliasesToMakeVisible&&p(t.aliasesToMakeVisible);else{Ae=!0;var n=Se.getSymbolAccessibilityDiagnostic(t);n&&(n.typeName?r.add(e.createDiagnosticForNode(t.errorNode||n.errorNode,n.diagnosticMessage,e.getTextOfNodeFromSourceText(fe,n.typeName),t.errorSymbolName,t.errorModuleName)):r.add(e.createDiagnosticForNode(t.errorNode||n.errorNode,n.diagnosticMessage,t.errorSymbolName,t.errorModuleName)))}}function d(e,t,r){f(n.isSymbolAccessible(e,t,r))}function m(){ye&&(Ae=!0,r.add(e.createDiagnosticForNode(ye,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary,e.declarationNameToString(ye))))}function h(e,t,r){Se.getSymbolAccessibilityDiagnostic=r,ae(": "),t?A(t):(ye=e.name,n.writeTypeOfDeclaration(e,le,2,Se),ye=void 0)}function y(e,t){Se.getSymbolAccessibilityDiagnostic=t,ae(": "),e.type?A(e.type):(ye=e.name,n.writeReturnTypeOfSignatureDeclaration(e,le,2,Se),ye=void 0)}function _(e){for(var t=0,n=e;t")))}(t);case 152:return function(e){i(e.typeName),e.typeArguments&&(ae("<"),v(e.typeArguments,A),ae(">"))}(t);case 155:return function(e){ae("typeof "),i(e.exprName)}(t);case 157:return function(e){A(e.elementType),ae("[]")}(t);case 158:return function(e){ae("["),v(e.elementTypes,A),ae("]")}(t);case 159:return function(e){g(e.types," | ",A)}(t);case 160:return function(e){g(e.types," & ",A)}(t);case 161:return function(e){ae("("),A(e.type),ae(")")}(t);case 153:case 154:return ee(t);case 156:return function(e){ae("{"),e.members.length&&(oe(),se(),_(e.members),ue()),ae("}")}(t);case 69:return i(t);case 136:return i(t);case 151:return function(e){ce(fe,e.parameterName),ae(" is "),A(e.type)}(t)}}function T(t){fe=t.text,de=e.getLineStarts(t),me=t.identifiers,he=e.isExternalModule(t),le=t,e.emitDetachedComments(fe,de,Se,e.writeCommentRange,t,ve,!0),_(t.statements)}function E(){if(!e.hasProperty(me,"_default"))return"_default";for(var t=0;;){t++;var n="_default_"+t;if(!e.hasProperty(me,n))return n}}function C(t){function r(n){return{diagnosticMessage:e.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,errorNode:t}}if(69===t.expression.kind)ae(t.isExportEquals?"export = ":"export default "),ce(fe,t.expression);else{var i=E();ae("declare var "),ae(i),ae(": "),Se.getSymbolAccessibilityDiagnostic=r,n.writeTypeOfExpression(t.expression,le,2,Se),ae(";"),oe(),ae(t.isExportEquals?"export = ":"export default "),ae(i)}if(ae(";"),oe(),69===t.expression.kind){p(n.collectLinkedAliases(t.expression))}}function N(e){return n.isDeclarationVisible(e)}function w(e,t){if(t)k(e);else if(224===e.kind||251===e.parent.kind&&he){var r=void 0;if(ge&&251!==e.parent.kind)ge.push({node:e,outputPos:Se.getTextPos(),indent:Se.getIndent(),isVisible:r});else{if(225===e.kind){var i=e;i.importClause&&(r=i.importClause.name&&n.isDeclarationVisible(i.importClause)||D(i.importClause.namedBindings))}Ce.push({node:e,outputPos:Se.getTextPos(),indent:Se.getIndent(),isVisible:r})}}}function k(t){switch(t.kind){case 216:return Z(t);case 196:return $(t);case 218:return H(t);case 217:return z(t);case 219:return B(t);case 220:return K(t);case 221:return F(t);case 224:return I(t);case 225:return M(t);default:e.Debug.fail("Unknown symbol kind")}}function x(e){251===e.parent.kind&&(2&e.flags&&ae("export "),512&e.flags?ae("default "):218===e.kind||_e||ae("declare "))}function R(e){16&e.flags?ae("private "):32&e.flags&&ae("protected "),64&e.flags&&ae("static "),128&e.flags&&ae("abstract ")}function I(t){function n(n){return{diagnosticMessage:e.Diagnostics.Import_declaration_0_is_using_private_name_1,errorNode:t,typeName:t.name}}Te(t),2&t.flags&&ae("export "),ae("import "),ce(fe,t.name),ae(" = "),e.isInternalModuleImportEqualsDeclaration(t)?(S(t.moduleReference,n),ae(";")):(ae("require("),P(t),ae(");")),Se.writeLine()}function D(t){if(t)return 227===t.kind?n.isDeclarationVisible(t):e.forEach(t.elements,function(e){return n.isDeclarationVisible(e)})}function M(e){if(Te(e),2&e.flags&&ae("export "),ae("import "),e.importClause){var t=Se.getTextPos();e.importClause.name&&n.isDeclarationVisible(e.importClause)&&ce(fe,e.importClause.name),e.importClause.namedBindings&&D(e.importClause.namedBindings)&&(t!==Se.getTextPos()&&ae(", "),227===e.importClause.namedBindings.kind?(ae("* as "),ce(fe,e.importClause.namedBindings.name)):(ae("{ "),v(e.importClause.namedBindings.elements,L,n.isDeclarationVisible),ae(" }"))),ae(" from ")}P(e),ae(";"),Se.writeLine()}function P(r){pe=pe||221!==r.kind;var i;if(224===r.kind){var a=r;i=e.getExternalModuleImportEqualsDeclarationExpression(a)}else if(221===r.kind)i=r.name;else{var a=r;i=a.moduleSpecifier}if(9===i.kind&&o&&(be.out||be.outFile)){var s=e.getExternalModuleNameFromDeclaration(t,n,r);if(s)return ae('"'),ae(s),void ae('"')}ce(fe,i)}function L(e){e.propertyName&&(ce(fe,e.propertyName),ae(" as ")),ce(fe,e.name)}function O(e){L(e),p(n.collectLinkedAliases(e.propertyName||e.name))}function U(e){Te(e),ae("export "),e.exportClause?(ae("{ "),v(e.exportClause.elements,O),ae(" }")):ae("*"),e.moduleSpecifier&&(ae(" from "),P(e)),ae(";"),Se.writeLine()}function F(t){for(Te(t),x(t),e.isGlobalScopeAugmentation(t)?ae("global "):(ae(65536&t.flags?"namespace ":"module "),e.isExternalModuleAugmentation(t)?P(t):ce(fe,t.name));222!==t.body.kind;)t=t.body,ae("."),ce(fe,t.name);var n=le;le=t,ae(" {"),oe(),se(),_(t.body.statements),ue(),ae("}"),oe(),le=n}function B(t){function n(n){return{diagnosticMessage:e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:t.type,typeName:t.name}}var r=le;le=t,Te(t),x(t),ae("type "),ce(fe,t.name),W(t.typeParameters),ae(" = "),S(t.type,n),ae(";"),oe(),le=r}function K(t){Te(t),x(t),e.isConst(t)&&ae("const "),ae("enum "),ce(fe,t.name),ae(" {"),oe(),se(),_(t.members),ue(),ae("}"),oe()}function V(e){Te(e),ce(fe,e.name);var t=n.getConstantValue(e);void 0!==t&&(ae(" = "),ae(t.toString())),ae(","),oe()}function j(e){return 144===e.parent.kind&&16&e.parent.flags}function W(t){function n(t){function n(n){var r;switch(t.parent.kind){case 217:r=e.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 218:r=e.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 149:r=e.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 148:r=e.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 144:case 143:r=64&t.parent.flags?e.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:217===t.parent.parent.kind?e.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:e.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;break;case 216:r=e.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;default:e.Debug.fail("This is unknown parent for type parameter: "+t.parent.kind)}return{diagnosticMessage:r,errorNode:t,typeName:t.name}}se(),Te(t),ue(),ce(fe,t.name),t.constraint&&!j(t)&&(ae(" extends "),153===t.parent.kind||154===t.parent.kind||t.parent.parent&&156===t.parent.parent.kind?(e.Debug.assert(144===t.parent.kind||143===t.parent.kind||153===t.parent.kind||154===t.parent.kind||148===t.parent.kind||149===t.parent.kind),A(t.constraint)):S(t.constraint,n))}t&&(ae("<"),v(t,n),ae(">"))}function q(t,n){function r(t){function r(r){var i;return i=217===t.parent.parent.kind?n?e.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:e.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1:e.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1,{diagnosticMessage:i,errorNode:t,typeName:t.parent.parent.name}}e.isSupportedExpressionWithTypeArguments(t)?S(t,r):n||93!==t.expression.kind||ae("null")}t&&(ae(n?" implements ":" extends "),v(t,r))}function z(t){Te(t),x(t),128&t.flags&&ae("abstract "),ae("class "),ce(fe,t.name);var n=le;le=t,W(t.typeParameters);var r=e.getClassExtendsHeritageClauseElement(t);r&&q([r],!1),q(e.getClassImplementsHeritageClauseElements(t),!0),ae(" {"),oe(),se(),function(t){t&&e.forEach(t.parameters,function(e){56&e.flags&&Y(e)})}(e.getFirstConstructorWithBody(t)),_(t.members),ue(),ae("}"),oe(),le=n}function H(t){Te(t),x(t),ae("interface "),ce(fe,t.name);var n=le;le=t,W(t.typeParameters),q(e.getInterfaceBaseTypeNodes(t),!1),ae(" {"),oe(),se(),_(t.members),ue(),ae("}"),oe(),le=n}function Y(t){e.hasDynamicName(t)||(Te(t),R(t),J(t),ae(";"),oe())}function J(t){function r(n){return 214===t.kind?n.errorModuleName?2===n.accessibility?e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1:142===t.kind||141===t.kind?64&t.flags?n.errorModuleName?2===n.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:217===t.parent.kind?n.errorModuleName?2===n.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:n.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1:void 0}function i(e){var n=r(e);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}function a(e){for(var t=[],n=0,r=e.elements;n0?e.parameters[0].type:void 0}function r(t){var n;return 147===i.kind?(n=64&i.parent.flags?t.errorModuleName?e.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1,{diagnosticMessage:n,errorNode:i.parameters[0],typeName:i.name}):(n=64&i.flags?t.errorModuleName?2===t.accessibility?e.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0:t.errorModuleName?2===t.accessibility?e.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0,{diagnosticMessage:n,errorNode:i.name,typeName:void 0})}if(!e.hasDynamicName(t)){var i,a=e.getAllAccessorDeclarations(t.parent.members,t);if(t===a.firstAccessor){if(Te(a.getAccessor),Te(a.setAccessor),R(t),ce(fe,t.name),!(16&t.flags)){i=t;var o=n(t);if(!o){var s=146===t.kind?a.setAccessor:a.getAccessor;o=n(s),o&&(i=s)}h(t,o,r)}ae(";"),oe()}}}function Z(t){e.hasDynamicName(t)||n.isImplementationOfOverload(t)||(Te(t),216===t.kind?x(t):144===t.kind&&R(t),216===t.kind?(ae("function "),ce(fe,t.name)):145===t.kind?ae("constructor"):(ce(fe,t.name),e.hasQuestionToken(t)&&ae("?")),te(t))}function ee(e){Te(e),te(e)}function te(t){function n(n){var r;switch(t.kind){case 149:r=n.errorModuleName?e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 148:r=n.errorModuleName?e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 150:r=n.errorModuleName?e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 144:case 143:r=64&t.flags?n.errorModuleName?2===n.accessibility?e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:217===t.parent.kind?n.errorModuleName?2===n.accessibility?e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:n.errorModuleName?e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;break;case 216:r=n.errorModuleName?2===n.accessibility?e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:e.Debug.fail("This is unknown kind for signature: "+t.kind)}return{diagnosticMessage:r,errorNode:t.name||t}}var r=le;le=t,149!==t.kind&&154!==t.kind||ae("new "),W(t.typeParameters),ae(150===t.kind?"[":"("),v(t.parameters,ne),ae(150===t.kind?"]":")");var i=153===t.kind||154===t.kind;i||156===t.parent.kind?t.type&&(ae(i?" => ":": "),A(t.type)):145===t.kind||16&t.flags||y(t,n),le=r,i||(ae(";"),oe())}function ne(t){function r(e){var n=i(e);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}function i(n){switch(t.parent.kind){case 145:return n.errorModuleName?2===n.accessibility?e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 149:return n.errorModuleName?e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 148:return n.errorModuleName?e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 144:case 143:return 64&t.parent.flags?n.errorModuleName?2===n.accessibility?e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:217===t.parent.parent.kind?n.errorModuleName?2===n.accessibility?e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:n.errorModuleName?e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;case 216:return n.errorModuleName?2===n.accessibility?e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;default:e.Debug.fail("This is unknown parent for parameter: "+t.parent.kind)}}function a(e){if(164===e.kind)ae("{"),v(e.elements,o),ae("}");else if(165===e.kind){ae("[");var t=e.elements;v(t,o),t&&t.hasTrailingComma&&ae(", "),ae("]")}}function o(t){190===t.kind?ae(" "):166===t.kind&&(t.propertyName&&(ce(fe,t.propertyName),ae(": ")),t.name&&(e.isBindingPattern(t.name)?a(t.name):(e.Debug.assert(69===t.name.kind),t.dotDotDotToken&&ae("..."),ce(fe,t.name))))}se(),Te(t),t.dotDotDotToken&&ae("..."),e.isBindingPattern(t.name)?a(t.name):ce(fe,t.name),n.isOptionalParameter(t)&&ae("?"),ue(),153===t.parent.kind||154===t.parent.kind||156===t.parent.parent.kind?G(t):16&t.parent.flags||h(t,t.type,r)}function re(e){switch(e.kind){case 216:case 221:case 224:case 218:case 217:case 219:case 220:return w(e,N(e));case 196:return w(e,X(e));case 225:return w(e,!e.importClause);case 231:return U(e);case 145:case 144:case 143:return Z(e);case 149:case 148:case 150:return ee(e);case 146:case 147:return Q(e);case 142:case 141:return Y(e);case 250:return V(e);case 230:return C(e);case 251:return T(e)}}function ie(n,r){function a(t,i,a){a&&!r||(e.Debug.assert(!!t.declarationFilePath||e.isSourceFileJavaScript(n),"Declaration file is not present only for javascript files"),o=t.declarationFilePath||t.jsFilePath,s=a)}var o,s=!1;return e.isDeclarationFile(n)?o=n.fileName:e.forEachExpectedEmitFile(t,a,n),o&&(o=e.getRelativePathToDirectoryOrUrl(e.getDirectoryPath(e.normalizeSlashes(i)),o,t.getCurrentDirectory(),t.getCanonicalFileName,!1),Ne+='/// '+ve),s}var ae,oe,se,ue,ce,le,pe,fe,de,me,he,ye,_e,ge,ve=t.getNewLine(),be=t.getCompilerOptions(),Se=c(),Ae=!1,Te=be.removeComments?function(e){}:b,Ee=be.stripInternal?u:re,Ce=[],Ne="",we=[],ke=!1,xe=[];return e.forEach(a,function(n){if(!e.isSourceFileJavaScript(n)){if(be.noResolve||e.forEach(n.referencedFiles,function(r){var i=e.tryResolveScriptReference(t,n,r);i&&!e.contains(we,i)&&(ie(i,!o&&!ke)&&(ke=!0),we.push(i))}),pe=!1,o&&e.isExternalModule(n)?e.isExternalModule(n)&&(_e=!0,ae('declare module "'+e.getResolvedExternalModuleName(t,n)+'" {'),oe(),se(),T(n),ue(),ae("}"),oe()):(_e=!1,T(n)),Ce.length){var r=Se;e.forEach(Ce,function(t){if(t.isVisible&&!t.asynchronousOutput){e.Debug.assert(225===t.node.kind),c(),e.Debug.assert(0===t.indent||1===t.indent&&o);for(var n=0;n0),ia(),Lt(t,n[0])?i&&ta(" "):ra();for(var a=0,o=n.length;a1)switch(t.charCodeAt(1)){case 98:case 66:case 111:case 79:return!0}return!1}function z(t){var n=H(t);!y.sourceMap&&!y.inlineSourceMap||9!==t.kind&&!e.isTemplateLiteralKind(t.kind)?ta(_<2&&q(t,n)?t.text:n):ea.writeLiteral(n)}function H(t){if(_<2&&(e.isTemplateLiteralKind(t.kind)||t.hasExtendedUnicodeEscape))return Y('"',t.text,'"');if(t.parent)return e.getTextOfNodeFromSourceText(ki,t);switch(t.kind){case 9:return Y('"',t.text,'"');case 11:return Y("`",t.text,"`");case 12:return Y("`",t.text,"${");case 13:return Y("}",t.text,"${");case 14:return Y("}",t.text,"`");case 8:return t.text}e.Debug.fail("Literal kind '"+t.kind+"' not accounted for.")}function Y(t,n,r){return t+e.escapeNonAsciiCharacters(e.escapeString(n))+r}function J(t){var n=e.getTextOfNodeFromSourceText(ki,t),r=11===t.kind||14===t.kind;n=n.substring(1,n.length-(r?1:2)),n=n.replace(/\r\n?/g,"\n"),n=e.escapeString(n),ta('"'+n+'"')}function G(t,n){ta("["),11===t.template.kind?n(t.template):(n(t.template.head),e.forEach(t.template.templateSpans,function(e){ta(", "),n(e.literal)})),ta("]")}function X(t){var n=P(0);ta("("),ri(n),ta(" = "),G(t,ri),ta(", "),ri(n),ta(".raw = "),G(t,J),ta(", "),F(t.tag,he(t.tag)),ta("("),ri(n),186===t.template.kind&&e.forEach(t.template.templateSpans,function(e){ta(", ");var t=184===e.expression.kind&&24===e.expression.operatorToken.kind;F(e.expression,t)}),ta("))")}function $(t){function n(e){switch(e.kind){case 184:switch(e.operatorToken.kind){case 37:case 39:case 40:return 1;case 35:case 36:return 0;default:return-1}case 187:case 185:return-1;default:return 1}}if(_>=2)return void e.forEachChild(t,ri);var r=e.isExpression(t.parent)&&function(e,t){switch(t.kind){case 171:case 172:return t.expression===e;case 173:case 175:return!1;default:return n(t)!==-1}}(t,t.parent);r&&ta("(");var i=!1;(function(){return e.Debug.assert(0!==t.templateSpans.length),0!==t.head.text.length||0===t.templateSpans[0].literal.text.length})()&&(z(t.head),i=!0);for(var a=0,o=t.templateSpans.length;a0||i)&&ta(" + "),F(s.expression,u),0!==s.literal.text.length&&(ta(" + "),z(s.literal))}r&&ta(")")}function Q(e){ri(e.expression),ri(e.literal)}function Z(t){function n(t){69===t.kind&&e.isIntrinsicJsxName(t.text)?(ta('"'),ri(t),ta('"')):ri(t)}function r(e){/^[A-Za-z_]\w*$/.test(e.text)?ri(e):(ta('"'),ri(e),ta('"'))}function i(e){r(e.name),ta(": "),e.initializer?ri(e.initializer):ta("true")}function a(t,r){var a=e.createSynthesizedNode(69);if(a.text=y.reactNamespace?y.reactNamespace:"React",a.parent=t,vi(t),re(a),ta(".createElement("),n(t.tagName),ta(", "),0===t.attributes.length)ta("null");else{var o=t.attributes;if(e.forEach(o,function(e){return 242===e.kind})){re(a),ta(".__spread(");for(var s=!1,u=0;u0&&ta(", "),ri(o[u].expression)):(e.Debug.assert(241===o[u].kind),s?ta(", "):(s=!0,u>0&&ta(", "),ta("{")),i(o[u]));s&&ta("}"),ta(")")}else{ta("{");for(var u=0,c=o.length;u0&&ta(", "),i(o[u]);ta("}")}}if(r)for(var u=0;u0&&ta(" "),242===t[i].kind?r(t[i]):(e.Debug.assert(241===t[i].kind),n(t[i]))}function a(e){ta("<"),ri(e.tagName),(e.attributes.length>0||237===e.kind)&&ta(" "),i(e.attributes),ta(237===e.kind?"/>":">")}function o(e){ta("")}236===t.kind?function(e){a(e.openingElement);for(var t=0,n=e.children.length;t=2)ta("super");else{ta(256&r.getNodeCheckFlags(e)?"_super.prototype":"_super")}}function ue(e){ta("{ ");var t=e.elements;K(t,0,t.length,!1,t.hasTrailingComma),ta(" }")}function ce(e){ta("[");var t=e.elements;K(t,0,t.length,!1,t.hasTrailingComma),ta("]")}function le(t){t.propertyName&&(ri(t.propertyName),ta(": ")),t.dotDotDotToken&&ta("..."),e.isBindingPattern(t.name)?ri(t.name):Yt(t),U(" = ",t.initializer)}function pe(e){ta("..."),ri(e.expression)}function fe(t){ta(e.tokenToString(114)),t.asteriskToken&&ta("*"),t.expression&&(ta(" "),ri(t.expression))}function de(t){var n=me(t);n&&ta("("),ta(e.tokenToString(114)),ta(" "),ri(t.expression),n&&ta(")")}function me(t){return 184===t.parent.kind&&!e.isAssignmentOperator(t.parent.operatorToken.kind)||185===t.parent.kind&&t.parent.condition===t}function he(e){switch(e.kind){case 69:case 167:case 169:case 170:case 171:case 175:return!1}return!0}function ye(e,t,n,r,i){for(var a=0,o=0,s=e.length;a0&&ta(", ");var u=e[a];if(188===u.kind)u=u.expression,F(u,0===o&&he(u)),++a===s&&0===o&&t&&167!==u.kind&&ta(".slice()");else{for(var c=a;c1&&i&&ta(")")}function _e(e){return 188===e.kind}function ge(t){var n=t.elements;0===n.length?ta("[]"):_>=2||!e.forEach(n,_e)?(ta("["),B(t,t.elements,n.hasTrailingComma,!1),ta("]")):ye(n,!0,0!=(1024&t.flags),n.hasTrailingComma,!0)}function ve(e,t){if(0===t)return void ta("{}");if(ta("{"),t>0){var n=e.properties;if(t===n.length)B(e,n,_>=1,!0);else{var r=0!=(1024&e.flags);r?ia():ta(" "),K(n,0,t,r,!1),r?aa():ta(" ")}}ta("}")}function be(t,n){function r(){i?(ta(","),ra()):ta(", ")}var i=0!=(1024&t.flags),a=t.properties;ta("("),i&&ia();var o=P(0);ri(o),ta(" = "),ve(t,n);for(var s=n,u=a.length;s=2&&e.asteriskToken&&ta("*"),ri(e.name),_<2&&ta(": function "),An(e)}function ke(e){ri(e.name),ta(": "),Ai(e.initializer.pos),ri(e.initializer)}function xe(e){var t=r.getReferencedExportContainer(e);return t&&251!==t.kind}function Re(e){na(ki,e.name),(5!==g||xe(e.name))&&(ta(": "),ri(e.name)),_>=2&&e.objectAssignmentInitializer&&(ta(" = "),ri(e.objectAssignmentInitializer))}function Ie(t){var n=De(t);if(void 0!==n){if(ta(n.toString()),!y.removeComments){ta(" /* "+(169===t.kind?e.declarationNameToString(t.name):e.getTextOfNode(t.argumentExpression))+" */")}return!0}return!1}function De(e){if(!y.isolatedModules)return 169===e.kind||170===e.kind?r.getConstantValue(e):void 0}function Me(t,n,r,i){var a=!e.nodeIsSynthesized(t)&&!Ut(n,r),o=at(r);return a||o?(ia(),ra(),!0):(i&&ta(i),!1)}function Pe(t){if(!Ie(t)){if(2===_&&95===t.expression.kind&&We(t)){var n=e.createSynthesizedNode(9);return n.text=t.name.text,void qe(t.expression,n)}ri(t.expression);var r=Me(t,t.expression,t.dotToken),i=!1;if(!r)if(8===t.expression.kind){var a=e.getTextOfNodeFromSourceText(ki,t.expression);i=a.indexOf(e.tokenToString(21))<0}else{var o=De(t.expression);i=isFinite(o)&&Math.floor(o)===o}ta(i?" .":".");var s=Me(t,t.dotToken,t.name);ri(t.name),st(r,s)}}function Le(e){ri(e.left),ta("."),ri(e.right)}function Oe(e,t){if(69===e.left.kind)Ue(e.left,t);else if(t){var n=P(0);ta("("),si(n),ta(" = "),Ue(e.left,!0),ta(") && "),si(n)}else Ue(e.left,!1);ta("."),ri(e.right)}function Ue(e,t){switch(e.kind){case 69:t&&(ta("typeof "),re(e),ta(" !== 'undefined' && ")),re(e);break;case 136:Oe(e,t);break;default:si(e)}}function Fe(e){if(!Ie(e)){if(2===_&&95===e.expression.kind&&We(e))return void qe(e.expression,e.argumentExpression);ri(e.expression),ta("["),ri(e.argumentExpression),ta("]")}}function Be(t){return e.forEach(t,function(e){return 188===e.kind})}function Ke(e){for(;175===e.kind||174===e.kind||192===e.kind;)e=e.expression;return e}function Ve(e){if(69===e.kind||97===e.kind||95===e.kind)return ri(e),e;var t=P(0);return ta("("),ri(t),ta(" = "),ri(e),ta(")"),t}function je(e){var t,n=Ke(e.expression);169===n.kind?(t=Ve(n.expression),ta("."),ri(n.name)):170===n.kind?(t=Ve(n.expression),ta("["),ri(n.argumentExpression),ta("]")):95===n.kind?(t=n,ta("_super")):ri(e.expression),ta(".apply("),t?95===t.kind?oe(t):ri(t):ta("void 0"),ta(", "),ye(e.arguments,!1,!1,!1,!0),ta(")")}function We(t){if(2===_){var n=e.getSuperContainer(t,!1);if(n&&6144&r.getNodeCheckFlags(n))return!0}return!1}function qe(t,n){var i=e.getSuperContainer(t,!1),a=4096&r.getNodeCheckFlags(i);ta("_super("),ri(n),ta(a?").value":")")}function ze(t){if(_<2&&Be(t.arguments))return void je(t);var n=t.expression,r=!1,i=!1;95===n.kind?(se(n),r=!0):(r=e.isSuperPropertyOrElementAccess(n),i=r&&We(t),ri(n)),r&&(_<2||i)?(ta(".call("),oe(n),t.arguments.length&&(ta(", "),V(t.arguments)),ta(")")):(ta("("),V(t.arguments),ta(")"))}function He(e){if(ta("new "),1===_&&e.arguments&&Be(e.arguments)){ta("(");var t=Ve(e.expression);ta(".bind.apply("),ri(t),ta(", [void 0].concat("),ye(e.arguments,!1,!1,!1,!1),ta(")))"),ta("()")}else ri(e.expression),e.arguments&&(ta("("),V(e.arguments),ta(")"))}function Ye(e){_>=2?(ri(e.tag),ta(" "),ri(e.template)):X(e)}function Je(t){if(!e.nodeIsSynthesized(t)&&177!==t.parent.kind&&(174===t.expression.kind||192===t.expression.kind)){for(var n=t.expression.expression;174===n.kind||192===n.kind;)n=n.expression;if(!(182===n.kind||180===n.kind||179===n.kind||178===n.kind||183===n.kind||172===n.kind||171===n.kind&&172===t.parent.kind||176===n.kind&&171===t.parent.kind||8===n.kind&&169===t.parent.kind))return void ri(n)}ta("("),ri(t.expression),ta(")")}function Ge(t){ta(e.tokenToString(78)),ta(" "),ri(t.expression)}function Xe(t){ta(e.tokenToString(103)),ta(" "),ri(t.expression)}function $e(t){ta(e.tokenToString(101)),ta(" "),ri(t.expression)}function Qe(t){return!(!Ir()||69!==t.kind||e.nodeIsSynthesized(t))&&nt(!t.parent||214!==t.parent.kind&&166!==t.parent.kind?r.getReferencedValueDeclaration(t):t.parent,!0)}function Ze(t){var n=(41===t.operator||42===t.operator)&&Qe(t.operand);if(n&&(ta(Pi+'("'),si(t.operand),ta('", ')),ta(e.tokenToString(t.operator)),182===t.operand.kind){var r=t.operand;35!==t.operator||35!==r.operator&&41!==r.operator?36!==t.operator||36!==r.operator&&42!==r.operator||ta(" "):ta(" ")}ri(t.operand),n&&ta(")")}function et(t){Qe(t.operand)?(ta("("+Pi+'("'),si(t.operand),ta('", '),ta(e.tokenToString(t.operator)),ri(t.operand),ta(41===t.operator?") - 1)":") + 1)")):(ri(t.operand),ta(e.tokenToString(t.operator)))}function tt(e){return nt(e,!1)}function nt(t,n){if(!t||!Ir())return!1;for(var r=e.getRootDeclaration(t).parent;r;){if(251===r.kind)return!n||0!=(2&e.getCombinedNodeFlags(t));if(e.isDeclaration(r))return!1;r=r.parent}}function rt(t){var n=t.left;if(60===t.operatorToken.kind){var r=void 0,i=!1;if(e.isElementAccessExpression(n)){i=!0,ta("("),r=e.createSynthesizedNode(170,!1);var a=en(n.expression,!1,!1);if(r.expression=a,8!==n.argumentExpression.kind&&9!==n.argumentExpression.kind){var o=P(268435456);r.argumentExpression=o,Zt(o,n.argumentExpression,!0,n.expression)}else r.argumentExpression=n.argumentExpression;ta(", ")}else if(e.isPropertyAccessExpression(n)){i=!0,ta("("),r=e.createSynthesizedNode(169,!1);var a=en(n.expression,!1,!1);r.expression=a,r.dotToken=n.dotToken,r.name=n.name,ta(", ")}ri(r||n),ta(" = "),ta("Math.pow("),ri(r||n),ta(", "),ri(t.right),ta(")"),i&&ta(")")}else ta("Math.pow("),ri(n),ta(", "),ri(t.right),ta(")")}function it(t){if(_<2&&56===t.operatorToken.kind&&(168===t.left.kind||167===t.left.kind))nn(t,198===t.parent.kind);else{var n=t.operatorToken.kind>=56&&t.operatorToken.kind<=68&&Qe(t.left);if(n&&(ta(Pi+'("'),si(t.left),ta('", ')),38===t.operatorToken.kind||60===t.operatorToken.kind)rt(t);else{ri(t.left);var r=Me(t,t.left,t.operatorToken,24!==t.operatorToken.kind?" ":void 0);ta(e.tokenToString(t.operatorToken.kind));var i=Me(t,t.operatorToken,t.right," ");ri(t.right),st(r,i)}n&&ta(")")}}function at(t){return e.nodeIsSynthesized(t)&&t.startsOnNewLine}function ot(e){ri(e.condition);var t=Me(e,e.condition,e.questionToken," ");ta("?");var n=Me(e,e.questionToken,e.whenTrue," ");ri(e.whenTrue),st(t,n);var r=Me(e,e.whenTrue,e.colonToken," ");ta(":");var i=Me(e,e.colonToken,e.whenFalse," ");ri(e.whenFalse),st(r,i)}function st(e,t){e&&aa(),t&&aa()}function ut(e){if(e&&195===e.kind){var t=e;return 0===t.statements.length&&Ut(t,t)}}function ct(t){if(ut(t))return O(15,t.pos),ta(" "),void O(16,t.statements.end);O(15,t.pos),ia(),222===t.kind&&(e.Debug.assert(221===t.parent.kind),_n(t.parent)),j(t.statements),222===t.kind&&L(!0),aa(),ra(),O(16,t.statements.end)}function lt(e){195===e.kind?(ta(" "),ri(e)):(ia(),ra(),ri(e),aa())}function pt(e){F(e.expression,177===e.expression.kind),ta(";")}function ft(e){var t=O(88,e.pos);ta(" "),t=O(17,t),ri(e.expression),O(18,e.expression.end),lt(e.thenStatement),e.elseStatement&&(ra(),O(80,e.thenStatement.end),199===e.elseStatement.kind?(ta(" "),ri(e.elseStatement)):lt(e.elseStatement))}function dt(e){bt(e,mt)}function mt(e,t){ta("do"),t?Et(t,!0):At(e,!0),195===e.statement.kind?ta(" "):ra(),ta("while ("),ri(e.expression),ta(");")}function ht(e){bt(e,yt)}function yt(e,t){ta("while ("),ri(e.expression),ta(")"),t?Et(t,!0):At(e,!0)}function _t(t){if(Rr(t,!0))return!1;if(Ki&&0==(24576&e.getCombinedNodeFlags(t))){for(var n=0,r=t.declarations;n=2?e.isLet(t)?"let ":e.isConst(t)?"const ":"var ":"var "),!0}function gt(e){for(var t=!1,n=0,r=e.declarations;n=1&&(_t(r),ri(r.declarations[0]))}else ri(e.initializer);ta(203===e.kind?" in ":" of "),ri(e.expression),O(18,e.expression.end),t?Et(t,!0):At(e,!0)}function xt(t,n){var r=O(86,t.pos);ta(" "),r=O(17,r);var i=D(268435456),a=e.createSynthesizedNode(69);a.text=69===t.expression.kind?E(t.expression.text):T(0),ua(t.expression),ta("var "),si(i),ta(" = 0"),ca(t.expression),ta(", "),ua(t.expression),si(a),ta(" = "),si(t.expression),ca(t.expression),ta("; "),ua(t.expression),si(i),ta(" < "),ii(a),ta(".length"),ca(t.expression),ta("; "),ua(t.expression),si(i),ta("++"),ca(t.expression),O(18,t.expression.end),ta(" {"),ra(),ia();var o=Ee(a,i);if(ua(t.initializer),215===t.initializer.kind){ta("var ");var s=t.initializer;if(s.declarations.length>0){var u=s.declarations[0];e.isBindingPattern(u.name)?nn(u,!1,o):(ii(u),ta(" = "),si(o))}else si(D(0)),ta(" = "),si(o)}else{var c=Ae(t.initializer,56,o,!1);167===t.initializer.kind||168===t.initializer.kind?nn(c,!0,void 0):ii(c)}ca(t.initializer),ta(";"),n?(ra(),Et(n,!1)):At(t,!1),ra(),aa(),ta("}")}function Rt(e){if(Ki){var t=206===e.kind?2:4;if(!(e.label&&Ki.labels&&Ki.labels[e.label.text]||!e.label&&Ki.allowedNonLabeledJumps&t)){if(ta("return "),Tt(Ki,1,!1),e.label){var n=void 0;206===e.kind?(n="break-"+e.label.text,u(Ki,!0,e.label.text,n)):(n="continue-"+e.label.text,u(Ki,!1,e.label.text,n)),ta('"'+n+'";')}else 206===e.kind?(Ki.nonLocalJumps|=2,ta('"break";')):(Ki.nonLocalJumps|=4,ta('"continue";'));return}}O(206===e.kind?70:75,e.pos),U(" ",e.label),ta(";")}function It(e){if(Ki)return Ki.nonLocalJumps|=8,ta("return { value: "),e.expression?ri(e.expression):ta("void 0"),void ta(" };");O(94,e.pos),U(" ",e.expression),ta(";")}function Dt(e){ta("with ("),ri(e.expression),ta(")"),lt(e.statement)}function Mt(e){var t=O(96,e.pos);ta(" "),O(17,t),ri(e.expression),t=O(18,e.expression.end),ta(" ");var n;Ki&&(n=Ki.allowedNonLabeledJumps,Ki.allowedNonLabeledJumps|=2),Pt(e.caseBlock,t),Ki&&(Ki.allowedNonLabeledJumps=n)}function Pt(e,t){O(15,t),ia(),j(e.clauses),aa(),ra(),O(16,e.clauses.end)}function Lt(t,n){return e.getLineOfLocalPositionFromLineMap(xi,e.skipTrivia(ki,t.pos))===e.getLineOfLocalPositionFromLineMap(xi,e.skipTrivia(ki,n.pos))}function Ot(t,n){return e.getLineOfLocalPositionFromLineMap(xi,t.end)===e.getLineOfLocalPositionFromLineMap(xi,n.end)}function Ut(t,n){return e.getLineOfLocalPositionFromLineMap(xi,t.end)===e.getLineOfLocalPositionFromLineMap(xi,e.skipTrivia(ki,n.pos))}function Ft(e){244===e.kind?(ta("case "),ri(e.expression),ta(":")):ta("default:"),1===e.statements.length&&Lt(e,e.statements[0])?(ta(" "),ri(e.statements[0])):(ia(),j(e.statements),aa())}function Bt(e){ta("throw "),ri(e.expression),ta(";")}function Kt(e){ta("try "),ri(e.tryBlock),ri(e.catchClause),e.finallyBlock&&(ra(),ta("finally "),ri(e.finallyBlock))}function Vt(e){ra();var t=O(72,e.pos);ta(" "),O(17,t),ri(e.variableDeclaration),O(18,e.variableDeclaration?e.variableDeclaration.end:t),ta(" "),ct(e.block)}function jt(e){O(76,e.pos),ta(";")}function Wt(e){ri(e.label),ta(": ")}function qt(t){e.isIterationStatement(t.statement,!1)&&vt(t.statement)||Wt(t),Ki&&(Ki.labels||(Ki.labels={}),Ki.labels[t.label.text]=t.label.text),ri(t.statement),Ki&&(Ki.labels[t.label.text]=void 0)}function zt(e){do{e=e.parent}while(e&&221!==e.kind);return e}function Ht(e){var t=zt(e);ta(t?R(t):"exports")}function Yt(t){if(ua(t.name),2&e.getCombinedNodeFlags(t)){var n=zt(t);n?(ta(R(n)),ta(".")):5!==g&&4!==g&&ta("exports.")}ii(t.name),ca(t.name)}function Jt(){var t=e.createSynthesizedNode(8);t.text="0";var n=e.createSynthesizedNode(180);return n.expression=t,n}function Gt(t){251===t.parent.kind&&(e.Debug.assert(!!(512&t.flags)||230===t.kind),1!==g&&2!==g&&3!==g||Di||(0!==_?(ta('Object.defineProperty(exports, "__esModule", { value: true });'),ra()):(ta("exports.__esModule = true;"),ra())))}function Xt(e){2&e.flags&&(ra(),ua(e),4===g&&e.parent===wi?(ta(Pi+'("'),512&e.flags?ta("default"):ii(e.name),ta('", '),mn(e),ta(")")):(512&e.flags?(Gt(e),ta(0===_?'exports["default"]':"exports.default")):Yt(e),ta(" = "),mn(e)),ca(e),ta(";"))}function $t(t){if(4!==g&&!Gi&&Ji&&e.hasProperty(Ji,t.text))for(var n=0,r=Ji[t.text];n0,n);return m++,r}function a(t,n,r){t=i(t,!0,r);var a=e.createSynthesizedNode(184);return a.left=t,a.operatorToken=e.createSynthesizedNode(32),a.right=Jt(),o(a,n,t)}function o(t,n,r){var i=e.createSynthesizedNode(185);return i.condition=t,i.questionToken=e.createSynthesizedNode(53),i.whenTrue=n,i.colonToken=e.createSynthesizedNode(54),i.whenFalse=r,i}function s(t){var n=e.createSynthesizedNode(8);return n.text=""+t,n}function u(t,n){var r,a=137===n.kind;return a?r=i(n.expression,!1,n):(r=e.createSynthesizedNode(n.kind),r.text=e.unescapeIdentifier(n.text)),a||69!==r.kind?Ee(t,r):Te(t,r)}function c(t,n){var r=e.createSynthesizedNode(171),i=e.createSynthesizedNode(69);return i.text="slice",r.expression=Te(t,i),r.arguments=e.createSynthesizedNodeArray(),r.arguments[0]=s(n),r}function l(e,t,n){var r=e.properties;1!==r.length&&(t=i(t,!0,n));for(var a=0,o=r;a0,n),m++)}function d(t,n){if(t.initializer?n=n?a(n,t.initializer,t):t.initializer:n||(n=Jt()),e.isBindingPattern(t.name)){var r=t.name,o=r.elements,l=o.length;1!==l&&(n=i(n,0!==l,t));for(var p=0;p0,t),m++}var m=0,h=!1;if(214===t.kind){var y=2&e.getCombinedNodeFlags(t),_=tt(t);h=!y&&!_}else 139===t.kind&&(h=!0);184===t.kind?function(t){var r=t.left,a=t.right;e.isEmptyObjectLiteralOrArrayLiteral(r)?ri(a):n?f(r,a,e.nodeIsSynthesized(t)?r:t):(175!==t.parent.kind&&ta("("),a=i(a,!0,t),f(r,a,t),ta(", "),ri(a),175!==t.parent.kind&&ta(")"))}(t):(e.Debug.assert(!n),tn(t)&&oa.changeEmitSourcePos(),d(t,r))}function rn(t){if(e.isBindingPattern(t.name))_<2?nn(t,!1):(ri(t.name),U(" = ",t.initializer));else{var n=t.initializer;if(!n&&_<2&&69===t.name.kind){var i=e.getEnclosingBlockScopeContainer(t),a=r.getNodeCheckFlags(t),o=131072&a,s=262144&a,u=e.isBlockScopedContainerTopLevel(i)||o&&s&&195===i.kind&&e.isIterationStatement(i.parent,!1);8192&e.getCombinedNodeFlags(t)&&!u&&203!==i.kind&&204!==i.kind&&(!r.isDeclarationWithCollidingName(t)||s&&!o&&!e.isIterationStatement(i,!1))&&(n=Jt())}var c=Qe(t.name);c&&(ta(Pi+'("'),ii(t.name),ta('", ')),Yt(t),U(" = ",n),c&&ta(")")}}function an(t){if(190!==t.kind){var n=t.name;69===n.kind?$t(n):e.isBindingPattern(n)&&e.forEach(n.elements,an)}}function on(e){return!!(2&e.flags)&&5===g&&251===e.parent.kind}function sn(t){var n=!1;if(2&t.flags?on(t)&&(ta("export "),n=_t(t.declarationList)):n=_t(t.declarationList),n)V(t.declarationList.declarations),ta(";");else{gt(t.declarationList)&&ta(";")}5!==g&&t.parent===wi&&e.forEach(t.declarationList.declarations,an)}function un(e){if(!(2&e.flags))return!0;if(on(e))return!0;for(var t=0,n=e.declarationList.declarations;t=2}function mn(e){e.name?ii(e.name):ta(R(e))}function hn(e){return 176===e.kind?!!e.name:216===e.kind?!!e.name||5!==g:void 0}function yn(t){if(e.nodeIsMissing(t.body))return gi(t);var n=t.kind,r=t.parent;144!==n&&143!==n&&r&&248!==r.kind&&171!==r.kind&&167!==r.kind&&vi(t),ua(t),dn(t)||(on(t)&&(ta("export "),512&t.flags&&ta("default ")),ta("function"),_>=2&&t.asteriskToken&&ta("*"),ta(" ")),hn(t)&&mn(t),An(t),5!==g&&216===n&&r===wi&&t.name&&$t(t.name),ca(t),144!==n&&143!==n&&Si(t)}function _n(e){4&r.getNodeCheckFlags(e)&&(ra(),ua(e),ta("var _this = this;"),ca(e))}function gn(t){if(ia(),ta("("),t){var n=t.parameters,r=_<2&&e.hasRestParameter(t)?1:0;K(n,0,n.length-r,!1,!1)}ta(")"),aa()}function vn(e){if(1===e.parameters.length&&e.pos===e.parameters[0].pos)return void ri(e.parameters[0]);gn(e)}function bn(t){var n=e.getEntityNameFromTypeNode(t.type),i=177===t.kind,a=0!=(8192&r.getNodeCheckFlags(t));i||(ta(" {"),ia(),ra(),4096&r.getNodeCheckFlags(t)?(ei("\nconst _super = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n})(name => super[name], (name, value) => super[name] = value);"),ra()):2048&r.getNodeCheckFlags(t)&&(ta("const _super = name => super[name];"),ra()),ta("return")),ta(" __awaiter(this"),ta(a?", arguments, ":", void 0, "),!n||y.noCustomAsyncPromise&&_>=2?ta("void 0"):Ue(n,!1),ta(", function* ()"),Sn(t),ta(")"),i||(ta(";"),aa(),ra(),ta("}"))}function Sn(e){e.body?195===e.body.kind?Nn(e,e.body):En(e,e.body):ta(" { }")}function An(t){var n=Ki,r=pa,i=zi,a=Hi;Ki=void 0,pa=0,zi=void 0,Hi=void 0,dn(t)?(vn(t),ta(" =>")):gn(t),e.isAsyncFunctionLike(t)?bn(t):Sn(t),on(t)||Xt(t),e.Debug.assert(void 0===Ki),Ki=n,pa=r,zi=i,Hi=a}function Tn(e){_n(e),ln(e),pn(e)}function En(e,t){if(_<2||256&e.flags)return void Cn(e,t);ta(" ");for(var n=t;174===n.kind;)n=n.expression;F(t,168===n.kind)}function Cn(e,t){ta(" {"),ia();var n=ea.getTextPos();Ei(e.body),Tn(e);var r=ea.getTextPos()!==n;aa(),!r&&Lt(e,t)?(ta(" "),ua(t),ta("return "),ri(t),ca(t),ta(";"),L(!1),ta(" ")):(ia(),ra(),vi(e.body),ua(t),ta("return "),ri(t),ca(t),ta(";"),Si(e.body),L(!0),aa(),ra()),ua(e.body),ta("}"),ca(e.body)}function Nn(e,t){ta(" {");var n=ea.getTextPos();ia(),Ei(t.statements);var r=Zr(t.statements,!0);if(Tn(e),aa(),ea.getTextPos()!==n||!Ut(t,t))ia(),W(t.statements,r),L(!0),ra(),fa(t.statements.end),aa();else{for(var i=0,a=t.statements;i=r.length)){var i=r[n];return 198===i.kind&&e.isSuperCallExpression(i.expression)?i:void 0}}}function kn(t){e.forEach(t.parameters,function(e){56&e.flags&&(ra(),ua(e),ua(e.name),ta("this."),si(e.name),ca(e.name),ta(" = "),ri(e.name),ta(";"),ca(e))})}function xn(e){9===e.kind||8===e.kind?(ta("["),ii(e),ta("]")):137===e.kind?Ne(e):(ta("."),ii(e))}function Rn(e,t){for(var n=[],r=0,i=e.members;r=2)||i||r){i&&vi(i),ua(i||t),_<2?(ta("function "),mn(t),gn(i)):(ta("constructor"),i?gn(i):ta(n?"(...args)":"()"));var a=0;ta(" {"),ia(),i&&(a=Zr(i.body.statements,!0),Ei(i.body.statements)),_n(t);var o;if(i?(ln(i),pn(i),n&&(o=wn(i,a))&&(ra(),ri(o)),kn(i)):n&&(ra(),ua(n),ta(_<2?"_super.apply(this, arguments);":"super(...args);"),ca(n)),In(t,Rn(t,!1)),i){var s=i.body.statements;o&&(s=s.slice(1)),W(s,a)}L(!0),ra(),i&&fa(i.body.statements.end),aa(),O(16,i?i.body.statements.end:t.members.end),ca(i||t),i&&Si(i)}}function Un(e){return Bn(e)}function Fn(e){return Bn(e)}function Bn(e){_<2?Vn(e):Kn(e),5!==g&&e.parent===wi&&e.name&&$t(e.name)}function Kn(t){var n,i=e.nodeIsDecorated(t);217===t.kind&&(i?(524288&r.getNodeCheckFlags(t)&&(n=e.unescapeIdentifier(E(t.name?t.name.text:"default")),Bi[e.getNodeId(t)]=n,ta("let "+n+";"),ra()),!on(t)||512&t.flags||ta("export "),ta("let "),mn(t),void 0!==n&&ta(" = "+n),ta(" = ")):on(t)&&(ta("export "),512&t.flags&&ta("default ")));var a,o=Rn(t,!0),s=o.length>0&&189===t.kind;s&&(a=P(0),ta("("),ia(),ri(a),ta(" = ")),ta("class"),(t.name||512&t.flags&&(o.length>0||5!==g)&&!i)&&(ta(" "),mn(t));var u=e.getClassExtendsHeritageClauseElement(t);if(u&&(ta(" extends "),ri(u.expression)),ta(" {"),ia(),ra(),Ln(t,u),Pn(t),aa(),ra(),O(16,t.members.end),i&&(Bi[e.getNodeId(t)]=void 0,ta(";")),s){for(var c=0,l=o;c0)),tr(t,s>=0),aa(),ra(),ta("], "),mn(t),ta(")"),ca(t.decorators||a),ta(";"),ra()}}function zn(t,n){for(var r=0,i=t.members;r0)),tr(a,p>0),aa(),ra(),ta("], "),jn(t,a),ta(", "),te(a.name),_>0&&ta(142!==a.kind?", null":", void 0"),ta(")"),ca(o||c),ta(";"),ra()}}}}function Hn(t,n){var r=0;if(t)for(var i=0,a=0,o=t.parameters;a0)for(var a=0;a0&&ta(", "),r[a].dotDotDotToken){var o=r[a].type;o=157===o.kind?o.elementType:152===o.kind&&o.typeArguments&&1===o.typeArguments.length?o.typeArguments[0]:void 0,$n(o)}else Xn(r[a])}}}function er(t){if(t&&e.isFunctionLike(t)&&t.type)return void $n(t.type);ta("void 0")}function tr(e,t){var n=0;return y.emitDecoratorMetadata&&(Yn(e)&&(t&&ta(", "),ra(),ta("__metadata('design:type', "),Xn(e),ta(")"),n++),Gn(e)&&((t||n)&&ta(", "),ra(),ta("__metadata('design:paramtypes', ["),Zn(e),ta("])"),n++),Jn(e)&&((t||n)&&ta(", "),ra(),ta("__metadata('design:returntype', "),er(e),ta(")"),n++)),n}function nr(e){gi(e)}function rr(t){return!e.isConst(t)||y.preserveConstEnums||y.isolatedModules}function ir(e){if(rr(e)){if(!tt(e)){var t=on(e);(!(2&e.flags)||t&&lr(e,e.symbol&&e.symbol.declarations,220))&&(ua(e),t&&ta("export "),ta("var "),ri(e.name),ca(e),ta(";"))}ra(),ua(e),ta("(function ("),ua(e.name),ta(R(e)),ca(e.name),ta(") {"),ia(),j(e.members),aa(),ra(),O(16,e.members.end),ta(")("),Yt(e),ta(" || ("),Yt(e),ta(" = {}));"),ca(e),!on(e)&&2&e.flags&&!tt(e)&&(ra(),ua(e),ta("var "),ri(e.name),ta(" = "),Yt(e),ca(e),ta(";")),5!==g&&e.parent===wi&&(4===g&&2&e.flags&&(ra(),ta(Pi+'("'),mn(e),ta('", '),mn(e),ta(");")),$t(e.name))}}function ar(e){var t=e.parent;ua(e),ta(R(t)),ta("["),ta(R(t)),ta("["),te(e.name),ta("] = "),or(e),ta("] = "),te(e.name),ca(e),ta(";")}function or(e){var t=r.getConstantValue(e);if(void 0!==t)return void ta(t.toString());e.initializer?ri(e.initializer):ta("undefined")}function sr(e){if(221===e.body.kind){return sr(e.body)||e.body}}function ur(t){return e.isInstantiatedModule(t,y.preserveConstEnums||y.isolatedModules)}function cr(e){return 2===_&&!!(32768&r.getNodeCheckFlags(e))}function lr(t,n,r){return!e.forEach(n,function(e){return e.kind===r&&e.pos0){var c=r.substr(i,a-i+1);n=(n?n+"\" + ' ' + \"":"")+e.escapeString(c)}i=-1}else e.isWhiteSpace(u)||(a=s,i===-1&&(i=s))}if(i!==-1){var c=r.substr(i);n=(n?n+"\" + ' ' + \"":"")+e.escapeString(c)}return n&&(n=n.replace(/&(\w+);/g,function(e,t){if(void 0!==o[t]){var n=String.fromCharCode(o[t]);return'"'===n?'\\"':n}return e})),n}function Jr(t){switch(y.jsx){case 2:var n=Yr(t);return void 0===n||0===n.length?void 0:n;case 1:default:return e.getTextOfNode(t,!0)}}function Gr(t){switch(y.jsx){case 2:ta('"'),ta(Yr(t)),ta('"');break;case 1:default:ea.writeLiteral(e.getTextOfNode(t,!0))}}function Xr(e){if(e.expression)switch(y.jsx){case 1:default:ta("{"),ri(e.expression),ta("}");break;case 2:ri(e.expression)}}function $r(e){return!!e.expression.text.match(/use strict/)}function Qr(e,t){t&&(e&&ra(),ta('"use strict";'))}function Zr(t,n,r){for(var i=!1,a=0;a0,!i&&r),a;$r(t[a])&&(i=!0),(n||a>0)&&ra(),ri(t[a])}return Qr(n,!i&&r),t.length}function ei(e){for(var t=e.split(/\r\n|\r|\n/g),n=0;ne.getRootLength(t)&&!a(t)){o(e.getDirectoryPath(t)),e.sys.createDirectory(t)}}function s(t,n,r,i){try{var a=(new Date).getTime();o(e.getDirectoryPath(e.normalizePath(t))),e.sys.writeFile(t,n,r),e.ioWriteTime+=(new Date).getTime()-a}catch(e){i&&i(e.message)}}var u={},c=-2147024809,l=e.getNewLineCharacter(t);return{getSourceFile:i,getDefaultLibFileName:function(t){return e.combinePaths(e.getDirectoryPath(e.normalizePath(e.sys.getExecutingFilePath())),e.getDefaultLibFileName(t))},writeFile:s,getCurrentDirectory:e.memoize(function(){return e.sys.getCurrentDirectory()}),useCaseSensitiveFileNames:function(){return e.sys.useCaseSensitiveFileNames},getCanonicalFileName:r,getNewLine:function(){return l},fileExists:function(t){return e.sys.fileExists(t)},readFile:function(t){return e.sys.readFile(t)},directoryExists:function(t){return e.sys.directoryExists(t)}}}function f(t,n,r){var i=t.getOptionsDiagnostics(r).concat(t.getSyntacticDiagnostics(n,r),t.getGlobalDiagnostics(r),t.getSemanticDiagnostics(n,r));return t.getCompilerOptions().declaration&&(i=i.concat(t.getDeclarationDiagnostics(n,r))),e.sortAndDeduplicateDiagnostics(i)}function d(e,t){if("string"==typeof e)return e;for(var n=e,r="",i=0;n;){if(i){r+=t;for(var a=0;a0||s.length>0)return{diagnostics:s,sourceMaps:void 0,emitSkipped:!0}}var u=l().getEmitResolver(i.outFile||i.out?void 0:n),p=(new Date).getTime(),f=e.emitFiles(u,c(r),n);return e.emitTime+=(new Date).getTime()-p,f}function _(t){return ae.get(e.toPath(t,re,K))}function g(t,n,r){if(t)return n(t,r);var i=[];return e.forEach(z.getSourceFiles(),function(t){r&&r.throwIfCancellationRequested(),e.addRange(i,n(t,r))}),e.sortAndDeduplicateDiagnostics(i)}function v(e,t){return g(e,A,t)}function b(e,t){return g(e,E,t)}function S(e,t){var n=z.getCompilerOptions();return!e||n.out||n.outFile?N(e,t):g(e,w,t)}function A(e,t){return e.parseDiagnostics}function T(t){try{return t()}catch(t){throw t instanceof e.OperationCanceledException&&(J=void 0,Y=void 0),t}}function E(t,n){return T(function(){var r=l();e.Debug.assert(!!t.bindDiagnostics);var i=t.bindDiagnostics,a=e.isSourceFileJavaScript(t)?C(t,n):r.getDiagnostics(t,n),o=$.getDiagnostics(t.fileName),s=Q.getDiagnostics(t.fileName);return i.concat(a).concat(o).concat(s)})}function C(t,n){return T(function(){function n(u){if(!u)return!1;switch(u.kind){case 224:return s.push(e.createDiagnosticForNode(u,e.Diagnostics.import_can_only_be_used_in_a_ts_file)),!0;case 230:if(u.isExportEquals)return s.push(e.createDiagnosticForNode(u,e.Diagnostics.export_can_only_be_used_in_a_ts_file)),!0;break;case 217:var c=u;if(o(c.modifiers)||r(c.typeParameters))return!0;break;case 246:if(106===u.token)return s.push(e.createDiagnosticForNode(u,e.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)),!0;break;case 218:return s.push(e.createDiagnosticForNode(u,e.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)),!0;case 221:return s.push(e.createDiagnosticForNode(u,e.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)),!0;case 219:return s.push(e.createDiagnosticForNode(u,e.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)),!0;case 144:case 143:case 145:case 146:case 147:case 176:case 216:case 177:case 216:var l=u;if(o(l.modifiers)||r(l.typeParameters)||a(l.type))return!0;break;case 196:if(o(u.modifiers))return!0;break;case 214:if(a(u.type))return!0;break;case 171:case 172:var p=u;if(p.typeArguments&&p.typeArguments.length>0){var f=p.typeArguments.pos;return s.push(e.createFileDiagnostic(t,f,p.typeArguments.end-f,e.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)),!0}break;case 139:var d=u;if(d.modifiers){var m=d.modifiers.pos;return s.push(e.createFileDiagnostic(t,m,d.modifiers.end-m,e.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)),!0}if(d.questionToken)return s.push(e.createDiagnosticForNode(d.questionToken,e.Diagnostics._0_can_only_be_used_in_a_ts_file,"?")),!0;if(d.type)return s.push(e.createDiagnosticForNode(d.type,e.Diagnostics.types_can_only_be_used_in_a_ts_file)),!0;break;case 142:return s.push(e.createDiagnosticForNode(u,e.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)),!0;case 220:return s.push(e.createDiagnosticForNode(u,e.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)),!0;case 174:var h=u;return s.push(e.createDiagnosticForNode(h.type,e.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)),!0;case 140:return i.experimentalDecorators||s.push(e.createDiagnosticForNode(u,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)),!0}return e.forEachChild(u,n)}function r(n){if(n){var r=n.pos;return s.push(e.createFileDiagnostic(t,r,n.end-r,e.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)),!0}return!1}function a(t){return!!t&&(s.push(e.createDiagnosticForNode(t,e.Diagnostics.types_can_only_be_used_in_a_ts_file)),!0)}function o(t){if(t)for(var n=0,r=t;n=0}function I(t,n){O(e.normalizePath(t),n)}function D(e,t){return e.fileName===t.fileName}function M(e,t){return e.text===t.text}function P(e){return e.text}function L(t){function n(r,o){switch(r.kind){case 225:case 224:case 231:var u=e.getExternalModuleName(r);if(!u||9!==u.kind)break;if(!u.text)break;o&&e.isExternalModuleNameRelative(u.text)||(i||(i=[])).push(u);break;case 221:if(e.isAmbientModule(r)&&(o||4&r.flags||e.isDeclarationFile(t))){var c=r.name;if(s||o&&!e.isExternalModuleNameRelative(c.text))(a||(a=[])).push(c);else if(!o)for(var l=0,p=r.body.statements;l1})&&Q.add(e.createCompilerDiagnostic(e.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files))}if(i.noEmit?(i.out&&Q.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"noEmit","out")),i.outFile&&Q.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"noEmit","outFile")),i.outDir&&Q.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"noEmit","outDir")),i.declaration&&Q.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"noEmit","declaration"))):i.allowJs&&i.declaration&&Q.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"allowJs","declaration")),i.emitDecoratorMetadata&&!i.experimentalDecorators&&Q.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators")),i.reactNamespace&&!e.isIdentifier(i.reactNamespace,n)&&Q.add(e.createCompilerDiagnostic(e.Diagnostics.Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier,i.reactNamespace)),!i.noEmit&&!i.suppressOutputPathCheck){var f=c(),d=e.createFileMap(a.useCaseSensitiveFileNames()?void 0:function(e){return e.toLocaleLowerCase()});e.forEachExpectedEmitFile(f,function(e,n,r){t(e.jsFilePath,d),t(e.declarationFilePath,d)})}}(),e.programTime+=(new Date).getTime()-te,z}e.programTime=0,e.emitTime=0,e.ioReadTime=0,e.ioWriteTime=0;var h=[];e.version="1.8.7",e.findConfigFile=t,e.resolveTripleslashReference=n,e.resolveModuleName=r,e.nodeModuleNameResolver=i,e.directoryProbablyExists=a,e.classicNameResolver=l,e.defaultInitCompilerOptions={module:1,target:1,noImplicitAny:!1,sourceMap:!1},e.createCompilerHost=p,e.getPreEmitDiagnostics=f,e.flattenDiagnosticMessageText=d,e.createProgram=m}(o||(o={}));var o;!function(e){function t(){if(u)return u;var t={},n={};return e.forEach(e.optionDeclarations,function(e){t[e.name.toLowerCase()]=e,e.shortName&&(n[e.shortName]=e.name)}),u={optionNameMap:t,shortOptionNames:n}}function n(n,r){function i(t){for(var n=0;n=n.length)break;var s=o;if(34===n.charCodeAt(s)){for(o++;o32;)o++;a.push(n.substring(s,o))}}i(a)}var o={},s=[],u=[],c=t(),l=c.optionNameMap,p=c.shortOptionNames;return i(n),{options:o,fileNames:s,errors:u}}function r(t,n){var r="";try{r=n(t)}catch(n){return{error:e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0_Colon_1,t,n.message)}}return i(t,r)}function i(t,n){try{var r=a(n);return{config:/\S/.test(r)?JSON.parse(r):{}}}catch(n){return{error:e.createCompilerDiagnostic(e.Diagnostics.Failed_to_parse_file_0_Colon_1,t,n.message)}}}function a(t){for(var n,r="",i=e.createScanner(1,!1,0,t);1!==(n=i.scan());)switch(n){case 2:case 3:r+=i.getTokenText().replace(/\S/g," ");break;default:r+=i.getTokenText()}return r}function o(t,n,r,i,a){void 0===i&&(i={});var o=s(t.compilerOptions,r,a),u=o.options,c=o.errors,l=e.extend(i,u);return{options:l,fileNames:function(){var i=[];if(e.hasProperty(t,"files"))t.files instanceof Array?i=e.map(t.files,function(t){return e.combinePaths(r,t)}):c.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"files","Array"));else{var a={},o=[];if(t.exclude instanceof Array)o=t.exclude;else{o=["node_modules"];var s=t.compilerOptions&&t.compilerOptions.outDir;s&&o.push(s)}o=e.map(o,e.normalizeSlashes);var u=e.getSupportedExtensions(l);e.Debug.assert(e.indexOf(u,".ts")1){r({pos:t,end:n,kind:2},!1)}}function o(t){return e.isFunctionBlock(t)&&177!==t.parent.kind}function s(r){if(!(l>p)){switch(e.isDeclaration(r)&&i(r),r.kind){case 195:if(!e.isFunctionBlock(r)){var a=r.parent,f=e.findChildOfKind(r,15,t),d=e.findChildOfKind(r,16,t);if(200===a.kind||203===a.kind||204===a.kind||202===a.kind||199===a.kind||201===a.kind||208===a.kind||247===a.kind){n(a,f,d,o(r));break}if(212===a.kind){var m=a;if(m.tryBlock===r){n(a,f,d,o(r));break}if(m.finallyBlock===r){var h=e.findChildOfKind(m,85,t);if(h){n(h,f,d,o(r));break}}}var y=e.createTextSpanFromBounds(r.getStart(),r.end);u.push({textSpan:y,hintSpan:y,bannerText:c,autoCollapse:o(r)});break}case 222:var f=e.findChildOfKind(r,15,t),d=e.findChildOfKind(r,16,t);n(r.parent,f,d,o(r));break;case 217:case 218:case 220:case 168:case 223:var f=e.findChildOfKind(r,15,t),d=e.findChildOfKind(r,16,t);n(r,f,d,o(r));break;case 167:n(r,e.findChildOfKind(r,19,t),e.findChildOfKind(r,20,t),o(r))}l++,e.forEachChild(r,s),l--}}var u=[],c="...",l=0,p=20;return s(t),u}t.collectElements=n}(e.OutliningElementsCollector||(e.OutliningElementsCollector={}))}(o||(o={}));var o;!function(e){!function(t){function n(t,n,r,i){function a(t){e.Debug.assert(t.length>0);for(var n=0,r=t;n0);for(var n=e.PatternMatchKind.camelCase,r=0,i=t;r0){var u=s.text+"-"+s.kind+"-"+s.indent,l=r[u];l?c(l,s):(r[u]=s,n.push(s))}}return n}function c(t,n){if(e.addRange(t.spans,n.spans),n.childItems){t.childItems||(t.childItems=[]);e:for(var r=0,i=n.childItems;r",e.ScriptElementKind.moduleElement,e.ScriptElementKindModifier.none,[_(t)],n)}}(t);case 217:return function(t){var n;if(t.members){var i=e.forEach(t.members,function(e){return 145===e.kind&&e}),o=h(t);i&&e.addRange(o,e.filter(i.parameters,function(t){return!e.isBindingPattern(t.name)})),n=u(a(o),l)}return f(t.name?t.name.text:"default",e.ScriptElementKind.classElement,e.getNodeModifiers(t),[_(t)],n,r(t))}(t);case 220:return function(t){var n=u(a(m(t)),l);return f(t.name.text,e.ScriptElementKind.enumElement,e.getNodeModifiers(t),[_(t)],n,r(t))}(t);case 218:return function(t){var n=u(a(h(t)),l);return f(t.name.text,e.ScriptElementKind.interfaceElement,e.getNodeModifiers(t),[_(t)],n,r(t))}(t);case 221:return function(t){var a=n(t),o=u(i(y(t).body.statements),l);return f(a,e.ScriptElementKind.moduleElement,e.getNodeModifiers(t),[_(t)],o,r(t))}(t);case 216:return function(t){if(t.body&&195===t.body.kind){var n=u(a(t.body.statements),l);return f(t.name?t.name.text:"default",e.ScriptElementKind.functionElement,e.getNodeModifiers(t),[_(t)],n,r(t))}}(t)}}function m(t){return e.filter(t.members,function(e){return void 0===e.name||137!==e.name.kind})}function h(t){return e.filter(t.members,function(t){return!e.hasDynamicName(t)})}function y(e){for(;221===e.body.kind;)e=e.body;return e}function _(t){return 251===t.kind?e.createTextSpanFromBounds(t.getFullStart(),t.getEnd()):e.createTextSpanFromBounds(t.getStart(),t.getEnd())}function g(n){return e.getTextOfNodeFromSourceText(t.text,n)}var v=!1;return u(function(e){var t=[];return t.push(e),o(e.statements,t),t}(t),d)}t.getNavigationBarItems=n}(e.NavigationBar||(e.NavigationBar={}))}(o||(o={}));var o;!function(e){function t(e,t,n,r){return{kind:e,punctuationStripped:t,isCaseSensitive:n,camelCaseWeight:r}}function n(n){function o(e){return S||!e}function c(t){if(!o(t))return h(t,e.lastOrUndefined(b))}function p(t,n){if(!o(n)){var r=h(n,e.lastOrUndefined(b));if(r&&(t=t||[],!(b.length-1>t.length))){for(var i=r,a=b.length-2,s=t.length-1;a>=0;a-=1,s-=1){var u=b[a],c=t[s],l=h(c,u);if(!l)return;e.addRange(i,l)}return i}}}function f(t){return e.hasProperty(v,t)||(v[t]=y(t)),v[t]}function d(e,n,r){var i=u(e,n.textLowerCase);if(0===i)return n.text.length===e.length?t(A.exact,r,e===n.text):t(A.prefix,r,s(e,n.text));var o=n.isLowerCase;if(o){if(i>0)for(var c=f(e),l=0,p=c;l0)return t(A.substring,r,!0);if(!o&&n.characterSpans.length>0){var m=f(e),h=g(e,m,n,!1);if(void 0!==h)return t(A.camelCase,r,!0,h);if(void 0!==(h=g(e,m,n,!0)))return t(A.camelCase,r,!1,h)}return o&&n.text.length0&&a(e.charCodeAt(i))?t(A.substring,r,!1):void 0}function m(e){for(var t=0;tt.length)return!1;if(r)for(var s=0;s1}}function r(e){return{totalTextChunk:m(e),subWordTextChunks:d(e)}}function i(e){return 0===e.subWordTextChunks.length}function a(t){if(t>=65&&t<=90)return!0;if(t<127||!e.isUnicodeIdentifierStart(t,2))return!1;var n=String.fromCharCode(t);return n===n.toUpperCase()}function o(t){if(t>=97&&t<=122)return!0;if(t<127||!e.isUnicodeIdentifierStart(t,2))return!1;var n=String.fromCharCode(t);return n===n.toLowerCase()}function s(e,t){for(var n=0,r=t.length;n=65&&e<=90?e-65+97:e<127?e:String.fromCharCode(e).toLowerCase().charCodeAt(0)}function p(e){return e>=48&&e<=57}function f(e){return a(e)||o(e)||p(e)||95===e||36===e}function d(e){for(var t=[],n=0,r=0,i=0;i0&&(t.push(m(e.substr(n,r))),r=0)}return r>0&&t.push(m(e.substr(n,r))),t}function m(e){var t=e.toLowerCase();return{text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:h(e)}}function h(e){return _(e,!1)}function y(e){return _(e,!0)}function _(t,n){for(var r=[],i=0,a=1,o=t.length;a0&&24===e.lastOrUndefined(n).kind&&r++,r}function c(t,n){return e.Debug.assert(r>=n.getStart(),"Assumed 'position' could not occur before node."),e.isTemplateLiteralKind(n.kind)?e.isInsideTemplateLiteral(n,r)?0:t+2:t+1}function l(t,n){var r=11===t.template.kind?1:t.template.templateSpans.length+1;return e.Debug.assert(0===n||n=0&&i.length>a+1),i[a+1]}function m(e,t){for(var n=-1,r=-1,i=0;i=t)return i;a.parameters.length>r&&(r=a.parameters.length,n=i)}return n}function h(t,n,r){function a(t){var n=e.mapToDisplayParts(function(e){return y.getSymbolDisplayBuilder().buildParameterDisplay(t,e,c)});return{name:t.name,documentation:t.getDocumentationComment(),displayParts:n,isOptional:y.isOptionalParameter(t.valueDeclaration)}}function o(t){var n=e.mapToDisplayParts(function(e){return y.getSymbolDisplayBuilder().buildTypeParameterDisplay(t,e,c)});return{name:t.symbol.name,documentation:i,displayParts:n,isOptional:!1}}var s=r.argumentsSpan,u=0===r.kind,c=r.invocation,l=e.getInvokedExpression(c),p=y.getSymbolAtLocation(l),f=p&&e.symbolToDisplayParts(y,p,void 0,void 0),d=e.map(t,function(t){var n,r=[],s=[];if(f&&e.addRange(r,f),u){r.push(e.punctuationPart(25));var l=t.typeParameters;n=l&&l.length>0?e.map(l,o):i,s.push(e.punctuationPart(27));var p=e.mapToDisplayParts(function(e){return y.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(t.parameters,e,c)});e.addRange(s,p)}else{var d=e.mapToDisplayParts(function(e){return y.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(t.typeParameters,e,c)});e.addRange(r,d),r.push(e.punctuationPart(17));var m=t.parameters;n=m.length>0?e.map(m,a):i,s.push(e.punctuationPart(18))}var h=e.mapToDisplayParts(function(e){return y.getSymbolDisplayBuilder().buildReturnTypeDisplay(t,e,c)});return e.addRange(s,h),{isVariadic:t.hasRestParameter,prefixDisplayParts:r,suffixDisplayParts:s,separatorDisplayParts:[e.punctuationPart(24),e.spacePart()],parameters:n,documentation:t.getDocumentationComment()}}),h=r.argumentIndex,_=r.argumentCount,g=t.indexOf(n);return g<0&&(g=m(t,_)),e.Debug.assert(0===h||h<_,"argumentCount < argumentIndex, "+_+" < "+h),{items:d,applicableSpan:s,selectedItemIndex:g,argumentIndex:h,argumentCount:_}}var y=t.getTypeChecker(),_=e.findTokenOnLeftOfPosition(n,r);if(_){var g=function(t){for(var n=t;251!==n.kind;n=n.parent){if(e.isFunctionBlock(n))return;(n.posn.parent.end)&&e.Debug.fail("Node of kind "+n.kind+" is not a subspan of its parent of kind "+n.parent.kind);var r=o(n);if(r)return r}}(_);if(a.throwIfCancellationRequested(),g){var v=g.invocation,b=[],S=y.getResolvedSignature(v,b);if(a.throwIfCancellationRequested(),b.length)return h(b,S,g);if(e.isSourceFileJavaScript(n))return function(n){if(171===n.invocation.kind){var r=n.invocation,i=r.expression,a=69===i.kind?i:169===i.kind?i.name:void 0;if(a&&a.text)for(var o=t.getTypeChecker(),s=0,u=t.getSourceFiles();s=0);var r=n.getLineStarts(),i=t;if(i+1===r.length)return n.text.length-1;var a=r[i],o=r[i+1]-1;for(e.Debug.assert(e.isLineBreak(n.text.charCodeAt(o)));a<=o&&e.isLineBreak(n.text.charCodeAt(o));)o--;return o}function n(e,t){return t.getLineStarts()[t.getLineAndCharacterOfPosition(e).line]}function r(e,t){return i(e.pos,e.end,t)}function i(e,t,n){return e<=n.pos&&t>=n.end}function a(e,t,n){return e.pos<=t&&e.end>=n}function o(e,t,n){return s(e.pos,e.end,t,n)}function s(e,t,n,r){return Math.max(e,n)t||!c(e,n)}function c(t,n){if(e.nodeIsMissing(t))return!1;switch(t.kind){case 217:case 218:case 220:case 168:case 164:case 156:case 195:case 222:case 223:return l(t,16,n);case 247:return c(t.block,n);case 172:if(!t.arguments)return!0;case 171:case 175:case 161:return l(t,18,n);case 153:case 154:return c(t.type,n);case 145:case 146:case 147:case 216:case 176:case 144:case 143:case 149:case 148:case 177:return t.body?c(t.body,n):t.type?c(t.type,n):f(t,18,n);case 221:return t.body&&c(t.body,n);case 199:return t.elseStatement?c(t.elseStatement,n):c(t.thenStatement,n);case 198:return c(t.expression,n)||f(t,23);case 167:case 165:case 170:case 137:case 158:return l(t,20,n);case 150:return t.type?c(t.type,n):f(t,20,n);case 244:case 245:return!1;case 202:case 203:case 204:case 201:return c(t.statement,n);case 200:return d(t,104,n)?l(t,18,n):c(t.statement,n);case 155:return c(t.exprName,n);case 179:case 178:case 180:case 187:case 188:return c(t.expression,n);case 173:return c(t.template,n);case 186:return c(e.lastOrUndefined(t.templateSpans),n);case 193:return e.nodeIsPresent(t.literal);case 182:return c(t.operand,n);case 184:return c(t.right,n);case 185:return c(t.whenFalse,n);default:return!0}}function l(t,n,r){var i=t.getChildren(r);if(i.length){var a=e.lastOrUndefined(i);if(a.kind===n)return!0;if(23===a.kind&&1!==i.length)return i[i.length-2].kind===n}return!1}function p(t){var n=m(t);if(n){var r=n.getChildren();return{listItemIndex:e.indexOf(r,t),list:n}}}function f(e,t,n){return!!d(e,t,n)}function d(t,n,r){return e.forEach(t.getChildren(r),function(e){return e.kind===n&&e})}function m(t){var n=e.forEach(t.parent.getChildren(),function(e){if(274===e.kind&&e.pos<=t.pos&&e.end>=t.end)return e});return e.Debug.assert(!n||e.contains(n.getChildren(),t)),n}function h(e,t){return _(e,t,function(e){return D(e.kind)})}function y(e,t){return _(e,t,function(e){return M(e.kind)})}function _(e,t,n){return v(e,t,!1,n)}function g(e,t){return v(e,t,!0,void 0)}function v(e,t,n,r){var i=e;e:for(;;){if(I(i))return i;for(var a=0,o=i.getChildCount(e);an.getStart(e)&&te.end||o.pos===e.end)&&k(o))return n(o)}}return n(t)}function A(t,n,r){function i(e){if(I(e)||239===e.kind)return e;var t=e.getChildren(),n=o(t,t.length);return n&&i(n)}function a(s){if(I(s)||239===s.kind)return s;for(var u=s.getChildren(),c=0,l=u.length;c=t||239===p.kind&&f===p.end){var d=o(u,c);return d&&i(d)}return a(p)}}if(e.Debug.assert(void 0!==r||251===s.kind),u.length){var d=o(u,u.length);return d&&i(d)}}function o(e,t){for(var n=t-1;n>=0;--n)if(k(e[n]))return e[n]}return a(r||n)}function T(e,t){var n=g(e,t);return n&&(9===n.kind||163===n.kind)&&t>n.getStart()}function E(e,t){return C(e,t,void 0)}function C(t,n,r){var i=g(t,n);if(i&&n<=i.getStart()){var a=e.getLeadingCommentRanges(t.text,i.pos);return r?e.forEach(a,function(e){return e.pos=e.pos+3&&"/"===n[e.pos]&&"*"===n[e.pos+1]&&"*"===n[e.pos+2]}var i=g(t,n),a=e.getLeadingCommentRanges(t.text,i.pos);return e.forEach(a,r)}function w(t,n){var r=e.getTokenAtPosition(t,n);if(I(r))switch(r.kind){case 102:case 108:case 74:r=void 0===r.parent?void 0:r.parent.parent;break;default:r=r.parent}if(r){var i=r.jsDocComment;if(i)for(var a=0,o=i.tags;a0?r.join(","):e.ScriptElementKindModifier.none}function R(t){return 152===t.kind||171===t.kind?t.typeArguments:e.isFunctionLike(t)||217===t.kind||218===t.kind?t.typeParameters:void 0}function I(e){return e.kind>=0&&e.kind<=135}function D(t){return 69===t||e.isKeyword(t)}function M(e){return 9===e||8===e||D(e)}function P(e){return 2===e||3===e}function L(t){return!(9!==t&&163!==t&&10!==t&&!e.isTemplateLiteralKind(t))}function O(e){return 15<=e&&e<=68}function U(t,n){return e.isTemplateLiteralKind(t.kind)&&t.getStart()0&&139===e.declarations[0].kind}function n(n,i){return r(n,function(n){var r=n.flags;return 3&r?t(n)?e.SymbolDisplayPartKind.parameterName:e.SymbolDisplayPartKind.localName:4&r?e.SymbolDisplayPartKind.propertyName:32768&r?e.SymbolDisplayPartKind.propertyName:65536&r?e.SymbolDisplayPartKind.propertyName:8&r?e.SymbolDisplayPartKind.enumMemberName:16&r?e.SymbolDisplayPartKind.functionName:32&r?e.SymbolDisplayPartKind.className:64&r?e.SymbolDisplayPartKind.interfaceName:384&r?e.SymbolDisplayPartKind.enumName:1536&r?e.SymbolDisplayPartKind.moduleName:8192&r?e.SymbolDisplayPartKind.methodName:262144&r?e.SymbolDisplayPartKind.typeParameterName:524288&r?e.SymbolDisplayPartKind.aliasName:8388608&r?e.SymbolDisplayPartKind.aliasName:e.SymbolDisplayPartKind.text}(i),i)}function r(t,n,r){return{text:t,kind:e.SymbolDisplayPartKind[n]}}function i(){return r(" ",e.SymbolDisplayPartKind.space)}function a(t){return r(e.tokenToString(t),e.SymbolDisplayPartKind.keyword)}function o(t){return r(e.tokenToString(t),e.SymbolDisplayPartKind.punctuation)}function s(t){return r(e.tokenToString(t),e.SymbolDisplayPartKind.operator)}function u(t){var n=e.stringToToken(t);return void 0===n?c(t):a(n)}function c(t){return r(t,e.SymbolDisplayPartKind.text)}function l(e){return e.getNewLine?e.getNewLine():b}function p(){return r("\n",e.SymbolDisplayPartKind.lineBreak)}function f(e){e(v);var t=v.displayParts();return v.clear(),t}function d(e,t,n,r){return f(function(i){e.getSymbolDisplayBuilder().buildTypeDisplay(t,i,n,r)})}function m(e,t,n,r,i){return f(function(a){e.getSymbolDisplayBuilder().buildSymbolDisplay(t,a,n,r,i)})}function h(e,t,n,r){return f(function(i){e.getSymbolDisplayBuilder().buildSignatureDisplay(t,i,n,r)})}function y(t,n,r){if(_(r))return r.getText();var i=e.getLocalSymbolForExportDefault(n);return t.symbolToString(i||n)}function _(e){return e.parent&&(229===e.parent.kind||233===e.parent.kind)&&e.parent.propertyName===e}function g(e){var t=e.length;return t>=2&&e.charCodeAt(0)===e.charCodeAt(t-1)&&(34===e.charCodeAt(0)||39===e.charCodeAt(0))?e.substring(1,t-1):e}e.isFirstDeclarationOfSymbolParameter=t;var v=function(){function t(){if(c){var t=e.getIndentString(l);t&&u.push(r(t,e.SymbolDisplayPartKind.space)),c=!1}}function i(e,n){t(),u.push(r(e,n))}function a(e,r){t(),u.push(n(e,r))}function o(){u.push(p()),c=!0}function s(){u=[],c=!0,l=0}var u,c,l;return s(),{displayParts:function(){return u},writeKeyword:function(t){return i(t,e.SymbolDisplayPartKind.keyword)},writeOperator:function(t){return i(t,e.SymbolDisplayPartKind.operator)},writePunctuation:function(t){return i(t,e.SymbolDisplayPartKind.punctuation)},writeSpace:function(t){return i(t,e.SymbolDisplayPartKind.space)},writeStringLiteral:function(t){return i(t,e.SymbolDisplayPartKind.stringLiteral)},writeParameter:function(t){return i(t,e.SymbolDisplayPartKind.parameterName)},writeSymbol:a,writeLine:o,increaseIndent:function(){l++},decreaseIndent:function(){l--},clear:s,trackSymbol:function(){},reportInaccessibleThisError:function(){}}}();e.symbolPart=n,e.displayPart=r,e.spacePart=i,e.keywordPart=a,e.punctuationPart=o,e.operatorPart=s,e.textOrKeywordPart=u,e.textPart=c;var b="\r\n";e.getNewLineOrDefaultFromHost=l,e.lineBreakPart=p,e.mapToDisplayParts=f,e.typeToDisplayParts=d,e.symbolToDisplayParts=m,e.signatureToDisplayParts=h,e.getDeclaredName=y,e.isImportOrExportSpecifierName=_,e.stripQuotes=g}(o||(o={}));var o;!function(e){!function(t){function n(t,n,i){function s(){e.Debug.assert(void 0!==r),b=void 0;var t=r.getStartPos()!==n;t&&(_?(e.Debug.assert(0!==_.length),S=4===e.lastOrUndefined(_).kind):S=!1),y=void 0,_=void 0,t||r.scan();for(var a=r.getStartPos();a>=5,n+=5;return t},t.prototype.IncreaseInsertionIndex=function(t){var n=this.rulesInsertionIndexBitmap>>t&31;n++,e.Debug.assert((31&n)===n,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules.");var r=this.rulesInsertionIndexBitmap&~(31<=0},t}();t.TokenRangeAccess=n;var r=function(){function e(e){this.tokens=e&&e.length?e:[]}return e.prototype.GetTokens=function(){return this.tokens},e.prototype.Contains=function(e){return this.tokens.indexOf(e)>=0},e}();t.TokenValuesAccess=r;var i=function(){function e(e){this.token=e}return e.prototype.GetTokens=function(){return[this.token]},e.prototype.Contains=function(e){return e===this.token},e}();t.TokenSingleValueAccess=i;var a=function(){function e(){}return e.prototype.GetTokens=function(){for(var e=[],t=0;t<=135;t++)e.push(t);return e},e.prototype.Contains=function(e){return!0},e.prototype.toString=function(){return"[allTokens]"},e}();t.TokenAllAccess=a;var o=function(){function e(e){this.tokenAccess=e}return e.FromToken=function(t){return new e(new i(t))},e.FromTokens=function(t){return new e(new r(t))},e.FromRange=function(t,r,i){return void 0===i&&(i=[]),new e(new n(t,r,i))},e.AllTokens=function(){return new e(new a)},e.prototype.GetTokens=function(){return this.tokenAccess.GetTokens()},e.prototype.Contains=function(e){return this.tokenAccess.Contains(e)},e.prototype.toString=function(){return this.tokenAccess.toString()},e.Any=e.AllTokens(),e.AnyIncludingMultilineComments=e.FromTokens(e.Any.GetTokens().concat([3])),e.Keywords=e.FromRange(70,135),e.BinaryOperators=e.FromRange(25,68),e.BinaryKeywordOperators=e.FromTokens([90,91,135,116,124]),e.UnaryPrefixOperators=e.FromTokens([41,42,50,49]),e.UnaryPrefixExpressions=e.FromTokens([8,69,17,19,15,97,92]),e.UnaryPreincrementExpressions=e.FromTokens([69,17,97,92]),e.UnaryPostincrementExpressions=e.FromTokens([69,18,20,92]),e.UnaryPredecrementExpressions=e.FromTokens([69,17,97,92]),e.UnaryPostdecrementExpressions=e.FromTokens([69,18,20,92]),e.Comments=e.FromTokens([2,3]),e.TypeNames=e.FromTokens([69,128,130,120,131,103,117]),e}();t.TokenRange=o}(t.Shared||(t.Shared={}))}(e.formatting||(e.formatting={}))}(o||(o={}));var o;!function(e){!function(t){var n=function(){function n(){this.globalRules=new t.Rules}return n.prototype.getRuleName=function(e){return this.globalRules.getRuleName(e)},n.prototype.getRuleByName=function(e){return this.globalRules[e]},n.prototype.getRulesMap=function(){return this.rulesMap},n.prototype.ensureUpToDate=function(n){if(null==this.options||!e.compareDataObjects(this.options,n)){var r=this.createActiveRules(n),i=t.RulesMap.create(r);this.activeRules=r,this.rulesMap=i,this.options=e.clone(n)}},n.prototype.createActiveRules=function(e){var t=this.globalRules.HighPriorityCommonRules.slice(0);return e.InsertSpaceAfterCommaDelimiter?t.push(this.globalRules.SpaceAfterComma):t.push(this.globalRules.NoSpaceAfterComma),e.InsertSpaceAfterFunctionKeywordForAnonymousFunctions?t.push(this.globalRules.SpaceAfterAnonymousFunctionKeyword):t.push(this.globalRules.NoSpaceAfterAnonymousFunctionKeyword),e.InsertSpaceAfterKeywordsInControlFlowStatements?t.push(this.globalRules.SpaceAfterKeywordInControl):t.push(this.globalRules.NoSpaceAfterKeywordInControl),e.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?(t.push(this.globalRules.SpaceAfterOpenParen),t.push(this.globalRules.SpaceBeforeCloseParen),t.push(this.globalRules.NoSpaceBetweenParens)):(t.push(this.globalRules.NoSpaceAfterOpenParen),t.push(this.globalRules.NoSpaceBeforeCloseParen),t.push(this.globalRules.NoSpaceBetweenParens)),e.InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?(t.push(this.globalRules.SpaceAfterOpenBracket),t.push(this.globalRules.SpaceBeforeCloseBracket),t.push(this.globalRules.NoSpaceBetweenBrackets)):(t.push(this.globalRules.NoSpaceAfterOpenBracket),t.push(this.globalRules.NoSpaceBeforeCloseBracket),t.push(this.globalRules.NoSpaceBetweenBrackets)),e.InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?(t.push(this.globalRules.SpaceAfterTemplateHeadAndMiddle),t.push(this.globalRules.SpaceBeforeTemplateMiddleAndTail)):(t.push(this.globalRules.NoSpaceAfterTemplateHeadAndMiddle),t.push(this.globalRules.NoSpaceBeforeTemplateMiddleAndTail)),e.InsertSpaceAfterSemicolonInForStatements?t.push(this.globalRules.SpaceAfterSemicolonInFor):t.push(this.globalRules.NoSpaceAfterSemicolonInFor),e.InsertSpaceBeforeAndAfterBinaryOperators?(t.push(this.globalRules.SpaceBeforeBinaryOperator),t.push(this.globalRules.SpaceAfterBinaryOperator)):(t.push(this.globalRules.NoSpaceBeforeBinaryOperator),t.push(this.globalRules.NoSpaceAfterBinaryOperator)),e.PlaceOpenBraceOnNewLineForControlBlocks&&t.push(this.globalRules.NewLineBeforeOpenBraceInControl),e.PlaceOpenBraceOnNewLineForFunctions&&(t.push(this.globalRules.NewLineBeforeOpenBraceInFunction),t.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock)),t=t.concat(this.globalRules.LowPriorityCommonRules)},n}();t.RulesProvider=n}(e.formatting||(e.formatting={}))}(o||(o={}));var o;!function(e){!function(t){function n(t,n,r,i){var a=n.getLineAndCharacterOfPosition(t).line;return 0===a?[]:m({pos:e.getStartPositionOfLine(a-1,n),end:e.getEndLinePosition(a,n)+1},n,i,r,2)}function r(e,t,n,r){return s(e,23,t,r,n,3)}function i(e,t,n,r){return s(e,16,t,r,n,4)}function a(e,t,n){return m({pos:0,end:e.text.length},e,n,t,0)}function o(t,n,r,i,a){return m({pos:e.getLineStartPositionForPosition(t,r),end:n},r,a,i,1)}function s(t,n,r,i,a,o){var s=u(t,n,r);return s?m({pos:e.getLineStartPositionForPosition(s.getStart(r),r),end:s.end},r,i,a,o):[]}function u(t,n,r){var i=e.findPrecedingToken(t,r);if(i&&i.kind===n&&t===i.getEnd()){for(var a=i;a&&a.parent&&a.parent.end===i.end&&!c(a.parent,a);)a=a.parent;return a}}function c(t,n){switch(t.kind){case 217:case 218:return e.rangeContainsRange(t.members,n);case 221:var r=t.body;return r&&195===r.kind&&e.rangeContainsRange(r.statements,n);case 251:case 195:case 222:return e.rangeContainsRange(t.statements,n);case 247:return e.rangeContainsRange(t.block.statements,n)}return!1}function l(t,n){function r(i){var a=e.forEachChild(i,function(r){return e.startEndContainsRange(r.getStart(n),r.end,t)&&r});if(a){var o=r(a);if(o)return o}return i}return r(n)}function p(t,n){function r(e){return!1}if(!t.length)return r;var i=t.filter(function(t){return e.rangeOverlapsWithStartEnd(n,t.start,t.start+t.length)}).sort(function(e,t){return e.start-t.start});if(!i.length)return r;var a=0;return function(t){for(;;){if(a>=i.length)return!1;var n=i[a];if(t.end<=n.start)return!1;if(e.startEndOverlapsWithStartEnd(t.pos,t.end,n.start,n.start+n.length))return!0;a++}}}function f(t,n,r){var i=t.getStart(r);if(i===n.pos&&t.end===n.end)return i;var a=e.findPrecedingToken(n.pos,r);return a?a.end>=n.pos?t.pos:a.end:t.pos}function d(e,n,r){for(var i,a=-1;e;){var o=r.getLineAndCharacterOfPosition(e.getStart(r)).line;if(a!==-1&&o!==a)break;if(t.SmartIndenter.shouldIndentChildNode(e,i))return n.IndentSize;a=o,i=e,e=e.parent}return 0}function m(n,r,i,a,o){function s(n,a,o,s,u){if(e.rangeOverlapsWithStartEnd(s,n,a)||e.rangeContainsStartEnd(s,n,a)){if(u!==-1)return u}else{var c=r.getLineAndCharacterOfPosition(n).line,l=e.getLineStartPositionForPosition(n,r),p=t.SmartIndenter.findFirstNonWhitespaceColumn(l,n,r,i);if(c!==o||n===p)return p}return-1}function u(e,n,a,o,s,u){var c=a,l=t.SmartIndenter.shouldIndentChildNode(e)?i.IndentSize:0;return u===n?(c=n===P?L:s.getIndentation(),l=Math.min(i.IndentSize,s.getDelta(e)+l)):c===-1&&(c=t.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(o,e,n,r)?s.getIndentation():s.getIndentation()+s.getDelta(e)),{indentation:c,delta:l}}function c(e){if(e.modifiers&&e.modifiers.length)return e.modifiers[0].kind;switch(e.kind){case 217:return 73;case 218:return 107;case 216:return 87;case 220:return 220;case 146:return 123;case 147:return 129;case 144:if(e.asteriskToken)return 37;case 142:case 139:return e.name.kind}}function m(e,n,r,a){function o(n,r){return t.SmartIndenter.nodeWillIndentChild(e,r,!0)?n:0}return{getIndentationForComment:function(e,t,n){switch(e){case 16:case 20:case 18:return r+o(a,n)}return t!==-1?t:r},getIndentationForToken:function(t,i,s){if(n!==t&&e.decorators&&i===c(e))return r;switch(i){case 15:case 16:case 19:case 20:case 17:case 18:case 80:case 104:case 55:return r;default:return n!==t?r+o(a,s):r}},getIndentation:function(){return r},getDelta:function(e){return o(a,e)},recomputeIndentation:function(n){e.parent&&t.SmartIndenter.shouldIndentChildNode(e.parent,e)&&(n?r+=i.IndentSize:r-=i.IndentSize,a=t.SmartIndenter.shouldIndentChildNode(e)?i.IndentSize:0)}}}function g(t,i,a,o,c,l){function p(i,a,o,c,l,p,f){var m=i.getStart(r),h=r.getLineAndCharacterOfPosition(m).line,y=h;i.decorators&&(y=r.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(i,r)).line);var _=-1;if(f&&(_=s(m,i.end,l,n,a))!==-1&&(a=_),!e.rangeOverlapsWithStartEnd(n,i.pos,i.end))return a;if(0===i.getFullWidth())return a;for(;B.isOnToken();){var v=B.readTokenInfo(t);if(v.token.end>m)break;d(v,t,c)}if(!B.isOnToken())return a;if(e.isToken(i)){var v=B.readTokenInfo(i);return e.Debug.assert(v.token.end===i.end),d(v,t,c,i),a}var b=140===i.kind?h:p,A=u(i,h,_,t,c,b);return g(i,S,h,y,A.indentation,A.delta),S=t,a}function f(n,i,a,o){var s=h(i,n),c=y(s),l=o,f=a;if(0!==s)for(;B.isOnToken();){var _=B.readTokenInfo(i);if(_.token.end>n.pos)break;if(_.token.kind===s){f=r.getLineAndCharacterOfPosition(_.token.pos).line;var g=u(_.token,f,-1,i,o,a);l=m(i,a,g.indentation,g.delta),d(_,i,l)}else d(_,i,o)}for(var v=-1,b=0,S=n;bt.end)break;d(E,t,_)}}}function v(t,i,a,o){for(var s=0,u=t;s0){var E=_(T,i);k(b,S.character,E)}else w(b,S.character)}}}function E(t,n,i){for(var a=t;as)){var u=C(o,s);u!==-1&&(e.Debug.assert(u===o||!e.isWhiteSpace(r.text.charCodeAt(u-1))),w(u,s+1-u))}}}function C(t,n){for(var i=n;i>=t&&e.isWhiteSpace(r.text.charCodeAt(i));)i--;return i!==n?i+1:-1}function N(t,n,r){return{span:e.createTextSpan(t,n),newText:r}}function w(e,t){t&&V.push(N(e,t,""))}function k(e,t,n){(t||n)&&V.push(N(e,t,n))}function x(e,t,n,a,o){switch(e.Operation.Action){case 1:return;case 8:t.end!==a.pos&&w(t.end,a.pos-t.end);break;case 4:if(1!==e.Flag&&n!==o)return;1!==o-n&&k(t.end,a.pos-t.end,i.NewLineCharacter);break;case 2:if(1!==e.Flag&&n!==o)return;1===a.pos-t.end&&32===r.text.charCodeAt(t.end)||k(t.end,a.pos-t.end," ")}}var R,I,D,M,P,L,O=p(r.parseDiagnostics,n),U=new t.FormattingContext(r,o),F=l(n,r),B=t.getFormattingScanner(r,f(F,n,r),n.end),K=t.SmartIndenter.getIndentationForNode(F,n,r,i),V=[];if(B.advance(),B.isOnToken()){var j=r.getLineAndCharacterOfPosition(F.getStart(r)).line,W=j;F.decorators&&(W=r.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(F,r)).line);g(F,F,j,W,K,d(F,i,r))}if(!B.isOnToken()){var q=B.getCurrentLeadingTrivia();q&&(v(q,F,F,void 0),function(){var e=I?I.end:n.pos;E(r.getLineAndCharacterOfPosition(e).line,r.getLineAndCharacterOfPosition(n.end).line+1,I)}())}return B.close(),V}function h(e,t){switch(e.kind){case 145:case 216:case 176:case 144:case 143:case 177:if(e.typeParameters===t)return 25;if(e.parameters===t)return 17;break;case 171:case 172:if(e.typeArguments===t)return 25;if(e.arguments===t)return 17;break;case 152:if(e.typeArguments===t)return 25}return 0}function y(e){switch(e){case 17:return 18;case 25:return 27}return 0}function _(e,t){function n(e,t){for(var n="",r=0;rr.text.length)return 0;if(a.IndentStyle===e.IndentStyle.None)return 0;var s=e.findPrecedingToken(n,r);if(!s)return 0;if(e.isStringOrRegularExpressionOrTemplateLiteral(s.kind)&&s.getStart(r)<=n&&s.end>n)return 0;var l=r.getLineAndCharacterOfPosition(n).line;if(a.IndentStyle===e.IndentStyle.Block){for(var p=n;p>0;){var m=r.text.charCodeAt(p);if(!e.isWhiteSpace(m)&&!e.isLineBreak(m))break;p--}var h=e.getLineStartPositionForPosition(p,r);return t.findFirstNonWhitespaceColumn(h,p,r,a)}if(24===s.kind&&184!==s.parent.kind){var y=o(s,r,a);if(y!==-1)return y}for(var _,g,v,S=s;S;){if(e.positionBelongsToNode(S,n,r)&&b(S,_)){g=c(S,r),v=u(s,S,l,r)?0:l!==g.line?a.IndentSize:0;break}var y=f(S,r,a);if(y!==-1)return y;if((y=d(S,r,a))!==-1)return y+a.IndentSize;_=S,S=S.parent}return S?i(S,g,void 0,v,r,a):0}function r(e,t,n,r){return i(e,n.getLineAndCharacterOfPosition(e.getStart(n)),t,0,n,r)}function i(e,t,n,r,i,o){for(var u,c=e.parent;c;){var p=!0;if(n){var m=e.getStart(i);p=mn.end}if(p){var h=f(e,i,o);if(h!==-1)return h+r}u=a(c,e,i);var y=u.line===t.line||l(c,e,t.line,i);if(p){var h=s(e,c,t,y,i,o);if(h!==-1)return h+r;if((h=d(e,i,o))!==-1)return h+r}b(c,e)&&!y&&(r+=o.IndentSize),e=c,t=u,c=e.parent}return r}function a(e,t,n){var r=p(t,n);return r?n.getLineAndCharacterOfPosition(r.pos):n.getLineAndCharacterOfPosition(e.getStart(n))}function o(t,n,r){var i=e.findListItemInfo(t);return i&&i.listItemIndex>0?m(i.list.getChildren(),i.listItemIndex-1,n,r):-1}function s(t,n,r,i,a,o){return!e.isDeclaration(t)&&!e.isStatement(t)||251!==n.kind&&i?-1:h(r,a,o)}function u(t,n,r,i){var a=e.findNextToken(t,n);if(!a)return!1;if(15===a.kind)return!0;if(16===a.kind){return r===c(a,i).line}return!1}function c(e,t){return t.getLineAndCharacterOfPosition(e.getStart(t))}function l(t,n,r,i){if(199===t.kind&&t.elseStatement===n){var a=e.findChildOfKind(t,80,i);e.Debug.assert(void 0!==a);return c(a,i).line===r}return!1}function p(t,n){if(t.parent)switch(t.parent.kind){case 152:if(t.parent.typeArguments&&e.rangeContainsStartEnd(t.parent.typeArguments,t.getStart(n),t.getEnd()))return t.parent.typeArguments;break;case 168:return t.parent.properties;case 167:return t.parent.elements;case 216:case 176:case 177:case 144:case 143:case 148:case 149:var r=t.getStart(n);if(t.parent.typeParameters&&e.rangeContainsStartEnd(t.parent.typeParameters,r,t.getEnd()))return t.parent.typeParameters;if(e.rangeContainsStartEnd(t.parent.parameters,r,t.getEnd()))return t.parent.parameters;break;case 172:case 171:var r=t.getStart(n);if(t.parent.typeArguments&&e.rangeContainsStartEnd(t.parent.typeArguments,r,t.getEnd()))return t.parent.typeArguments;if(t.parent.arguments&&e.rangeContainsStartEnd(t.parent.arguments,r,t.getEnd()))return t.parent.arguments}}function f(t,n,r){var i=p(t,n);return i?function(i){var a=e.indexOf(i,t);return a!==-1?m(i,a,n,r):-1}(i):-1}function d(e,t,n){if(18===e.kind)return-1;if(e.parent&&(171===e.parent.kind||172===e.parent.kind)&&e.parent.expression!==e){var r=e.parent.expression,i=function(e){for(;;)switch(e.kind){case 171:case 172:case 169:case 170:e=e.expression;break;default:return e}}(r);if(r===i)return-1;var a=t.getLineAndCharacterOfPosition(r.end),o=t.getLineAndCharacterOfPosition(i.end);return a.line===o.line?-1:h(a,t,n)}return-1}function m(t,n,r,i){e.Debug.assert(n>=0&&n=0;--s)if(24!==t[s].kind){var u=r.getLineAndCharacterOfPosition(t[s].end).line;if(u!==o.line)return h(o,r,i);o=c(t[s],r)}return-1}function h(e,t,n){var r=t.getPositionOfLineAndCharacter(e.line,0);return _(r,r+e.character,t,n)}function y(t,n,r,i){for(var a=0,o=0,s=t;s=r)break;if(123===i.text.charCodeAt(t)){t++;for(var y=1;t=r)break}if(s(t,r,i,n)){if((t=l(t+n.length))>=r)break;for(var g="",v=t;t=r)){void 0===p&&(p=i.getLineAndCharacterOfPosition(e).character);var n=t;if(!((t=a(t,r,i,p))>=r)){var s=t-n;s=0),0===s.languageServiceRefCount&&a.remove(o)}void 0===n&&(n="");var l={},d=e.createGetCanonicalFileName(!!t);return{acquireDocument:o,updateDocument:s,releaseDocument:c,reportStats:a}}function m(t,n,r){function i(){p||(p=[]),p.push(B.getTokenValue())}function a(){var e=B.getTokenValue(),t=B.getTokenPos();d.push({fileName:e,pos:t,end:t+e.length})}function o(){var e=B.getToken();return 122===e&&(e=B.scan(),125===e&&9===(e=B.scan())&&i(),!0)}function s(){var t=B.getToken();if(89===t){if(9===(t=B.scan()))return a(),!0;if(69===t||e.isKeyword(t))if(133===(t=B.scan())){if(9===(t=B.scan()))return a(),!0}else if(56===t){if(c(!0))return!0}else{if(24!==t)return!0;t=B.scan()}if(15===t){for(t=B.scan();16!==t&&1!==t;)t=B.scan();16===t&&133===(t=B.scan())&&9===(t=B.scan())&&a()}else 37===t&&116===(t=B.scan())&&(69===(t=B.scan())||e.isKeyword(t))&&133===(t=B.scan())&&9===(t=B.scan())&&a();return!0}return!1}function u(){var t=B.getToken();if(82===t){if(15===(t=B.scan())){for(t=B.scan();16!==t&&1!==t;)t=B.scan();16===t&&133===(t=B.scan())&&9===(t=B.scan())&&a()}else if(37===t)133===(t=B.scan())&&9===(t=B.scan())&&a();else if(89===t&&(69===(t=B.scan())||e.isKeyword(t))&&56===(t=B.scan())&&c(!0))return!0;return!0}return!1}function c(e){var t=e?B.scan():B.getToken();return 127===t&&(t=B.scan(),17===t&&9===(t=B.scan())&&a(),!0)}function l(){var e=B.getToken();if(69===e&&"define"===B.getTokenValue()){if(17!==(e=B.scan()))return!0;if(9===(e=B.scan())){if(24!==(e=B.scan()))return!0;e=B.scan()}if(19!==e)return!0;e=B.scan();for(var t=0;20!==e&&1!==e;)9===e&&(a(),t++),e=B.scan();return!0}return!1}void 0===n&&(n=!0),void 0===r&&(r=!1);var p,f=[],d=[],m=!1;return n&&function(){for(B.setText(t),B.scan();1!==B.getToken();)o()||s()||u()||r&&(c(!1)||l())||B.scan();B.setText(void 0)}(),function(){var n=e.getLeadingCommentRanges(t,0);e.forEach(n,function(n){var r=t.substring(n.pos,n.end),i=e.getFileReferenceFromReferencePath(r,n);if(i){m=i.isNoDefaultLib;var a=i.fileReference;a&&f.push(a)}})}(),{referencedFiles:f,importedFiles:d,isLibFile:m,ambientExternalModules:p}}function h(e,t){for(;e;){if(210===e.kind&&e.label.text===t)return e.label;e=e.parent}}function y(e){return 69===e.kind&&(206===e.parent.kind||205===e.parent.kind)&&e.parent.label===e}function _(e){return 69===e.kind&&210===e.parent.kind&&e.parent.label===e}function g(e,t){for(var n=e.parent;210===n.kind;n=n.parent)if(n.label.text===t)return!0;return!1}function v(e){return _(e)||y(e)}function b(e){return 136===e.parent.kind&&e.parent.right===e}function S(e){return e&&e.parent&&169===e.parent.kind&&e.parent.name===e}function A(e){return S(e)&&(e=e.parent),e&&e.parent&&171===e.parent.kind&&e.parent.expression===e}function T(e){return S(e)&&(e=e.parent),e&&e.parent&&172===e.parent.kind&&e.parent.expression===e}function E(e){return 221===e.parent.kind&&e.parent.name===e}function C(t){return 69===t.kind&&e.isFunctionLike(t.parent)&&t.parent.name===t}function N(e){return!(69!==e.kind&&9!==e.kind&&8!==e.kind||248!==e.parent.kind&&249!==e.parent.kind||e.parent.name!==e)}function w(e){if(9===e.kind||8===e.kind)switch(e.parent.kind){case 142:case 141:case 248:case 250:case 144:case 143:case 146:case 147:case 221:return e.parent.name===e;case 170:return e.parent.argumentExpression===e}return!1}function k(t){return 9===t.kind&&(E(t)||e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t)}function x(t,n,r){function i(n){return e.forEach(n,function(e){if(e.pos0&&(Y=b(a,r)),!0}function f(t){var n=228===t.kind?225:231,r=e.getAncestor(t,n);if(!r.moduleSpecifier)return!1;q=!0,z=!1;var i,a=A.getSymbolAtLocation(r.moduleSpecifier);return a&&(i=A.getExportsOfModule(a)),Y=i?v(i,t.elements):K,!0}function d(e){if(e)switch(e.kind){case 15:case 24:var t=e.parent;if(t&&(168===t.kind||164===t.kind))return t}}function m(e){if(e)switch(e.kind){case 15:case 24:switch(e.parent.kind){case 228:case 232:return e.parent}}}function h(e){if(e){var t=e.parent;switch(e.kind){case 26:case 39:case 69:case 241:case 242:if(t&&(237===t.kind||238===t.kind))return t;if(241===t.kind)return t.parent;break;case 9:if(t&&(241===t.kind||242===t.kind))return t.parent;break;case 16:if(t&&243===t.kind&&t.parent&&241===t.parent.kind)return t.parent.parent;if(t&&242===t.kind)return t.parent}}}function y(e){switch(e){case 176:case 177:case 216:case 144:case 143:case 146:case 147:case 148:case 149:case 150:return!0}return!1}function _(e){var t=e.parent.kind;switch(e.kind){case 24:return 214===t||215===t||196===t||220===t||y(t)||217===t||189===t||218===t||165===t||219===t;case 21:return 165===t;case 54:return 166===t;case 19:return 165===t;case 17:return 247===t||y(t);case 15:return 220===t||218===t||156===t;case 23:return 141===t&&e.parent&&e.parent.parent&&(218===e.parent.parent.kind||156===e.parent.parent.kind);case 25:return 217===t||189===t||218===t||219===t||y(t);case 113:return 142===t;case 22:return 139===t||e.parent&&e.parent.parent&&165===e.parent.parent.kind;case 112:case 110:case 111:return 139===t;case 116:return 229===t||233===t||227===t;case 73:case 81:case 107:case 87:case 102:case 123:case 129:case 89:case 108:case 74:case 114:case 132:return!0}switch(e.getText()){case"abstract":case"async":case"class":case"const":case"declare":case"enum":case"function":case"interface":case"let":case"private":case"protected":case"public":case"static":case"var":case"yield":return!0}return!1}function g(e){if(8===e.kind){var t=e.getFullText();return"."===t.charAt(t.length-1)}return!1}function v(t,r){for(var i={},a=0,o=r;a0?e.getNodeModifiers(t.declarations[0]):Q.none}function j(t,n,r,i,a){function o(){y.length&&y.push(e.lineBreakPart())}function s(t,r){var i=e.symbolToDisplayParts(h,t,r||n,void 0,3);e.addRange(y,i)}function u(t,n){o(),n&&(c(n),y.push(e.spacePart()),s(t))}function c(t){switch(t){case X.variableElement:case X.functionElement:case X.letElement:case X.constElement:case X.constructorImplementationElement:return void y.push(e.textOrKeywordPart(t));default:return y.push(e.punctuationPart(17)),y.push(e.textOrKeywordPart(t)),void y.push(e.punctuationPart(18))}}function l(t,n,i){e.addRange(y,e.signatureToDisplayParts(h,t,r,32|i)),n.length>1&&(y.push(e.spacePart()),y.push(e.punctuationPart(17)),y.push(e.operatorPart(35)),y.push(e.displayPart((n.length-1).toString(),G.numericLiteral)),y.push(e.spacePart()),y.push(e.textPart(2===n.length?"overload":"overloads")),y.push(e.punctuationPart(18))),f=t.getDocumentationComment()}function p(t,n){var r=e.mapToDisplayParts(function(e){h.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(t,e,n)});e.addRange(y,r)}void 0===a&&(a=Te(i));var f,d,m,h=Je.getTypeChecker(),y=[],_=t.flags,g=U(t,_,i);if(g!==X.unknown||32&_||8388608&_){g!==X.memberGetAccessorElement&&g!==X.memberSetAccessorElement||(g=X.memberVariableElement);var v=void 0;if(m=h.getTypeOfSymbolAtLocation(t,i)){if(i.parent&&169===i.parent.kind){var b=i.parent.name;(b===i||b&&0===b.getFullWidth())&&(i=i.parent)}var S=void 0;if(171===i.kind||172===i.kind?S=i:(A(i)||T(i))&&(S=i.parent),S){var E=[];v=h.getResolvedSignature(S,E),!v&&E.length&&(v=E[0]);var N=172===S.kind||95===S.expression.kind,w=N?m.getConstructSignatures():m.getCallSignatures();if(e.contains(w,v.target)||e.contains(w,v)||(v=w.length?w[0]:void 0),v){switch(N&&32&_?(g=X.constructorImplementationElement,u(m.symbol,g)):8388608&_?(g=X.alias,c(g),y.push(e.spacePart()),N&&(y.push(e.keywordPart(92)),y.push(e.spacePart())),s(t)):u(t,g),g){case X.memberVariableElement:case X.variableElement:case X.constElement:case X.letElement:case X.parameterElement:case X.localVariableElement:y.push(e.punctuationPart(54)),y.push(e.spacePart()),N&&(y.push(e.keywordPart(92)),y.push(e.spacePart())),65536&m.flags||e.addRange(y,e.symbolToDisplayParts(h,m.symbol,r,void 0,1)),l(v,w,8);break;default:l(v,w)}d=!0}}else if(C(i)&&!(98304&t.flags)||121===i.kind&&145===i.parent.kind){var k=i.parent,w=145===k.kind?m.getConstructSignatures():m.getCallSignatures();v=h.isImplementationOfOverload(k)?w[0]:h.getSignatureFromDeclaration(k),145===k.kind?(g=X.constructorImplementationElement,u(m.symbol,g)):u(148!==k.kind||2048&m.symbol.flags||4096&m.symbol.flags?t:m.symbol,g),l(v,w),d=!0}}}if(32&_&&!d&&(e.getDeclarationOfKind(t,189)?c(X.localClassElement):y.push(e.keywordPart(73)),y.push(e.spacePart()),s(t),p(t,n)),64&_&&2&a&&(o(),y.push(e.keywordPart(107)),y.push(e.spacePart()),s(t),p(t,n)),524288&_&&(o(),y.push(e.keywordPart(132)),y.push(e.spacePart()),s(t),p(t,n),y.push(e.spacePart()),y.push(e.operatorPart(56)),y.push(e.spacePart()),e.addRange(y,e.typeToDisplayParts(h,h.getDeclaredTypeOfSymbol(t),r))),384&_&&(o(),e.forEach(t.declarations,e.isConstEnumDeclaration)&&(y.push(e.keywordPart(74)),y.push(e.spacePart())),y.push(e.keywordPart(81)),y.push(e.spacePart()),s(t)),1536&_){o();var x=e.getDeclarationOfKind(t,221),R=x&&x.name&&69===x.name.kind;y.push(e.keywordPart(R?126:125)),y.push(e.spacePart()),s(t)}if(262144&_&&2&a)if(o(),y.push(e.punctuationPart(17)),y.push(e.textPart("type parameter")),y.push(e.punctuationPart(18)),y.push(e.spacePart()),s(t),y.push(e.spacePart()),y.push(e.keywordPart(90)),y.push(e.spacePart()),t.parent)s(t.parent,r),p(t.parent,r);else{var x=e.getDeclarationOfKind(t,138);if(e.Debug.assert(void 0!==x),x=x.parent)if(e.isFunctionLikeKind(x.kind)){var v=h.getSignatureFromDeclaration(x);149===x.kind?(y.push(e.keywordPart(92)),y.push(e.spacePart())):148!==x.kind&&x.name&&s(x.symbol),e.addRange(y,e.signatureToDisplayParts(h,v,n,32))}else y.push(e.keywordPart(132)),y.push(e.spacePart()),s(x.symbol),p(x.symbol,n)}if(8&_){u(t,"enum member");var x=t.declarations[0];if(250===x.kind){var I=h.getConstantValue(x);void 0!==I&&(y.push(e.spacePart()),y.push(e.operatorPart(56)),y.push(e.spacePart()),y.push(e.displayPart(I.toString(),G.numericLiteral)))}}if(8388608&_&&(o(),y.push(e.keywordPart(89)),y.push(e.spacePart()),s(t),e.forEach(t.declarations,function(t){if(224===t.kind){var n=t;if(e.isExternalModuleImportEqualsDeclaration(n))y.push(e.spacePart()),y.push(e.operatorPart(56)),y.push(e.spacePart()),y.push(e.keywordPart(127)),y.push(e.punctuationPart(17)),y.push(e.displayPart(e.getTextOfNode(e.getExternalModuleImportEqualsDeclarationExpression(n)),G.stringLiteral)),y.push(e.punctuationPart(18));else{var i=h.getSymbolAtLocation(n.moduleReference);i&&(y.push(e.spacePart()),y.push(e.operatorPart(56)),y.push(e.spacePart()),s(i,r))}return!0}})),!d)if(g!==X.unknown){if(m)if(u(t,g),g===X.memberVariableElement||3&_||g===X.localVariableElement)if(y.push(e.punctuationPart(54)),y.push(e.spacePart()),m.symbol&&262144&m.symbol.flags){var D=e.mapToDisplayParts(function(e){h.getSymbolDisplayBuilder().buildTypeParameterDisplay(m,e,r)});e.addRange(y,D)}else e.addRange(y,e.typeToDisplayParts(h,m,r));else if(16&_||8192&_||16384&_||131072&_||98304&_||g===X.memberFunctionElement){var w=m.getCallSignatures();l(w[0],w)}}else g=O(t,i);return f||(f=t.getDocumentationComment()),{displayParts:y,documentation:f,symbolKind:g}}function W(t,n){s();var r=a(t),i=e.getTouchingPropertyName(r,n);if(i&&!v(i)){var o=Je.getTypeChecker(),u=o.getSymbolAtLocation(i);if(u&&!o.isUnknownSymbol(u)){var c=j(u,r,R(i),i);return{kind:c.symbolKind,kindModifiers:B(u),textSpan:e.createTextSpan(i.getStart(),i.getWidth()),displayParts:c.displayParts,documentation:c.documentation}}switch(i.kind){case 69:case 169:case 136:case 97:case 162:case 95:var l=o.getTypeAtLocation(i);if(l)return{kind:X.unknown,kindModifiers:Q.none,textSpan:e.createTextSpan(i.getStart(),i.getWidth()),displayParts:e.typeToDisplayParts(o,l,R(i)),documentation:l.symbol?l.symbol.getDocumentationComment():void 0}}}}function q(t,n,r,i){return{fileName:t.getSourceFile().fileName,textSpan:e.createTextSpanFromBounds(t.getStart(),t.getEnd()),kind:n,name:r,containerKind:void 0,containerName:i}}function z(t,n){function r(t,n,r,i,a,o){var s,u=[];return e.forEach(t,function(e){(n&&145===e.kind||!n&&(216===e.kind||144===e.kind||143===e.kind))&&(u.push(e),e.body&&(s=e))}),s?(o.push(q(s,r,i,a)),!0):!!u.length&&(o.push(q(e.lastOrUndefined(u),r,i,a)),!0)}var i=Je.getTypeChecker(),a=[],o=t.getDeclarations(),s=i.symbolToString(t),u=O(t,n),c=t.parent,l=c?i.symbolToString(c,n):"";return function(t,n,i,a,o,s){if((T(n)||121===n.kind)&&32&t.flags){for(var u=0,c=t.getDeclarations();u=0&&!f(n,r[a],104);a--);var o=s(t.statement);return e.forEach(o,function(e){c(t,e)&&f(n,e.getFirstToken(),70,75)}),e.map(n,i)}function y(e){var t=l(e);if(t)switch(t.kind){case 202:case 203:case 204:case 200:case 201:return h(t);case 209:return _(t)}}function _(t){var n=[];return f(n,t.getFirstToken(),96),e.forEach(t.caseBlock.clauses,function(r){f(n,r.getFirstToken(),71,77);var i=s(r);e.forEach(i,function(e){c(t,e)&&f(n,e.getFirstToken(),70)})}),e.map(n,i)}function v(t){var n=[];if(f(n,t.getFirstToken(),100),t.catchClause&&f(n,t.catchClause.getFirstToken(),72),t.finallyBlock){f(n,e.findChildOfKind(t,85,u),85)}return e.map(n,i)}function b(t){var n=o(t);if(n){var r=[];return e.forEach(a(n),function(e){f(r,e.getFirstToken(),98)}),e.isFunctionBlock(n)&&e.forEachReturnStatement(n,function(e){f(r,e.getFirstToken(),94)}),e.map(r,i)}}function S(t){var r=e.getContainingFunction(t);if(r&&n(r.body,195)){var o=[];return e.forEachReturnStatement(r.body,function(e){f(o,e.getFirstToken(),94)}),e.forEach(a(r.body),function(e){f(o,e.getFirstToken(),98)}),e.map(o,i)}}function A(t){for(var r=[];n(t.parent,199)&&t.parent.elseStatement===t;)t=t.parent;for(;t;){var a=t.getChildren();f(r,a[0],88);for(var o=a.length-1;o>=0&&!f(r,a[o],80);o--);if(!n(t.elseStatement,199))break;t=t.elseStatement}for(var s=[],o=0;o=c.end;d--)if(!e.isWhiteSpace(u.text.charCodeAt(d))){p=!1;break}if(p){s.push({fileName:T,textSpan:e.createTextSpanFromBounds(c.getStart(),l.end),kind:J.reference}),o++;continue}}s.push(i(r[o]))}return s}var T=u.fileName,E=function(t){if(t)switch(t.kind){case 88:case 80:if(n(t.parent,199))return A(t.parent);break;case 94:if(n(t.parent,207))return S(t.parent);break;case 98:if(n(t.parent,211))return b(t.parent);break;case 72:if(n(r(r(t)),212))return v(t.parent.parent);break;case 100:case 85:if(n(r(t),212))return v(t.parent);break;case 96:if(n(t.parent,209))return _(t.parent);break;case 71:case 77:if(n(r(r(r(t))),209))return _(t.parent.parent.parent);break;case 70:case 75:if(n(t.parent,206)||n(t.parent,205))return y(t.parent);break;case 86:if(n(t.parent,202)||n(t.parent,203)||n(t.parent,204))return h(t.parent);break;case 104:case 79:if(n(t.parent,201)||n(t.parent,200))return h(t.parent);break;case 121:if(n(t.parent,145))return m(t.parent);break;case 123:case 129:if(n(t.parent,146)||n(t.parent,147))return d(t.parent);break;default:if(e.isModifierKind(t.kind)&&t.parent&&(e.isDeclaration(t.parent)||196===t.parent.kind))return p(t.kind,t.parent)}}(t);if(E&&0!==E.length)return[{fileName:T,highlightSpans:E}]}(c)}function re(e,t){return s(),function(e){if(e){for(var t=[],n=0,r=e;n=0&&(Qe.throwIfCancellationRequested(),!(c>i));){var l=c+u;0!==c&&e.isIdentifierPart(o.charCodeAt(c-1),2)||l!==s&&e.isIdentifierPart(o.charCodeAt(l),2)||a.push(c),c=o.indexOf(n,c+u+1)}return a}function u(t,n){var r=[],i=t.getSourceFile(),a=n.text,o=s(i,a,t.getStart(),t.getEnd());return e.forEach(o,function(t){Qe.throwIfCancellationRequested();var o=e.getTouchingWord(i,t);o&&o.getWidth()===a.length&&(o===n||y(o)&&h(o,a)===n)&&r.push(fe(o))}),[{definition:{containerKind:"",containerName:"",fileName:n.getSourceFile().fileName,kind:X.label,name:a,textSpan:e.createTextSpanFromBounds(n.getStart(),n.getEnd())},references:r}]}function c(e,t){if(e)switch(e.kind){case 69:return e.getWidth()===t.length;case 9:if(w(e)||k(e))return e.getWidth()===t.length+2;break;case 8:if(w(e))return e.getWidth()===t.length}return!1}function l(t,n,r,i,o,u,l,f,m){function h(t){var n=e.getSymbolId(t),r=m[n];return void 0===r&&(r=f.length,m[n]=r,f.push({definition:a(t),references:[]})),f[r]}function y(t,n){function r(e){var n=t.text.substring(e.pos,e.end);return!v.test(n)}return e.isInCommentHelper(t,n,r)}var g=t.getSourceFile(),v=/^\/\/\/\s*=0){var m=h(s);m.references.push(fe(a.name))}}}})}}function p(t,n){var r=[t];if(o(t)&&r.push(_.getAliasedSymbol(t)),233===n.parent.kind&&r.push(_.getExportSpecifierLocalTargetSymbol(n.parent)),N(n)){e.forEach(m(n),function(t){e.addRange(r,_.getRootSymbols(t))});var i=_.getShorthandAssignmentValueSymbol(n.parent);i&&r.push(i)}return t.valueDeclaration&&139===t.valueDeclaration.kind&&e.isParameterPropertyDeclaration(t.valueDeclaration)&&(r=r.concat(_.getSymbolsOfParameterPropertyDeclaration(t.valueDeclaration,t.name))),e.forEach(_.getRootSymbols(t),function(e){e!==t&&r.push(e),e.parent&&96&e.parent.flags&&f(e.parent,e.getName(),r,{})}),r}function f(t,n,r,i){function a(e){if(e){var a=_.getTypeAtLocation(e);if(a){var o=_.getPropertyOfType(a,n);o&&r.push(o),i[t.name]=t,f(a.symbol,n,r,i)}}}t&&(e.hasProperty(i,t.name)||96&t.flags&&e.forEach(t.getDeclarations(),function(t){217===t.kind?(a(e.getClassExtendsHeritageClauseElement(t)),e.forEach(e.getClassImplementsHeritageClauseElements(t),a)):218===t.kind&&e.forEach(e.getInterfaceBaseTypeNodes(t),a)}))}function d(t,n,r){if(t.indexOf(n)>=0)return n;if(o(n)){var i=_.getAliasedSymbol(n);if(t.indexOf(i)>=0)return i}if(233===r.parent.kind){var i=_.getExportSpecifierLocalTargetSymbol(r.parent);if(t.indexOf(i)>=0)return i}return N(r)?e.forEach(m(r),function(n){return e.forEach(_.getRootSymbols(n),function(e){return t.indexOf(e)>=0?e:void 0})}):e.forEach(_.getRootSymbols(n),function(n){if(t.indexOf(n)>=0)return n;if(n.parent&&96&n.parent.flags){var r=[];return f(n.parent,n.getName(),r,{}),e.forEach(r,function(e){return t.indexOf(e)>=0?e:void 0})}})}function m(t){if(N(t)){var n=t.parent.parent,r=_.getContextualType(n),i=t.text;if(r){if(16384&r.flags){var a=r.getProperty(i);if(a)return[a];var o=[];return e.forEach(r.types,function(e){var t=e.getProperty(i);t&&o.push(t)}),o}var s=r.getProperty(i);if(s)return[s]}}}var _=Je.getTypeChecker();if(v(t)){if(y(t)){var g=h(t.parent,t.text);return g?u(g.parent,g):void 0}return u(t.parent,t)}if(97===t.kind||162===t.kind)return function(n,r){function i(t,n,r,i){e.forEach(r,function(r){Qe.throwIfCancellationRequested();var a=e.getTouchingWord(t,r);if(a&&(97===a.kind||162===a.kind)){var s=e.getThisContainer(a,!1);switch(n.kind){case 176:case 216:n.symbol===s.symbol&&i.push(fe(a));break;case 144:case 143:e.isObjectLiteralMethod(n)&&n.symbol===s.symbol&&i.push(fe(a));break;case 189:case 217:s.parent&&n.symbol===s.parent.symbol&&(64&s.flags)===o&&i.push(fe(a));break;case 251:251!==s.kind||e.isExternalModule(s)||i.push(fe(a))}}})}var a=e.getThisContainer(n,!1),o=64;switch(a.kind){case 144:case 143:if(e.isObjectLiteralMethod(a))break;case 142:case 141:case 145:case 146:case 147:o&=a.flags,a=a.parent;break;case 251:if(e.isExternalModule(a))return;case 216:case 176:break;default:return}var u,c=[];if(251===a.kind)e.forEach(r,function(e){u=s(e,"this",e.getStart(),e.getEnd()),i(e,e,u,c)});else{var l=a.getSourceFile();u=s(l,"this",a.getStart(),a.getEnd()),i(l,a,u,c)}return[{definition:{containerKind:"",containerName:"",fileName:t.getSourceFile().fileName,kind:X.variableElement,name:"this",textSpan:e.createTextSpanFromBounds(t.getStart(),t.getEnd())},references:c}]}(t,n);if(95===t.kind)return function(t){var n=e.getSuperContainer(t,!1);if(n){var r=64;switch(n.kind){case 142:case 141:case 144:case 143:case 145:case 146:case 147:r&=n.flags,n=n.parent;break;default:return}var i=[],o=n.getSourceFile(),u=s(o,"super",n.getStart(),n.getEnd());e.forEach(u,function(t){Qe.throwIfCancellationRequested();var a=e.getTouchingWord(o,t);if(a&&95===a.kind){var s=e.getSuperContainer(a,!1);s&&(64&s.flags)===r&&s.parent.symbol===n.symbol&&i.push(fe(a))}});return[{definition:a(n.symbol),references:i}]}}(t);var b=_.getSymbolAtLocation(t);if(b){var S=b.declarations;if(S&&S.length){var A,T=function(e,t){if(t){var n=void 0;do{n=e;for(var r=0,i=t;r=0),o>0){var s=n||d(t.kind,t);s&&r(a,o,s)}return!0}function f(e){switch(e.parent&&e.parent.kind){case 238:if(e.parent.tagName===e)return 19;break;case 240:if(e.parent.tagName===e)return 20;break;case 237:if(e.parent.tagName===e)return 21;break;case 241:if(e.parent.name===e)return 22}}function d(t,n){if(e.isKeyword(t))return 3;if((25===t||27===t)&&n&&e.getTypeArgumentOrTypeParameterList(n.parent))return 10;if(e.isPunctuation(t)){if(n){if(56===t&&(214===n.parent.kind||142===n.parent.kind||139===n.parent.kind||241===n.parent.kind))return 5;if(184===n.parent.kind||182===n.parent.kind||183===n.parent.kind||185===n.parent.kind)return 5}return 10}if(8===t)return 4;if(9===t||163===t)return 241===n.parent.kind?24:6;if(10===t)return 6;if(e.isTemplateLiteralKind(t))return 6;if(239===t)return 23;if(69===t){if(n)switch(n.parent.kind){case 217:if(n.parent.name===n)return 11;return;case 138:if(n.parent.name===n)return 15;return;case 218:if(n.parent.name===n)return 13;return;case 220:if(n.parent.name===n)return 12;return;case 221:if(n.parent.name===n)return 14;return;case 139:if(n.parent.name===n)return 17;return}return 2}}function m(t){if(t&&e.decodedTextSpanIntersectsWith(y,_,t.pos,t.getFullWidth())){Re(t.kind);for(var n=t.getChildren(h),r=0,i=n.length;r0)for(var c=function(){var t=/(?:\/\/+\s*)/.source,i=/(?:\/\*+\s*)/.source,a=/(?:^(?:\s|\*)*)/.source,o="("+a+"|"+t+"|"+i+")",s="(?:"+e.map(n,function(e){return"("+r(e.text)+")"}).join("|")+")",u=/(?:$|\*\/)/.source,c=/(?:.*?)/.source,l="("+s+c+")",p=o+l+u;return new RegExp(p,"gim")}(),l=void 0;l=c.exec(o);){Qe.throwIfCancellationRequested();e.Debug.assert(l.length===n.length+3);var p=l[1],f=l.index+p.length,d=e.getTokenAtPosition(i,f);if(x(i,d,f)){for(var m=void 0,h=0,y=n.length;h=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}(o.charCodeAt(f+m.text.length))){var _=l[2];u.push({descriptor:m,message:_,position:f})}}}return u}function He(n,r){function i(e){return{canRename:!1,localizedErrorMessage:e,displayName:void 0,fullDisplayName:void 0,kind:void 0,kindModifiers:void 0,triggerSpan:void 0}}s();var o=a(n),u=Je.getTypeChecker(),c=e.getTouchingWord(o,r);if(c&&69===c.kind){var l=u.getSymbolAtLocation(c);if(l){var p=l.getDeclarations();if(p&&p.length>0){var f=t.getDefaultLibFileName(t.getCompilationSettings()),d=et(e.normalizePath(f));if(f)for(var m=0,h=p;m=0){var p=u-a;p>0&&n.push({length:p,classification:$.Whitespace})}n.push({length:c,classification:r(l)}),a=u+c}var f=t.length-a;return f>0&&n.push({length:f,classification:$.Whitespace}),{entries:n,finalLexState:e.endOfLineState}}function r(e){switch(e){case 1:return $.Comment;case 3:return $.Keyword;case 4:return $.NumberLiteral;case 5:return $.Operator;case 6:return $.StringLiteral;case 8:return $.Whitespace;case 10:return $.Punctuation;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:default:return $.Identifier}}function i(e,t,r){return n(a(e,t,r),e)}function a(n,r,i){function a(e,t,n){if(8!==n){0===e&&o>0&&(e+=o),e-=o,t-=o;var r=t-e;r>0&&(m.spans.push(e),m.spans.push(r),m.spans.push(n))}}for(var o=0,s=0,d=0;f.length>0;)f.pop();switch(r){case 3:n='"\\\n'+n,o=3;break;case 2:n="'\\\n"+n,o=3;break;case 1:n="/*\n"+n,o=3;break;case 4:n="`\n"+n,o=2;break;case 5:n="}\n"+n,o=2;case 6:f.push(12)}l.setText(n);var m={endOfLineState:0,spans:[]},h=0;do{if(s=l.scan(),!e.isTrivia(s)){if(39!==s&&61!==s||p[d]){if(21===d&&u(s))s=69;else if(u(d)&&u(s)&&!t(d,s))s=69;else if(69===d&&25===s)h++;else if(27===s&&h>0)h--;else if(117===s||130===s||128===s||120===s||131===s)h>0&&!i&&(s=69);else if(12===s)f.push(s);else if(15===s)f.length>0&&f.push(s);else if(16===s&&f.length>0){var y=e.lastOrUndefined(f);12===y?(s=l.reScanTemplateToken(),14===s?f.pop():e.Debug.assert(13===s,"Should have been a template middle. Was "+s)):(e.Debug.assert(15===y,"Should have been an open brace. Was: "+s),f.pop())}}else 10===l.reScanSlashToken()&&(s=10);d=s}!function(){var t=l.getTokenPos(),r=l.getTextPos();if(a(t,r,c(s)),r>=n.length)if(9===s||163===s){var i=l.getTokenText();if(l.isUnterminated()){for(var o=i.length-1,u=0;92===i.charCodeAt(o-u);)u++;if(1&u){var p=i.charCodeAt(0);m.endOfLineState=34===p?3:2}}}else 3===s?l.isUnterminated()&&(m.endOfLineState=1):e.isTemplateLiteralKind(s)?l.isUnterminated()&&(14===s?m.endOfLineState=5:11===s?m.endOfLineState=4:e.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+s)):f.length>0&&12===e.lastOrUndefined(f)&&(m.endOfLineState=6)}()}while(1!==s);return m}function o(e){switch(e){case 37:case 39:case 40:case 35:case 36:case 43:case 44:case 45:case 25:case 27:case 28:case 29:case 91:case 90:case 116:case 30:case 31:case 32:case 33:case 46:case 48:case 47:case 51:case 52:case 67:case 66:case 68:case 63:case 64:case 65:case 57:case 58:case 59:case 61:case 62:case 56:case 24:return!0;default:return!1}}function s(e){switch(e){case 35:case 36:case 50:case 49:case 41:case 42:return!0;default:return!1}}function u(e){return e>=70&&e<=135}function c(t){if(u(t))return 3;if(o(t)||s(t))return 5;if(t>=15&&t<=68)return 10;switch(t){case 8:return 4;case 9:case 163:return 6;case 10:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;case 69:default:return e.isTemplateLiteralKind(t)?6:2}}var l=e.createScanner(2,!1),p=[];p[69]=!0,p[9]=!0,p[8]=!0,p[10]=!0,p[97]=!0,p[41]=!0,p[42]=!0,p[18]=!0,p[20]=!0,p[16]=!0,p[99]=!0,p[84]=!0;var f=[];return{getClassificationsForLine:i,getEncodedLexicalClassifications:a}}function U(t){return a+e.directorySeparator+e.getDefaultLibFileName(t)}e.servicesVersion="0.4";!function(e){function t(e){return new n(e)}var n=function(){function e(e){this.text=e}return e.prototype.getText=function(e,t){return this.text.substring(e,t)},e.prototype.getLength=function(){return this.text.length},e.prototype.getChangeRange=function(e){},e}();e.fromString=t}(e.ScriptSnapshot||(e.ScriptSnapshot={}));var F,B=e.createScanner(2,!0),K=[],V=["augments","author","argument","borrows","class","constant","constructor","constructs","default","deprecated","description","event","example","extends","field","fileOverview","function","ignore","inner","lends","link","memberOf","name","namespace","param","private","property","public","requires","returns","see","since","static","throws","type","version"],j=function(){function n(e,t,n){this.kind=e,this.pos=t,this.end=n,this.flags=0,this.parent=void 0}return n.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},n.prototype.getStart=function(t){return e.getTokenPosOfNode(this,t)},n.prototype.getFullStart=function(){return this.pos},n.prototype.getEnd=function(){return this.end},n.prototype.getWidth=function(e){return this.getEnd()-this.getStart(e)},n.prototype.getFullWidth=function(){return this.end-this.pos},n.prototype.getLeadingTriviaWidth=function(e){return this.getStart(e)-this.pos},n.prototype.getFullText=function(e){return(e||this.getSourceFile()).text.substring(this.pos,this.end)},n.prototype.getText=function(e){return(e||this.getSourceFile()).text.substring(this.getStart(),this.getEnd())},n.prototype.addSyntheticNodes=function(e,n,r){for(B.setTextPos(n);n=136){B.setText((t||this.getSourceFile()).text),n=[];var i=this.pos,a=function(e){i0?c(t.declarations[0]):void 0}function _(t){var n=e.forEach(t.elements,function(e){return 190!==e.kind?e:void 0});return n?c(n):166===t.parent.kind?r(t.parent):l(t.parent)}function g(t){e.Debug.assert(165!==t.kind&&164!==t.kind);var n=167===t.kind?t.elements:t.properties,i=e.forEach(n,function(e){return 190!==e.kind?e:void 0});return i?c(i):r(184===t.parent.kind?t.parent:t)}if(n)switch(n.kind){case 196:return p(n.declarationList.declarations[0]);case 214:case 142:case 141:return p(n);case 139:return d(n);case 216:case 144:case 143:case 146:case 147:case 145:case 176:case 177:return function(e){if(e.body)return m(e)?r(e):c(e.body)}(n);case 195:if(e.isFunctionBlock(n))return function(e){var t=e.statements.length?e.statements[0]:e.getLastToken();return m(e.parent)?a(e.parent,t):c(t)}(n);case 222:return h(n);case 247:return h(n.block);case 198:return r(n.expression);case 207:return r(n.getChildAt(0),n.expression);case 201:return i(n,n.expression);case 200:return c(n.statement);case 213:return r(n.getChildAt(0));case 199:return i(n,n.expression);case 210:return c(n.statement);case 206:case 205:return r(n.getChildAt(0),n.label);case 202:return function(e){return e.initializer?y(e):e.condition?r(e.condition):e.incrementor?r(e.incrementor):void 0}(n);case 203:return i(n,n.expression);case 204:return y(n);case 209:return i(n,n.expression);case 244:case 245:return c(n.statements[0]);case 212:return h(n.tryBlock);case 211:return r(n,n.expression);case 230:return r(n,n.expression);case 224:return r(n,n.moduleReference);case 225:return r(n,n.moduleSpecifier);case 231:return r(n,n.moduleSpecifier);case 221:if(1!==e.getModuleInstanceState(n))return;case 217:case 220:case 250:case 166:return r(n);case 208:return c(n.statement);case 140:return o(n.parent.decorators);case 164:case 165:return _(n);case 218:case 219:return;case 23:case 1:return a(e.findPrecedingToken(n.pos,t));case 24:return s(n);case 15:return function(n){switch(n.parent.kind){case 220:var r=n.parent;return a(e.findPrecedingToken(n.pos,t,n.parent),r.members.length?r.members[0]:r.getLastToken(t));case 217:var i=n.parent;return a(e.findPrecedingToken(n.pos,t,n.parent),i.members.length?i.members[0]:i.getLastToken(t));case 223:return a(n.parent.parent,n.parent.clauses[0])}return c(n.parent)}(n);case 16:return function(t){switch(t.parent.kind){case 222:if(1!==e.getModuleInstanceState(t.parent.parent))return;case 220:case 217:return r(t);case 195:if(e.isFunctionBlock(t.parent))return r(t);case 247:return c(e.lastOrUndefined(t.parent.statements));case 223:var n=t.parent,i=e.lastOrUndefined(n.clauses);if(i)return c(e.lastOrUndefined(i.statements));return;case 164:var a=t.parent;return c(e.lastOrUndefined(a.elements)||a);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var o=t.parent;return r(e.lastOrUndefined(o.properties)||o)}return c(t.parent)}}(n);case 20:return function(t){switch(t.parent.kind){case 165:var n=t.parent;return r(e.lastOrUndefined(n.elements)||n);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var i=t.parent;return r(e.lastOrUndefined(i.elements)||i)}return c(t.parent)}}(n);case 17:return function(e){return 200===e.parent.kind||171===e.parent.kind||172===e.parent.kind?s(e):175===e.parent.kind?u(e):c(e.parent)}(n);case 18:return function(e){switch(e.parent.kind){case 176:case 216:case 177:case 144:case 143:case 146:case 147:case 145:case 201:case 200:case 202:case 204:case 171:case 172:case 175:return s(e);default:return c(e.parent)}}(n);case 54:return function(t){return e.isFunctionLike(t.parent)||248===t.parent.kind||139===t.parent.kind?s(t):c(t.parent)}(n);case 27:case 25:return function(e){return 174===e.parent.kind?u(e):c(e.parent)}(n);case 104:return function(e){return 200===e.parent.kind?i(e,e.parent.expression):c(e.parent)}(n);case 80:case 72:case 85:return u(n);case 135:return function(e){return 204===e.parent.kind?u(e):c(e.parent)}(n);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(n))return g(n);if((69===n.kind||188==n.kind||248===n.kind||249===n.kind)&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(n.parent))return r(n);if(184===n.kind){var v=n;if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(v.left))return g(v.left);if(56===v.operatorToken.kind&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(v.parent))return r(n);if(24===v.operatorToken.kind)return c(v.left)}if(e.isExpression(n))switch(n.parent.kind){case 200:return s(n);case 140:return c(n.parent);case 202:case 204:return r(n);case 184:if(24===n.parent.operatorToken.kind)return r(n);break;case 177:if(n.parent.body===n)return r(n)}if(248===n.parent.kind&&n.parent.name===n&&!e.isArrayLiteralOrObjectLiteralDestructuringPattern(n.parent.parent))return c(n.parent.initializer);if(174===n.parent.kind&&n.parent.type===n)return u(n.parent.type);if(e.isFunctionLike(n.parent)&&n.parent.type===n)return s(n);if(214===n.parent.kind||139===n.parent.kind){var b=n.parent;if(b.initializer===n||b.type===n||e.isAssignmentOperator(n.kind))return s(n)}if(184===n.parent.kind){var v=n.parent;if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(v.left)&&(v.right===n||v.operatorToken===n))return s(n)}return c(n.parent)}}if(!(4096&t.flags)){var l=e.getTokenAtPosition(t,n),p=t.getLineAndCharacterOfPosition(n).line;if((!(t.getLineAndCharacterOfPosition(l.getStart(t)).line>p)||(l=e.findPrecedingToken(l.pos,t))&&t.getLineAndCharacterOfPosition(l.getEnd()).line===p)&&!e.isInAmbientContext(l))return c(l)}}t.spanInSourceFileAtLocation=n}(e.BreakpointResolver||(e.BreakpointResolver={}))}(o||(o={}));var o,u=this;!function(t){function n(e,t){e&&e.log("*INTERNAL ERROR* - Exception in typescript services: "+t.message)}function r(e,t,n,r){var i;r&&(e.log(t),i=Date.now());var a=n();if(r){var o=Date.now();if(e.log(t+" completed in "+(o-i)+" msec"),"string"==typeof a){var s=a;s.length>128&&(s=s.substring(0,128)+"..."),e.log(" result.length="+s.length+", result='"+JSON.stringify(s)+"'")}}return a}function i(e,i,a,o){try{var s=r(e,i,a,o);return JSON.stringify({result:s})}catch(r){return r instanceof t.OperationCanceledException?JSON.stringify({canceled:!0}):(n(e,r),r.description=i,JSON.stringify({error:r}))}}function a(e,t){return e.map(function(e){return o(e,t)})}function o(e,n){return{message:t.flattenDiagnosticMessageText(e.messageText,n),start:e.start,length:e.length,category:t.DiagnosticCategory[e.category].toLowerCase(),code:e.code}}function c(e){return{spans:e.spans.join(","),endOfLineState:e.endOfLineState}}var l=function(){function e(e){this.scriptSnapshotShim=e}return e.prototype.getText=function(e,t){return this.scriptSnapshotShim.getText(e,t)},e.prototype.getLength=function(){return this.scriptSnapshotShim.getLength()},e.prototype.getChangeRange=function(e){var n=e,r=this.scriptSnapshotShim.getChangeRange(n.scriptSnapshotShim);if(null==r)return null;var i=JSON.parse(r);return t.createTextChangeRange(t.createTextSpan(i.span.start,i.span.length),i.newLength)},e.prototype.dispose=function(){"dispose"in this.scriptSnapshotShim&&this.scriptSnapshotShim.dispose()},e}(),p=function(){function e(e){var n=this;this.shimHost=e,this.loggingEnabled=!1,this.tracingEnabled=!1,"getModuleResolutionsForFile"in this.shimHost&&(this.resolveModuleNames=function(e,r){var i=JSON.parse(n.shimHost.getModuleResolutionsForFile(r));return t.map(e,function(e){var n=t.lookUp(i,e);return n?{resolvedFileName:n}:void 0})}),"directoryExists"in this.shimHost&&(this.directoryExists=function(e){return n.shimHost.directoryExists(e)})}return e.prototype.log=function(e){this.loggingEnabled&&this.shimHost.log(e)},e.prototype.trace=function(e){this.tracingEnabled&&this.shimHost.trace(e)},e.prototype.error=function(e){this.shimHost.error(e)},e.prototype.getProjectVersion=function(){if(this.shimHost.getProjectVersion)return this.shimHost.getProjectVersion()},e.prototype.useCaseSensitiveFileNames=function(){return!!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames()},e.prototype.getCompilationSettings=function(){var e=this.shimHost.getCompilationSettings();if(null==e||""==e)throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");return JSON.parse(e)},e.prototype.getScriptFileNames=function(){var e=this.shimHost.getScriptFileNames();return this.files=JSON.parse(e)},e.prototype.getScriptSnapshot=function(e){var t=this.shimHost.getScriptSnapshot(e);return t&&new l(t)},e.prototype.getScriptVersion=function(e){return this.shimHost.getScriptVersion(e)},e.prototype.getLocalizedDiagnosticMessages=function(){var e=this.shimHost.getLocalizedDiagnosticMessages();if(null==e||""==e)return null;try{return JSON.parse(e)}catch(e){return this.log(e.description||"diagnosticMessages.generated.json has invalid JSON format"),null}},e.prototype.getCancellationToken=function(){return new f(this.shimHost.getCancellationToken())},e.prototype.getCurrentDirectory=function(){return this.shimHost.getCurrentDirectory()},e.prototype.getDefaultLibFileName=function(e){return this.shimHost.getDefaultLibFileName(JSON.stringify(e))},e}();t.LanguageServiceShimHostAdapter=p;var f=function(){function e(e){this.hostCancellationToken=e,this.lastCancellationCheckTime=0}return e.prototype.isCancellationRequested=function(){var e=Date.now();return Math.abs(e-this.lastCancellationCheckTime)>10&&(this.lastCancellationCheckTime=e,this.hostCancellationToken.isCancellationRequested())},e}(),d=function(){function e(e){var t=this;this.shimHost=e,"directoryExists"in this.shimHost&&(this.directoryExists=function(e){return t.shimHost.directoryExists(e)})}return e.prototype.readDirectory=function(e,t,n){var r=this.shimHost.readDirectory(e,t,JSON.stringify(n));return JSON.parse(r)},e.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},e.prototype.readFile=function(e){return this.shimHost.readFile(e)},e}();t.CoreServicesShimHostAdapter=d;var m=function(){function e(e){this.factory=e,e.registerShim(this)}return e.prototype.dispose=function(e){this.factory.unregisterShim(this)},e}();t.realizeDiagnostics=a;var h=function(e){function n(t,n,r){e.call(this,t),this.host=n,this.languageService=r,this.logPerformance=!1,this.logger=this.host}return s(n,e),n.prototype.forwardJSONCall=function(e,t){return i(this.logger,e,t,this.logPerformance)},n.prototype.dispose=function(t){this.logger.log("dispose()"),this.languageService.dispose(),this.languageService=null,u&&u.CollectGarbage&&(u.CollectGarbage(),this.logger.log("CollectGarbage()")),this.logger=null,e.prototype.dispose.call(this,t)},n.prototype.refresh=function(e){this.forwardJSONCall("refresh("+e+")",function(){return null})},n.prototype.cleanupSemanticCache=function(){var e=this;this.forwardJSONCall("cleanupSemanticCache()",function(){return e.languageService.cleanupSemanticCache(),null})},n.prototype.realizeDiagnostics=function(e){var n=t.getNewLineOrDefaultFromHost(this.host);return t.realizeDiagnostics(e,n)},n.prototype.getSyntacticClassifications=function(e,n,r){var i=this;return this.forwardJSONCall("getSyntacticClassifications('"+e+"', "+n+", "+r+")",function(){return i.languageService.getSyntacticClassifications(e,t.createTextSpan(n,r))})},n.prototype.getSemanticClassifications=function(e,n,r){var i=this;return this.forwardJSONCall("getSemanticClassifications('"+e+"', "+n+", "+r+")",function(){return i.languageService.getSemanticClassifications(e,t.createTextSpan(n,r))})},n.prototype.getEncodedSyntacticClassifications=function(e,n,r){var i=this;return this.forwardJSONCall("getEncodedSyntacticClassifications('"+e+"', "+n+", "+r+")",function(){return c(i.languageService.getEncodedSyntacticClassifications(e,t.createTextSpan(n,r)))})},n.prototype.getEncodedSemanticClassifications=function(e,n,r){var i=this;return this.forwardJSONCall("getEncodedSemanticClassifications('"+e+"', "+n+", "+r+")",function(){return c(i.languageService.getEncodedSemanticClassifications(e,t.createTextSpan(n,r)))})},n.prototype.getSyntacticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSyntacticDiagnostics('"+e+"')",function(){var n=t.languageService.getSyntacticDiagnostics(e);return t.realizeDiagnostics(n)})},n.prototype.getSemanticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSemanticDiagnostics('"+e+"')",function(){var n=t.languageService.getSemanticDiagnostics(e);return t.realizeDiagnostics(n)})},n.prototype.getCompilerOptionsDiagnostics=function(){var e=this;return this.forwardJSONCall("getCompilerOptionsDiagnostics()",function(){var t=e.languageService.getCompilerOptionsDiagnostics();return e.realizeDiagnostics(t)})},n.prototype.getQuickInfoAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getQuickInfoAtPosition('"+e+"', "+t+")",function(){return n.languageService.getQuickInfoAtPosition(e,t)})},n.prototype.getNameOrDottedNameSpan=function(e,t,n){var r=this;return this.forwardJSONCall("getNameOrDottedNameSpan('"+e+"', "+t+", "+n+")",function(){return r.languageService.getNameOrDottedNameSpan(e,t,n)})},n.prototype.getBreakpointStatementAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getBreakpointStatementAtPosition('"+e+"', "+t+")",function(){return n.languageService.getBreakpointStatementAtPosition(e,t)})},n.prototype.getSignatureHelpItems=function(e,t){var n=this;return this.forwardJSONCall("getSignatureHelpItems('"+e+"', "+t+")",function(){return n.languageService.getSignatureHelpItems(e,t)})},n.prototype.getDefinitionAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getDefinitionAtPosition('"+e+"', "+t+")",function(){return n.languageService.getDefinitionAtPosition(e,t)})},n.prototype.getTypeDefinitionAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getTypeDefinitionAtPosition('"+e+"', "+t+")",function(){return n.languageService.getTypeDefinitionAtPosition(e,t)})},n.prototype.getRenameInfo=function(e,t){var n=this;return this.forwardJSONCall("getRenameInfo('"+e+"', "+t+")",function(){return n.languageService.getRenameInfo(e,t)})},n.prototype.findRenameLocations=function(e,t,n,r){var i=this;return this.forwardJSONCall("findRenameLocations('"+e+"', "+t+", "+n+", "+r+")",function(){return i.languageService.findRenameLocations(e,t,n,r)})},n.prototype.getBraceMatchingAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getBraceMatchingAtPosition('"+e+"', "+t+")",function(){return n.languageService.getBraceMatchingAtPosition(e,t)})},n.prototype.getIndentationAtPosition=function(e,t,n){var r=this;return this.forwardJSONCall("getIndentationAtPosition('"+e+"', "+t+")",function(){var i=JSON.parse(n);return r.languageService.getIndentationAtPosition(e,t,i)})},n.prototype.getReferencesAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getReferencesAtPosition('"+e+"', "+t+")",function(){return n.languageService.getReferencesAtPosition(e,t)})},n.prototype.findReferences=function(e,t){var n=this;return this.forwardJSONCall("findReferences('"+e+"', "+t+")",function(){return n.languageService.findReferences(e,t)})},n.prototype.getOccurrencesAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getOccurrencesAtPosition('"+e+"', "+t+")",function(){return n.languageService.getOccurrencesAtPosition(e,t)})},n.prototype.getDocumentHighlights=function(e,n,r){var i=this;return this.forwardJSONCall("getDocumentHighlights('"+e+"', "+n+")",function(){var a=i.languageService.getDocumentHighlights(e,n,JSON.parse(r)),o=t.normalizeSlashes(e).toLowerCase();return t.filter(a,function(e){return t.normalizeSlashes(e.fileName).toLowerCase()===o})})},n.prototype.getCompletionsAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getCompletionsAtPosition('"+e+"', "+t+")",function(){return n.languageService.getCompletionsAtPosition(e,t)})},n.prototype.getCompletionEntryDetails=function(e,t,n){var r=this;return this.forwardJSONCall("getCompletionEntryDetails('"+e+"', "+t+", '"+n+"')",function(){return r.languageService.getCompletionEntryDetails(e,t,n)})},n.prototype.getFormattingEditsForRange=function(e,t,n,r){var i=this;return this.forwardJSONCall("getFormattingEditsForRange('"+e+"', "+t+", "+n+")",function(){var a=JSON.parse(r);return i.languageService.getFormattingEditsForRange(e,t,n,a)})},n.prototype.getFormattingEditsForDocument=function(e,t){var n=this;return this.forwardJSONCall("getFormattingEditsForDocument('"+e+"')",function(){var r=JSON.parse(t);return n.languageService.getFormattingEditsForDocument(e,r)})},n.prototype.getFormattingEditsAfterKeystroke=function(e,t,n,r){var i=this;return this.forwardJSONCall("getFormattingEditsAfterKeystroke('"+e+"', "+t+", '"+n+"')",function(){var a=JSON.parse(r);return i.languageService.getFormattingEditsAfterKeystroke(e,t,n,a)})},n.prototype.getDocCommentTemplateAtPosition=function(e,t){var n=this;return this.forwardJSONCall("getDocCommentTemplateAtPosition('"+e+"', "+t+")",function(){return n.languageService.getDocCommentTemplateAtPosition(e,t)})},n.prototype.getNavigateToItems=function(e,t){var n=this;return this.forwardJSONCall("getNavigateToItems('"+e+"', "+t+")",function(){return n.languageService.getNavigateToItems(e,t)})},n.prototype.getNavigationBarItems=function(e){var t=this;return this.forwardJSONCall("getNavigationBarItems('"+e+"')",function(){return t.languageService.getNavigationBarItems(e)})},n.prototype.getOutliningSpans=function(e){var t=this;return this.forwardJSONCall("getOutliningSpans('"+e+"')",function(){return t.languageService.getOutliningSpans(e)})},n.prototype.getTodoComments=function(e,t){var n=this;return this.forwardJSONCall("getTodoComments('"+e+"')",function(){return n.languageService.getTodoComments(e,JSON.parse(t))})},n.prototype.getEmitOutput=function(e){var t=this;return this.forwardJSONCall("getEmitOutput('"+e+"')",function(){return t.languageService.getEmitOutput(e)})},n}(m),y=function(e){function n(n,r){e.call(this,n),this.logger=r,this.logPerformance=!1,this.classifier=t.createClassifier()}return s(n,e),n.prototype.getEncodedLexicalClassifications=function(e,t,n){var r=this;return i(this.logger,"getEncodedLexicalClassifications",function(){return c(r.classifier.getEncodedLexicalClassifications(e,t,n))},this.logPerformance)},n.prototype.getClassificationsForLine=function(e,t,n){for(var r=this.classifier.getClassificationsForLine(e,t,n),i="",a=0,o=r.entries;a=t+n||t?new java.lang.String(e,t,n)+"":e}function c(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}r.prototype.parseFromString=function(e,t){var n=this.options,r=new l,o=n.domBuilder||new a,s=n.errorHandler,u=n.locator,c=n.xmlns||{},p={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&o.setDocumentLocator(u),r.errorHandler=i(s,o,u),r.domBuilder=n.domBuilder||o,/\/x?html?$/.test(t)&&(p.nbsp=" ",p.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",e?r.parse(e,c,p):r.errorHandler.error("invalid doc source"),o.doc},a.prototype={startDocument:function(){this.doc=(new p).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),s=r.length;c(this,a),this.currentElement=a,this.locator&&o(this.locator,a);for(var u=0;uc){for(var t=0,n=o.length-u;t11?e:e+12:t<2?e:t<3&&e>9?e:e+12}}})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve German (de) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("de",{MMMM:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],MMM:["Jan.","Febr.","Mrz.","Apr.","Mai","Jun.","Jul.","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],dd:["So","Mo","Di","Mi","Do","Fr","Sa"],A:["Uhr nachmittags","Uhr morgens"]})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Spanish (es) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("es",{MMMM:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],MMM:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."],dd:["do","lu","ma","mi","ju","vi","sá"],A:["de la mañana","de la tarde","de la noche"],formats:{A:function(e){var t=e.getHours();return t<12?this.A[0]:t<19?this.A[1]:this.A[2]}},parsers:{h:function(e,t){return t<1?e:e>11?e:e+12}}})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve French (fr) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("fr",{MMMM:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],MMM:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dd:["Di","Lu","Ma","Me","Je","Ve","Sa"],A:["matin","l'après-midi"]})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Hindi (hi) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("hi",{MMMM:["जनवरी","फ़रवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितम्बर","अक्टूबर","नवम्बर","दिसम्बर"],MMM:["जन.","फ़र.","मार्च","अप्रै.","मई","जून","जुल.","अग.","सित.","अक्टू.","नव.","दिस."],dddd:["रविवार","सोमवार","मंगलवार","बुधवार","गुरूवार","शुक्रवार","शनिवार"],ddd:["रवि","सोम","मंगल","बुध","गुरू","शुक्र","शनि"],dd:["र","सो","मं","बु","गु","शु","श"],A:["रात","सुबह","दोपहर","शाम"],formats:{A:function(e){var t=e.getHours();return t<4?this.A[0]:t<10?this.A[1]:t<17?this.A[2]:t<20?this.A[3]:this.A[0]}},parsers:{h:function(e,t){return t<1?e<4||e>11?e:e+12:t<2?e:t<3&&e>9?e:e+12}}})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Italian (it) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("it",{MMMM:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],MMM:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],ddd:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dd:["Do","Lu","Ma","Me","Gi","Ve","Sa"],A:["di mattina","di pomerrigio"]})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Japanese (ja) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("ja",{MMMM:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],MMM:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"],dd:["日","月","火","水","木","金","土"],A:["午前","午後"],formats:{hh:function(e){return("0"+e.getHours()%12).slice(-2)},h:function(e){return e.getHours()%12}}})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Korean (ko) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("ko",{MMMM:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],MMM:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"],dd:["일","월","화","수","목","금","토"],A:["오전","오후"]})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Portuguese (pt) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("pt",{MMMM:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],MMM:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dddd:["Domingo","Segunda-Feira","Terça-Feira","Quarta-Feira","Quinta-Feira","Sexta-Feira","Sábado"],ddd:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dd:["Dom","2ª","3ª","4ª","5ª","6ª","Sáb"],A:["da madrugada","da manhã","da tarde","da noite"],formats:{A:function(e){var t=e.getHours();return t<5?this.A[0]:t<12?this.A[1]:t<19?this.A[2]:this.A[3]}},parsers:{h:function(e,t){return t<2?e:e>11?e:e+12}}})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Russian (ru) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("ru",{MMMM:["Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря"],MMM:["янв","фев","мар","апр","мая","июня","июля","авг","сен","окт","ноя","дек"],dddd:["Воскресенье","Понедельник","Вторник","Среду","Четверг","Пятницу","Субботу"],ddd:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],dd:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],A:["ночи","утра","дня","вечера"],formats:{A:function(e){var t=e.getHours();return t<4?this.A[0]:t<12?this.A[1]:t<17?this.A[2]:this.A[3]}},parsers:{h:function(e,t){return t<2?e:e>11?e:e+12}}})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Chinese (zh-cn) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("zh-cn",{MMMM:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],MMM:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"],dd:["日","一","二","三","四","五","六"],A:["凌晨","早上","上午","中午","下午","晚上"],formats:{A:function(e){var t=100*e.getHours()+e.getMinutes();return t<600?this.A[0]:t<900?this.A[1]:t<1130?this.A[2]:t<1230?this.A[3]:t<1800?this.A[4]:this.A[5]}},parsers:{h:function(e,t){return t<4?e:e>11?e:e+12}}})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){var r,i,a;/** * @preserve date-and-time.js locale configuration * @preserve Chinese (zh-tw) * @preserve It is using moment.js locale configuration as a reference. */ !function(o){"use strict";var s=function(e){e.setLocales("zh-tw",{MMMM:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],MMM:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"],dd:["日","一","二","三","四","五","六"],A:["早上","上午","中午","下午","晚上"],formats:{A:function(e){var t=100*e.getHours()+e.getMinutes();return t<900?this.A[0]:t<1130?this.A[1]:t<1230?this.A[2]:t<1800?this.A[3]:this.A[4]}},parsers:{h:function(e,t){return t<3?e:e>11?e:e+12}}})};"object"==typeof e&&"object"==typeof e.exports?s(n(2)):(i=[n(2)],r=s,void 0!==(a="function"==typeof r?r.apply(t,i):r)&&(e.exports=a))}()},function(e,t,n){"use strict";function r(e,t,n,r){if("number"!=typeof e)throw new TypeError("statusCode must be a number but was "+typeof e);if(null===t)throw new TypeError("headers cannot be null");if("object"!=typeof t)throw new TypeError("headers must be an object but was "+typeof t);this.statusCode=e,this.headers={};for(var i in t)this.headers[i.toLowerCase()]=t[i];this.body=n,this.url=r}e.exports=r,r.prototype.getBody=function(e){if(this.statusCode>=300){var t=new Error("Server responded with status code "+this.statusCode+":\n"+this.body.toString());throw t.statusCode=this.statusCode,t.headers=this.headers,t.body=this.body,t.url=this.url,t}return e?this.body.toString(e):this.body}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r="undefined"!=typeof JSON?JSON:n(185);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n=t.space||"";"number"==typeof n&&(n=Array(n+1).join(" "));var o="boolean"==typeof t.cycles&&t.cycles,s=t.replacer||function(e,t){return t},u=t.cmp&&function(e){return function(t){return function(n,r){return e({key:n,value:t[n]},{key:r,value:t[r]})}}}(t.cmp),c=[];return function e(t,l,p,f){var d=n?"\n"+new Array(f+1).join(n):"",m=n?": ":":";if(p&&p.toJSON&&"function"==typeof p.toJSON&&(p=p.toJSON()),void 0!==(p=s.call(t,l,p))){if("object"!=typeof p||null===p)return r.stringify(p);if(i(p)){for(var h=[],y=0;yf))return!1;var m=l.get(e);if(m&&l.get(t))return m==t;var h=-1,y=!0,_=n&u?new i:void 0;for(l.set(e,t),l.set(t,e);++h0&&!u.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(p,"\\$1")+'"'}function o(e){var t=m.exec(e.toLowerCase());if(!t)throw new TypeError("invalid media type");var n,r=t[1],i=t[2],a=i.lastIndexOf("+");return a!==-1&&(n=i.substr(a+1),i=i.substr(0,a)),{type:r,subtype:i,suffix:n}}/*! * media-typer * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ var s=/; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g,u=/^[\u0020-\u007e\u0080-\u00ff]+$/,c=/^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/,l=/\\([\u0000-\u007f])/g,p=/([\\"])/g,f=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/,d=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/,m=/^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;t.format=n,t.parse=r},function(e,t,n){"use strict";var r=String.prototype.replace;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,/%20/g,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){"use strict";var r=n(305),i=n(304),a=n(136);e.exports={formats:a,parse:i,stringify:r}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?n+=t.charAt(r):a<128?n+=i[a]:a<2048?n+=i[192|a>>6]+i[128|63&a]:a<55296||a>=57344?n+=i[224|a>>12]+i[128|a>>6&63]+i[128|63&a]:(r+=1,a=65536+((1023&a)<<10|1023&t.charCodeAt(r)),n+=i[240|a>>18]+i[128|a>>12&63]+i[128|a>>6&63]+i[128|63&a])}return n},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;var r=n||[],i=r.indexOf(e);if(i!==-1)return r[i];if(r.push(e),Array.isArray(e)){for(var a=[],o=0;oo)&&(t[r]=i,a(e,t,n))}),delete n[r],t}}var o=n(86);t.buildWrapperNode=i;var s={AbstractSecurityScheme:function(e,t){return new o.AbstractSecuritySchemeImpl(e,t)},AnyType:function(e){return new o.AnyTypeImpl(e)},Api:function(e,t){return new o.ApiImpl(e,t)},BasicSecurityScheme:function(e,t){return new o.BasicSecuritySchemeImpl(e,t)},BodyLike:function(e,t){return new o.BodyLikeImpl(e,t)},BooleanType:function(e){return new o.BooleanTypeImpl(e)},BooleanTypeDeclaration:function(e,t){return new o.BooleanTypeDeclarationImpl(e,t)},CustomSecurityScheme:function(e,t){return new o.CustomSecuritySchemeImpl(e,t)},DateTypeDeclaration:function(e,t){return new o.DateTypeDeclarationImpl(e,t)},DigestSecurityScheme:function(e,t){return new o.DigestSecuritySchemeImpl(e,t)},DocumentationItem:function(e,t){return new o.DocumentationItemImpl(e,t)},ExampleString:function(e){return new o.ExampleStringImpl(e)},FileTypeDeclaration:function(e,t){return new o.FileTypeDeclarationImpl(e,t)},FixedUri:function(e){return new o.FixedUriImpl(e)},FullUriTemplateString:function(e){return new o.FullUriTemplateStringImpl(e)},GlobalSchema:function(e,t){return new o.GlobalSchemaImpl(e,t)},IntegerTypeDeclaration:function(e,t){return new o.IntegerTypeDeclarationImpl(e,t)},JSONBody:function(e,t){return new o.JSONBodyImpl(e,t)},JSONExample:function(e){return new o.JSONExampleImpl(e)},JSonSchemaString:function(e){return new o.JSonSchemaStringImpl(e)},MarkdownString:function(e){return new o.MarkdownStringImpl(e)},Method:function(e,t){return new o.MethodImpl(e,t)},MethodBase:function(e,t){return new o.MethodBaseImpl(e,t)},MimeType:function(e){return new o.MimeTypeImpl(e)},NumberType:function(e){return new o.NumberTypeImpl(e)},NumberTypeDeclaration:function(e,t){return new o.NumberTypeDeclarationImpl(e,t)},OAuth1SecurityScheme:function(e,t){return new o.OAuth1SecuritySchemeImpl(e,t)},OAuth1SecuritySchemeSettings:function(e,t){return new o.OAuth1SecuritySchemeSettingsImpl(e,t)},OAuth2SecurityScheme:function(e,t){return new o.OAuth2SecuritySchemeImpl(e,t)},OAuth2SecuritySchemeSettings:function(e,t){return new o.OAuth2SecuritySchemeSettingsImpl(e,t)},Parameter:function(e,t){return new o.ParameterImpl(e,t)},ParameterLocation:function(e){return new o.ParameterLocationImpl(e)},RAMLSimpleElement:function(e,t){return new o.RAMLSimpleElementImpl(e,t)},Reference:function(e){return new o.ReferenceImpl(e)},RelativeUriString:function(e){return new o.RelativeUriStringImpl(e)},Resource:function(e,t){return new o.ResourceImpl(e,t)},ResourceType:function(e,t){return new o.ResourceTypeImpl(e,t)},ResourceTypeRef:function(e){return new o.ResourceTypeRefImpl(e)},Response:function(e,t){return new o.ResponseImpl(e,t)},SchemaString:function(e){return new o.SchemaStringImpl(e)},SecuritySchemePart:function(e,t){return new o.SecuritySchemePartImpl(e,t)},SecuritySchemeRef:function(e){return new o.SecuritySchemeRefImpl(e)},SecuritySchemeSettings:function(e,t){return new o.SecuritySchemeSettingsImpl(e,t)},StatusCodeString:function(e){return new o.StatusCodeStringImpl(e)},StringType:function(e){return new o.StringTypeImpl(e)},StringTypeDeclaration:function(e,t){return new o.StringTypeDeclarationImpl(e,t)},Trait:function(e,t){return new o.TraitImpl(e,t)},TraitRef:function(e){return new o.TraitRefImpl(e)},UriTemplate:function(e){return new o.UriTemplateImpl(e)},ValueType:function(e){return new o.ValueTypeImpl(e)},XMLBody:function(e,t){return new o.XMLBodyImpl(e,t)},XMLExample:function(e){return new o.XMLExampleImpl(e)},XMLSchemaString:function(e){return new o.XMLSchemaStringImpl(e)}}},function(e,t,n){"use strict";function r(e){return e.isBuiltIn()?s[e.nameId()]:null}function i(e,t){void 0===t&&(t=!0);var n=e.definition(),i=(n.nameId(),r(n));if(!i){for(var o=a(n),u=n.allSuperTypes().sort(function(e,t){return o[e.nameId()]-o[t.nameId()]}),c=0;co)&&(t[r]=i,a(e,t,n))}),delete n[r],t}}var o=n(34);t.buildWrapperNode=i;var s={AbstractSecurityScheme:function(e,t){return new o.AbstractSecuritySchemeImpl(e,t)},Annotable:function(e,t){return new o.AnnotableImpl(e,t)},AnnotationRef:function(e){return new o.AnnotationRefImpl(e)},AnnotationTarget:function(e){return new o.AnnotationTargetImpl(e)},AnyType:function(e){return new o.AnyTypeImpl(e)},Api:function(e,t){return new o.ApiImpl(e,t)},ArrayTypeDeclaration:function(e,t){return new o.ArrayTypeDeclarationImpl(e,t)},BasicSecurityScheme:function(e,t){return new o.BasicSecuritySchemeImpl(e,t)},BooleanType:function(e){return new o.BooleanTypeImpl(e)},BooleanTypeDeclaration:function(e,t){return new o.BooleanTypeDeclarationImpl(e,t)},ContentType:function(e){return new o.ContentTypeImpl(e)},CustomSecurityScheme:function(e,t){return new o.CustomSecuritySchemeImpl(e,t)},DateOnlyType:function(e){return new o.DateOnlyTypeImpl(e)},DateOnlyTypeDeclaration:function(e,t){return new o.DateOnlyTypeDeclarationImpl(e,t)},DateTimeOnlyType:function(e){return new o.DateTimeOnlyTypeImpl(e)},DateTimeOnlyTypeDeclaration:function(e,t){return new o.DateTimeOnlyTypeDeclarationImpl(e,t)},DateTimeType:function(e){return new o.DateTimeTypeImpl(e)},DateTimeTypeDeclaration:function(e,t){return new o.DateTimeTypeDeclarationImpl(e,t)},DigestSecurityScheme:function(e,t){return new o.DigestSecuritySchemeImpl(e,t)},DocumentationItem:function(e,t){return new o.DocumentationItemImpl(e,t)},Extension:function(e,t){return new o.ExtensionImpl(e,t)},FileType:function(e){return new o.FileTypeImpl(e)},FileTypeDeclaration:function(e,t){return new o.FileTypeDeclarationImpl(e,t)},FixedUriString:function(e){return new o.FixedUriStringImpl(e)},FragmentDeclaration:function(e,t){return new o.FragmentDeclarationImpl(e,t)},FullUriTemplateString:function(e){return new o.FullUriTemplateStringImpl(e)},IntegerType:function(e){return new o.IntegerTypeImpl(e)},IntegerTypeDeclaration:function(e,t){return new o.IntegerTypeDeclarationImpl(e,t)},Library:function(e,t){return new o.LibraryImpl(e,t)},LibraryBase:function(e,t){return new o.LibraryBaseImpl(e,t)},LocationKind:function(e){return new o.LocationKindImpl(e)},MarkdownString:function(e){return new o.MarkdownStringImpl(e)},Method:function(e,t){return new o.MethodImpl(e,t)},MethodBase:function(e,t){return new o.MethodBaseImpl(e,t)},MimeType:function(e){return new o.MimeTypeImpl(e)},ModelLocation:function(e){return new o.ModelLocationImpl(e)},NullType:function(e){return new o.NullTypeImpl(e)},NumberType:function(e){return new o.NumberTypeImpl(e)},NumberTypeDeclaration:function(e,t){return new o.NumberTypeDeclarationImpl(e,t)},OAuth1SecurityScheme:function(e,t){return new o.OAuth1SecuritySchemeImpl(e,t)},OAuth1SecuritySchemeSettings:function(e,t){return new o.OAuth1SecuritySchemeSettingsImpl(e,t)},OAuth2SecurityScheme:function(e,t){return new o.OAuth2SecuritySchemeImpl(e,t)},OAuth2SecuritySchemeSettings:function(e,t){return new o.OAuth2SecuritySchemeSettingsImpl(e,t)},ObjectTypeDeclaration:function(e,t){return new o.ObjectTypeDeclarationImpl(e,t)},Operation:function(e,t){return new o.OperationImpl(e,t)},Overlay:function(e,t){return new o.OverlayImpl(e,t)},PassThroughSecurityScheme:function(e,t){return new o.PassThroughSecuritySchemeImpl(e,t)},Reference:function(e){return new o.ReferenceImpl(e)},RelativeUriString:function(e){return new o.RelativeUriStringImpl(e)},Resource:function(e,t){return new o.ResourceImpl(e,t)},ResourceBase:function(e,t){return new o.ResourceBaseImpl(e,t)},ResourceType:function(e,t){return new o.ResourceTypeImpl(e,t)},ResourceTypeRef:function(e){return new o.ResourceTypeRefImpl(e)},Response:function(e,t){return new o.ResponseImpl(e,t)},SchemaString:function(e){return new o.SchemaStringImpl(e)},SecuritySchemePart:function(e,t){return new o.SecuritySchemePartImpl(e,t)},SecuritySchemeRef:function(e){return new o.SecuritySchemeRefImpl(e)},SecuritySchemeSettings:function(e,t){return new o.SecuritySchemeSettingsImpl(e,t)},StatusCodeString:function(e){return new o.StatusCodeStringImpl(e)},StringType:function(e){return new o.StringTypeImpl(e)},StringTypeDeclaration:function(e,t){return new o.StringTypeDeclarationImpl(e,t)},TimeOnlyType:function(e){return new o.TimeOnlyTypeImpl(e)},TimeOnlyTypeDeclaration:function(e,t){return new o.TimeOnlyTypeDeclarationImpl(e,t)},Trait:function(e,t){return new o.TraitImpl(e,t)},TraitRef:function(e){return new o.TraitRefImpl(e)},TypeDeclaration:function(e,t){return new o.TypeDeclarationImpl(e,t)},UnionTypeDeclaration:function(e,t){return new o.UnionTypeDeclarationImpl(e,t)},UriTemplate:function(e){return new o.UriTemplateImpl(e)},UsesDeclaration:function(e,t){return new o.UsesDeclarationImpl(e,t)},ValueType:function(e){return new o.ValueTypeImpl(e)},XMLFacetInfo:function(e,t){return new o.XMLFacetInfoImpl(e,t)}}},function(e,t,n){"use strict";var r=n(0);e.exports=r},function(e,t,n){"use strict";function r(e){if(!e)return e;var t=e.indexOf("#");return t==-1?e:e.substring(0,t)}function i(e){if(!e)return null;"string"!=typeof e&&(e=""+e);var t=e.indexOf("#");if(t==-1)return null;var n=t==e.length-1?"":e.substring(t+1,e.length),i=n.split("/");return 0==i.length?null:(""==i[0].trim()&&i.splice(0,1),new m(n,r(e),i))}function a(){return[new h,new _]}function o(e,t){if(!e)return t;var n=i(e);return n?s(r(e),n,t).content:t}function s(e,t,n){var r=p.find(a(),function(t){return t.isApplicable(e,n)});return r?r.resolveReference(n,t):{content:n,validation:[]}}function u(e,t,n){if(!n)return[];var r=p.find(a(),function(t){return t.isApplicable(e,n)});return r?r.completeReference(n,t):[]}function c(e,t){return!!e&&(!!t&&e.lastIndexOf(t)===e.length-t.length)}function l(e,t){for(var n=e.getElementsByTagName(t),r=[],i=0;i");if(_>0&&m.length>_+2){"\n"!=m.charAt(_+2)&&(h=m.slice(0,_+2)+"\n"+m.slice(_+2))}return{content:h,validation:[]}}catch(e){console.log(e)}return{content:e,validation:[]}},e.prototype.completeReference=function(e,t){try{var n=new f(y).parseFromString(e),r=[],i=l(n,"xs:schema")[0],a=l(i,"xs:element"),o=l(i,"xs:complexType");a.forEach(function(e){return r.push(e.getAttribute("name"))}),o.forEach(function(e){return r.push(e.getAttribute("name"))});return 0===t.asString().trim().length?r:r.filter(function(e){return 0===e.indexOf(t.asString())})}catch(e){return[]}},e}()},function(e,t,n){"use strict";var r=n(0),i=n(3),a=n(5),o=r,s=n(21),u=function(){function e(e,t){void 0===t&&(t=!1),this.enabled=e,this.toHighLevel=t,this.unconditionalValueCalculators=[new _],this.valueCalculators=[new d,new f,new p,new l,new m(this.toHighLevel),new h,new y]}return e.prototype.attributeDefaultIfEnabled=function(e,t){return this.enabled?this.getAttributeDefault(e,t):this.getUnconditionalAttributeDefault(t,e)},e.prototype.getUnconditionalAttributeDefault=function(e,t){if(!t||!e)return null;for(var n=0;n0?n:null},e.prototype.matches=function(e,t){return null!=t.definition()&&a.isSecuredByProperty(e)},e.prototype.kind=function(){return c.CALCULATED},e}(),h=function(){function e(){}return e.prototype.calculate=function(e,t){for(;null!=t&&!a.isApiSibling(t.definition());)t=t.parent();var n,r=t.attr(i.Universe10.Api.properties.baseUri.name);if(r){var o=r.value();if(o){var s=o.indexOf("://");s>=0&&(n=[o.substring(0,s).toUpperCase()]),n||(n=["HTTP"])}}return n},e.prototype.matches=function(e,t){if(!a.isProtocolsProperty(e))return!1;var n=t.definition(),r=!1;if(a.isApiSibling(n))r=!0;else if(a.isResourceType(n))r=!0;else if(a.isMethodType(n)){var i=t.parent();r=i&&a.isResourceType(i.definition())}return r},e.prototype.kind=function(){return c.CALCULATED},e}(),y=function(){function e(){}return e.prototype.calculate=function(e,t){for(;null!=t&&!a.isApiSibling(t.definition());)t=t.parent();var n=t.attr(i.Universe10.Api.properties.version.name);if(n){var r=n.value();if(r&&r.trim())return[r]}return null},e.prototype.matches=function(e,t){if(!a.isEnumProperty(e))return!1;var n=t.property();if(!n)return!1;if(!a.isBaseUriParametersProperty(n))return!1;var r=t.attr(i.Universe10.TypeDeclaration.properties.name.name);return"version"==(r&&r.value())},e.prototype.kind=function(){return c.CALCULATED},e}(),_=function(){function e(){}return e.prototype.calculate=function(e,t){var n=t.definition();if(null==n)return null;var r=n.getAdapter(o.RAMLService);if(null==r)return null;var i=r.getKeyProp();if(null==i)return null;var a=t.attr(i.nameId());return null==a?null:!a.optional()&&null},e.prototype.matches=function(e,t){return a.isRequiredProperty(e)},e.prototype.kind=function(){return c.BY_DEFAULT},e}()},function(e,t,n){"use strict";function r(e){var t=e.getExtra(l.SOURCE_EXTRA);return null==t?null:c.isSourceProvider(t)?t:f.isLowLevelNode(t)?{getSource:function(){return t.highLevelNode()}}:p.isParseResult(t)?{getSource:function(){return t}}:null}function i(e){return r(e)}function a(e){var t=e.getAdapters();return t?m.find(t,function(e){return c.rt.isParsedType(e)}):null}function o(e){if(!e)return null;if(e.getExtra(l.SOURCE_EXTRA))return r(e);var t=a(e);return t?i(t):null}function s(e,t){var n=o(e);return n?{getSource:function(){var e=n.getSource(),r=e.asElement();if(null==r)return null;var i=r.elementsOfKind(d.Universe10.ObjectTypeDeclaration.properties.properties.name);return null==i||0==i.length?null:m.find(i,function(e){return t==e.attrValue(d.Universe10.TypeDeclaration.properties.name.name)})}}:null}function u(e){return s(e.domain(),e.nameId())}var c=n(0),l=c.rt,p=n(24),f=n(20),d=n(3),m=n(1);t.getExtraProviderSource=r,t.getRTypeSource=i,t.findRTypeByNominal=a,t.getNominalTypeSource=o,t.getNominalPropertySource=s,t.getNominalPropertySource2=u},function(e,t,n){"use strict";function r(e,t,n){null==n&&(n=i(e)),n.length>0&&(n+=":");for(var r=e.getElementsByTagName(n+t),a=[],o=0;o0}catch(e){return!1}}function o(e){var t={};if(1==e.nodeType){if(e.attributes.length>0)for(var n=0;n0){var o=a.map(function(n){return t.convertConnectingNodeToError(n,e)});if(o&&o.length>0)for(var s=r,u=o.length-1;u>=0;u--){var c=o[u];s.extras=[],s.extras.push(c),s=c}}}},e.prototype.begin=function(){},e.prototype.end=function(){},e.prototype.acceptUnique=function(e){for(var t=0,n=this.errors;t0)return i[0]}var a=e.oneMeta(c.Default);if(a)return a.value();if(e.isObject()){var o={};return e.meta().forEach(function(e){if(e instanceof p.PropertyIs){var t=e,n=r(t.value());o[t.propertyName()]=n}}),e.superTypes().forEach(function(e){if(e.oneMeta(c.Example)||e.oneMeta(c.Examples)){var t=r(e);t&&"object"==typeof t&&Object.keys(t).forEach(function(e){o[e]=t[e]})}}),o}if(e.isArray()){var s=e.oneMeta(l.ComponentShouldBeOfType),u=[];return s&&u.push(r(s.value())),u}return e.isUnion()?r(e.typeFamily()[0]):e.isNumber()?1:!!e.isBoolean()||"some value"}finally{e.putExtra(f,!1)}}function i(e,t){var n=e[t];return null!=n&&"object"==typeof n?n.value:n}function a(e){var t=[];if(!e||"object"!=typeof e)return t;for(var n=0,r=Object.keys(e).filter(function(e){return e.length>0&&"("==e.charAt(0)&&")"==e.charAt(e.length-1)});n0)return r;if(t&&e.isUserDefined()&&!e.isGenuineUserDefinedType()&&e.genuineUserDefinedTypeInHierarchy()){var i=e.genuineUserDefinedTypeInHierarchy(),a=i.getAdapter(u.InheritedType);if(a){var s=o(a);if(s&&s.length>0)return s}}}if(n){var c=new d(null,void 0,void 0,void 0,!1,void 0,void 0,!0);return c.setOwnerType(n),[c]}return[]}var u=n(6),c=n(7),l=n(8),p=n(8),f="exampleCalculation";t.example=r;var d=function(){function e(e,t,n,r,i,a,o,s){void 0===t&&(t=void 0),void 0===n&&(n=void 0),void 0===r&&(r=void 0),void 0===i&&(i=!0),void 0===o&&(o=!1),void 0===s&&(s=!1),this._value=e,this._name=t,this._displayName=n,this._description=r,this._strict=i,this._annotations=a,this._isSingle=o,this._empty=s,this.isExpanded=!1,this._scalarsAnnotations={},this._annotations?this._hasAnnotations=!0:this._annotations={}}return e.prototype.isEmpty=function(){return this._empty},e.prototype.isJSONString=function(){var e=this.firstCharacter();return"{"==e||"["==e},e.prototype.isXMLString=function(){return"<"==this.firstCharacter()},e.prototype.firstCharacter=function(){if(null==this._value)return null;if("string"!=typeof this._value)return null;var e=this._value.trim();return 0==e.length?null:e.charAt(0)},e.prototype.asXMLString=function(){return this.isXMLString()?this._value:this._owner?this._owner.asXMLString():null},e.prototype.isYAML=function(){return"string"!=typeof this._value||!(this.isJSONString()||this.isXMLString())},e.prototype.asString=function(){return"string"==typeof this._value?""+this._value:JSON.stringify(this._value,null,2)},e.prototype.asJSON=function(){if(this.isJSONString())try{return JSON.parse(this._value)}catch(e){return null}return this.isYAML()?this._value:this.asString()},e.prototype.original=function(){return this._value},e.prototype.expandAsString=function(){return JSON.stringify(this.expandAsJSON(),null,2)},e.prototype.expandAsJSON=function(){return this.isEmpty()?this.isExpanded?this._expandedValue:(this._expandedValue=r(this._ownerType),this.isExpanded=!0,this._expandedValue):this._value},e.prototype.isSingle=function(){return this._isSingle},e.prototype.strict=function(){return this._strict},e.prototype.description=function(){return this._description},e.prototype.displayName=function(){return this._displayName},e.prototype.annotations=function(){return this._annotations},e.prototype.name=function(){return this._name},e.prototype.scalarsAnnotations=function(){return this._scalarsAnnotations},e.prototype.registerScalarAnnotatoion=function(e,t){this._hasScalarAnnotations=!0;var n=this._scalarsAnnotations[t];n||(n={},this._scalarsAnnotations[t]=n),n[e.facetName()]=e},e.prototype.setOwner=function(e){this._owner=e},e.prototype.owner=function(){return this._owner},e.prototype.setOwnerType=function(e){this._ownerType=e},e.prototype.ownerType=function(){return this._ownerType},e.prototype.hasAnnotations=function(){return this._hasAnnotations},e.prototype.hasScalarAnnotations=function(){return this._hasScalarAnnotations},e}(),m=function(e,t,n,r){void 0===n&&(n=null),void 0===r&&(r=!1);var o;if(null!=t){var s=t.value;if(s){var u=i(t,"displayName"),c=i(t,"description"),l=i(t,"strict"),p={};a(t).forEach(function(e){p[e.facetName()]=e}),o=new d(s,n,u,c,l,p,r);for(var f=0,m=a(t.displayName);f0&&this.superTypes().forEach(function(r){r instanceof t&&r.allFacets(e).forEach(function(e){return n[e.nameId()]=e})}),this._facets.forEach(function(e){return n[e.nameId()]=e}),this._allFacets=Object.keys(n).map(function(e){return n[e]}),this._allFacets},t.prototype.facets=function(){return[].concat(this._facets)},t.prototype.facet=function(e){return s.find(this.allFacets(),function(t){return t.nameId()==e})},t.prototype.typeId=function(){return this.nameId()},t.prototype.allProperties=function(e){if(void 0===e&&(e={}),this._props)return this._props;if(e[this.typeId()])return[];e[this.typeId()]=this;var n={};this.superTypes().length>0&&this.superTypes().forEach(function(r){r instanceof t?r.allProperties(e).forEach(function(e){return n[e.nameId()]=e}):r.allProperties().forEach(function(e){return n[e.nameId()]=e})});for(var r in this.fixedFacets())delete n[r];return this.properties().forEach(function(e){return n[e.nameId()]=e}),this._props=Object.keys(n).map(function(e){return n[e]}),this._props},t.prototype.property=function(e){return s.find(this.allProperties(),function(t){return t.nameId()==e})},t.prototype.hasValueTypeInHierarchy=function(){return null!=s.find(this.allSuperTypes(),function(e){var t=e;if(t.uc)return!1;t.uc=!0;try{return e.hasValueTypeInHierarchy()}finally{t.uc=!1}})},t.prototype.isAnnotationType=function(){return!1},t.prototype.hasStructure=function(){return!1},t.prototype.key=function(){return this._key?this._key:this._universe&&(this._key=this.universe().matched()[this.nameId()],!this._key)?null:this._key},t.prototype.hasArrayInHierarchy=function(){return null!=s.find(this.allSuperTypes(),function(e){return e instanceof b})},t.prototype.arrayInHierarchy=function(){var e=this.allSuperTypes(),t=null;return e.forEach(function(e){e instanceof b&&(t=e)}),t},t.prototype.unionInHierarchy=function(){var e=this.allSuperTypes(),t=null;return e.forEach(function(e){e instanceof v&&(t=e)}),t},t.prototype.hasExternalInHierarchy=function(){return null!=s.find(this.allSuperTypes(),function(e){var t=e;if(t.uc)return!1;t.uc=!0;try{return e instanceof S}finally{t.uc=!1}})},t.prototype.hasUnionInHierarchy=function(){return null!=s.find(this.allSuperTypes(),function(e){var t=e;if(t.uc)return!1;t.uc=!0;try{return e.hasUnionInHierarchy()}finally{t.uc=!1}})},t.prototype.fixFacet=function(e,t,n){void 0===n&&(n=!1),n?this._fixedBuildInFacets[e]=t:this._fixedFacets[e]=t},t.prototype.getFixedFacets=function(){return this.fixedFacets()},t.prototype.fixedFacets=function(){return this.collectFixedFacets(!1)},t.prototype.fixedBuiltInFacets=function(){return this.collectFixedFacets(!0)},t.prototype.collectFixedFacets=function(e){for(var t=e?this._fixedBuildInFacets:this._fixedFacets,n={},r=0,i=Object.keys(t);r0&&!n.hideProperties&&(i+=e+" Properties:\n",o.forEach(function(n){var r="",a=n.range();a instanceof c&&(r+=a.nameId()),a instanceof t&&(r+="[",r+=a.getTypeClassName(),r+="]"),i+=e+" "+n.nameId()+" : "+r+"\n"}));var u=this.superTypes(),l=u;return u&&!n.printStandardSuperclasses&&(l=s.filter(u,function(e){var n=e instanceof c?e.nameId():"",i=e instanceof t?e.getTypeClassName():"";return!r.isStandardSuperclass(n,i)})),l&&l.length>0&&(i+=e+" Super types:\n",l.forEach(function(t){i+=t.printDetails(e+" ",{hideProperties:n.hideSuperTypeProperties,hideSuperTypeProperties:n.hideSuperTypeProperties,printStandardSuperclasses:n.printStandardSuperclasses})})),i},t.prototype.getTypeClassName=function(){return this.constructor.toString().match(/\w+/g)[1]},t.prototype.isStandardSuperclass=function(e,t){return"TypeDeclaration"===e&&"NodeClass"===t||("ObjectTypeDeclaration"===e&&"NodeClass"===t||"RAMLLanguageElement"===e&&"NodeClass"===t)},t.prototype.examples=function(e){return m.exampleFromNominal(this,e)},t.prototype.isGenuineUserDefinedType=function(){if(this.buildIn)return!1;if(this.properties()&&this.properties().length>0)return!0;var e=this.fixedFacets();if(e&&Object.keys(e).length>0)return!0;var t=this.fixedBuiltInFacets();return!!(t&&Object.keys(t).length>0)||this.isTopLevel()&&this.nameId()&&this.nameId().length>0},t.prototype.genuineUserDefinedTypeInHierarchy=function(){if(this.isGenuineUserDefinedType())return this;var e=null;return this.allSuperTypes().forEach(function(t){!e&&t.isGenuineUserDefinedType()&&(e=t)}),e},t.prototype.hasGenuineUserDefinedTypeInHierarchy=function(){return null!=s.find(this.allSuperTypes(),function(e){var t=e;if(t.uc)return!1;t.uc=!0;try{return e.isGenuineUserDefinedType()}finally{t.uc=!1}})},t.prototype.customProperties=function(){return[].concat(this._customProperties)},t.prototype.allCustomProperties=function(){var e=[];return this.superTypes().forEach(function(t){return e=e.concat(t.allCustomProperties())}),e=e.concat(this.customProperties())},t.prototype.registerCustomProperty=function(e){if(e.domain()!=this)throw new Error("Should be already owned by this");if(this._customProperties.indexOf(e)!=-1)throw new Error("Already included");this._customProperties.push(e)},t.prototype.setCustom=function(e){this._isCustom=e},t.prototype.isCustom=function(){return this._isCustom},t.prototype.isUnion=function(){return!1},t.prototype.union=function(){return null},t.prototype.isExternal=function(){return!1},t.prototype.external=function(){return null},t.prototype.isArray=function(){return!1},t.prototype.isObject=function(){if("object"==this.nameId())return!0;for(var e=0,t=this.allSuperTypes();e0){var o="{"==i.charAt(0);if(o||"<"==i.charAt(0)&&i.length>1&&"<"!=i.charAt(1))return new p.ExternalType("",i,o,n,r);return a(l.parse(e),t)}return p.derive(e,[p.STRING])}catch(t){return p.derive(e,[p.UNKNOWN])}}function i(e,t){for(;e>0;){var n=p.derive("",[p.ARRAY]);n.addMeta(new f.ComponentShouldBeOfType(t)),t=n,e--}return t}function a(e,t){if("union"==e.type){var n=e;return p.union("",[a(n.first,t),a(n.rest,t)])}if("parens"==e.type){var r=e,o=a(r.expr,t);return i(r.arr,o)}var s=e;if("?"==s.value.charAt(s.value.length-1)){var u=t.get(s.value.substr(0,s.value.length-1));u||(u=p.derive(s.value,[p.UNKNOWN])),u=p.union(s.value,[u,p.NIL]);var c=s.arr;return i(c,u)}var u=t.get(s.value);u||(u=p.derive(s.value,[p.UNKNOWN]));var c=s.arr;return i(c,u)}function o(e){if(e.isSubTypeOf(p.ARRAY)){var t=e.oneMeta(f.ComponentShouldBeOfType);return t?t.value().isUnion()?"("+o(t.value())+")[]":o(t.value())+"[]":"array"}if(e instanceof p.UnionType){return e.options().map(function(e){return o(e)}).join(" | ")}return e.isAnonymous()&&e.isEmpty()?e.superTypes().map(function(e){return o(e)}).join(" , "):e.name()}function s(e,t){if(t(e),"union"==e.type){var n=e;s(n.first,t),s(n.rest,t)}else if("parens"==e.type){var r=e;s(r.expr,t)}}function u(e){var t,n=0;if("name"==e.type){var r=e;t=r.value,n=r.arr}else if("union"==e.type){var i=e;t=u(i.first)+" | "+u(i.rest)}else if("parens"==e.type){var a=e;t="("+u(a.expr)+")",n=a.arr}for(;--n>=0;)t+="[]";return t}function c(e){return l.parse(e)}var l=n(340),p=n(6),f=n(8);t.parseToType=r,t.storeToString=o,t.visit=s,t.serializeToString=u,t.parse=c},function(e,t,n){"use strict";function r(e,t){return o.find(e,t)}function i(e,t){return o.filter(e,t)}function a(e){return o.unique(e)}var o=n(1);t.find=r,t.filter=i,t.unique=a},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);i.call(this,e)}e.exports=r;var i=n(93),a=n(39);a.inherits=n(26),a.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";(function(t){function r(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?I(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function i(e,t){x=x||n(30),e=e||{},this.objectMode=!!e.objectMode,t instanceof x&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.buffer=new K,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(B||(B=n(95).StringDecoder),this.decoder=new B(e.encoding),this.encoding=e.encoding)}function a(e){if(x=x||n(30),!(this instanceof a))return new a(e);this._readableState=new i(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),D.call(this)}function o(e,t,n,r,i){var a=l(t,n);if(a)e.emit("error",a);else if(null===n)t.reading=!1,p(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var c;!t.decoder||i||r||(n=t.decoder.write(n),c=!t.objectMode&&0===n.length),i||(t.reading=!1),c||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&f(e))),m(e,t)}else i||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function c(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=u(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function l(e,t){var n=null;return P.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function p(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,f(e)}}function f(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(F("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?R(d,e):d(e))}function d(e){F("emit readable"),e.emit("readable"),b(e)}function m(e,t){t.readingMore||(t.readingMore=!0,R(h,e,t))}function h(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=A(e,t.buffer,t.decoder),n}function A(e,t,n){var r;return ea.length?a.length:e;if(i+=o===a.length?a:a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}function E(e,t){var n=L.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,R(N,t,e))}function N(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function w(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return F("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):f(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&C(this),null;var r=t.needReadable;F("need readable",r),(0===t.length||t.length-e0?S(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&C(this)),null!==i&&this.emit("data",i),i},a.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},a.prototype.pipe=function(e,n){function i(e){F("onunpipe"),e===f&&o()}function a(){F("onend"),e.end()}function o(){F("cleanup"),e.removeListener("close",c),e.removeListener("finish",l),e.removeListener("drain",_),e.removeListener("error",u),e.removeListener("unpipe",i),f.removeListener("end",a),f.removeListener("end",o),f.removeListener("data",s),g=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||_()}function s(t){F("ondata"),v=!1,!1!==e.write(t)||v||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&k(d.pipes,e)!==-1)&&!g&&(F("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,v=!0),f.pause())}function u(t){F("onerror",t),p(),e.removeListener("error",u),0===M(e,"error")&&e.emit("error",t)}function c(){e.removeListener("finish",l),p()}function l(){F("onfinish"),e.removeListener("close",c),p()}function p(){F("unpipe"),f.unpipe(e)}var f=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,F("pipe count=%d opts=%j",d.pipesCount,n);var m=(!n||n.end!==!1)&&e!==t.stdout&&e!==t.stderr,h=m?a:o;d.endEmitted?R(h):f.once("end",h),e.on("unpipe",i);var _=y(f);e.on("drain",_);var g=!1,v=!1;return f.on("data",s),r(e,"error",u),e.once("close",c),e.once("finish",l),e.emit("pipe",f),d.flowing||(F("pipe resume"),f.resume()),e},a.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0?s:null,c.override=c.override||!1,c.primary=c.primary||!1,c.deprecated=c.deprecated||!1,c}catch(e){console.log(e)}return{}}function a(e,t){var n,r=e.name.text,i=l.buildType(e.type,t),a=null!=e.questionToken;return null!=e.initializer&&(n=l.parseArg(e.initializer),a=!0),{name:r,type:i,defaultValue:n,optional:a}}var o=n(97),s=n(159),u=n(11),c=n(47),l=n(160),p=n(158);t.getHelperMethods=r;var f=function(e){return e.replace(/^\s*\/\*+/g,"").replace(/\*+\/\s*$/g,"").split("\n").map(function(e){return e.replace(/^\s*\/\//g,"").replace(/^\s*\* {0,1}/g,"")}).join("\n").trim()}},function(e,t,n){"use strict";function r(e,t){if(e.typeKind==a.TypeKind.ARRAY)return t?[]:[r(e.base)[0]+"[]"];if(e.typeKind==a.TypeKind.BASIC){var n=e,i=n.basicName,o=n.nameSpace&&n.nameSpace.trim();return null!=o&&o.length>0&&"RamlWrapper"!=o&&(i=o+"."+i),n.typeArguments&&0!=n.typeArguments.length&&(i+="<"+n.typeArguments.map(function(e){return r(e)}).join(", ")+">"),t?n.nameSpace&&t[n.nameSpace]?[i]:[]:[i]}if(e.typeKind==a.TypeKind.UNION){var s=e,u=[];return s.options.forEach(function(e){return u=u.concat(r(e,t))}),u}return[]}function i(e){return o.getHelperMethods(e)}var a=n(67),o=n(157),s={RamlWrapper:!0},u=function(){function e(e,t,n,r,i){this.originalName=e,this.wrapperMethodName=t,this.returnType=n,this.args=r,this.meta=i}return e.prototype.targetWrappers=function(){var e=!0,t=[];return this.args.forEach(function(n){var i=r(n.type,s);if(0!=i.length)return e&&0==t.length?void(t=t.concat(i)):(t=[],void(e=!1))}),t},e.prototype.callArgs=function(){return this.args.map(function(e){return 0==r(e.type,s).length?e:{name:"this",type:null,optional:!1,defaultValue:void 0}})},e}();t.HelperMethod=u,t.flatten=r,t.getHelperMethods=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=n(97);!function(e){function t(n,r){var a=r(n);return a?a==e.SKIP?null:a:i.forEachChild(n,function(e){var n=t(e,r);if(n)return n})}function n(e,t){void 0===t&&(t=function(e){return!0});for(var n=e.split("."),r=null,i=0;i0&&null==n.path[n.path.length-1].arguments?(n.path[n.path.length-1].arguments=t.arguments,n.path[n.path.length-1]._callExpression=t,n):null}else if(e.kind==i.SyntaxKind.PropertyAccessExpression){var r=e,a=this.doMatch(r.expression);if(a)return r.name.kind==i.SyntaxKind.Identifier?(a.path.push(new A(r.name.text,r.name)),a):null}else if(e.kind==i.SyntaxKind.Identifier){var o=e;if(this.rootMatcher.doMatch(o))return new T(o.text,o)}return null},e.prototype.nodeType=function(){return null},e}();e.CallBaseMatcher=C,e.ident=a,e.anyNode=o,e.call=s,e.exprStmt=u,e.assign=c,e.varDecl=l,e.field=p,e.classDeclaration=f}(t.Matching||(t.Matching={}))},function(e,t,n){"use strict";function r(e){return v.createSourceFile("sample.ts",e,v.ScriptTarget.ES3,!0)}function i(e,n,s){var u=r(e),c={classes:[],aliases:[],enumDeclarations:[],imports:{},name:s};n[s]=c;var l=null;return t.tsm.Matching.visit(u,function(r){if(r.kind==v.SyntaxKind.ModuleDeclaration){l=r.name.text}if(r.kind==v.SyntaxKind.ImportEqualsDeclaration){var u=r,p=u.name.text;if("RamlWrapper"==p)return;var f=u.moduleReference,d=f.expression,m=d.text,h=b.resolve(b.dirname(s)+"/",m)+".ts";if(!b.existsSync(h))throw new Error("Path "+m+" resolve to "+h+"do not exists");if(!n[h]){var _=b.readFileSync(h);i(_,n,h)}c.imports[p]=n[h]}if(r.kind==v.SyntaxKind.TypeAliasDeclaration){var g=r;if(g.name){var S=g.name.text,E=y(g.type,s);c.aliases.push({name:S,type:E})}}if(r.kind==v.SyntaxKind.EnumDeclaration){var C=r,N=[];C.members&&C.members.forEach(function(e){N.push(e.name.text)}),C.name&&c.enumDeclarations.push({name:C.name.text,members:N})}var w=r.kind==v.SyntaxKind.InterfaceDeclaration,k=r.kind==v.SyntaxKind.ClassDeclaration;if(w||k){var x=r;if(x){var R={},I=A.classDecl(x.name.text,w);return I.moduleName=l,c.classes.push(I),x.members.forEach(function(t){if(t.kind==v.SyntaxKind.MethodDeclaration){var n=t,r=o(n,e,s);I.methods.push(r)}var i=T.doMatch(t);if(i){var u=a(i,s);if("$"==u.name)I.annotations=u.annotations;else if("$"!=u.name.charAt(0)||"$ref"==u.name)R[u.name]=u,I.fields.push(u);else{var c=u.name.substr(1),l=R[c];if(l)l.annotations=u.annotations;else if("$$"!=u.name){var p=I.annotationOverridings[c];p||(p=[]),I.annotationOverridings[c]=p.concat(u.annotations)}}}}),x.typeParameters&&x.typeParameters.forEach(function(e){I.typeParameters.push(e.name.text),null==e.constraint?I.typeParameterConstraint.push(null):I.typeParameterConstraint.push(e.constraint.typeName.text)}),x.heritageClauses&&x.heritageClauses.forEach(function(e){e.types.forEach(function(t){if(e.token==v.SyntaxKind.ExtendsKeyword)I.extends.push(y(t,s));else{if(e.token!=v.SyntaxKind.ImplementsKeyword)throw new Error("Unknown token class heritage");I.implements.push(y(t,s))}})}),t.tsm.Matching.SKIP}}}),c}function a(e,t){return{name:e.name.text,type:y(e.type,t),annotations:"$"==e.name.text.charAt(0)?c(e.initializer):[],valueConstraint:"$"!=e.name.text.charAt(0)?u(e.initializer):null,optional:null!=e.questionToken}}function o(e,t,n){var r=e.name.text,i=t.substring(e.pos,e.end),a=[];return e.parameters.forEach(function(e){a.push(s(e,t,n))}),{returnType:y(e.type,n),name:r,start:e.pos,end:e.end,text:i,arguments:a}}function s(e,t,n){var r=t.substring(e.pos,e.end);return{name:e.name.text,start:e.pos,end:e.end,text:r,type:y(e.type,n)}}function u(e){return null==e?null:e.kind==v.SyntaxKind.CallExpression?{isCallConstraint:!0,value:l(e)}:{isCallConstraint:!1,value:p(e)}}function c(e){if(null==e)return[];if(e.kind==v.SyntaxKind.ArrayLiteralExpression){var t=e,n=[];return t.elements.forEach(function(e){n.push(l(e))}),n}throw new Error("Only Array Literals supported now")}function l(e){if(e.kind==v.SyntaxKind.CallExpression){var t=e,n=f(t.expression),r={name:n,arguments:[]};return t.arguments.forEach(function(e){r.arguments.push(p(e))}),r}throw new Error("Only call expressions may be annotations")}function p(e){if(e.kind==v.SyntaxKind.StringLiteral){return e.text}if(e.kind==v.SyntaxKind.NoSubstitutionTemplateLiteral){return e.text}if(e.kind==v.SyntaxKind.ArrayLiteralExpression){var t=e,n=[];return t.elements.forEach(function(e){n.push(p(e))}),n}if(e.kind==v.SyntaxKind.TrueKeyword)return!0;if(e.kind==v.SyntaxKind.PropertyAccessExpression){var r=e;return p(r.expression)+"."+p(r.name)}if(e.kind==v.SyntaxKind.Identifier){return e.text}if(e.kind==v.SyntaxKind.FalseKeyword)return!1;if(e.kind==v.SyntaxKind.NumericLiteral){var i=e;return Number(i.text)}if(e.kind==v.SyntaxKind.BinaryExpression){var a=e;if(a.operatorToken.kind=v.SyntaxKind.PlusToken)return p(a.left)+p(a.right)}throw new Error("Unknown value in annotation")}function f(e){if(e.kind==v.SyntaxKind.Identifier)return e.text;if(e.kind==v.SyntaxKind.PropertyAccessExpression){var t=e;return f(t.expression)+"."+f(t.name)}throw new Error("Only simple identifiers are supported now")}function d(e,t){var n=e.indexOf(".");return{typeName:e,nameSpace:n!=-1?e.substring(0,n):"",basicName:n!=-1?e.substring(n+1):e,typeKind:S.TypeKind.BASIC,typeArguments:[],modulePath:t}}function m(e){return{base:e,typeKind:S.TypeKind.ARRAY}}function h(e){return{options:e,typeKind:S.TypeKind.UNION}}function y(e,t){if(null==e)return null;if(e.kind==v.SyntaxKind.StringKeyword)return d("string",null);if(e.kind==v.SyntaxKind.NumberKeyword)return d("number",null);if(e.kind==v.SyntaxKind.BooleanKeyword)return d("boolean",null);if(e.kind==v.SyntaxKind.AnyKeyword)return d("any",null);if(e.kind==v.SyntaxKind.VoidKeyword)return d("void",null);if(e.kind==v.SyntaxKind.TypeReference){var n=e,r=d(g(n.typeName),t);return n.typeArguments&&n.typeArguments.forEach(function(e){r.typeArguments.push(y(e,t))}),r}if(e.kind==v.SyntaxKind.ArrayType){return m(y(e.elementType,t))}if(e.kind==v.SyntaxKind.UnionType){return h(e.types.map(function(e){return y(e,t)}))}if(e.kind==v.SyntaxKind.ExpressionWithTypeArguments){var i=e,r=d(_(i.expression),t);return i.typeArguments&&i.typeArguments.forEach(function(e){r.typeArguments.push(y(e,t))}),r}throw new Error("Case not supported: "+e.kind)}function _(e){return e.name?e.name.text:e.text}function g(e){if(e.kind==v.SyntaxKind.Identifier)return e.text;var t=e;return g(t.left)+"."+g(t.right)}var v=n(97);t.tsm=n(159),t.helperMethodExtractor=n(157);var b=n(359),S=n(67),A=n(67),T=t.tsm.Matching.field();t.parseStruct=i,t.parseArg=p,t.buildType=y},function(e,t,n){var r=n(32);e.exports=function(e,t){return null==e?"":(e=String(e),r(e.charAt(0),t)+e.substr(1))}},function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,n){if(e&&c.isObject(e)&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}function a(e){return c.isString(e)&&(e=i(e)),e instanceof r?e.format():r.prototype.format.call(e)}function o(e,t){return i(e,!1,!0).resolve(t)}function s(e,t){return e?i(e,!1,!0).resolveObject(t):t}var u=n(303),c=n(361);t.parse=i,t.resolve=o,t.resolveObject=s,t.format=a,t.Url=r;var l=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],m=["{","}","|","\\","^","`"].concat(d),h=["'"].concat(m),y=["%","/","?",";","#"].concat(h),_=["/","?","#"],g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=n(308);r.prototype.parse=function(e,t,n){if(!c.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),i=r!==-1&&r127?"x":R[D];if(!I.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var P=k.slice(0,T),L=k.slice(T+1),O=R.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);O&&(P.push(O[1]),L.unshift(O[2])),L.length&&(o="/"+L.join(".")+o),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),w||(this.hostname=u.toASCII(this.hostname));var U=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+U,this.href+=this.host,w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!g[d])for(var T=0,x=h.length;T0)&&n.host.split("@");C&&(n.auth=C.shift(),n.host=n.hostname=C.shift())}return n.search=e.search,n.query=e.query,c.isNull(n.pathname)&&c.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!T.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var N=T.slice(-1)[0],w=(n.host||e.host||T.length>1)&&("."===N||".."===N)||""===N,k=0,x=T.length;x>=0;x--)N=T[x],"."===N?T.splice(x,1):".."===N?(T.splice(x,1),k++):k&&(T.splice(x,1),k--);if(!S&&!A)for(;k--;k)T.unshift("..");!S||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),w&&"/"!==T.join("/").substr(-1)&&T.push("");var R=""===T[0]||T[0]&&"/"===T[0].charAt(0);if(E){n.hostname=n.host=R?"":T.length?T.shift():"";var C=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");C&&(n.auth=C.shift(),n.host=n.hostname=C.shift())}return S=S||n.host&&T.length,S&&!R&&T.unshift(""),T.length?n.pathname=T.join("/"):(n.pathname=null,n.path=null),c.isNull(n.pathname)&&c.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=p.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(){var t,r,i=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty;r=n(12),t=n(37),e.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(n)}return i(t,e),t.prototype.clone=function(){return r(t.prototype,this)},t.prototype.toString=function(e,t){var n,r,i,a,o,s,u,c,l;return a=(null!=e?e.pretty:void 0)||!1,n=null!=(s=null!=e?e.indent:void 0)?s:" ",i=null!=(u=null!=e?e.offset:void 0)?u:0,r=null!=(c=null!=e?e.newline:void 0)?c:"\n",t||(t=0),l=new Array(t+i+1).join(n),o="",a&&(o+=l),o+="",a&&(o+=r),o},t}(t)}).call(this)},function(e,t,n){(function(){var t,r,i=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty;r=n(12),t=n(37),e.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing comment text");this.text=this.stringify.comment(n)}return i(t,e),t.prototype.clone=function(){return r(t.prototype,this)},t.prototype.toString=function(e,t){var n,r,i,a,o,s,u,c,l;return a=(null!=e?e.pretty:void 0)||!1,n=null!=(s=null!=e?e.indent:void 0)?s:" ",i=null!=(u=null!=e?e.offset:void 0)?u:0,r=null!=(c=null!=e?e.newline:void 0)?c:"\n",t||(t=0),l=new Array(t+i+1).join(n),o="",a&&(o+=l),o+="",a&&(o+=r),o},t}(t)}).call(this)},function(e,t,n){(function(){var t,r,i=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty;n(12),r=n(19),t=n(37),e.exports=function(e){function t(e,n,i,a){var o;t.__super__.constructor.call(this,e),r(n)&&(o=n,n=o.version,i=o.encoding,a=o.standalone),n||(n="1.0"),this.version=this.stringify.xmlVersion(n),null!=i&&(this.encoding=this.stringify.xmlEncoding(i)),null!=a&&(this.standalone=this.stringify.xmlStandalone(a))}return i(t,e),t.prototype.toString=function(e,t){var n,r,i,a,o,s,u,c,l;return a=(null!=e?e.pretty:void 0)||!1,n=null!=(s=null!=e?e.indent:void 0)?s:" ",i=null!=(u=null!=e?e.offset:void 0)?u:0,r=null!=(c=null!=e?e.newline:void 0)?c:"\n",t||(t=0),l=new Array(t+i+1).join(n),o="",a&&(o+=l),o+="",a&&(o+=r),o},t}(t)}).call(this)},function(e,t,n){(function(){var t,r,i,a,o,s,u,c;n(12),c=n(19),t=n(163),r=n(164),i=n(369),o=n(371),a=n(370),s=n(372),u=n(168),e.exports=function(){function e(e,t,n){var r,i;this.documentObject=e,this.stringify=this.documentObject.stringify,this.children=[],c(t)&&(r=t,t=r.pubID,n=r.sysID),null==n&&(i=[t,n],n=i[0],t=i[1]),null!=t&&(this.pubID=this.stringify.dtdPubID(t)),null!=n&&(this.sysID=this.stringify.dtdSysID(n))}return e.prototype.element=function(e,t){var n;return n=new a(this,e,t),this.children.push(n),this},e.prototype.attList=function(e,t,n,r,a){var o;return o=new i(this,e,t,n,r,a),this.children.push(o),this},e.prototype.entity=function(e,t){var n;return n=new o(this,!1,e,t),this.children.push(n),this},e.prototype.pEntity=function(e,t){var n;return n=new o(this,!0,e,t),this.children.push(n),this},e.prototype.notation=function(e,t){var n;return n=new s(this,e,t),this.children.push(n),this},e.prototype.cdata=function(e){var n;return n=new t(this,e),this.children.push(n),this},e.prototype.comment=function(e){var t;return t=new r(this,e),this.children.push(t),this},e.prototype.instruction=function(e,t){var n;return n=new u(this,e,t),this.children.push(n),this},e.prototype.root=function(){return this.documentObject.root()},e.prototype.document=function(){return this.documentObject},e.prototype.toString=function(e,t){var n,r,i,a,o,s,u,c,l,p,f,d,m;if(u=(null!=e?e.pretty:void 0)||!1,i=null!=(l=null!=e?e.indent:void 0)?l:" ",s=null!=(p=null!=e?e.offset:void 0)?p:0,o=null!=(f=null!=e?e.newline:void 0)?f:"\n",t||(t=0),m=new Array(t+s+1).join(i),c="",u&&(c+=m),c+="0){for(c+=" [",u&&(c+=o),d=this.children,r=0,a=d.length;r",h&&(y+=d);else if(h&&1===this.children.length&&null!=this.children[0].value)y+=">",y+=this.children[0].value,y+="",y+=d;else{for(y+=">",h&&(y+=d),A=this.children,u=0,p=A.length;u",h&&(y+=d)}return y},n.prototype.att=function(e,t){return this.attribute(e,t)},n.prototype.ins=function(e,t){return this.instruction(e,t)},n.prototype.a=function(e,t){return this.attribute(e,t)},n.prototype.i=function(e,t){return this.instruction(e,t)},n}(r)}).call(this)},function(e,t,n){(function(){var t;t=n(12),e.exports=function(){function e(e,t,n){if(this.stringify=e.stringify,null==t)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(t),n&&(this.value=this.stringify.insValue(n))}return e.prototype.clone=function(){return t(e.prototype,this)},e.prototype.toString=function(e,t){var n,r,i,a,o,s,u,c,l;return a=(null!=e?e.pretty:void 0)||!1,n=null!=(s=null!=e?e.indent:void 0)?s:" ",i=null!=(u=null!=e?e.offset:void 0)?u:0,r=null!=(c=null!=e?e.newline:void 0)?c:"\n",t||(t=0),l=new Array(t+i+1).join(n),o="",a&&(o+=l),o+="",a&&(o+=r),o},e}()}).call(this)},function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}function r(e,t){function r(){}var i=e.prototype;if(Object.create){var a=Object.create(t.prototype);i.__proto__=a}i instanceof t||(r.prototype=t.prototype,r=new r,n(i,r),e.prototype=i=r),i.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),i.constructor=e)}function i(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,ie[e]),this.message=ie[e],Error.captureStackTrace&&Error.captureStackTrace(this,i);return n.code=e,t&&(this.message=this.message+": "+t),n}function a(){}function o(e,t){this._node=e,this._refresh=t,s(this)}function s(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var r=e._refresh(e._node);V(e,"length",r.length),n(r,e),e._inc=t}}function u(){}function c(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function l(e,t,n,r){if(r?t[c(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&g(i,e,r),_(i,e,n))}}function p(e,t,n){var r=c(t,n);if(!(r>=0))throw i(oe,new Error(e.tagName+"@"+n));for(var a=t.length-1;r"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function h(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(h(e,t))return!0}while(e=e.nextSibling)}function y(){}function _(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function g(e,t,n,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function v(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a}}}function b(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,v(e.ownerDocument,e),t}function S(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===te){var i=t.firstChild;if(null==i)return t;var a=t.lastChild}else i=a=t;var o=n?n.previousSibling:e.lastChild;i.previousSibling=o,a.nextSibling=n,o?o.nextSibling=i:e.firstChild=i,null==n?e.lastChild=a:n.previousSibling=a;do{i.parentNode=e}while(i!==a&&(i=i.nextSibling));return v(e.ownerDocument||e,e),t.nodeType==te&&(t.firstChild=t.lastChild=null),t}function A(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t);var r=e.lastChild}var r=e.lastChild;return t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,v(e.ownerDocument,e,t),t}function T(){this._nsMap={}}function E(){}function C(){}function N(){}function w(){}function k(){}function x(){}function R(){}function I(){}function D(){}function M(){}function P(){}function L(){}function O(e,t){var n=[],r=9==this.nodeType?this.documentElement:this,i=r.prefix,a=r.namespaceURI;if(a&&null==i){var i=r.lookupPrefix(a);if(null==i)var o=[{namespace:a,prefix:null}]}return F(this,n,e,t,o),n.join("")}function U(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var a=n.length;a--;){var o=n[a];if(o.prefix==r)return o.namespace!=i}return!0}function F(e,t,n,r,i){if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case z:i||(i=[]);var a=(i.length,e.attributes),o=a.length,s=e.firstChild,u=e.tagName;n=W===e.namespaceURI||n,t.push("<",u);for(var c=0;c"),n&&/^script$/i.test(u))for(;s;)s.data?t.push(s.data):F(s,t,n,r,i),s=s.nextSibling;else for(;s;)F(s,t,n,r,i),s=s.nextSibling;t.push("")}else t.push("/>");return;case Z:case te:for(var s=e.firstChild;s;)F(s,t,n,r,i),s=s.nextSibling;return;case H:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,m),'"');case Y:return t.push(e.data.replace(/[<&]/g,m));case J:return t.push("");case Q:return t.push("");case ee:var h=e.publicId,y=e.systemId;if(t.push("');else if(y&&"."!=y)t.push(' SYSTEM "',y,'">');else{var _=e.internalSubset;_&&t.push(" [",_,"]"),t.push(">")}return;case $:return t.push("");case G:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function B(e,t,n){var r;switch(t.nodeType){case z:r=t.cloneNode(!1),r.ownerDocument=e;case te:break;case H:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(B(e,i,n)),i=i.nextSibling;return r}function K(e,t,n){var r=new t.constructor;for(var i in t){var o=t[i];"object"!=typeof o&&o!=r[i]&&(r[i]=o)}switch(t.childNodes&&(r.childNodes=new a),r.ownerDocument=e,r.nodeType){case z:var s=t.attributes,c=r.attributes=new u,l=s.length;c._ownerElement=r;for(var p=0;p0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=t.nodeType==H?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==H?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(q,d),n(q,d.prototype),y.prototype={nodeName:"#document",nodeType:Z,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==te){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==z&&(this.documentElement=e),S(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),b(this,e)},importNode:function(e,t){return B(this,e,t)},getElementById:function(e){var t=null;return h(this.documentElement,function(n){if(n.nodeType==z&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new T;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new a,(t.attributes=new u)._ownerElement=t,t},createDocumentFragment:function(){var e=new M;return e.ownerDocument=this,e.childNodes=new a,e},createTextNode:function(e){var t=new N;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new w;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new k;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new P;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new E;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new D;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new T,r=t.split(":"),i=n.attributes=new u;return n.childNodes=new a,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new E,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},r(y,d),T.prototype={nodeType:z,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===te?this.insertBefore(e,null):A(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new o(this,function(t){var n=[];return h(t,function(r){r===t||r.nodeType!=z||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new o(this,function(n){var r=[];return h(n,function(i){i===n||i.nodeType!==z||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)}),r})}},y.prototype.getElementsByTagName=T.prototype.getElementsByTagName,y.prototype.getElementsByTagNameNS=T.prototype.getElementsByTagNameNS,r(T,d),E.prototype.nodeType=H,r(E,d),C.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(ie[ae])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},r(C,d),N.prototype={nodeName:"#text",nodeType:Y,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},r(N,C),w.prototype={nodeName:"#comment",nodeType:Q},r(w,C),k.prototype={nodeName:"#cdata-section",nodeType:J},r(k,C),x.prototype.nodeType=ee,r(x,d),R.prototype.nodeType=ne,r(R,d),I.prototype.nodeType=X,r(I,d),D.prototype.nodeType=G,r(D,d),M.prototype.nodeName="#document-fragment",M.prototype.nodeType=te,r(M,d),P.prototype.nodeType=$,r(P,d),L.prototype.serializeToString=function(e,t,n){return O.call(e,t,n)},d.prototype.toString=O;try{Object.defineProperty&&(Object.defineProperty(o.prototype,"length",{get:function(){return s(this),this.$$length}}),Object.defineProperty(d.prototype,"textContent",{get:function(){return j(this)},set:function(e){switch(this.nodeType){case z:case te:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),V=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=f,t.XMLSerializer=L},function(e,t,n){"use strict";var r=n(49),i=new r({include:[n(100)],explicit:[n(389),n(388)]});r.DEFAULT=i,e.exports=i},function(e,t,n){"use strict";function r(e,t){return h.load(e,t)}function i(e,t){return h.loadSync(e,t)}function a(e,t,n){return h.loadApi(e,t,n).getOrElse(null)}function o(e,t,n){return h.loadApi(e,t,n).getOrElse(null)}function s(e,t,n){return{fsResolver:{content:function(r){return r===(n||y.resolve("/","#local.raml")).replace(/\\/,"/")?e:t&&t.fsResolver?t.fsResolver.content(r):void 0},contentAsync:function(r){return r===(n||y.resolve("/","#local.raml")).replace(/\\/,"/")?Promise.resolve(e):t&&t.fsResolver?t.fsResolver.contentAsync(r):void 0}},httpResolver:t?t.httpResolver:null,rejectOnErrors:!!t&&t.rejectOnErrors,attributeDefaults:!t||t.attributeDefaults}}function u(e,t){var n=null;return t&&t.filePath&&(n=t.filePath),h.loadApi(n||"/#local.raml",[],s(e,t,n)).getOrElse(null)}function c(e,t){var n=null;return t&&t.filePath&&(n=t.filePath),h.loadApiAsync(n||"/#local.raml",[],s(e,t,n))}function l(e,t,n){return h.loadApiAsync(e,t,n)}function p(e,t,n){return h.loadRAMLAsync(e,t,n)}function f(e){return h.getLanguageElementByRuntimeType(e)}function d(e){return t.api10.isFragment(e)}function m(e){return t.api10.asFragment(e)}var h=n(85),y=n(11),_=n(295);t.api10=n(87),t.api08=n(313),t.load=r,t.loadSync=i,t.loadApiSync=a,t.loadRAMLSync=o,t.parseRAMLSync=u,t.parseRAML=c,t.loadApi=l,t.loadRAML=p,t.getLanguageElementByRuntimeType=f,t.isFragment=d,t.asFragment=m,t.hl=n(24),t.ll=n(20),t.search=n(21),t.stubs=n(322),t.utils=n(146),t.project=n(312),t.universeHelpers=n(5),t.ds=n(0),t.schema=n(320),t.universes=t.ds.universesInfo,t.parser=n(310),t.expander=n(309),t.wrapperHelper=n(329),"undefined"==typeof Promise&&"undefined"!=typeof window&&(window.Promise=_)},function(e,t){var n=function(){function e(e){}return e.prototype.validate=function(e,t){return[]},e}();t.XMLValidator=n},function(e,t,n){"use strict";function r(){if(u.length)throw u.shift()}function i(e){var t;t=s.length?s.pop():new a,t.task=e,o(t)}function a(){this.task=null}var o=n(101),s=[],u=[],c=o.makeRequestCallFromTimer(r);e.exports=i,a.prototype.call=function(){try{this.task.call()}catch(e){i.onerror?i.onerror(e):(u.push(e),c())}finally{this.task=null,s[s.length]=this}}},function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function a(e){var t,n,i,a,o,s,u=e.length;o=r(e),s=new p(3*u/4-o),i=o>0?u-4:u;var c=0;for(t=0,n=0;t>16&255,s[c++]=a>>8&255,s[c++]=255&a;return 2===o?(a=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[c++]=255&a):1===o&&(a=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[c++]=a>>8&255,s[c++]=255&a),s}function o(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function s(e,t,n){for(var r,i=[],a=t;au?u:o+16383));return 1===r?(t=e[n-1],i+=c[t>>2],i+=c[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=c[t>>10],i+=c[t>>4&63],i+=c[t<<2&63],i+="="),a.push(i),a.join("")}t.byteLength=i,t.toByteArray=a,t.fromByteArray=u;for(var c=[],l=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,m=f.length;d>1,l=-7,p=n?i-1:0,f=n?-1:1,d=e[t+p];for(p+=f,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+p],p+=f,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+p],p+=f,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=c}return(d?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,m=r?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),t+=o+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(o++,u/=2),o+p>=l?(s=0,o=l):o+p>=1?(s=(t*u-1)*Math.pow(2,i),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;e[n+d]=255&s,d+=m,s/=256,i-=8);for(o=o<0;e[n+d]=255&o,d+=m,o/=256,c-=8);e[n+d-m]|=128*h}},function(e,t){var n=[].indexOf;e.exports=function(e,t){if(n)return e.indexOf(t);for(var r=0;r="0"&&r<="9";)t+=r,u();if("."===r)for(t+=".";u()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,u(),"-"!==r&&"+"!==r||(t+=r,u());r>="0"&&r<="9";)t+=r,u();if(e=+t,isFinite(e))return e;s("Bad number")},l=function(){var e,t,n,i="";if('"'===r)for(;u();){if('"'===r)return u(),i;if("\\"===r)if(u(),"u"===r){for(n=0,t=0;t<4&&(e=parseInt(u(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!=typeof o[r])break;i+=o[r]}else i+=r}s("Bad string")},p=function(){for(;r&&r<=" ";)u()},f=function(){switch(r){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}s("Unexpected '"+r+"'")},d=function(){var e=[];if("["===r){if(u("["),p(),"]"===r)return u("]"),e;for(;r;){if(e.push(a()),p(),"]"===r)return u("]"),e;u(","),p()}}s("Bad array")},m=function(){var e,t={};if("{"===r){if(u("{"),p(),"}"===r)return u("}"),t;for(;r;){if(e=l(),p(),u(":"),Object.hasOwnProperty.call(t,e)&&s('Duplicate key "'+e+'"'),t[e]=a(),p(),"}"===r)return u("}"),t;u(","),p()}}s("Bad object")};a=function(){switch(p(),r){case"{":return m();case"[":return d();case'"':return l();case"-":return c();default:return r>="0"&&r<="9"?c():f()}},e.exports=function(e,t){var o;return i=e,n=0,r=" ",o=a(),p(),r&&s("Syntax error"),"function"==typeof t?function e(n,r){var i,a,o=n[r];if(o&&"object"==typeof o)for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(a=e(o,i),void 0!==a?o[i]=a:delete o[i]);return t.call(n,r,o)}({"":o},""):o}},function(e,t){function n(e){return s.lastIndex=0,s.test(e)?'"'+e.replace(s,function(e){var t=u[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function r(e,t){var s,u,c,l,p,f=i,d=t[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),"function"==typeof o&&(d=o.call(t,e,d)),typeof d){case"string":return n(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(i+=a,p=[],"[object Array]"===Object.prototype.toString.apply(d)){for(l=d.length,s=0;s or an