From d569825e1c9781b9c8bc881ec5797c102721945d Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Wed, 30 May 2018 18:04:14 +0300 Subject: [PATCH 001/186] Add draft implementation of I18n engine --- .eslintrc.js | 1 + package.json | 1 + packages/kbn-i18n/package.json | 14 ++ .../src/angular_i18n/i18n.directive.js | 45 +++++ .../kbn-i18n/src/angular_i18n/i18n.filter.js | 29 ++++ .../kbn-i18n/src/angular_i18n/i18n.servise.js | 60 +++++++ packages/kbn-i18n/src/angular_i18n/index.js | 22 +++ packages/kbn-i18n/src/core.js | 164 ++++++++++++++++++ packages/kbn-i18n/src/i18n.js | 24 +++ packages/kbn-i18n/src/index.js | 25 +++ .../kbn-i18n/src/react_i18n/i18n_provider.js | 46 +++++ packages/kbn-i18n/src/react_i18n/index.js | 21 +++ packages/kbn-i18n/yarn.lock | 147 ++++++++++++++++ src/core_plugins/kibana/index.js | 4 +- src/core_plugins/kibana/translations/en.json | 4 - src/ui/public/autoload/modules.js | 1 + src/ui/ui_exports/ui_export_defaults.js | 4 +- src/ui/ui_i18n/README.md | 44 ++--- src/ui/ui_i18n/i18n.js | 2 +- src/ui/ui_i18n/translations/en.json | 4 - src/ui/ui_render/ui_render_mixin.js | 4 +- src/ui/ui_render/views/ui_app.jade | 2 +- yarn.lock | 35 +++- 23 files changed, 657 insertions(+), 46 deletions(-) create mode 100644 packages/kbn-i18n/package.json create mode 100644 packages/kbn-i18n/src/angular_i18n/i18n.directive.js create mode 100644 packages/kbn-i18n/src/angular_i18n/i18n.filter.js create mode 100644 packages/kbn-i18n/src/angular_i18n/i18n.servise.js create mode 100644 packages/kbn-i18n/src/angular_i18n/index.js create mode 100644 packages/kbn-i18n/src/core.js create mode 100644 packages/kbn-i18n/src/i18n.js create mode 100644 packages/kbn-i18n/src/index.js create mode 100644 packages/kbn-i18n/src/react_i18n/i18n_provider.js create mode 100644 packages/kbn-i18n/src/react_i18n/index.js create mode 100644 packages/kbn-i18n/yarn.lock delete mode 100644 src/core_plugins/kibana/translations/en.json delete mode 100644 src/ui/ui_i18n/translations/en.json diff --git a/.eslintrc.js b/.eslintrc.js index 2995d4fc8ac60..9b0c7a7da47ad 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,6 +31,7 @@ module.exports = { 'packages/kbn-pm/**/*', 'packages/kbn-es/**/*', 'packages/kbn-datemath/**/*', + 'packages/kbn-i18n/**/*', 'packages/kbn-dev-utils/**/*', 'packages/kbn-plugin-helpers/**/*', 'packages/kbn-plugin-generator/**/*', diff --git a/package.json b/package.json index adc34d19005be..4106aeddecde0 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "@elastic/ui-ace": "0.2.3", "@kbn/babel-preset": "link:packages/kbn-babel-preset", "@kbn/datemath": "link:packages/kbn-datemath", + "@kbn/i18n": "link:packages/kbn-i18n", "@kbn/pm": "link:packages/kbn-pm", "@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector", "@kbn/ui-framework": "link:packages/kbn-ui-framework", diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json new file mode 100644 index 0000000000000..9a5e29a25b95e --- /dev/null +++ b/packages/kbn-i18n/package.json @@ -0,0 +1,14 @@ +{ + "name": "@kbn/i18n", + "main": "./src/index.js", + "version": "1.0.0", + "license": "Apache-2.0", + "private": true, + "dependencies": { + "intl-format-cache": "2.1.0", + "intl-messageformat": "2.2.0", + "prop-types": "15.5.8", + "react": "^16.3.0", + "react-intl": "2.4.0" + } +} diff --git a/packages/kbn-i18n/src/angular_i18n/i18n.directive.js b/packages/kbn-i18n/src/angular_i18n/i18n.directive.js new file mode 100644 index 0000000000000..8f59dc22e044f --- /dev/null +++ b/packages/kbn-i18n/src/angular_i18n/i18n.directive.js @@ -0,0 +1,45 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { uiModules } from 'ui/modules'; + +uiModules.get('i18n').directive('i18nId', function(i18n) { + return { + restrict: 'A', + scope: { + id: '@i18nId', + defaultMessage: '@i18nDefaultMessage', + values: '=i18nValues', + }, + link: function($scope, $element) { + $scope.$watchGroup(['id', 'defaultMessage', 'values'], function([ + id, + defaultMessage = '', + values = {}, + ]) { + $element.html( + i18n(id, { + values, + defaultMessage, + }) + ); + }); + }, + }; +}); diff --git a/packages/kbn-i18n/src/angular_i18n/i18n.filter.js b/packages/kbn-i18n/src/angular_i18n/i18n.filter.js new file mode 100644 index 0000000000000..5b41fa230c662 --- /dev/null +++ b/packages/kbn-i18n/src/angular_i18n/i18n.filter.js @@ -0,0 +1,29 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { uiModules } from 'ui/modules'; + +uiModules.get('i18n').filter('i18n', function(i18n) { + return function(id, { defaultMessage = '', values = {} } = {}) { + return i18n(id, { + values, + defaultMessage, + }); + }; +}); diff --git a/packages/kbn-i18n/src/angular_i18n/i18n.servise.js b/packages/kbn-i18n/src/angular_i18n/i18n.servise.js new file mode 100644 index 0000000000000..85a64bd6fe355 --- /dev/null +++ b/packages/kbn-i18n/src/angular_i18n/i18n.servise.js @@ -0,0 +1,60 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { uiModules } from 'ui/modules'; + +import i18n from '../i18n'; + +uiModules.get('i18n').provider('i18n', function() { + this.addMessages = function(messages, locale) { + i18n.addMessages(messages, locale); + }; + + this.getMessages = function() { + return i18n.getMessages(); + }; + + this.setLocale = function(locale) { + i18n.setLocale(locale); + }; + + this.getLocale = function() { + return i18n.getLocale(); + }; + + this.setDefaultLocale = function(locale) { + i18n.setDefaultLocale(locale); + }; + + this.getDefaultLocale = function() { + return i18n.getDefaultLocale(); + }; + + this.defineFormats = function(formats) { + i18n.defineFormats(formats); + }; + + this.getFormats = function() { + return i18n.getFormats(); + }; + + this.$get = function() { + return i18n.translate.bind(i18n); + }; +}); diff --git a/packages/kbn-i18n/src/angular_i18n/index.js b/packages/kbn-i18n/src/angular_i18n/index.js new file mode 100644 index 0000000000000..6076cb4236cbc --- /dev/null +++ b/packages/kbn-i18n/src/angular_i18n/index.js @@ -0,0 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import './i18n.servise'; +import './i18n.directive'; +import './i18n.filter'; diff --git a/packages/kbn-i18n/src/core.js b/packages/kbn-i18n/src/core.js new file mode 100644 index 0000000000000..b5a0a4aa9f1a8 --- /dev/null +++ b/packages/kbn-i18n/src/core.js @@ -0,0 +1,164 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import IntlMessageFormat from 'intl-messageformat'; +import memoizeIntlConstructor from 'intl-format-cache'; + +const EN_LOCALE = 'en'; + +const getMessageById = (messages, id) => + id.split('.').reduce((val, key) => (val ? val[key] : null), messages); + +const hasValues = values => Object.keys(values).length > 0; + +const addLocaleData = localeData => { + if (localeData && localeData.locale) { + IntlMessageFormat.__addLocaleData(localeData); + } +}; + +const normalizeLocale = (locale = '') => locale.toLowerCase().replace('_', '-'); + +const showError = error => { + if (process.env.NODE_ENV !== 'production') { + console.error(error); + } +}; + +const getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); + +export default class I18n { + constructor(messages = {}, locale = messages.locale || EN_LOCALE) { + this.currentLocale = normalizeLocale(locale); + this.messages = { [this.currentLocale]: messages }; + this.defaultLocale = EN_LOCALE; + this.formats = {}; + + if (messages.localeData) { + addLocaleData(messages.localeData); + } + } + + addMessages(messages = {}, locale = messages.locale || EN_LOCALE) { + const normalizedLocale = normalizeLocale(locale); + + this.messages[normalizedLocale] = { + ...this.messages[normalizedLocale], + ...messages, + }; + + if (messages.localeData) { + addLocaleData(messages.localeData); + } + } + + getMessages() { + return this.messages[this.currentLocale]; + } + + setLocale(locale) { + this.currentLocale = normalizeLocale(locale); + } + + getLocale() { + return this.currentLocale; + } + + setDefaultLocale(locale) { + this.defaultLocale = normalizeLocale(locale); + } + + getDefaultLocale() { + return this.defaultLocale; + } + + defineFormats(formats) { + this.formats = formats; + } + + getFormats() { + return this.formats; + } + + translate(id, { values = {}, defaultMessage = '' } = {}) { + if (!id) { + showError('[I18n] An `id` must be provided to translate a message.'); + } + + const message = getMessageById(this.getMessages(), id); + + if (!hasValues(values) && process.env.NODE_ENV === 'production') { + return message || defaultMessage || id; + } + + let formattedMessage; + + if (message) { + try { + const msg = getMessageFormat( + message, + this.getLocale(), + this.getFormats() + ); + + formattedMessage = msg.format(values); + } catch (e) { + showError( + `[I18n] Error formatting message: "${id}" for locale: "${this.getLocale()}"` + + (defaultMessage ? ', using default message as fallback.' : '') + + `\n${e}` + ); + } + } else { + if (!defaultMessage || this.getLocale() !== this.getDefaultLocale()) { + showError( + `[I18n] Missing message: "${id}" for locale: "${this.getLocale()}"` + + (defaultMessage ? ', using default message as fallback.' : '') + ); + } + } + + if (!formattedMessage && defaultMessage) { + try { + const msg = getMessageFormat( + defaultMessage, + this.getDefaultLocale(), + this.getFormats() + ); + + formattedMessage = msg.format(values); + } catch (e) { + showError( + `[I18n] Error formatting the default message for: "${id}"\n${e}` + ); + } + } + + if (!formattedMessage) { + showError( + `[I18n] Cannot format message: "${id}", ` + + `using message ${ + message || defaultMessage ? 'source' : 'id' + } as fallback.` + ); + } + + return formattedMessage || message || defaultMessage || id; + } +} diff --git a/packages/kbn-i18n/src/i18n.js b/packages/kbn-i18n/src/i18n.js new file mode 100644 index 0000000000000..93a20f393552d --- /dev/null +++ b/packages/kbn-i18n/src/i18n.js @@ -0,0 +1,24 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { metadata } from 'ui/metadata'; + +import I18n from './core'; + +export default new I18n(metadata.translations); diff --git a/packages/kbn-i18n/src/index.js b/packages/kbn-i18n/src/index.js new file mode 100644 index 0000000000000..939efed7e4021 --- /dev/null +++ b/packages/kbn-i18n/src/index.js @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import './angular_i18n'; + +export * from './react_i18n'; + +export { default as I18n } from './core'; +export { default as i18n } from './i18n'; diff --git a/packages/kbn-i18n/src/react_i18n/i18n_provider.js b/packages/kbn-i18n/src/react_i18n/i18n_provider.js new file mode 100644 index 0000000000000..3563a49e4b2a7 --- /dev/null +++ b/packages/kbn-i18n/src/react_i18n/i18n_provider.js @@ -0,0 +1,46 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React, { PureComponent } from 'react'; +import PropTypes from 'prop-types'; +import { IntlProvider } from 'react-intl'; + +import i18n from '../i18n'; + +export class I18nProvider extends PureComponent { + static propTypes = { + children: PropTypes.object, + }; + + render() { + const { children } = this.props; + + return ( + + {children} + + ); + } +} diff --git a/packages/kbn-i18n/src/react_i18n/index.js b/packages/kbn-i18n/src/react_i18n/index.js new file mode 100644 index 0000000000000..bc50b7ea0395d --- /dev/null +++ b/packages/kbn-i18n/src/react_i18n/index.js @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export * from 'react-intl'; +export { I18nProvider } from './i18n_provider'; diff --git a/packages/kbn-i18n/yarn.lock b/packages/kbn-i18n/yarn.lock new file mode 100644 index 0000000000000..026ddc9bf6ad2 --- /dev/null +++ b/packages/kbn-i18n/yarn.lock @@ -0,0 +1,147 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + dependencies: + iconv-lite "~0.4.13" + +fbjs@^0.8.16, fbjs@^0.8.9: + version "0.8.16" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.9" + +iconv-lite@~0.4.13: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +intl-format-cache@2.1.0, intl-format-cache@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-2.1.0.tgz#04a369fecbfad6da6005bae1f14333332dcf9316" + +intl-messageformat-parser@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075" + +intl-messageformat@2.2.0, intl-messageformat@^2.0.0, intl-messageformat@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc" + dependencies: + intl-messageformat-parser "1.4.0" + +intl-relativeformat@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/intl-relativeformat/-/intl-relativeformat-2.1.0.tgz#010f1105802251f40ac47d0e3e1a201348a255df" + dependencies: + intl-messageformat "^2.0.0" + +invariant@^2.1.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + dependencies: + loose-envify "^1.0.0" + +is-stream@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +isomorphic-fetch@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +js-tokens@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + dependencies: + asap "~2.0.3" + +prop-types@15.5.8: + version "15.5.8" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" + dependencies: + fbjs "^0.8.9" + +prop-types@^15.6.0: + version "15.6.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.3.1" + object-assign "^4.1.1" + +react-intl@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.4.0.tgz#66c14dc9df9a73b2fbbfbd6021726e80a613eb15" + dependencies: + intl-format-cache "^2.0.5" + intl-messageformat "^2.1.0" + intl-relativeformat "^2.0.0" + invariant "^2.1.1" + +react@^16.3.0: + version "16.4.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.4.0.tgz#402c2db83335336fba1962c08b98c6272617d585" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +ua-parser-js@^0.7.9: + version "0.7.18" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" + +whatwg-fetch@>=0.10.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" diff --git a/src/core_plugins/kibana/index.js b/src/core_plugins/kibana/index.js index 622373089f38e..4e2c36cca0347 100644 --- a/src/core_plugins/kibana/index.js +++ b/src/core_plugins/kibana/index.js @@ -123,9 +123,7 @@ export default function (kibana) { }; }, - translations: [ - resolve(__dirname, './translations/en.json') - ], + translations: [], mappings, uiSettingDefaults: getUiSettingDefaults(), diff --git a/src/core_plugins/kibana/translations/en.json b/src/core_plugins/kibana/translations/en.json deleted file mode 100644 index ddb7a272e1129..0000000000000 --- a/src/core_plugins/kibana/translations/en.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "UI-WELCOME_MESSAGE": "Loading Kibana", - "UI-WELCOME_ERROR": "Kibana did not load properly. Check the server output for more information." -} diff --git a/src/ui/public/autoload/modules.js b/src/ui/public/autoload/modules.js index 194279dfd05bf..19ef546f8a195 100644 --- a/src/ui/public/autoload/modules.js +++ b/src/ui/public/autoload/modules.js @@ -18,6 +18,7 @@ */ import 'angular'; +import '@kbn/i18n'; import '../chrome'; import '../bind'; import '../kbn_top_nav'; diff --git a/src/ui/ui_exports/ui_export_defaults.js b/src/ui/ui_exports/ui_export_defaults.js index 16dae9db46687..b4a8e91252673 100644 --- a/src/ui/ui_exports/ui_export_defaults.js +++ b/src/ui/ui_exports/ui_export_defaults.js @@ -35,9 +35,7 @@ export const UI_EXPORT_DEFAULTS = { 'moment-timezone$': resolve(ROOT, 'webpackShims/moment-timezone') }, - translationPaths: [ - resolve(ROOT, 'src/ui/ui_i18n/translations/en.json'), - ], + translationPaths: [], appExtensions: { fieldFormatEditors: [ diff --git a/src/ui/ui_i18n/README.md b/src/ui/ui_i18n/README.md index 4aecb8f1f0346..6ae1e0ca180e8 100644 --- a/src/ui/ui_i18n/README.md +++ b/src/ui/ui_i18n/README.md @@ -98,6 +98,8 @@ data to UI frameworks and provides methods for the direct translation. Here is the public API exposed by this engine: +- `addMessages(messages: Map, [locale: string])` - provides a way to register +translations with the engine - `getMessages()` - returns messages for the current language - `setLocale(locale: string)` - tells the engine which language to use by given language key @@ -107,6 +109,7 @@ when missing translations - `getDefaultLocale()` - returns the default locale - `defineFormats(formats: object)` - supplies a set of options to the underlying formatter. For the detailed explanation, see the section below +- `getFormats()` - returns current formats - `translate(id: string, [{values: object, defaultMessage: string}])` – translate message by id #### I18n engine internals @@ -179,24 +182,17 @@ React Intl uses the provider pattern to scope an i18n context to a tree of compo are able to use `FormattedMessage` component in order to translate messages. `IntlProvider` should wrap react app's root component (inside each react render method). -In order to translate messages we need to pass them into the `IntlProvider` -from I18n engine: +In order to translate messages we need to use custom `I18nProvider` component +that uses I18n engine under the hood: ```js import React from 'react'; import ReactDOM from 'react-dom'; -import i18n from 'kbn-i18n'; -import { IntlProvider } from 'ui/i18n/react-intl'; - -const locale = i18n.getLocale(); -const messages = i18n.getMessages(); +import { I18nProvider } from '@kbn/i18n'; ReactDOM.render( - + ... @@ -209,7 +205,7 @@ After that we can use `FormattedMessage` components inside `RootComponent`: ```js import React, { Component } from 'react'; -import { FormattedMessage } from 'ui/i18n/react-intl'; +import { FormattedMessage } from '@kbn/i18n'; class RootComponent extends Component { constructor(props) { @@ -261,6 +257,7 @@ language key when missing translations - `getDefaultLocale()` - returns the default locale - `defineFormats(formats: object)` - supplies a set of options to the underlying formatter +- `getFormats()` - returns current formats The translation `service` provides only one method: - `translate(id: string, [{values: object, defaultMessage: string}])` – translate message by id @@ -291,20 +288,8 @@ Where: - `i18n-values` - values to pass into translation - `i18n-default-message` - will be used unless translation was successful -In order to initialize the translation service, we need to pass locale and -localization messages from I18n engine into the `i18nProvider`: - -```js -import { uiModules } from 'ui/modules'; -import i18n from 'kbn-i18n'; - -uiModules.get('kibana').config(function (i18nProvider) { - i18nProvider.addMessages(i18n.getMessages()); - i18nProvider.setLocale(i18n.getLocale()); -}); -``` - -After that we can use i18n directive in Angular templates: +Angular `I18n` module is placed into `autoload` module, so it will be +loaded automatically. After that we can use i18n directive in Angular templates: ```html _.assign({}, ...translations)); + .then(translations => _.assign({ locale }, ...translations)); } } diff --git a/src/ui/ui_i18n/translations/en.json b/src/ui/ui_i18n/translations/en.json deleted file mode 100644 index ac491cf6f3465..0000000000000 --- a/src/ui/ui_i18n/translations/en.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "UI-WELCOME_MESSAGE": "Loading", - "UI-WELCOME_ERROR": "" -} diff --git a/src/ui/ui_render/ui_render_mixin.js b/src/ui/ui_render/ui_render_mixin.js index 66545c90209cb..2c080ccda3a49 100644 --- a/src/ui/ui_render/ui_render_mixin.js +++ b/src/ui/ui_render/ui_render_mixin.js @@ -21,6 +21,7 @@ import { defaults, get } from 'lodash'; import { props, reduce as reduceAsync } from 'bluebird'; import Boom from 'boom'; import { resolve } from 'path'; +import I18n from '@kbn/i18n/src/core'; import { AppBootstrap } from './bootstrap'; export function uiRenderMixin(kbnServer, server, config) { @@ -138,6 +139,7 @@ export function uiRenderMixin(kbnServer, server, config) { try { const request = reply.request; const translations = await request.getUiTranslations(); + const i18n = new I18n(translations); return reply.view('ui_app', { app, @@ -148,7 +150,7 @@ export function uiRenderMixin(kbnServer, server, config) { injectedVarsOverrides }), bundlePath: `${config.get('server.basePath')}/bundles`, - i18n: key => get(translations, key, ''), + i18n: i18n.translate.bind(i18n), }); } catch (err) { reply(err); diff --git a/src/ui/ui_render/views/ui_app.jade b/src/ui/ui_render/views/ui_app.jade index 38942e7bf1ee3..e50bd41b12856 100644 --- a/src/ui/ui_render/views/ui_app.jade +++ b/src/ui/ui_render/views/ui_app.jade @@ -108,6 +108,6 @@ block content .kibanaWelcomeLogoCircle .kibanaWelcomeLogo .kibanaWelcomeText - | #{i18n('UI-WELCOME_MESSAGE')} + | #{i18n('UI-WELCOME_MESSAGE', { defaultMessage: 'Loading Kibana' })} script(src='#{bundlePath}/app/#{app.getId()}/bootstrap.js') diff --git a/yarn.lock b/yarn.lock index 429b827b02d04..398cae6a69a2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -145,6 +145,10 @@ version "0.0.0" uid "" +"@kbn/i18n@link:packages/kbn-i18n": + version "0.0.0" + uid "" + "@kbn/plugin-generator@link:packages/kbn-plugin-generator": version "0.0.0" uid "" @@ -6336,6 +6340,26 @@ interpret@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" +intl-format-cache@2.1.0, intl-format-cache@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-2.1.0.tgz#04a369fecbfad6da6005bae1f14333332dcf9316" + +intl-messageformat-parser@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075" + +intl-messageformat@2.2.0, intl-messageformat@^2.0.0, intl-messageformat@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc" + dependencies: + intl-messageformat-parser "1.4.0" + +intl-relativeformat@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/intl-relativeformat/-/intl-relativeformat-2.1.0.tgz#010f1105802251f40ac47d0e3e1a201348a255df" + dependencies: + intl-messageformat "^2.0.0" + into-stream@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" @@ -6343,7 +6367,7 @@ into-stream@^3.1.0: from2 "^2.1.1" p-is-promise "^1.1.0" -invariant@^2.0.0, invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2: +invariant@^2.0.0, invariant@^2.1.1, invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: @@ -10366,6 +10390,15 @@ react-input-range@^1.3.0: autobind-decorator "^1.3.4" prop-types "^15.5.8" +react-intl@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.4.0.tgz#66c14dc9df9a73b2fbbfbd6021726e80a613eb15" + dependencies: + intl-format-cache "^2.0.5" + intl-messageformat "^2.1.0" + intl-relativeformat "^2.0.0" + invariant "^2.1.1" + react-markdown-renderer@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/react-markdown-renderer/-/react-markdown-renderer-1.4.0.tgz#f3b95bd9fc7f7bf8ab3f0150aa696b41740e7d01" From e4ceebb9b60a90dd8fd7b811a981862e53f0bd90 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Mon, 4 Jun 2018 13:03:41 +0300 Subject: [PATCH 002/186] Add i18n loader --- package.json | 1 - .../ui_i18n => packages/kbn-i18n}/README.md | 6 +- packages/kbn-i18n/package.json | 9 +- .../directive.js} | 0 .../i18n.filter.js => angular/filter.js} | 0 .../src/{angular_i18n => angular}/index.js | 6 +- .../i18n.servise.js => angular/provider.js} | 10 +- packages/kbn-i18n/src/core.js | 89 +++++++-- packages/kbn-i18n/src/index.js | 4 +- .../src/{react_i18n => react}/index.js | 2 +- .../i18n_provider.js => react/provider.js} | 0 .../translations/test_plugin_1/de.json | 0 .../translations/test_plugin_1/en.json | 0 .../translations/test_plugin_1/es-ES.json | 0 .../translations/test_plugin_2/de.json | 0 .../translations/test_plugin_2/en.json | 0 .../kbn-i18n/src/server}/__tests__/i18n.js | 19 +- packages/kbn-i18n/src/server/i18n_loader.js | 178 ++++++++++++++++++ .../kbn-i18n/src/server}/index.js | 2 +- .../kbn-i18n/src/server}/ui_i18n_mixin.js | 41 ++-- packages/kbn-i18n/yarn.lock | 20 +- src/ui/ui_i18n/i18n.js | 164 ---------------- src/ui/ui_mixin.js | 3 +- src/ui/ui_render/ui_render_mixin.js | 2 +- yarn.lock | 12 +- 25 files changed, 320 insertions(+), 248 deletions(-) rename {src/ui/ui_i18n => packages/kbn-i18n}/README.md (97%) rename packages/kbn-i18n/src/{angular_i18n/i18n.directive.js => angular/directive.js} (100%) rename packages/kbn-i18n/src/{angular_i18n/i18n.filter.js => angular/filter.js} (100%) rename packages/kbn-i18n/src/{angular_i18n => angular}/index.js (91%) rename packages/kbn-i18n/src/{angular_i18n/i18n.servise.js => angular/provider.js} (87%) rename packages/kbn-i18n/src/{react_i18n => react}/index.js (94%) rename packages/kbn-i18n/src/{react_i18n/i18n_provider.js => react/provider.js} (100%) rename {src/ui/ui_i18n => packages/kbn-i18n/src/server}/__tests__/fixtures/translations/test_plugin_1/de.json (100%) rename {src/ui/ui_i18n => packages/kbn-i18n/src/server}/__tests__/fixtures/translations/test_plugin_1/en.json (100%) rename {src/ui/ui_i18n => packages/kbn-i18n/src/server}/__tests__/fixtures/translations/test_plugin_1/es-ES.json (100%) rename {src/ui/ui_i18n => packages/kbn-i18n/src/server}/__tests__/fixtures/translations/test_plugin_2/de.json (100%) rename {src/ui/ui_i18n => packages/kbn-i18n/src/server}/__tests__/fixtures/translations/test_plugin_2/en.json (100%) rename {src/ui/ui_i18n => packages/kbn-i18n/src/server}/__tests__/i18n.js (95%) create mode 100644 packages/kbn-i18n/src/server/i18n_loader.js rename {src/ui/ui_i18n => packages/kbn-i18n/src/server}/index.js (95%) rename {src/ui/ui_i18n => packages/kbn-i18n/src/server}/ui_i18n_mixin.js (67%) delete mode 100644 src/ui/ui_i18n/i18n.js diff --git a/package.json b/package.json index 4106aeddecde0..3a10c157d8bd6 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,6 @@ "@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector", "@kbn/ui-framework": "link:packages/kbn-ui-framework", "JSONStream": "1.1.1", - "accept-language-parser": "1.2.0", "angular": "1.6.9", "angular-aria": "1.6.6", "angular-elastic": "2.5.0", diff --git a/src/ui/ui_i18n/README.md b/packages/kbn-i18n/README.md similarity index 97% rename from src/ui/ui_i18n/README.md rename to packages/kbn-i18n/README.md index 6ae1e0ca180e8..b5f90c07f693f 100644 --- a/src/ui/ui_i18n/README.md +++ b/packages/kbn-i18n/README.md @@ -107,9 +107,10 @@ language key - `setDefaultLocale(locale: string)` - tells the library which language to fallback when missing translations - `getDefaultLocale()` - returns the default locale -- `defineFormats(formats: object)` - supplies a set of options to the underlying formatter. +- `setFormats(formats: object)` - supplies a set of options to the underlying formatter. For the detailed explanation, see the section below - `getFormats()` - returns current formats +- `getRegisteredLocales()` - returns array of locales having translations - `translate(id: string, [{values: object, defaultMessage: string}])` – translate message by id #### I18n engine internals @@ -256,8 +257,9 @@ language key - `setDefaultLocale(locale: string)` - tells the library which language to fallback when missing translations - `getDefaultLocale()` - returns the default locale -- `defineFormats(formats: object)` - supplies a set of options to the underlying formatter +- `setFormats(formats: object)` - supplies a set of options to the underlying formatter - `getFormats()` - returns current formats +- `getRegisteredLocales()` - returns array of locales having translations The translation `service` provides only one method: - `translate(id: string, [{values: object, defaultMessage: string}])` – translate message by id diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index 9a5e29a25b95e..db77940517f2a 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -5,10 +5,11 @@ "license": "Apache-2.0", "private": true, "dependencies": { - "intl-format-cache": "2.1.0", - "intl-messageformat": "2.2.0", - "prop-types": "15.5.8", + "accept-language-parser": "^1.5.0", + "intl-format-cache": "^2.1.0", + "intl-messageformat": "^2.2.0", + "prop-types": "^15.5.8", "react": "^16.3.0", - "react-intl": "2.4.0" + "react-intl": "^2.4.0" } } diff --git a/packages/kbn-i18n/src/angular_i18n/i18n.directive.js b/packages/kbn-i18n/src/angular/directive.js similarity index 100% rename from packages/kbn-i18n/src/angular_i18n/i18n.directive.js rename to packages/kbn-i18n/src/angular/directive.js diff --git a/packages/kbn-i18n/src/angular_i18n/i18n.filter.js b/packages/kbn-i18n/src/angular/filter.js similarity index 100% rename from packages/kbn-i18n/src/angular_i18n/i18n.filter.js rename to packages/kbn-i18n/src/angular/filter.js diff --git a/packages/kbn-i18n/src/angular_i18n/index.js b/packages/kbn-i18n/src/angular/index.js similarity index 91% rename from packages/kbn-i18n/src/angular_i18n/index.js rename to packages/kbn-i18n/src/angular/index.js index 6076cb4236cbc..2e32860bb45b5 100644 --- a/packages/kbn-i18n/src/angular_i18n/index.js +++ b/packages/kbn-i18n/src/angular/index.js @@ -17,6 +17,6 @@ * under the License. */ -import './i18n.servise'; -import './i18n.directive'; -import './i18n.filter'; +import './provider'; +import './directive'; +import './filter'; diff --git a/packages/kbn-i18n/src/angular_i18n/i18n.servise.js b/packages/kbn-i18n/src/angular/provider.js similarity index 87% rename from packages/kbn-i18n/src/angular_i18n/i18n.servise.js rename to packages/kbn-i18n/src/angular/provider.js index 85a64bd6fe355..dcb480a145b7a 100644 --- a/packages/kbn-i18n/src/angular_i18n/i18n.servise.js +++ b/packages/kbn-i18n/src/angular/provider.js @@ -21,7 +21,7 @@ import { uiModules } from 'ui/modules'; import i18n from '../i18n'; -uiModules.get('i18n').provider('i18n', function() { +uiModules.get('kbn-i18n').provider('i18n', function() { this.addMessages = function(messages, locale) { i18n.addMessages(messages, locale); }; @@ -46,14 +46,18 @@ uiModules.get('i18n').provider('i18n', function() { return i18n.getDefaultLocale(); }; - this.defineFormats = function(formats) { - i18n.defineFormats(formats); + this.setFormats = function(formats) { + i18n.setFormats(formats); }; this.getFormats = function() { return i18n.getFormats(); }; + this.getRegisteredLocales = function() { + return i18n.getRegisteredLocales(); + }; + this.$get = function() { return i18n.translate.bind(i18n); }; diff --git a/packages/kbn-i18n/src/core.js b/packages/kbn-i18n/src/core.js index b5a0a4aa9f1a8..8a5dd5897ceab 100644 --- a/packages/kbn-i18n/src/core.js +++ b/packages/kbn-i18n/src/core.js @@ -17,11 +17,16 @@ * under the License. */ +/** + @typedef Messages + @type {object} + @property {string} [locale] - locale of the messages + @property {object} [localeData] - localization rules for IntlMessageFormat + */ + import IntlMessageFormat from 'intl-messageformat'; import memoizeIntlConstructor from 'intl-format-cache'; -const EN_LOCALE = 'en'; - const getMessageById = (messages, id) => id.split('.').reduce((val, key) => (val ? val[key] : null), messages); @@ -33,8 +38,6 @@ const addLocaleData = localeData => { } }; -const normalizeLocale = (locale = '') => locale.toLowerCase().replace('_', '-'); - const showError = error => { if (process.env.NODE_ENV !== 'production') { console.error(error); @@ -44,10 +47,23 @@ const showError = error => { const getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); export default class I18n { - constructor(messages = {}, locale = messages.locale || EN_LOCALE) { - this.currentLocale = normalizeLocale(locale); + static EN_LOCALE = 'en'; + static LOCALE_DELIMITER = '-'; + + static normalizeLocale(locale = '') { + return locale.toLowerCase().replace('_', I18n.LOCALE_DELIMITER); + } + + /** + * Platform agnostic abstraction that helps to supply locale data to + * UI frameworks and provides methods for the direct translation. + * @param {Messages} messages + * @param {string} [locale = messages.locale||'en'] + */ + constructor(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { + this.currentLocale = I18n.normalizeLocale(locale); this.messages = { [this.currentLocale]: messages }; - this.defaultLocale = EN_LOCALE; + this.defaultLocale = I18n.EN_LOCALE; this.formats = {}; if (messages.localeData) { @@ -55,8 +71,13 @@ export default class I18n { } } - addMessages(messages = {}, locale = messages.locale || EN_LOCALE) { - const normalizedLocale = normalizeLocale(locale); + /** + * Provides a way to register translations with the engine + * @param {Messages} messages + * @param {string} [locale = messages.locale||'en'] + */ + addMessages(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { + const normalizedLocale = I18n.normalizeLocale(locale); this.messages[normalizedLocale] = { ...this.messages[normalizedLocale], @@ -68,34 +89,78 @@ export default class I18n { } } + /** + * Returns messages for the current language + * @returns {Messages} messages + */ getMessages() { return this.messages[this.currentLocale]; } + /** + * Tells the engine which language to use by given language key + * @param {string} locale + */ setLocale(locale) { - this.currentLocale = normalizeLocale(locale); + this.currentLocale = I18n.normalizeLocale(locale); } + /** + * Returns the current locale + * @returns {string} locale + */ getLocale() { return this.currentLocale; } + /** + * Tells the library which language to fallback when missing translations + * @param {string} locale + */ setDefaultLocale(locale) { - this.defaultLocale = normalizeLocale(locale); + this.defaultLocale = I18n.normalizeLocale(locale); } + /** + * Returns the default locale + * @returns {string} defaultLocale + */ getDefaultLocale() { return this.defaultLocale; } - defineFormats(formats) { + /** + * Supplies a set of options to the underlying formatter + * @param {object} formats + */ + setFormats(formats) { this.formats = formats; } + /** + * Returns current formats + * @returns {object} formats + */ getFormats() { return this.formats; } + /** + * Returns array of locales having translations + * @returns {string[]} locales + */ + getRegisteredLocales() { + return Object.keys(this.messages); + } + + /** + * Translate message by id + * @param {string} id - translation id to be translated + * @param {object} [options] + * @param {object} [options.values] - values to pass into translation + * @param {string} [options.defaultMessage] - will be used unless translation was successful + * @returns {string} + */ translate(id, { values = {}, defaultMessage = '' } = {}) { if (!id) { showError('[I18n] An `id` must be provided to translate a message.'); diff --git a/packages/kbn-i18n/src/index.js b/packages/kbn-i18n/src/index.js index 939efed7e4021..a25487f483762 100644 --- a/packages/kbn-i18n/src/index.js +++ b/packages/kbn-i18n/src/index.js @@ -17,9 +17,9 @@ * under the License. */ -import './angular_i18n'; +import './angular'; -export * from './react_i18n'; +export * from './react'; export { default as I18n } from './core'; export { default as i18n } from './i18n'; diff --git a/packages/kbn-i18n/src/react_i18n/index.js b/packages/kbn-i18n/src/react/index.js similarity index 94% rename from packages/kbn-i18n/src/react_i18n/index.js rename to packages/kbn-i18n/src/react/index.js index bc50b7ea0395d..a6569e047c5e5 100644 --- a/packages/kbn-i18n/src/react_i18n/index.js +++ b/packages/kbn-i18n/src/react/index.js @@ -18,4 +18,4 @@ */ export * from 'react-intl'; -export { I18nProvider } from './i18n_provider'; +export { I18nProvider } from './provider'; diff --git a/packages/kbn-i18n/src/react_i18n/i18n_provider.js b/packages/kbn-i18n/src/react/provider.js similarity index 100% rename from packages/kbn-i18n/src/react_i18n/i18n_provider.js rename to packages/kbn-i18n/src/react/provider.js diff --git a/src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_1/de.json b/packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_1/de.json similarity index 100% rename from src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_1/de.json rename to packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_1/de.json diff --git a/src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_1/en.json b/packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_1/en.json similarity index 100% rename from src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_1/en.json rename to packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_1/en.json diff --git a/src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_1/es-ES.json b/packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_1/es-ES.json similarity index 100% rename from src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_1/es-ES.json rename to packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_1/es-ES.json diff --git a/src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_2/de.json b/packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_2/de.json similarity index 100% rename from src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_2/de.json rename to packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_2/de.json diff --git a/src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_2/en.json b/packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_2/en.json similarity index 100% rename from src/ui/ui_i18n/__tests__/fixtures/translations/test_plugin_2/en.json rename to packages/kbn-i18n/src/server/__tests__/fixtures/translations/test_plugin_2/en.json diff --git a/src/ui/ui_i18n/__tests__/i18n.js b/packages/kbn-i18n/src/server/__tests__/i18n.js similarity index 95% rename from src/ui/ui_i18n/__tests__/i18n.js rename to packages/kbn-i18n/src/server/__tests__/i18n.js index 7ab16fc04cecf..36f4002bbf7f4 100644 --- a/src/ui/ui_i18n/__tests__/i18n.js +++ b/packages/kbn-i18n/src/server/__tests__/i18n.js @@ -21,30 +21,27 @@ import expect from 'expect.js'; import _ from 'lodash'; import { join } from 'path'; -import { I18n } from '../'; +import { I18nLoader } from '../i18n_loader'; const FIXTURES = join(__dirname, 'fixtures'); -describe('ui/i18n module', function () { +describe('ui/i18n module', function() { - describe('one plugin', function () { + describe('one plugin', function() { - const i18nObj = new I18n(); + const i18nObj = new I18nLoader(); - before('registerTranslations - one plugin', function () { + before('registerTranslations - one plugin', function() { const pluginName = 'test_plugin_1'; const pluginTranslationPath = join(FIXTURES, 'translations', pluginName); const translationFiles = [ join(pluginTranslationPath, 'de.json'), - join(pluginTranslationPath, 'en.json') + join(pluginTranslationPath, 'en.json'), ]; - const filesLen = translationFiles.length; - for (let indx = 0; indx < filesLen; indx++) { - i18nObj.registerTranslations(translationFiles[indx]); - } + i18nObj.registerTranslationFiles(translationFiles); }); - describe('getTranslations', function () { + describe('getTranslations', function() { it('should return the translations for en locale as registered', function () { const languageTag = ['en']; diff --git a/packages/kbn-i18n/src/server/i18n_loader.js b/packages/kbn-i18n/src/server/i18n_loader.js new file mode 100644 index 0000000000000..c73e72fc9aae5 --- /dev/null +++ b/packages/kbn-i18n/src/server/i18n_loader.js @@ -0,0 +1,178 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import path from 'path'; +import { readFile } from 'fs'; +import { promisify } from 'util'; +import { pick } from 'accept-language-parser'; + +const asyncReadFile = promisify(readFile); + +export class I18nLoader { + static TRANSLATION_FILE_EXTENSION = '.json'; + + static unique(arr = []) { + return arr.filter((value, index, array) => array.indexOf(value) === index); + } + + static getLocaleFromFileName(fullFileName) { + if (!fullFileName) { + throw new Error('Filename is empty'); + } + + const fileExt = path.extname(fullFileName); + + if (fileExt !== I18nLoader.TRANSLATION_FILE_EXTENSION) { + throw new Error( + `Translations must be in a JSON file. File being registered is ${fullFileName}` + ); + } + + return path.basename(fullFileName, I18nLoader.TRANSLATION_FILE_EXTENSION); + } + + static async loadFile(pathToFile) { + return JSON.parse(await asyncReadFile(pathToFile, 'utf8')); + } + + /** + * Internal property for storing registered translations paths + * @private + * @type {Map|{}} - Key is locale, value is array of registered paths + */ + translationsRegistry = {}; + + /** + * Internal property for caching loaded translations files + * @private + * @type {Map|{}} - Key is path to translation file, value is + * object with translation messages + */ + loadedFiles = {}; + + /** + * The translation file is registered with i18n plugin. + * The plugin contains a list of registered translation file paths per language. + * @param {String} pluginTranslationFilePath - Absolute path to the translation file to register. + */ + registerTranslationFile(pluginTranslationFilePath) { + if (!path.isAbsolute(pluginTranslationFilePath)) { + throw new TypeError( + 'Paths to translation files must be absolute. ' + + `Got relative path: "${pluginTranslationFilePath}"` + ); + } + + const locale = I18nLoader.getLocaleFromFileName(pluginTranslationFilePath); + + this.translationsRegistry[locale] = I18nLoader.unique([ + ...(this.translationsRegistry[locale] || []), + pluginTranslationFilePath, + ]); + } + + registerTranslationFiles(arrayOfPaths = []) { + arrayOfPaths.forEach(this.registerTranslationFile.bind(this)); + } + + getRegisteredTranslations() { + return Object.keys(this.translationsRegistry); + } + + pickLocaleByLanguageHeader(header) { + return pick(this.getRegisteredTranslations(), header); + } + + /** + * Return translations for a suitable locale from a user side locale list + * @param {...string} languageTags - BCP 47 language tags. The tags are listed in priority order as set in the Accept-Language header. + * @returns {Promise} translations - promise for an object where + * keys are translation keys and + * values are translations + * This object will contain all registered translations for the highest priority locale which is registered with the i18n module. + * This object can be empty if no locale in the language tags can be matched against the registered locales. + */ + async getTranslationsByLanguageHeader(header) { + return this.getTranslationsByLocale( + this.pickLocaleByLanguageHeader(header) + ); + } + + /** + * Returns translation messages by specified locale + * @param locale + * @returns {Promise} + */ + async getTranslationsByLocale(locale) { + const files = this.translationsRegistry[locale] || []; + const notLoadedFiles = files.filter(file => !this.loadedFiles[file]); + + if (notLoadedFiles.length) { + await this.loadAndCacheFiles(notLoadedFiles); + } + + return files.length + ? files.reduce( + (messages, file) => ({ + ...messages, + ...this.loadedFiles[file], + }), + { locale } + ) + : {}; + } + + /** + * Returns all translations for registered locales + * @return {Promise} translations - A Promise object where keys are + * the locale and values are Objects of translation keys and translations + */ + async getAllTranslations() { + const locales = this.getRegisteredTranslations(); + const translations = await Promise.all( + locales.map(locale => this.getTranslationsByLocale(locale)) + ); + + return locales.reduce( + (acc, locale, index) => ({ + ...acc, + [locale]: translations[index], + }), + {} + ); + } + + /** + * Loads translations files and adds them into "loadedFiles" cache + * @private + * @param {string[]} files + * @returns {Promise} + */ + async loadAndCacheFiles(files) { + const translations = await Promise.all(files.map(I18nLoader.loadFile)); + + this.loadedFiles = files.reduce( + (loadedFiles, file, index) => ({ + ...loadedFiles, + [file]: translations[index], + }), + this.loadedFiles + ); + } +} diff --git a/src/ui/ui_i18n/index.js b/packages/kbn-i18n/src/server/index.js similarity index 95% rename from src/ui/ui_i18n/index.js rename to packages/kbn-i18n/src/server/index.js index a4b45b9875326..cae9e22d83108 100644 --- a/src/ui/ui_i18n/index.js +++ b/packages/kbn-i18n/src/server/index.js @@ -17,5 +17,5 @@ * under the License. */ -export { I18n } from './i18n'; +export { I18nLoader } from './i18n_loader'; export { uiI18nMixin } from './ui_i18n_mixin'; diff --git a/src/ui/ui_i18n/ui_i18n_mixin.js b/packages/kbn-i18n/src/server/ui_i18n_mixin.js similarity index 67% rename from src/ui/ui_i18n/ui_i18n_mixin.js rename to packages/kbn-i18n/src/server/ui_i18n_mixin.js index f0c9caab2cabc..67d814ce88623 100644 --- a/src/ui/ui_i18n/ui_i18n_mixin.js +++ b/packages/kbn-i18n/src/server/ui_i18n_mixin.js @@ -17,25 +17,14 @@ * under the License. */ -import { defaults, compact } from 'lodash'; -import langParser from 'accept-language-parser'; - -import { I18n } from './i18n'; - -function acceptLanguageHeaderToBCP47Tags(header) { - return langParser.parse(header).map(lang => ( - compact([lang.code, lang.region, lang.script]).join('-') - )); -} +import { I18nLoader } from '@kbn/i18n/src/server'; export function uiI18nMixin(kbnServer, server, config) { const defaultLocale = config.get('i18n.defaultLocale'); - - const i18n = new I18n(defaultLocale); const { translationPaths = [] } = kbnServer.uiExports; - translationPaths.forEach(translationPath => { - i18n.registerTranslations(translationPath); - }); + const i18nLoader = new I18nLoader(); + + i18nLoader.registerTranslationFiles(translationPaths); /** * Fetch the translations matching the Accept-Language header for a requests. @@ -44,16 +33,19 @@ export function uiI18nMixin(kbnServer, server, config) { */ server.decorate('request', 'getUiTranslations', async function () { const header = this.headers['accept-language']; - const tags = acceptLanguageHeaderToBCP47Tags(header); - const requestedTranslations = await i18n.getTranslations(...tags); - const defaultTranslations = await i18n.getTranslationsForDefaultLocale(); - - return defaults( - {}, + const [ + defaultTranslations, requestedTranslations, - defaultTranslations - ); + ] = await Promise.all([ + i18nLoader.getTranslationsByLocale(defaultLocale), + i18nLoader.getTranslationsByLanguageHeader(header) + ]); + + return { + ...defaultTranslations, + ...requestedTranslations, + }; }); /** @@ -62,7 +54,6 @@ export function uiI18nMixin(kbnServer, server, config) { * @return {Promise>>} */ server.decorate('server', 'getAllUiTranslations', async () => { - return await i18n.getAllTranslations(); + return await i18nLoader.getAllTranslations(); }); - } diff --git a/packages/kbn-i18n/yarn.lock b/packages/kbn-i18n/yarn.lock index 026ddc9bf6ad2..cf0ac4bc277b1 100644 --- a/packages/kbn-i18n/yarn.lock +++ b/packages/kbn-i18n/yarn.lock @@ -2,6 +2,10 @@ # yarn lockfile v1 +accept-language-parser@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/accept-language-parser/-/accept-language-parser-1.5.0.tgz#8877c54040a8dcb59e0a07d9c1fde42298334791" + asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -16,7 +20,7 @@ encoding@^0.1.11: dependencies: iconv-lite "~0.4.13" -fbjs@^0.8.16, fbjs@^0.8.9: +fbjs@^0.8.16: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" dependencies: @@ -34,7 +38,7 @@ iconv-lite@~0.4.13: dependencies: safer-buffer ">= 2.1.2 < 3" -intl-format-cache@2.1.0, intl-format-cache@^2.0.5: +intl-format-cache@^2.0.5, intl-format-cache@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-2.1.0.tgz#04a369fecbfad6da6005bae1f14333332dcf9316" @@ -42,7 +46,7 @@ intl-messageformat-parser@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075" -intl-messageformat@2.2.0, intl-messageformat@^2.0.0, intl-messageformat@^2.1.0: +intl-messageformat@^2.0.0, intl-messageformat@^2.1.0, intl-messageformat@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc" dependencies: @@ -98,13 +102,7 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@15.5.8: - version "15.5.8" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" - dependencies: - fbjs "^0.8.9" - -prop-types@^15.6.0: +prop-types@^15.5.8, prop-types@^15.6.0: version "15.6.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" dependencies: @@ -112,7 +110,7 @@ prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" -react-intl@2.4.0: +react-intl@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.4.0.tgz#66c14dc9df9a73b2fbbfbd6021726e80a613eb15" dependencies: diff --git a/src/ui/ui_i18n/i18n.js b/src/ui/ui_i18n/i18n.js deleted file mode 100644 index 27c881c3565ce..0000000000000 --- a/src/ui/ui_i18n/i18n.js +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import path from 'path'; -import Promise from 'bluebird'; -import { readFile } from 'fs'; -import _ from 'lodash'; - -const asyncReadFile = Promise.promisify(readFile); - -const TRANSLATION_FILE_EXTENSION = '.json'; - -function getLocaleFromFileName(fullFileName) { - if (_.isEmpty(fullFileName)) throw new Error('Filename empty'); - - const fileExt = path.extname(fullFileName); - if (fileExt.length <= 0 || fileExt !== TRANSLATION_FILE_EXTENSION) { - throw new Error('Translations must be in a JSON file. File being registered is ' + fullFileName); - } - - return path.basename(fullFileName, TRANSLATION_FILE_EXTENSION); -} - -function getBestLocaleMatch(languageTag, registeredLocales) { - if (_.contains(registeredLocales, languageTag)) { - return languageTag; - } - - // Find the first registered locale that begins with one of the language codes from the provided language tag. - // For example, if there is an 'en' language code, it would match an 'en-US' registered locale. - const languageCode = _.first(languageTag.split('-')) || []; - return _.find(registeredLocales, (locale) => _.startsWith(locale, languageCode)); -} - -export class I18n { - static async getAllTranslationsFromPaths(paths) { - const i18n = new I18n(); - - paths.forEach(path => { - i18n.registerTranslations(path); - }); - - return await i18n.getAllTranslations(); - } - - _registeredTranslations = {}; - - constructor(defaultLocale = 'en') { - this._defaultLocale = defaultLocale; - } - - /** - * Return all translations for registered locales - * @return {Promise} translations - A Promise object where keys are - * the locale and values are Objects - * of translation keys and translations - */ - getAllTranslations() { - const localeTranslations = {}; - - const locales = this._getRegisteredTranslationLocales(); - const translations = _.map(locales, (locale) => { - return this._getTranslationsForLocale(locale) - .then(function (translations) { - localeTranslations[locale] = translations; - }); - }); - - return Promise.all(translations) - .then(() => _.assign({}, localeTranslations)); - } - - /** - * Return translations for a suitable locale from a user side locale list - * @param {...string} languageTags - BCP 47 language tags. The tags are listed in priority order as set in the Accept-Language header. - * @returns {Promise} translations - promise for an object where - * keys are translation keys and - * values are translations - * This object will contain all registered translations for the highest priority locale which is registered with the i18n module. - * This object can be empty if no locale in the language tags can be matched against the registered locales. - */ - getTranslations(...languageTags) { - const locale = this._getTranslationLocale(languageTags); - return this._getTranslationsForLocale(locale); - } - - /** - * Return all translations registered for the default locale. - * @returns {Promise} translations - promise for an object where - * keys are translation keys and - * values are translations - */ - getTranslationsForDefaultLocale() { - return this._getTranslationsForLocale(this._defaultLocale); - } - - /** - * The translation file is registered with i18n plugin. The plugin contains a list of registered translation file paths per language. - * @param {String} absolutePluginTranslationFilePath - Absolute path to the translation file to register. - */ - registerTranslations(absolutePluginTranslationFilePath) { - if (!path.isAbsolute(absolutePluginTranslationFilePath)) { - throw new TypeError( - 'Paths to translation files must be absolute. ' + - `Got relative path: "${absolutePluginTranslationFilePath}"` - ); - } - - const locale = getLocaleFromFileName(absolutePluginTranslationFilePath); - - this._registeredTranslations[locale] = - _.uniq(_.get(this._registeredTranslations, locale, []).concat(absolutePluginTranslationFilePath)); - } - - _getRegisteredTranslationLocales() { - return Object.keys(this._registeredTranslations); - } - - _getTranslationLocale(languageTags) { - let locale = ''; - const registeredLocales = this._getRegisteredTranslationLocales(); - _.forEach(languageTags, (tag) => { - locale = locale || getBestLocaleMatch(tag, registeredLocales); - }); - return locale; - } - - _getTranslationsForLocale(locale) { - if (!this._registeredTranslations.hasOwnProperty(locale)) { - return Promise.resolve({}); - } - - const translationFiles = this._registeredTranslations[locale]; - const translations = _.map(translationFiles, (filename) => { - return asyncReadFile(filename, 'utf8') - .then(fileContents => JSON.parse(fileContents)) - .catch(SyntaxError, function () { - throw new Error('Invalid json in ' + filename); - }) - .catch(function () { - throw new Error('Cannot read file ' + filename); - }); - }); - - return Promise.all(translations) - .then(translations => _.assign({ locale }, ...translations)); - } -} diff --git a/src/ui/ui_mixin.js b/src/ui/ui_mixin.js index 8015a44b1cad4..7aa7653b19821 100644 --- a/src/ui/ui_mixin.js +++ b/src/ui/ui_mixin.js @@ -17,11 +17,12 @@ * under the License. */ +import { uiI18nMixin } from '@kbn/i18n/src/server'; + import { uiExportsMixin } from './ui_exports'; import { fieldFormatsMixin } from './field_formats'; import { tutorialsMixin } from './tutorials_mixin'; import { uiAppsMixin } from './ui_apps'; -import { uiI18nMixin } from './ui_i18n'; import { uiBundlesMixin } from './ui_bundles'; import { uiNavLinksMixin } from './ui_nav_links'; import { uiRenderMixin } from './ui_render'; diff --git a/src/ui/ui_render/ui_render_mixin.js b/src/ui/ui_render/ui_render_mixin.js index 2c080ccda3a49..1d67a870a2d04 100644 --- a/src/ui/ui_render/ui_render_mixin.js +++ b/src/ui/ui_render/ui_render_mixin.js @@ -150,7 +150,7 @@ export function uiRenderMixin(kbnServer, server, config) { injectedVarsOverrides }), bundlePath: `${config.get('server.basePath')}/bundles`, - i18n: i18n.translate.bind(i18n), + i18n: (id, options) => i18n.translate(id, options), }); } catch (err) { reply(err); diff --git a/yarn.lock b/yarn.lock index 398cae6a69a2f..f7d75dd838aba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -375,9 +375,9 @@ abbrev@1.0.x: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" -accept-language-parser@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/accept-language-parser/-/accept-language-parser-1.2.0.tgz#6a18942acab3f090a4a09590e03101a99fa22bff" +accept-language-parser@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/accept-language-parser/-/accept-language-parser-1.5.0.tgz#8877c54040a8dcb59e0a07d9c1fde42298334791" accept@2.x.x: version "2.1.4" @@ -6340,7 +6340,7 @@ interpret@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" -intl-format-cache@2.1.0, intl-format-cache@^2.0.5: +intl-format-cache@^2.0.5, intl-format-cache@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-2.1.0.tgz#04a369fecbfad6da6005bae1f14333332dcf9316" @@ -6348,7 +6348,7 @@ intl-messageformat-parser@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075" -intl-messageformat@2.2.0, intl-messageformat@^2.0.0, intl-messageformat@^2.1.0: +intl-messageformat@^2.0.0, intl-messageformat@^2.1.0, intl-messageformat@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc" dependencies: @@ -10390,7 +10390,7 @@ react-input-range@^1.3.0: autobind-decorator "^1.3.4" prop-types "^15.5.8" -react-intl@2.4.0: +react-intl@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.4.0.tgz#66c14dc9df9a73b2fbbfbd6021726e80a613eb15" dependencies: From be7e201eca29385845959ba3e691cbd81c48c468 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Tue, 5 Jun 2018 17:37:03 +0300 Subject: [PATCH 003/186] kbn-i18n refactoring --- packages/kbn-i18n/README.md | 2 +- packages/kbn-i18n/src/angular/directive.js | 6 +- packages/kbn-i18n/src/angular/filter.js | 6 +- packages/kbn-i18n/src/angular/index.js | 7 +- packages/kbn-i18n/src/angular/module.js | 30 +++ packages/kbn-i18n/src/angular/provider.js | 8 +- packages/kbn-i18n/src/core.js | 229 ------------------ packages/kbn-i18n/src/i18n.js | 215 +++++++++++++++- packages/kbn-i18n/src/index.js | 9 +- packages/kbn-i18n/src/react/context.js | 45 ++++ packages/kbn-i18n/src/react/index.js | 13 +- packages/kbn-i18n/src/react/provider.js | 7 +- packages/kbn-i18n/src/server/ui_i18n_mixin.js | 11 +- src/ui/public/autoload/modules.js | 2 +- src/ui/public/i18n/index.js | 33 +++ src/ui/ui_render/ui_render_mixin.js | 4 +- 16 files changed, 362 insertions(+), 265 deletions(-) create mode 100644 packages/kbn-i18n/src/angular/module.js delete mode 100644 packages/kbn-i18n/src/core.js create mode 100644 packages/kbn-i18n/src/react/context.js create mode 100644 src/ui/public/i18n/index.js diff --git a/packages/kbn-i18n/README.md b/packages/kbn-i18n/README.md index b5f90c07f693f..8a595ba9c5a03 100644 --- a/packages/kbn-i18n/README.md +++ b/packages/kbn-i18n/README.md @@ -197,7 +197,7 @@ ReactDOM.render( ... - , + , document.getElementById('container') ); ``` diff --git a/packages/kbn-i18n/src/angular/directive.js b/packages/kbn-i18n/src/angular/directive.js index 8f59dc22e044f..f9421814d9817 100644 --- a/packages/kbn-i18n/src/angular/directive.js +++ b/packages/kbn-i18n/src/angular/directive.js @@ -17,9 +17,7 @@ * under the License. */ -import { uiModules } from 'ui/modules'; - -uiModules.get('i18n').directive('i18nId', function(i18n) { +export function i18nDirective(i18n) { return { restrict: 'A', scope: { @@ -42,4 +40,4 @@ uiModules.get('i18n').directive('i18nId', function(i18n) { }); }, }; -}); +} diff --git a/packages/kbn-i18n/src/angular/filter.js b/packages/kbn-i18n/src/angular/filter.js index 5b41fa230c662..cdbe869237b1a 100644 --- a/packages/kbn-i18n/src/angular/filter.js +++ b/packages/kbn-i18n/src/angular/filter.js @@ -17,13 +17,11 @@ * under the License. */ -import { uiModules } from 'ui/modules'; - -uiModules.get('i18n').filter('i18n', function(i18n) { +export function i18nFilter(i18n) { return function(id, { defaultMessage = '', values = {} } = {}) { return i18n(id, { values, defaultMessage, }); }; -}); +} diff --git a/packages/kbn-i18n/src/angular/index.js b/packages/kbn-i18n/src/angular/index.js index 2e32860bb45b5..b34bb05c86aa7 100644 --- a/packages/kbn-i18n/src/angular/index.js +++ b/packages/kbn-i18n/src/angular/index.js @@ -17,6 +17,7 @@ * under the License. */ -import './provider'; -import './directive'; -import './filter'; +export { i18nProvider } from './provider'; +export { i18nFilter } from './filter'; +export { i18nDirective } from './directive'; +export { i18nModule } from './module'; diff --git a/packages/kbn-i18n/src/angular/module.js b/packages/kbn-i18n/src/angular/module.js new file mode 100644 index 0000000000000..cba27444efe3c --- /dev/null +++ b/packages/kbn-i18n/src/angular/module.js @@ -0,0 +1,30 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import angular from 'angular'; + +import { i18nProvider } from './provider'; +import { i18nFilter } from './filter'; +import { i18nDirective } from './directive'; + +export const i18nModule = angular + .module('kbn-i18n', []) + .provider('i18n', i18nProvider) + .filter('i18n', i18nFilter) + .directive('i18nId', i18nDirective); diff --git a/packages/kbn-i18n/src/angular/provider.js b/packages/kbn-i18n/src/angular/provider.js index dcb480a145b7a..de18a150ad216 100644 --- a/packages/kbn-i18n/src/angular/provider.js +++ b/packages/kbn-i18n/src/angular/provider.js @@ -17,11 +17,9 @@ * under the License. */ -import { uiModules } from 'ui/modules'; +import { i18n } from '../i18n'; -import i18n from '../i18n'; - -uiModules.get('kbn-i18n').provider('i18n', function() { +export function i18nProvider() { this.addMessages = function(messages, locale) { i18n.addMessages(messages, locale); }; @@ -61,4 +59,4 @@ uiModules.get('kbn-i18n').provider('i18n', function() { this.$get = function() { return i18n.translate.bind(i18n); }; -}); +} diff --git a/packages/kbn-i18n/src/core.js b/packages/kbn-i18n/src/core.js deleted file mode 100644 index 8a5dd5897ceab..0000000000000 --- a/packages/kbn-i18n/src/core.js +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - @typedef Messages - @type {object} - @property {string} [locale] - locale of the messages - @property {object} [localeData] - localization rules for IntlMessageFormat - */ - -import IntlMessageFormat from 'intl-messageformat'; -import memoizeIntlConstructor from 'intl-format-cache'; - -const getMessageById = (messages, id) => - id.split('.').reduce((val, key) => (val ? val[key] : null), messages); - -const hasValues = values => Object.keys(values).length > 0; - -const addLocaleData = localeData => { - if (localeData && localeData.locale) { - IntlMessageFormat.__addLocaleData(localeData); - } -}; - -const showError = error => { - if (process.env.NODE_ENV !== 'production') { - console.error(error); - } -}; - -const getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); - -export default class I18n { - static EN_LOCALE = 'en'; - static LOCALE_DELIMITER = '-'; - - static normalizeLocale(locale = '') { - return locale.toLowerCase().replace('_', I18n.LOCALE_DELIMITER); - } - - /** - * Platform agnostic abstraction that helps to supply locale data to - * UI frameworks and provides methods for the direct translation. - * @param {Messages} messages - * @param {string} [locale = messages.locale||'en'] - */ - constructor(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { - this.currentLocale = I18n.normalizeLocale(locale); - this.messages = { [this.currentLocale]: messages }; - this.defaultLocale = I18n.EN_LOCALE; - this.formats = {}; - - if (messages.localeData) { - addLocaleData(messages.localeData); - } - } - - /** - * Provides a way to register translations with the engine - * @param {Messages} messages - * @param {string} [locale = messages.locale||'en'] - */ - addMessages(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { - const normalizedLocale = I18n.normalizeLocale(locale); - - this.messages[normalizedLocale] = { - ...this.messages[normalizedLocale], - ...messages, - }; - - if (messages.localeData) { - addLocaleData(messages.localeData); - } - } - - /** - * Returns messages for the current language - * @returns {Messages} messages - */ - getMessages() { - return this.messages[this.currentLocale]; - } - - /** - * Tells the engine which language to use by given language key - * @param {string} locale - */ - setLocale(locale) { - this.currentLocale = I18n.normalizeLocale(locale); - } - - /** - * Returns the current locale - * @returns {string} locale - */ - getLocale() { - return this.currentLocale; - } - - /** - * Tells the library which language to fallback when missing translations - * @param {string} locale - */ - setDefaultLocale(locale) { - this.defaultLocale = I18n.normalizeLocale(locale); - } - - /** - * Returns the default locale - * @returns {string} defaultLocale - */ - getDefaultLocale() { - return this.defaultLocale; - } - - /** - * Supplies a set of options to the underlying formatter - * @param {object} formats - */ - setFormats(formats) { - this.formats = formats; - } - - /** - * Returns current formats - * @returns {object} formats - */ - getFormats() { - return this.formats; - } - - /** - * Returns array of locales having translations - * @returns {string[]} locales - */ - getRegisteredLocales() { - return Object.keys(this.messages); - } - - /** - * Translate message by id - * @param {string} id - translation id to be translated - * @param {object} [options] - * @param {object} [options.values] - values to pass into translation - * @param {string} [options.defaultMessage] - will be used unless translation was successful - * @returns {string} - */ - translate(id, { values = {}, defaultMessage = '' } = {}) { - if (!id) { - showError('[I18n] An `id` must be provided to translate a message.'); - } - - const message = getMessageById(this.getMessages(), id); - - if (!hasValues(values) && process.env.NODE_ENV === 'production') { - return message || defaultMessage || id; - } - - let formattedMessage; - - if (message) { - try { - const msg = getMessageFormat( - message, - this.getLocale(), - this.getFormats() - ); - - formattedMessage = msg.format(values); - } catch (e) { - showError( - `[I18n] Error formatting message: "${id}" for locale: "${this.getLocale()}"` + - (defaultMessage ? ', using default message as fallback.' : '') + - `\n${e}` - ); - } - } else { - if (!defaultMessage || this.getLocale() !== this.getDefaultLocale()) { - showError( - `[I18n] Missing message: "${id}" for locale: "${this.getLocale()}"` + - (defaultMessage ? ', using default message as fallback.' : '') - ); - } - } - - if (!formattedMessage && defaultMessage) { - try { - const msg = getMessageFormat( - defaultMessage, - this.getDefaultLocale(), - this.getFormats() - ); - - formattedMessage = msg.format(values); - } catch (e) { - showError( - `[I18n] Error formatting the default message for: "${id}"\n${e}` - ); - } - } - - if (!formattedMessage) { - showError( - `[I18n] Cannot format message: "${id}", ` + - `using message ${ - message || defaultMessage ? 'source' : 'id' - } as fallback.` - ); - } - - return formattedMessage || message || defaultMessage || id; - } -} diff --git a/packages/kbn-i18n/src/i18n.js b/packages/kbn-i18n/src/i18n.js index 93a20f393552d..5ea9e94b9dff0 100644 --- a/packages/kbn-i18n/src/i18n.js +++ b/packages/kbn-i18n/src/i18n.js @@ -17,8 +17,217 @@ * under the License. */ -import { metadata } from 'ui/metadata'; +/** + @typedef Messages + @type {object} + @property {string} [locale] - locale of the messages + @property {object} [localeData] - localization rules for IntlMessageFormat + */ + +import IntlMessageFormat from 'intl-messageformat'; +import memoizeIntlConstructor from 'intl-format-cache'; + +const getMessageById = (messages, id) => + id.split('.').reduce((val, key) => (val ? val[key] : null), messages); + +const hasValues = values => Object.keys(values).length > 0; + +const addLocaleData = localeData => { + if (localeData && localeData.locale) { + IntlMessageFormat.__addLocaleData(localeData); + } +}; + +const showError = error => { + if (process.env.NODE_ENV !== 'production') { + console.error(error); + } +}; + +const getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); + +export class I18n { + static EN_LOCALE = 'en'; + static LOCALE_DELIMITER = '-'; + + static normalizeLocale(locale = '') { + return locale.toLowerCase().replace('_', I18n.LOCALE_DELIMITER); + } + + /** + * Platform agnostic abstraction that helps to supply locale data to + * UI frameworks and provides methods for the direct translation. + * @param {Messages} messages + * @param {string} [locale = messages.locale||'en'] + */ + constructor(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { + this.currentLocale = I18n.normalizeLocale(locale); + this.messages = { [this.currentLocale]: messages }; + this.defaultLocale = I18n.EN_LOCALE; + this.formats = {}; + IntlMessageFormat.defaultLocale = this.defaultLocale; + + if (messages.localeData) { + addLocaleData(messages.localeData); + } + } + + /** + * Provides a way to register translations with the engine + * @param {Messages} messages + * @param {string} [locale = messages.locale||'en'] + */ + addMessages(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { + const normalizedLocale = I18n.normalizeLocale(locale); + + this.messages[normalizedLocale] = { + ...this.messages[normalizedLocale], + ...messages, + }; + + if (messages.localeData) { + addLocaleData(messages.localeData); + } + } + + /** + * Returns messages for the current language + * @returns {Messages} messages + */ + getMessages() { + return this.messages[this.currentLocale]; + } + + /** + * Tells the engine which language to use by given language key + * @param {string} locale + */ + setLocale(locale) { + this.currentLocale = I18n.normalizeLocale(locale); + } + + /** + * Returns the current locale + * @returns {string} locale + */ + getLocale() { + return this.currentLocale; + } + + /** + * Tells the library which language to fallback when missing translations + * @param {string} locale + */ + setDefaultLocale(locale) { + this.defaultLocale = I18n.normalizeLocale(locale); + IntlMessageFormat.defaultLocale = this.defaultLocale; + } + + /** + * Returns the default locale + * @returns {string} defaultLocale + */ + getDefaultLocale() { + return this.defaultLocale; + } + + /** + * Supplies a set of options to the underlying formatter + * @param {object} formats + */ + setFormats(formats) { + this.formats = formats; + } + + /** + * Returns current formats + * @returns {object} formats + */ + getFormats() { + return this.formats; + } + + /** + * Returns array of locales having translations + * @returns {string[]} locales + */ + getRegisteredLocales() { + return Object.keys(this.messages); + } + + /** + * Translate message by id + * @param {string} id - translation id to be translated + * @param {object} [options] + * @param {object} [options.values] - values to pass into translation + * @param {string} [options.defaultMessage] - will be used unless translation was successful + * @returns {string} + */ + translate(id, { values = {}, defaultMessage = '' } = {}) { + if (!id) { + showError('[I18n] An `id` must be provided to translate a message.'); + } + + const message = getMessageById(this.getMessages(), id); + + if (!hasValues(values) && process.env.NODE_ENV === 'production') { + return message || defaultMessage || id; + } + + let formattedMessage; + + if (message) { + try { + const msg = getMessageFormat( + message, + this.getLocale(), + this.getFormats() + ); + + formattedMessage = msg.format(values); + } catch (e) { + showError( + `[I18n] Error formatting message: "${id}" for locale: "${this.getLocale()}"` + + (defaultMessage ? ', using default message as fallback.' : '') + + `\n${e}` + ); + } + } else { + if (!defaultMessage || this.getLocale() !== this.getDefaultLocale()) { + showError( + `[I18n] Missing message: "${id}" for locale: "${this.getLocale()}"` + + (defaultMessage ? ', using default message as fallback.' : '') + ); + } + } + + if (!formattedMessage && defaultMessage) { + try { + const msg = getMessageFormat( + defaultMessage, + this.getDefaultLocale(), + this.getFormats() + ); + + formattedMessage = msg.format(values); + } catch (e) { + showError( + `[I18n] Error formatting the default message for: "${id}"\n${e}` + ); + } + } + + if (!formattedMessage) { + showError( + `[I18n] Cannot format message: "${id}", ` + + `using message ${ + message || defaultMessage ? 'source' : 'id' + } as fallback.` + ); + } -import I18n from './core'; + return formattedMessage || message || defaultMessage || id; + } +} -export default new I18n(metadata.translations); +export const i18n = new I18n(); diff --git a/packages/kbn-i18n/src/index.js b/packages/kbn-i18n/src/index.js index a25487f483762..73ca7604fde48 100644 --- a/packages/kbn-i18n/src/index.js +++ b/packages/kbn-i18n/src/index.js @@ -17,9 +17,10 @@ * under the License. */ -import './angular'; +import * as angular from './angular'; +import * as react from './react'; -export * from './react'; +export const AngularI18n = angular; +export const ReactI18n = react; -export { default as I18n } from './core'; -export { default as i18n } from './i18n'; +export { I18n, i18n } from './i18n'; diff --git a/packages/kbn-i18n/src/react/context.js b/packages/kbn-i18n/src/react/context.js new file mode 100644 index 0000000000000..1f350ff680609 --- /dev/null +++ b/packages/kbn-i18n/src/react/context.js @@ -0,0 +1,45 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { PureComponent } from 'react'; +import PropTypes from 'prop-types'; + +/** + * Provides intl context to a child component using React render callback pattern + * @example + * + * {intl => ( + * + * )} + * + */ +export class I18nContext extends PureComponent { + static propTypes = { + children: PropTypes.func.isRequired, + }; + + render() { + return this.props.children(this.context.intl); + } +} diff --git a/packages/kbn-i18n/src/react/index.js b/packages/kbn-i18n/src/react/index.js index a6569e047c5e5..f80dd27268f96 100644 --- a/packages/kbn-i18n/src/react/index.js +++ b/packages/kbn-i18n/src/react/index.js @@ -17,5 +17,16 @@ * under the License. */ -export * from 'react-intl'; +export { + intlShape, + FormattedDate, + FormattedTime, + FormattedRelative, + FormattedNumber, + FormattedPlural, + FormattedMessage, + FormattedHTMLMessage, +} from 'react-intl'; + export { I18nProvider } from './provider'; +export { I18nContext } from './context'; diff --git a/packages/kbn-i18n/src/react/provider.js b/packages/kbn-i18n/src/react/provider.js index 3563a49e4b2a7..0fe292af15b54 100644 --- a/packages/kbn-i18n/src/react/provider.js +++ b/packages/kbn-i18n/src/react/provider.js @@ -21,8 +21,13 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { IntlProvider } from 'react-intl'; -import i18n from '../i18n'; +import { i18n } from '../i18n'; +/** + * The library uses the provider pattern to scope an i18n context to a tree + * of components. This component is used to setup the i18n context for a tree. + * IntlProvider should wrap react app's root component (inside each react render method). + */ export class I18nProvider extends PureComponent { static propTypes = { children: PropTypes.object, diff --git a/packages/kbn-i18n/src/server/ui_i18n_mixin.js b/packages/kbn-i18n/src/server/ui_i18n_mixin.js index 67d814ce88623..33d37b23793d9 100644 --- a/packages/kbn-i18n/src/server/ui_i18n_mixin.js +++ b/packages/kbn-i18n/src/server/ui_i18n_mixin.js @@ -17,7 +17,7 @@ * under the License. */ -import { I18nLoader } from '@kbn/i18n/src/server'; +import { I18nLoader } from './i18n_loader'; export function uiI18nMixin(kbnServer, server, config) { const defaultLocale = config.get('i18n.defaultLocale'); @@ -31,15 +31,12 @@ export function uiI18nMixin(kbnServer, server, config) { * @name request.getUiTranslations * @returns {Promise>} translations */ - server.decorate('request', 'getUiTranslations', async function () { + server.decorate('request', 'getUiTranslations', async function() { const header = this.headers['accept-language']; - const [ - defaultTranslations, - requestedTranslations, - ] = await Promise.all([ + const [defaultTranslations, requestedTranslations] = await Promise.all([ i18nLoader.getTranslationsByLocale(defaultLocale), - i18nLoader.getTranslationsByLanguageHeader(header) + i18nLoader.getTranslationsByLanguageHeader(header), ]); return { diff --git a/src/ui/public/autoload/modules.js b/src/ui/public/autoload/modules.js index 19ef546f8a195..e4058ec22a427 100644 --- a/src/ui/public/autoload/modules.js +++ b/src/ui/public/autoload/modules.js @@ -18,7 +18,6 @@ */ import 'angular'; -import '@kbn/i18n'; import '../chrome'; import '../bind'; import '../kbn_top_nav'; @@ -54,3 +53,4 @@ import '../validate_date_interval'; import '../watch_multi'; import '../courier/saved_object/ui/saved_object_save_as_checkbox'; import '../react_components'; +import '../i18n'; diff --git a/src/ui/public/i18n/index.js b/src/ui/public/i18n/index.js new file mode 100644 index 0000000000000..3f90e0c1c4f1e --- /dev/null +++ b/src/ui/public/i18n/index.js @@ -0,0 +1,33 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { AngularI18n, i18n } from '@kbn/i18n'; + +import { uiModules } from 'ui/modules'; +import { metadata } from 'ui/metadata'; + +if (metadata.translations) { + i18n.addMessages(metadata.translations); + + if (metadata.translations.locale) { + i18n.setLocale(metadata.translations.locale); + } +} + +uiModules.get('i18n', [AngularI18n.i18nModule.name]); diff --git a/src/ui/ui_render/ui_render_mixin.js b/src/ui/ui_render/ui_render_mixin.js index 1d67a870a2d04..06c74286023e2 100644 --- a/src/ui/ui_render/ui_render_mixin.js +++ b/src/ui/ui_render/ui_render_mixin.js @@ -17,11 +17,11 @@ * under the License. */ -import { defaults, get } from 'lodash'; +import { defaults } from 'lodash'; import { props, reduce as reduceAsync } from 'bluebird'; import Boom from 'boom'; import { resolve } from 'path'; -import I18n from '@kbn/i18n/src/core'; +import { I18n } from '@kbn/i18n/src/i18n'; import { AppBootstrap } from './bootstrap'; export function uiRenderMixin(kbnServer, server, config) { From e55b75fd925041f6ac8a3b014ff7fda69594aa73 Mon Sep 17 00:00:00 2001 From: Maryia Lapata Date: Tue, 5 Jun 2018 17:37:36 +0300 Subject: [PATCH 004/186] integration i18n-ingine with index pattern tab --- .eslintignore | 1 + .../components/header/header.js | 20 +++++- .../components/header/header.js | 43 ++++++++++--- .../components/indices_list/indices_list.js | 8 ++- .../loading_indices/loading_indices.js | 12 +++- .../status_message/status_message.js | 62 ++++++++++++++++--- .../step_index_pattern/step_index_pattern.js | 29 +++++++-- .../create_index_pattern_wizard/render.js | 12 ++-- 8 files changed, 159 insertions(+), 28 deletions(-) diff --git a/.eslintignore b/.eslintignore index 4dae1a36513ee..ef01aad717779 100644 --- a/.eslintignore +++ b/.eslintignore @@ -28,3 +28,4 @@ bower_components /x-pack/plugins/**/__tests__/fixtures/** **/*.js.snap !/.eslintrc.js +* diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js index 7264c606ea158..234ea96fe722d 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js @@ -29,6 +29,8 @@ import { EuiSwitch, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n'; + export const Header = ({ isIncludingSystemIndices, onChangeIncludingSystemIndices, @@ -36,21 +38,33 @@ export const Header = ({
-

Create index pattern

+

+ +

+

- Kibana uses index patterns to retrieve data from Elasticsearch indices for things like visualizations. +

} checked={isIncludingSystemIndices} onChange={onChangeIncludingSystemIndices} /> diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js index 68914fcfd0a3a..b5f2cd7d6acf2 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js @@ -30,7 +30,13 @@ import { EuiFieldText, } from '@elastic/eui'; -export const Header = ({ +import { + injectIntl, + FormattedMessage +} from '@kbn/i18n'; + +const HeaderComponent = ({ + intl, isInputInvalid, errors, characterList, @@ -43,7 +49,10 @@ export const Header = ({

- Step 1 of 2: Define index pattern +

@@ -53,19 +62,34 @@ export const Header = ({ isInvalid={isInputInvalid} > } isInvalid={isInputInvalid} error={errors} helpText={
-

You can use a * as a wildcard in your index pattern.

-

You can't use spaces or the characters {characterList}.

+

+ * }} + /> +

+

+ ', characterList: {characterList} }} + /> +

} > - Next step +
); + +export const Header = injectIntl(HeaderComponent); diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js index f04de5d2fe80c..1c53326e19e74 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js @@ -40,6 +40,8 @@ import { Pager } from '@elastic/eui/lib/services'; +import { FormattedMessage } from '@kbn/i18n'; + export class IndicesList extends Component { static propTypes = { indices: PropTypes.array.isRequired, @@ -98,7 +100,11 @@ export class IndicesList extends Component { iconSide="right" onClick={this.openPerPageControl} > - Rows per page: {perPage} + ); diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js index dfbe4fea78bc2..0af564d545241 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js @@ -27,6 +27,8 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n'; + export const LoadingIndices = ({ ...rest }) => ( ( - Looking for matching indices... + - Just a sec... + diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js index 4bd24c0c07b0d..90802265a79cc 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js @@ -25,6 +25,8 @@ import { EuiIcon, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n'; + export const StatusMessage = ({ matchedIndices: { allIndices = [], @@ -45,14 +47,28 @@ export const StatusMessage = ({ if (allIndices.length > 1) { statusMessage = ( - Your index pattern can match any of your {allIndices.length} indices, below. + + ) }} + /> ); } else if (!isIncludingSystemIndices) { statusMessage = ( - No Elasticsearch indices match your pattern. To view the matching system indices, toggle the switch in the upper right. + ); } @@ -61,6 +77,10 @@ export const StatusMessage = ({ statusMessage = ( No Elasticsearch indices match your pattern. + ); } @@ -71,9 +91,25 @@ export const StatusMessage = ({ statusMessage = (   - Success! + + +   - Your index pattern matches {exactMatchedIndices.length} {exactMatchedIndices.length > 1 ? 'indices' : 'index'}. + + ) + }} + /> ); } @@ -82,11 +118,23 @@ export const StatusMessage = ({ statusColor = 'default'; statusMessage = ( - Your index pattern doesn't match any indices, but you have  + ', space:   }} + /> - {partialMatchedIndices.length} {partialMatchedIndices.length > 1 ? 'indices ' : 'index '} + - which {partialMatchedIndices.length > 1 ? 'look' : 'looks'} similar. + ); } diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js index 6acd867e8fd6d..ad2b35a03358b 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js @@ -38,7 +38,12 @@ import { EuiCallOut, } from '@elastic/eui'; -export class StepIndexPattern extends Component { +import { + injectIntl, + FormattedMessage +} from '@kbn/i18n'; + +class StepIndexPatternComponent extends Component { static propTypes = { allIndices: PropTypes.array.isRequired, isIncludingSystemIndices: PropTypes.bool.isRequired, @@ -46,6 +51,7 @@ export class StepIndexPattern extends Component { savedObjectsClient: PropTypes.object.isRequired, goToNextStep: PropTypes.func.isRequired, initialQuery: PropTypes.string, + intl: PropTypes.object } static defaultProps = { @@ -205,11 +211,19 @@ export class StepIndexPattern extends Component { return ( } iconType="help" color="warning" > -

There's already an index pattern called `{query}`

+

', query }} + /> +

); } @@ -227,7 +241,12 @@ export class StepIndexPattern extends Component { containsErrors = true; } else if (!containsInvalidCharacters(query, ILLEGAL_CHARACTERS)) { - errors.push(`An index pattern cannot contain spaces or the characters: ${characterList}`); + errors.push(this.props.intl.formatMessage({ + id: 'management.indices.indexPattern.error.invalidCharacters', + defaultMessage: `An index pattern cannot contain spaces or the characters: {characterList}` + }, + { characterList } + )); containsErrors = true; } @@ -273,3 +292,5 @@ export class StepIndexPattern extends Component { ); } } + +export const StepIndexPattern = injectIntl(StepIndexPatternComponent); diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js index 192afb5174242..9fec6997b1371 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js @@ -21,6 +21,8 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { CreateIndexPatternWizard } from './create_index_pattern_wizard'; +import { I18nProvider } from '@kbn/i18n'; + const CREATE_INDEX_PATTERN_DOM_ELEMENT_ID = 'createIndexPatternReact'; export function renderCreateIndexPatternWizard( @@ -33,10 +35,12 @@ export function renderCreateIndexPatternWizard( } render( - , + + + , node, ); } From a6eb6cded3b90027787cafd81899bae2febbe1f2 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Wed, 6 Jun 2018 12:35:48 +0300 Subject: [PATCH 005/186] Fix react i18n context and update doc --- packages/kbn-i18n/README.md | 8 +++++--- packages/kbn-i18n/src/react/context.js | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/kbn-i18n/README.md b/packages/kbn-i18n/README.md index 8a595ba9c5a03..202f01e59c05d 100644 --- a/packages/kbn-i18n/README.md +++ b/packages/kbn-i18n/README.md @@ -189,8 +189,9 @@ that uses I18n engine under the hood: ```js import React from 'react'; import ReactDOM from 'react-dom'; +import { ReactI18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n'; +const { I18nProvider } = ReactI18n; ReactDOM.render( @@ -205,8 +206,9 @@ ReactDOM.render( After that we can use `FormattedMessage` components inside `RootComponent`: ```js import React, { Component } from 'react'; +import { ReactI18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n'; +const { FormattedMessage } = ReactI18n; class RootComponent extends Component { constructor(props) { @@ -311,7 +313,7 @@ for all 200+ languages is loaded along with the library) and pass the translatio messages into the constructor: ```js -import I18n from '@kbn/i18n/src/core'; +import { I18n } from '@kbn/i18n/src/i18n'; const i18n = new I18n(messages); ``` diff --git a/packages/kbn-i18n/src/react/context.js b/packages/kbn-i18n/src/react/context.js index 1f350ff680609..df7c8877725fb 100644 --- a/packages/kbn-i18n/src/react/context.js +++ b/packages/kbn-i18n/src/react/context.js @@ -19,6 +19,7 @@ import { PureComponent } from 'react'; import PropTypes from 'prop-types'; +import { intlShape } from 'react-intl'; /** * Provides intl context to a child component using React render callback pattern @@ -39,6 +40,10 @@ export class I18nContext extends PureComponent { children: PropTypes.func.isRequired, }; + static contextTypes = { + intl: intlShape, + }; + render() { return this.props.children(this.context.intl); } From d918d0cfd22aadfaa956a69ed87426425f175d67 Mon Sep 17 00:00:00 2001 From: Maryia Lapata Date: Wed, 6 Jun 2018 13:17:40 +0300 Subject: [PATCH 006/186] Adjustments according changed API --- .../components/header/header.js | 10 +++-- .../components/header/header.js | 43 ++++++++++--------- .../components/indices_list/indices_list.js | 6 ++- .../loading_indices/loading_indices.js | 8 ++-- .../status_message/status_message.js | 26 +++++------ .../step_index_pattern/step_index_pattern.js | 31 ++++++------- .../create_index_pattern_wizard/render.js | 3 +- 7 files changed, 68 insertions(+), 59 deletions(-) diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js index 234ea96fe722d..e51a50c0003c3 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js @@ -29,7 +29,9 @@ import { EuiSwitch, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; export const Header = ({ isIncludingSystemIndices, @@ -41,7 +43,7 @@ export const Header = ({

@@ -53,7 +55,7 @@ export const Header = ({

@@ -63,7 +65,7 @@ export const Header = ({ } checked={isIncludingSystemIndices} onChange={onChangeIncludingSystemIndices} diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js index b5f2cd7d6acf2..8ae3a707282fc 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js @@ -30,13 +30,11 @@ import { EuiFieldText, } from '@elastic/eui'; -import { - injectIntl, - FormattedMessage -} from '@kbn/i18n'; +import { ReactI18n } from '@kbn/i18n'; + +const { I18nContext, FormattedMessage } = ReactI18n; -const HeaderComponent = ({ - intl, +export const Header = ({ isInputInvalid, errors, characterList, @@ -51,7 +49,7 @@ const HeaderComponent = ({

@@ -64,7 +62,7 @@ const HeaderComponent = ({ } isInvalid={isInputInvalid} error={errors} @@ -73,28 +71,34 @@ const HeaderComponent = ({

* }} />

', characterList: {characterList} }} />

} > - + + {intl => ( + + )} + @@ -107,7 +111,7 @@ const HeaderComponent = ({ > @@ -115,4 +119,3 @@ const HeaderComponent = ({ ); -export const Header = injectIntl(HeaderComponent); diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js index 1c53326e19e74..7691bc0e942ba 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js @@ -40,7 +40,9 @@ import { Pager } from '@elastic/eui/lib/services'; -import { FormattedMessage } from '@kbn/i18n'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; export class IndicesList extends Component { static propTypes = { @@ -102,7 +104,7 @@ export class IndicesList extends Component { > diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js index 0af564d545241..845a277295c99 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js @@ -27,7 +27,9 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; export const LoadingIndices = ({ ...rest }) => ( ( @@ -53,7 +55,7 @@ export const LoadingIndices = ({ ...rest }) => ( diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js index 90802265a79cc..c4b9b97960286 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js @@ -25,7 +25,9 @@ import { EuiIcon, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; export const StatusMessage = ({ matchedIndices: { @@ -49,11 +51,11 @@ export const StatusMessage = ({ ) }} @@ -66,8 +68,8 @@ export const StatusMessage = ({ ); @@ -79,7 +81,7 @@ export const StatusMessage = ({ No Elasticsearch indices match your pattern. ); @@ -94,17 +96,17 @@ export const StatusMessage = ({   ) @@ -120,19 +122,19 @@ export const StatusMessage = ({ ', space:   }} /> diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js index ad2b35a03358b..1c7f1f7ba2798 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js @@ -38,20 +38,18 @@ import { EuiCallOut, } from '@elastic/eui'; -import { - injectIntl, - FormattedMessage -} from '@kbn/i18n'; +import { ReactI18n } from '@kbn/i18n'; + +const { I18nContext, FormattedMessage } = ReactI18n; -class StepIndexPatternComponent extends Component { +export class StepIndexPattern extends Component { static propTypes = { allIndices: PropTypes.array.isRequired, isIncludingSystemIndices: PropTypes.bool.isRequired, esService: PropTypes.object.isRequired, savedObjectsClient: PropTypes.object.isRequired, goToNextStep: PropTypes.func.isRequired, - initialQuery: PropTypes.string, - intl: PropTypes.object + initialQuery: PropTypes.string } static defaultProps = { @@ -213,14 +211,14 @@ class StepIndexPatternComponent extends Component { } iconType="help" color="warning" >

', query }} />

@@ -228,7 +226,7 @@ class StepIndexPatternComponent extends Component { ); } - renderHeader({ exactMatchedIndices: indices }) { + renderHeader({ exactMatchedIndices: indices }, intl) { const { goToNextStep } = this.props; const { query, showingIndexPatternQueryErrors, indexPatternExists } = this.state; @@ -241,12 +239,10 @@ class StepIndexPatternComponent extends Component { containsErrors = true; } else if (!containsInvalidCharacters(query, ILLEGAL_CHARACTERS)) { - errors.push(this.props.intl.formatMessage({ + errors.push(intl.formatMessage({ id: 'management.indices.indexPattern.error.invalidCharacters', - defaultMessage: `An index pattern cannot contain spaces or the characters: {characterList}` - }, - { characterList } - )); + defaultMessage: 'An index pattern cannot contain spaces or the characters: {characterList}' + }, { characterList })); containsErrors = true; } @@ -281,7 +277,9 @@ class StepIndexPatternComponent extends Component { return ( - {this.renderHeader(matchedIndices)} + + {intl => this.renderHeader(matchedIndices, intl)} + {this.renderLoadingState(matchedIndices)} {this.renderIndexPatternExists()} @@ -293,4 +291,3 @@ class StepIndexPatternComponent extends Component { } } -export const StepIndexPattern = injectIntl(StepIndexPatternComponent); diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js index 9fec6997b1371..3713188e40f8b 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js @@ -21,9 +21,10 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { CreateIndexPatternWizard } from './create_index_pattern_wizard'; -import { I18nProvider } from '@kbn/i18n'; +import { ReactI18n } from '@kbn/i18n'; const CREATE_INDEX_PATTERN_DOM_ELEMENT_ID = 'createIndexPatternReact'; +const {I18nProvider} = ReactI18n; export function renderCreateIndexPatternWizard( initialQuery, From b9cb0a1d79e6e93c3c12cb8ff8a3f9fc908d83d2 Mon Sep 17 00:00:00 2001 From: Maryia Lapata Date: Wed, 6 Jun 2018 13:54:07 +0300 Subject: [PATCH 007/186] Fix localized message --- .../components/status_message/status_message.js | 17 ++++++++++++----- .../step_index_pattern/step_index_pattern.js | 5 ++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js index c4b9b97960286..a75c4f30f13a0 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js @@ -67,7 +67,7 @@ export const StatusMessage = ({ statusMessage = ( @@ -78,9 +78,8 @@ export const StatusMessage = ({ // This should never really happen but let's handle it just in case statusMessage = ( - No Elasticsearch indices match your pattern. @@ -145,8 +144,16 @@ export const StatusMessage = ({ statusColor = 'default'; statusMessage = ( - The index pattern you've entered doesn't match any indices. - You can match any of your {allIndices.length} indices, below. + ', allIndices: ( + ) }} + /> ); } diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js index 1c7f1f7ba2798..1d6061c679447 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js @@ -49,7 +49,7 @@ export class StepIndexPattern extends Component { esService: PropTypes.object.isRequired, savedObjectsClient: PropTypes.object.isRequired, goToNextStep: PropTypes.func.isRequired, - initialQuery: PropTypes.string + initialQuery: PropTypes.string, } static defaultProps = { @@ -218,7 +218,7 @@ export class StepIndexPattern extends Component { >

', query }} />

@@ -290,4 +290,3 @@ export class StepIndexPattern extends Component { ); } } - From e4cf32f21dd9bd7e67230d781daf20aa3d3dfde5 Mon Sep 17 00:00:00 2001 From: Maryia Lapata Date: Wed, 6 Jun 2018 17:14:34 +0300 Subject: [PATCH 008/186] Intergation of time step with i18n --- .../components/empty_state/empty_state.js | 38 ++++++++-- .../components/header/header.js | 6 +- .../components/loading_state/loading_state.js | 16 ++++- .../components/header/header.js | 12 ++-- .../components/indices_list/indices_list.js | 2 +- .../loading_indices/loading_indices.js | 4 +- .../status_message/status_message.js | 40 ++++++----- .../step_index_pattern/step_index_pattern.js | 6 +- .../action_buttons/action_buttons.js | 14 +++- .../advanced_options/advanced_options.js | 71 +++++++++++++------ .../components/header/header.js | 17 ++++- .../components/time_field/time_field.js | 63 ++++++++++++---- .../step_time_field/step_time_field.js | 11 ++- .../create_index_pattern_wizard/render.js | 2 +- 14 files changed, 220 insertions(+), 82 deletions(-) diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/empty_state/empty_state.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/empty_state/empty_state.js index 304f3875cc05e..9f5a9c787a447 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/empty_state/empty_state.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/empty_state/empty_state.js @@ -32,6 +32,10 @@ import { EuiButton, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export const EmptyState = ({ onRefresh, }) => ( @@ -40,26 +44,45 @@ export const EmptyState = ({ -

Couldn't find any Elasticsearch data

+

+ ' }} + /> +

- You'll need to index some data into Elasticsearch before you can create an index pattern. + ' }} + />   - Learn how + - {' or '} + - get started with some sample data sets. +

@@ -73,7 +96,10 @@ export const EmptyState = ({ onClick={onRefresh} data-test-subj="refreshIndicesButton" > - Check for new data +
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js index e51a50c0003c3..9b1e3f9b4e8fc 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js @@ -42,7 +42,7 @@ export const Header = ({

@@ -54,7 +54,7 @@ export const Header = ({

@@ -64,7 +64,7 @@ export const Header = ({ } checked={isIncludingSystemIndices} diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/loading_state/loading_state.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/loading_state/loading_state.js index 692f76cc29a2f..dd35f4dd4a6f5 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/loading_state/loading_state.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/loading_state/loading_state.js @@ -30,13 +30,22 @@ import { EuiTitle, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export const LoadingState = () => ( -

Checking for Elasticsearch data

+

+ +

@@ -49,7 +58,10 @@ export const LoadingState = () => ( - Reticulating splines... + diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js index 8ae3a707282fc..ede0a6c078ab1 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js @@ -48,7 +48,7 @@ export const Header = ({

@@ -61,7 +61,7 @@ export const Header = ({ > } isInvalid={isInputInvalid} @@ -70,14 +70,14 @@ export const Header = ({

* }} />

', characterList: {characterList} }} /> @@ -90,7 +90,7 @@ export const Header = ({ diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js index 7691bc0e942ba..8531b3f231d88 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js @@ -103,7 +103,7 @@ export class IndicesList extends Component { onClick={this.openPerPageControl} > diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js index 845a277295c99..edbf6f8023349 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js @@ -45,7 +45,7 @@ export const LoadingIndices = ({ ...rest }) => ( @@ -54,7 +54,7 @@ export const LoadingIndices = ({ ...rest }) => ( diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js index a75c4f30f13a0..c7559e96766a2 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js @@ -50,7 +50,7 @@ export const StatusMessage = ({ statusMessage = ( @@ -79,7 +79,7 @@ export const StatusMessage = ({ statusMessage = ( @@ -94,21 +94,23 @@ export const StatusMessage = ({     - ) + exactMatchedIndices: ( + + + ) }} /> @@ -120,19 +122,19 @@ export const StatusMessage = ({ statusMessage = ( ', space:   }} /> @@ -145,10 +147,12 @@ export const StatusMessage = ({ statusMessage = ( ', allIndices: (', allIndices: ( + diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js index 1d6061c679447..08662813b753c 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js @@ -210,14 +210,14 @@ export class StepIndexPattern extends Component { return ( } iconType="help" color="warning" >

', query }} /> @@ -240,7 +240,7 @@ export class StepIndexPattern extends Component { } else if (!containsInvalidCharacters(query, ILLEGAL_CHARACTERS)) { errors.push(intl.formatMessage({ - id: 'management.indices.indexPattern.error.invalidCharacters', + id: 'management.indices.createIndexPattern.step.error.invalidCharacters', defaultMessage: 'An index pattern cannot contain spaces or the characters: {characterList}' }, { characterList })); containsErrors = true; diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.js index b8d11fbf238c8..5baaf71ca4553 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.js @@ -26,6 +26,10 @@ import { EuiButtonEmpty } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export const ActionButtons = ({ goToPreviousStep, submittable, @@ -37,7 +41,10 @@ export const ActionButtons = ({ iconType="arrowLeft" onClick={goToPreviousStep} > - Back + @@ -47,7 +54,10 @@ export const ActionButtons = ({ fill onClick={createIndexPattern} > - Create index pattern + diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.js index fbb0c3af41b70..d93d9a9bf12b5 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.js @@ -27,6 +27,10 @@ import { EuiSpacer, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { I18nContext, FormattedMessage } = ReactI18n; + export const AdvancedOptions = ({ isVisible, indexPatternId, @@ -39,32 +43,57 @@ export const AdvancedOptions = ({ onClick={toggleAdvancedOptions} > { isVisible - ? (Hide advanced options) - : (Show advanced options) + ? ( + + + + ) + : ( + + + + ) } { isVisible ? - - - Kibana will provide a unique identifier for each index pattern. - If you do not want to use this unique ID, enter a custom one. - - } - > - - - + + {intl => ( + + + + + } + > + + + + )} + : null }

diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/header/header.js index 00660a87c3289..27ed357515594 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/header/header.js @@ -25,20 +25,31 @@ import { EuiText, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export const Header = ({ indexPattern, }) => (

- Step 2 of 2: Configure settings +

- You've defined {indexPattern} as your index pattern. - Now you can specify some settings before we create it. + ', indexPattern: {indexPattern} }} + />
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.js index b720ca37d2b43..a7ce34fc87d16 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.js @@ -32,6 +32,10 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { I18nContext, FormattedMessage } = ReactI18n; + export const TimeField = ({ isVisible, fetchTimeFields, @@ -46,7 +50,12 @@ export const TimeField = ({ label={ - Time Filter field name + + + { isLoading ? ( @@ -57,7 +66,10 @@ export const TimeField = ({ className="timeFieldRefreshButton" onClick={fetchTimeFields} > - Refresh + ) } @@ -66,20 +78,39 @@ export const TimeField = ({ } helpText={
-

The Time Filter will use this field to filter your data by time.

-

You can choose not to have a time field, but you will not be able to narrow down your data by a time range.

+

+ +

+

+ +

} > { isLoading ? ( - + + {intl => ( + + )} + ) : ( : -

The indices which match this index pattern don't contain any time fields.

+

+ ' }} + /> +

} diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js index 7b82b62d06c70..2485dbbef46c7 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js @@ -35,6 +35,10 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export class StepTimeField extends Component { static propTypes = { indexPattern: PropTypes.string.isRequired, @@ -121,7 +125,12 @@ export class StepTimeField extends Component {
- Creating index pattern... + + +
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js index 3713188e40f8b..2af59c36315bb 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js @@ -24,7 +24,7 @@ import { CreateIndexPatternWizard } from './create_index_pattern_wizard'; import { ReactI18n } from '@kbn/i18n'; const CREATE_INDEX_PATTERN_DOM_ELEMENT_ID = 'createIndexPatternReact'; -const {I18nProvider} = ReactI18n; +const { I18nProvider } = ReactI18n; export function renderCreateIndexPatternWizard( initialQuery, From d21f8503a1a44cb09784302f550a6ceb6a742369 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Wed, 6 Jun 2018 19:12:55 +0300 Subject: [PATCH 009/186] i18n engine refactoring --- packages/kbn-i18n/src/angular/index.js | 1 - packages/kbn-i18n/src/angular/module.js | 30 ------ packages/kbn-i18n/src/i18n.js | 135 +++++++++++++----------- src/ui/public/i18n/index.js | 11 +- 4 files changed, 82 insertions(+), 95 deletions(-) delete mode 100644 packages/kbn-i18n/src/angular/module.js diff --git a/packages/kbn-i18n/src/angular/index.js b/packages/kbn-i18n/src/angular/index.js index b34bb05c86aa7..a7af6fbeffc35 100644 --- a/packages/kbn-i18n/src/angular/index.js +++ b/packages/kbn-i18n/src/angular/index.js @@ -20,4 +20,3 @@ export { i18nProvider } from './provider'; export { i18nFilter } from './filter'; export { i18nDirective } from './directive'; -export { i18nModule } from './module'; diff --git a/packages/kbn-i18n/src/angular/module.js b/packages/kbn-i18n/src/angular/module.js deleted file mode 100644 index cba27444efe3c..0000000000000 --- a/packages/kbn-i18n/src/angular/module.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import angular from 'angular'; - -import { i18nProvider } from './provider'; -import { i18nFilter } from './filter'; -import { i18nDirective } from './directive'; - -export const i18nModule = angular - .module('kbn-i18n', []) - .provider('i18n', i18nProvider) - .filter('i18n', i18nFilter) - .directive('i18nId', i18nDirective); diff --git a/packages/kbn-i18n/src/i18n.js b/packages/kbn-i18n/src/i18n.js index 5ea9e94b9dff0..734917c259313 100644 --- a/packages/kbn-i18n/src/i18n.js +++ b/packages/kbn-i18n/src/i18n.js @@ -27,67 +27,67 @@ import IntlMessageFormat from 'intl-messageformat'; import memoizeIntlConstructor from 'intl-format-cache'; -const getMessageById = (messages, id) => - id.split('.').reduce((val, key) => (val ? val[key] : null), messages); +// Add all locale data to `IntlMessageFormat`. +// TODO: Use dynamic import for asynchronous loading of specific locale data +import 'intl-messageformat/lib/locales'; +const isString = value => typeof value === 'string'; +const isObject = value => typeof value === 'object'; const hasValues = values => Object.keys(values).length > 0; -const addLocaleData = localeData => { - if (localeData && localeData.locale) { - IntlMessageFormat.__addLocaleData(localeData); - } -}; - const showError = error => { if (process.env.NODE_ENV !== 'production') { console.error(error); } }; -const getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); - export class I18n { static EN_LOCALE = 'en'; static LOCALE_DELIMITER = '-'; + static getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); - static normalizeLocale(locale = '') { + static getMessageById(messages, id) { + return id + .split('.') + .reduce((val, key) => (val ? val[key] : null), messages); + } + + static normalizeLocale(locale) { return locale.toLowerCase().replace('_', I18n.LOCALE_DELIMITER); } + _defaultLocale = I18n.EN_LOCALE; + _formats = {}; + _messages = {}; + /** * Platform agnostic abstraction that helps to supply locale data to * UI frameworks and provides methods for the direct translation. * @param {Messages} messages - * @param {string} [locale = messages.locale||'en'] + * @param {string} [locale = messages.locale] */ - constructor(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { - this.currentLocale = I18n.normalizeLocale(locale); - this.messages = { [this.currentLocale]: messages }; - this.defaultLocale = I18n.EN_LOCALE; - this.formats = {}; - IntlMessageFormat.defaultLocale = this.defaultLocale; - - if (messages.localeData) { - addLocaleData(messages.localeData); - } + constructor(messages = {}, locale = messages.locale) { + this.setLocale(locale || this._defaultLocale); + this.addMessages(messages, this._currentLocale); + IntlMessageFormat.defaultLocale = this._defaultLocale; } /** * Provides a way to register translations with the engine * @param {Messages} messages - * @param {string} [locale = messages.locale||'en'] + * @param {string} [locale = messages.locale] */ - addMessages(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { + addMessages(messages = {}, locale = messages.locale) { + if (!locale) { + showError('[I18n] A `locale` must be provided to add messages.'); + } + const normalizedLocale = I18n.normalizeLocale(locale); - this.messages[normalizedLocale] = { - ...this.messages[normalizedLocale], + this._messages[normalizedLocale] = { + ...this._messages[normalizedLocale], ...messages, }; - - if (messages.localeData) { - addLocaleData(messages.localeData); - } } /** @@ -95,7 +95,7 @@ export class I18n { * @returns {Messages} messages */ getMessages() { - return this.messages[this.currentLocale]; + return this._messages[this._currentLocale]; } /** @@ -103,7 +103,11 @@ export class I18n { * @param {string} locale */ setLocale(locale) { - this.currentLocale = I18n.normalizeLocale(locale); + if (!locale || !isString(locale)) { + showError('[I18n] A `locale` must be not non-empty string.'); + } else { + this._currentLocale = I18n.normalizeLocale(locale); + } } /** @@ -111,7 +115,7 @@ export class I18n { * @returns {string} locale */ getLocale() { - return this.currentLocale; + return this._currentLocale; } /** @@ -119,8 +123,12 @@ export class I18n { * @param {string} locale */ setDefaultLocale(locale) { - this.defaultLocale = I18n.normalizeLocale(locale); - IntlMessageFormat.defaultLocale = this.defaultLocale; + if (!locale || !isString(locale)) { + showError('[I18n] A `locale` must be not non-empty string.'); + } else { + this._defaultLocale = I18n.normalizeLocale(locale); + IntlMessageFormat.defaultLocale = this._defaultLocale; + } } /** @@ -128,7 +136,7 @@ export class I18n { * @returns {string} defaultLocale */ getDefaultLocale() { - return this.defaultLocale; + return this._defaultLocale; } /** @@ -136,7 +144,11 @@ export class I18n { * @param {object} formats */ setFormats(formats) { - this.formats = formats; + if (!isObject(formats) || !hasValues(formats)) { + showError('[I18n] A `formats` must be not non-empty object.'); + } else { + this._formats = formats; + } } /** @@ -144,7 +156,7 @@ export class I18n { * @returns {object} formats */ getFormats() { - return this.formats; + return this._formats; } /** @@ -152,7 +164,7 @@ export class I18n { * @returns {string[]} locales */ getRegisteredLocales() { - return Object.keys(this.messages); + return Object.keys(this._messages); } /** @@ -168,23 +180,21 @@ export class I18n { showError('[I18n] An `id` must be provided to translate a message.'); } - const message = getMessageById(this.getMessages(), id); + const message = I18n.getMessageById(this.getMessages(), id); if (!hasValues(values) && process.env.NODE_ENV === 'production') { return message || defaultMessage || id; } - let formattedMessage; - if (message) { try { - const msg = getMessageFormat( + const msg = I18n.getMessageFormat( message, this.getLocale(), this.getFormats() ); - formattedMessage = msg.format(values); + return msg.format(values); } catch (e) { showError( `[I18n] Error formatting message: "${id}" for locale: "${this.getLocale()}"` + @@ -192,24 +202,25 @@ export class I18n { `\n${e}` ); } - } else { - if (!defaultMessage || this.getLocale() !== this.getDefaultLocale()) { - showError( - `[I18n] Missing message: "${id}" for locale: "${this.getLocale()}"` + - (defaultMessage ? ', using default message as fallback.' : '') - ); - } + } else if ( + !defaultMessage || + this.getLocale() !== this.getDefaultLocale() + ) { + showError( + `[I18n] Missing message: "${id}" for locale: "${this.getLocale()}"` + + (defaultMessage ? ', using default message as fallback.' : '') + ); } - if (!formattedMessage && defaultMessage) { + if (defaultMessage) { try { - const msg = getMessageFormat( + const msg = I18n.getMessageFormat( defaultMessage, this.getDefaultLocale(), this.getFormats() ); - formattedMessage = msg.format(values); + return msg.format(values); } catch (e) { showError( `[I18n] Error formatting the default message for: "${id}"\n${e}` @@ -217,16 +228,14 @@ export class I18n { } } - if (!formattedMessage) { - showError( - `[I18n] Cannot format message: "${id}", ` + - `using message ${ - message || defaultMessage ? 'source' : 'id' - } as fallback.` - ); - } + showError( + `[I18n] Cannot format message: "${id}", ` + + `using message ${ + message || defaultMessage ? 'source' : 'id' + } as fallback.` + ); - return formattedMessage || message || defaultMessage || id; + return message || defaultMessage || id; } } diff --git a/src/ui/public/i18n/index.js b/src/ui/public/i18n/index.js index 3f90e0c1c4f1e..8e6e305593044 100644 --- a/src/ui/public/i18n/index.js +++ b/src/ui/public/i18n/index.js @@ -22,6 +22,12 @@ import { AngularI18n, i18n } from '@kbn/i18n'; import { uiModules } from 'ui/modules'; import { metadata } from 'ui/metadata'; +const { + i18nProvider, + i18nFilter, + i18nDirective, +} = AngularI18n; + if (metadata.translations) { i18n.addMessages(metadata.translations); @@ -30,4 +36,7 @@ if (metadata.translations) { } } -uiModules.get('i18n', [AngularI18n.i18nModule.name]); +uiModules.get('i18n') + .provider('i18n', i18nProvider) + .filter('i18n', i18nFilter) + .directive('i18nId', i18nDirective); From 6ebf046aaece66b93cbc6c70d98ed67082a4b9aa Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Thu, 7 Jun 2018 15:07:25 +0300 Subject: [PATCH 010/186] Fix locales data loading and add more jsdoc comments --- packages/kbn-i18n/package.json | 2 + packages/kbn-i18n/src/i18n.js | 34 +- packages/kbn-i18n/src/locales.js | 565 ++++++++++++++++++ packages/kbn-i18n/src/server/i18n_loader.js | 117 ++-- packages/kbn-i18n/src/server/ui_i18n_mixin.js | 11 +- packages/kbn-i18n/yarn.lock | 12 +- 6 files changed, 690 insertions(+), 51 deletions(-) create mode 100644 packages/kbn-i18n/src/locales.js diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index db77940517f2a..689fddd6a9014 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -8,6 +8,8 @@ "accept-language-parser": "^1.5.0", "intl-format-cache": "^2.1.0", "intl-messageformat": "^2.2.0", + "intl-relativeformat": "^2.1.0", + "json5": "^1.0.1", "prop-types": "^15.5.8", "react": "^16.3.0", "react-intl": "^2.4.0" diff --git a/packages/kbn-i18n/src/i18n.js b/packages/kbn-i18n/src/i18n.js index 734917c259313..1846c12287d04 100644 --- a/packages/kbn-i18n/src/i18n.js +++ b/packages/kbn-i18n/src/i18n.js @@ -18,40 +18,58 @@ */ /** - @typedef Messages + @typedef Messages - messages tree, where leafs are translated strings @type {object} @property {string} [locale] - locale of the messages - @property {object} [localeData] - localization rules for IntlMessageFormat */ import IntlMessageFormat from 'intl-messageformat'; +import IntlRelativeFormat from 'intl-relativeformat'; import memoizeIntlConstructor from 'intl-format-cache'; // Add all locale data to `IntlMessageFormat`. // TODO: Use dynamic import for asynchronous loading of specific locale data -import 'intl-messageformat/lib/locales'; +import './locales'; const isString = value => typeof value === 'string'; const isObject = value => typeof value === 'object'; const hasValues = values => Object.keys(values).length > 0; - const showError = error => { if (process.env.NODE_ENV !== 'production') { console.error(error); } }; +/** + * Platform agnostic abstraction that helps to supply locale data to + * UI frameworks and provides methods for the direct translation. + */ export class I18n { static EN_LOCALE = 'en'; static LOCALE_DELIMITER = '-'; static getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); + static getRelativeFormat = memoizeIntlConstructor(IntlRelativeFormat); + /** + * Returns message by the given message id. + * @param {Messages} messages - messages tree + * @param {string} id - path to the message that consists of properties + * names separated by dots + * @returns {string} message - translated message from messages tree + * @example + * getMessageById({ a: { b: { c: 'test' } } }, 'a.b.c'); // => 'test' + */ static getMessageById(messages, id) { return id .split('.') .reduce((val, key) => (val ? val[key] : null), messages); } + /** + * Normalizes locale to make it consistent with IntlMessageFormat locales + * @param {string} locale + * @returns {string} normalizedLocale + */ static normalizeLocale(locale) { return locale.toLowerCase().replace('_', I18n.LOCALE_DELIMITER); } @@ -61,15 +79,16 @@ export class I18n { _messages = {}; /** - * Platform agnostic abstraction that helps to supply locale data to - * UI frameworks and provides methods for the direct translation. - * @param {Messages} messages + * Creates i18n engine instance and fills messages registry with a passed messages + * @constructor + * @param {Messages} [messages] * @param {string} [locale = messages.locale] */ constructor(messages = {}, locale = messages.locale) { this.setLocale(locale || this._defaultLocale); this.addMessages(messages, this._currentLocale); IntlMessageFormat.defaultLocale = this._defaultLocale; + IntlRelativeFormat.defaultLocale = this._defaultLocale; } /** @@ -128,6 +147,7 @@ export class I18n { } else { this._defaultLocale = I18n.normalizeLocale(locale); IntlMessageFormat.defaultLocale = this._defaultLocale; + IntlRelativeFormat.defaultLocale = this._defaultLocale; } } diff --git a/packages/kbn-i18n/src/locales.js b/packages/kbn-i18n/src/locales.js new file mode 100644 index 0000000000000..d9612a467b240 --- /dev/null +++ b/packages/kbn-i18n/src/locales.js @@ -0,0 +1,565 @@ +/* eslint-disable */ + +// TODO: Get rid of this file + +import IntlMessageFormat from 'intl-messageformat'; +import IntlRelativeFormat from 'intl-relativeformat'; + +function addLocaleData(localeData) { + IntlMessageFormat.__addLocaleData(localeData); + IntlRelativeFormat.__addLocaleData(localeData); +} + +addLocaleData({"locale":"af","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"af-NA","parentLocale":"af"}); +addLocaleData({"locale":"agq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ak","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"am","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"ar","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return n==0?"zero":n==1?"one":n==2?"two":n100>=3&&n100<=10?"few":n100>=11&&n100<=99?"many":"other"}}); +addLocaleData({"locale":"ar-AE","parentLocale":"ar"}); +addLocaleData({"locale":"ar-BH","parentLocale":"ar"}); +addLocaleData({"locale":"ar-DJ","parentLocale":"ar"}); +addLocaleData({"locale":"ar-DZ","parentLocale":"ar"}); +addLocaleData({"locale":"ar-EG","parentLocale":"ar"}); +addLocaleData({"locale":"ar-EH","parentLocale":"ar"}); +addLocaleData({"locale":"ar-ER","parentLocale":"ar"}); +addLocaleData({"locale":"ar-IL","parentLocale":"ar"}); +addLocaleData({"locale":"ar-IQ","parentLocale":"ar"}); +addLocaleData({"locale":"ar-JO","parentLocale":"ar"}); +addLocaleData({"locale":"ar-KM","parentLocale":"ar"}); +addLocaleData({"locale":"ar-KW","parentLocale":"ar"}); +addLocaleData({"locale":"ar-LB","parentLocale":"ar"}); +addLocaleData({"locale":"ar-LY","parentLocale":"ar"}); +addLocaleData({"locale":"ar-MA","parentLocale":"ar"}); +addLocaleData({"locale":"ar-MR","parentLocale":"ar"}); +addLocaleData({"locale":"ar-OM","parentLocale":"ar"}); +addLocaleData({"locale":"ar-PS","parentLocale":"ar"}); +addLocaleData({"locale":"ar-QA","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SA","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SD","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SO","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SS","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SY","parentLocale":"ar"}); +addLocaleData({"locale":"ar-TD","parentLocale":"ar"}); +addLocaleData({"locale":"ar-TN","parentLocale":"ar"}); +addLocaleData({"locale":"ar-YE","parentLocale":"ar"}); +addLocaleData({"locale":"as","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5||n==7||n==8||n==9||n==10?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"asa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ast","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"az","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],i10=i.slice(-1),i100=i.slice(-2),i1000=i.slice(-3);if(ord)return i10==1||i10==2||i10==5||i10==7||i10==8||(i100==20||i100==50||i100==70||i100==80)?"one":i10==3||i10==4||(i1000==100||i1000==200||i1000==300||i1000==400||i1000==500||i1000==600||i1000==700||i1000==800||i1000==900)?"few":i==0||i10==6||(i100==40||i100==60||i100==90)?"many":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"az-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"az-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"az-Latn","parentLocale":"az"}); +addLocaleData({"locale":"bas","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"be","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return(n10==2||n10==3)&&n100!=12&&n100!=13?"few":"other";return n10==1&&n100!=11?"one":n10>=2&&n10<=4&&(n100<12||n100>14)?"few":t0&&n10==0||n10>=5&&n10<=9||n100>=11&&n100<=14?"many":"other"}}); +addLocaleData({"locale":"bem","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"bez","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"bg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"bh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"bm","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"bm-Nkoo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"bn","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5||n==7||n==8||n==9||n==10?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"bn-IN","parentLocale":"bn"}); +addLocaleData({"locale":"bo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"bo-IN","parentLocale":"bo"}); +addLocaleData({"locale":"br","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),n1000000=t0&&s[0].slice(-6);if(ord)return"other";return n10==1&&n100!=11&&n100!=71&&n100!=91?"one":n10==2&&n100!=12&&n100!=72&&n100!=92?"two":(n10==3||n10==4||n10==9)&&(n100<10||n100>19)&&(n100<70||n100>79)&&(n100<90||n100>99)?"few":n!=0&&t0&&n1000000==0?"many":"other"}}); +addLocaleData({"locale":"brx","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"bs","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}}); +addLocaleData({"locale":"bs-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"bs-Latn","parentLocale":"bs"}); +addLocaleData({"locale":"ca","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return n==1||n==3?"one":n==2?"two":n==4?"few":"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"ca-AD","parentLocale":"ca"}); +addLocaleData({"locale":"ca-ES-VALENCIA","parentLocale":"ca-ES"}); +addLocaleData({"locale":"ca-ES","parentLocale":"ca"}); +addLocaleData({"locale":"ca-FR","parentLocale":"ca"}); +addLocaleData({"locale":"ca-IT","parentLocale":"ca"}); +addLocaleData({"locale":"ce","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"cgg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"chr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ckb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ckb-IR","parentLocale":"ckb"}); +addLocaleData({"locale":"cs","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1];if(ord)return"other";return n==1&&v0?"one":i>=2&&i<=4&&v0?"few":!v0?"many":"other"}}); +addLocaleData({"locale":"cu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"cy","pluralRuleFunction":function (n,ord){if(ord)return n==0||n==7||n==8||n==9?"zero":n==1?"one":n==2?"two":n==3||n==4?"few":n==5||n==6?"many":"other";return n==0?"zero":n==1?"one":n==2?"two":n==3?"few":n==6?"many":"other"}}); +addLocaleData({"locale":"da","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],t0=Number(s[0])==n;if(ord)return"other";return n==1||!t0&&(i==0||i==1)?"one":"other"}}); +addLocaleData({"locale":"da-GL","parentLocale":"da"}); +addLocaleData({"locale":"dav","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"de","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"de-AT","parentLocale":"de"}); +addLocaleData({"locale":"de-BE","parentLocale":"de"}); +addLocaleData({"locale":"de-CH","parentLocale":"de"}); +addLocaleData({"locale":"de-LI","parentLocale":"de"}); +addLocaleData({"locale":"de-LU","parentLocale":"de"}); +addLocaleData({"locale":"dje","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"dsb","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i100=i.slice(-2),f100=f.slice(-2);if(ord)return"other";return v0&&i100==1||f100==1?"one":v0&&i100==2||f100==2?"two":v0&&(i100==3||i100==4)||(f100==3||f100==4)?"few":"other"}}); +addLocaleData({"locale":"dua","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"dv","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"dyo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"dz","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ebu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ee","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ee-TG","parentLocale":"ee"}); +addLocaleData({"locale":"el","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"el-CY","parentLocale":"el"}); +addLocaleData({"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"en-001","parentLocale":"en"}); +addLocaleData({"locale":"en-150","parentLocale":"en-001"}); +addLocaleData({"locale":"en-AG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-AI","parentLocale":"en-001"}); +addLocaleData({"locale":"en-AS","parentLocale":"en"}); +addLocaleData({"locale":"en-AT","parentLocale":"en-150"}); +addLocaleData({"locale":"en-AU","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BB","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BE","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BI","parentLocale":"en"}); +addLocaleData({"locale":"en-BM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BW","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BZ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CA","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CH","parentLocale":"en-150"}); +addLocaleData({"locale":"en-CK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CX","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CY","parentLocale":"en-001"}); +addLocaleData({"locale":"en-DE","parentLocale":"en-150"}); +addLocaleData({"locale":"en-DG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-DK","parentLocale":"en-150"}); +addLocaleData({"locale":"en-DM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-Dsrt","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"en-ER","parentLocale":"en-001"}); +addLocaleData({"locale":"en-FI","parentLocale":"en-150"}); +addLocaleData({"locale":"en-FJ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-FK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-FM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GB","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GD","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GH","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GI","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GU","parentLocale":"en"}); +addLocaleData({"locale":"en-GY","parentLocale":"en-001"}); +addLocaleData({"locale":"en-HK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IE","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IL","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IN","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IO","parentLocale":"en-001"}); +addLocaleData({"locale":"en-JE","parentLocale":"en-001"}); +addLocaleData({"locale":"en-JM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-KE","parentLocale":"en-001"}); +addLocaleData({"locale":"en-KI","parentLocale":"en-001"}); +addLocaleData({"locale":"en-KN","parentLocale":"en-001"}); +addLocaleData({"locale":"en-KY","parentLocale":"en-001"}); +addLocaleData({"locale":"en-LC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-LR","parentLocale":"en-001"}); +addLocaleData({"locale":"en-LS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MH","parentLocale":"en"}); +addLocaleData({"locale":"en-MO","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MP","parentLocale":"en"}); +addLocaleData({"locale":"en-MS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MT","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MU","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MW","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MY","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NA","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NF","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NL","parentLocale":"en-150"}); +addLocaleData({"locale":"en-NR","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NU","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NZ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PH","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PN","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PR","parentLocale":"en"}); +addLocaleData({"locale":"en-PW","parentLocale":"en-001"}); +addLocaleData({"locale":"en-RW","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SB","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SD","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SE","parentLocale":"en-150"}); +addLocaleData({"locale":"en-SG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SH","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SI","parentLocale":"en-150"}); +addLocaleData({"locale":"en-SL","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SX","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SZ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-Shaw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"en-TC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TO","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TT","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TV","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TZ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-UG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-UM","parentLocale":"en"}); +addLocaleData({"locale":"en-US","parentLocale":"en"}); +addLocaleData({"locale":"en-VC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-VG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-VI","parentLocale":"en"}); +addLocaleData({"locale":"en-VU","parentLocale":"en-001"}); +addLocaleData({"locale":"en-WS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-ZA","parentLocale":"en-001"}); +addLocaleData({"locale":"en-ZM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-ZW","parentLocale":"en-001"}); +addLocaleData({"locale":"eo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"es","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"es-419","parentLocale":"es"}); +addLocaleData({"locale":"es-AR","parentLocale":"es-419"}); +addLocaleData({"locale":"es-BO","parentLocale":"es-419"}); +addLocaleData({"locale":"es-CL","parentLocale":"es-419"}); +addLocaleData({"locale":"es-CO","parentLocale":"es-419"}); +addLocaleData({"locale":"es-CR","parentLocale":"es-419"}); +addLocaleData({"locale":"es-CU","parentLocale":"es-419"}); +addLocaleData({"locale":"es-DO","parentLocale":"es-419"}); +addLocaleData({"locale":"es-EA","parentLocale":"es"}); +addLocaleData({"locale":"es-EC","parentLocale":"es-419"}); +addLocaleData({"locale":"es-GQ","parentLocale":"es"}); +addLocaleData({"locale":"es-GT","parentLocale":"es-419"}); +addLocaleData({"locale":"es-HN","parentLocale":"es-419"}); +addLocaleData({"locale":"es-IC","parentLocale":"es"}); +addLocaleData({"locale":"es-MX","parentLocale":"es-419"}); +addLocaleData({"locale":"es-NI","parentLocale":"es-419"}); +addLocaleData({"locale":"es-PA","parentLocale":"es-419"}); +addLocaleData({"locale":"es-PE","parentLocale":"es-419"}); +addLocaleData({"locale":"es-PH","parentLocale":"es"}); +addLocaleData({"locale":"es-PR","parentLocale":"es-419"}); +addLocaleData({"locale":"es-PY","parentLocale":"es-419"}); +addLocaleData({"locale":"es-SV","parentLocale":"es-419"}); +addLocaleData({"locale":"es-US","parentLocale":"es-419"}); +addLocaleData({"locale":"es-UY","parentLocale":"es-419"}); +addLocaleData({"locale":"es-VE","parentLocale":"es-419"}); +addLocaleData({"locale":"et","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"eu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ewo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"fa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"fa-AF","parentLocale":"fa"}); +addLocaleData({"locale":"ff","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<2?"one":"other"}}); +addLocaleData({"locale":"ff-CM","parentLocale":"ff"}); +addLocaleData({"locale":"ff-GN","parentLocale":"ff"}); +addLocaleData({"locale":"ff-MR","parentLocale":"ff"}); +addLocaleData({"locale":"fi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"fil","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),f10=f.slice(-1);if(ord)return n==1?"one":"other";return v0&&(i==1||i==2||i==3)||v0&&i10!=4&&i10!=6&&i10!=9||!v0&&f10!=4&&f10!=6&&f10!=9?"one":"other"}}); +addLocaleData({"locale":"fo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"fo-DK","parentLocale":"fo"}); +addLocaleData({"locale":"fr","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return n>=0&&n<2?"one":"other"}}); +addLocaleData({"locale":"fr-BE","parentLocale":"fr"}); +addLocaleData({"locale":"fr-BF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-BI","parentLocale":"fr"}); +addLocaleData({"locale":"fr-BJ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-BL","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CA","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CD","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CG","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CH","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CI","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CM","parentLocale":"fr"}); +addLocaleData({"locale":"fr-DJ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-DZ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GA","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GN","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GP","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GQ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-HT","parentLocale":"fr"}); +addLocaleData({"locale":"fr-KM","parentLocale":"fr"}); +addLocaleData({"locale":"fr-LU","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MA","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MC","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MG","parentLocale":"fr"}); +addLocaleData({"locale":"fr-ML","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MQ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MR","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MU","parentLocale":"fr"}); +addLocaleData({"locale":"fr-NC","parentLocale":"fr"}); +addLocaleData({"locale":"fr-NE","parentLocale":"fr"}); +addLocaleData({"locale":"fr-PF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-PM","parentLocale":"fr"}); +addLocaleData({"locale":"fr-RE","parentLocale":"fr"}); +addLocaleData({"locale":"fr-RW","parentLocale":"fr"}); +addLocaleData({"locale":"fr-SC","parentLocale":"fr"}); +addLocaleData({"locale":"fr-SN","parentLocale":"fr"}); +addLocaleData({"locale":"fr-SY","parentLocale":"fr"}); +addLocaleData({"locale":"fr-TD","parentLocale":"fr"}); +addLocaleData({"locale":"fr-TG","parentLocale":"fr"}); +addLocaleData({"locale":"fr-TN","parentLocale":"fr"}); +addLocaleData({"locale":"fr-VU","parentLocale":"fr"}); +addLocaleData({"locale":"fr-WF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-YT","parentLocale":"fr"}); +addLocaleData({"locale":"fur","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"fy","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"ga","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return n==1?"one":"other";return n==1?"one":n==2?"two":t0&&n>=3&&n<=6?"few":t0&&n>=7&&n<=10?"many":"other"}}); +addLocaleData({"locale":"gd","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n==1||n==11?"one":n==2||n==12?"two":t0&&n>=3&&n<=10||t0&&n>=13&&n<=19?"few":"other"}}); +addLocaleData({"locale":"gl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"gsw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"gsw-FR","parentLocale":"gsw"}); +addLocaleData({"locale":"gsw-LI","parentLocale":"gsw"}); +addLocaleData({"locale":"gu","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"guw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"guz","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"gv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return v0&&i10==1?"one":v0&&i10==2?"two":v0&&(i100==0||i100==20||i100==40||i100==60||i100==80)?"few":!v0?"many":"other"}}); +addLocaleData({"locale":"ha","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ha-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ha-GH","parentLocale":"ha"}); +addLocaleData({"locale":"ha-NE","parentLocale":"ha"}); +addLocaleData({"locale":"haw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"he","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return"other";return n==1&&v0?"one":i==2&&v0?"two":v0&&(n<0||n>10)&&t0&&n10==0?"many":"other"}}); +addLocaleData({"locale":"hi","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"hr","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}}); +addLocaleData({"locale":"hr-BA","parentLocale":"hr"}); +addLocaleData({"locale":"hsb","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i100=i.slice(-2),f100=f.slice(-2);if(ord)return"other";return v0&&i100==1||f100==1?"one":v0&&i100==2||f100==2?"two":v0&&(i100==3||i100==4)||(f100==3||f100==4)?"few":"other"}}); +addLocaleData({"locale":"hu","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5?"one":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"hy","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return n>=0&&n<2?"one":"other"}}); +addLocaleData({"locale":"id","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ig","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ii","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"in","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"is","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],t0=Number(s[0])==n,i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return t0&&i10==1&&i100!=11||!t0?"one":"other"}}); +addLocaleData({"locale":"it","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return n==11||n==8||n==80||n==800?"many":"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"it-CH","parentLocale":"it"}); +addLocaleData({"locale":"it-SM","parentLocale":"it"}); +addLocaleData({"locale":"iu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"iu-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"iw","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return"other";return n==1&&v0?"one":i==2&&v0?"two":v0&&(n<0||n>10)&&t0&&n10==0?"many":"other"}}); +addLocaleData({"locale":"ja","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"jbo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"jgo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ji","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"jmc","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"jv","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"jw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ka","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],i100=i.slice(-2);if(ord)return i==1?"one":i==0||(i100>=2&&i100<=20||i100==40||i100==60||i100==80)?"many":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kab","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<2?"one":"other"}}); +addLocaleData({"locale":"kaj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kam","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"kcg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kde","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"kea","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"khq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ki","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"kk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return n10==6||n10==9||t0&&n10==0&&n!=0?"many":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kkj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kl","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kln","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"km","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"kn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"ko","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ko-KP","parentLocale":"ko"}); +addLocaleData({"locale":"kok","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ks","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ksb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ksf","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ksh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0?"zero":n==1?"one":"other"}}); +addLocaleData({"locale":"ku","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"ky","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"lag","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0];if(ord)return"other";return n==0?"zero":(i==0||i==1)&&n!=0?"one":"other"}}); +addLocaleData({"locale":"lb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"lg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"lkt","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ln","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"ln-AO","parentLocale":"ln"}); +addLocaleData({"locale":"ln-CF","parentLocale":"ln"}); +addLocaleData({"locale":"ln-CG","parentLocale":"ln"}); +addLocaleData({"locale":"lo","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}}); +addLocaleData({"locale":"lrc","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"lrc-IQ","parentLocale":"lrc"}); +addLocaleData({"locale":"lt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return"other";return n10==1&&(n100<11||n100>19)?"one":n10>=2&&n10<=9&&(n100<11||n100>19)?"few":f!=0?"many":"other"}}); +addLocaleData({"locale":"lu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"luo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"luy","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"lv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",v=f.length,t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),f100=f.slice(-2),f10=f.slice(-1);if(ord)return"other";return t0&&n10==0||n100>=11&&n100<=19||v==2&&(f100>=11&&f100<=19)?"zero":n10==1&&n100!=11||v==2&&f10==1&&f100!=11||v!=2&&f10==1?"one":"other"}}); +addLocaleData({"locale":"mas","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"mas-TZ","parentLocale":"mas"}); +addLocaleData({"locale":"mer","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mfe","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"mgh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mgo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"mk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1);if(ord)return i10==1&&i100!=11?"one":i10==2&&i100!=12?"two":(i10==7||i10==8)&&i100!=17&&i100!=18?"many":"other";return v0&&i10==1||f10==1?"one":"other"}}); +addLocaleData({"locale":"ml","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"mn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"mn-Mong","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mo","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":"other";return n==1&&v0?"one":!v0||n==0||n!=1&&(n100>=1&&n100<=19)?"few":"other"}}); +addLocaleData({"locale":"mr","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"ms","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}}); +addLocaleData({"locale":"ms-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ms-BN","parentLocale":"ms"}); +addLocaleData({"locale":"ms-SG","parentLocale":"ms"}); +addLocaleData({"locale":"mt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return n==1?"one":n==0||n100>=2&&n100<=10?"few":n100>=11&&n100<=19?"many":"other"}}); +addLocaleData({"locale":"mua","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"my","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mzn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"nah","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"naq","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"nb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nb-SJ","parentLocale":"nb"}); +addLocaleData({"locale":"nd","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ne","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return t0&&n>=1&&n<=4?"one":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ne-IN","parentLocale":"ne"}); +addLocaleData({"locale":"nl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"nl-AW","parentLocale":"nl"}); +addLocaleData({"locale":"nl-BE","parentLocale":"nl"}); +addLocaleData({"locale":"nl-BQ","parentLocale":"nl"}); +addLocaleData({"locale":"nl-CW","parentLocale":"nl"}); +addLocaleData({"locale":"nl-SR","parentLocale":"nl"}); +addLocaleData({"locale":"nl-SX","parentLocale":"nl"}); +addLocaleData({"locale":"nmg","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"nn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nnh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"no","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nqo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"nr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nso","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"nus","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ny","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nyn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"om","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"om-KE","parentLocale":"om"}); +addLocaleData({"locale":"or","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"os","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"os-RU","parentLocale":"os"}); +addLocaleData({"locale":"pa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"pa-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"pa-Guru","parentLocale":"pa"}); +addLocaleData({"locale":"pap","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"pl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return n==1&&v0?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i!=1&&(i10==0||i10==1)||v0&&(i10>=5&&i10<=9)||v0&&(i100>=12&&i100<=14)?"many":"other"}}); +addLocaleData({"locale":"prg","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",v=f.length,t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),f100=f.slice(-2),f10=f.slice(-1);if(ord)return"other";return t0&&n10==0||n100>=11&&n100<=19||v==2&&(f100>=11&&f100<=19)?"zero":n10==1&&n100!=11||v==2&&f10==1&&f100!=11||v!=2&&f10==1?"one":"other"}}); +addLocaleData({"locale":"ps","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"pt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return t0&&n>=0&&n<=2&&n!=2?"one":"other"}}); +addLocaleData({"locale":"pt-AO","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-PT","parentLocale":"pt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"pt-CV","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-GW","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-MO","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-MZ","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-ST","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-TL","parentLocale":"pt-PT"}); +addLocaleData({"locale":"qu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"qu-BO","parentLocale":"qu"}); +addLocaleData({"locale":"qu-EC","parentLocale":"qu"}); +addLocaleData({"locale":"rm","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"rn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ro","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":"other";return n==1&&v0?"one":!v0||n==0||n!=1&&(n100>=1&&n100<=19)?"few":"other"}}); +addLocaleData({"locale":"ro-MD","parentLocale":"ro"}); +addLocaleData({"locale":"rof","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ru","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i10==0||v0&&(i10>=5&&i10<=9)||v0&&(i100>=11&&i100<=14)?"many":"other"}}); +addLocaleData({"locale":"ru-BY","parentLocale":"ru"}); +addLocaleData({"locale":"ru-KG","parentLocale":"ru"}); +addLocaleData({"locale":"ru-KZ","parentLocale":"ru"}); +addLocaleData({"locale":"ru-MD","parentLocale":"ru"}); +addLocaleData({"locale":"ru-UA","parentLocale":"ru"}); +addLocaleData({"locale":"rw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"rwk","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"sah","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"saq","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"sbp","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"sdh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"se","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"se-FI","parentLocale":"se"}); +addLocaleData({"locale":"se-SE","parentLocale":"se"}); +addLocaleData({"locale":"seh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ses","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"sg","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"sh","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}}); +addLocaleData({"locale":"shi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n>=0&&n<=1?"one":t0&&n>=2&&n<=10?"few":"other"}}); +addLocaleData({"locale":"shi-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"shi-Tfng","parentLocale":"shi"}); +addLocaleData({"locale":"si","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"";if(ord)return"other";return n==0||n==1||i==0&&f==1?"one":"other"}}); +addLocaleData({"locale":"sk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1];if(ord)return"other";return n==1&&v0?"one":i>=2&&i<=4&&v0?"few":!v0?"many":"other"}}); +addLocaleData({"locale":"sl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i100=i.slice(-2);if(ord)return"other";return v0&&i100==1?"one":v0&&i100==2?"two":v0&&(i100==3||i100==4)||!v0?"few":"other"}}); +addLocaleData({"locale":"sma","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"smi","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"smj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"smn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"sms","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"sn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"so","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"so-DJ","parentLocale":"so"}); +addLocaleData({"locale":"so-ET","parentLocale":"so"}); +addLocaleData({"locale":"so-KE","parentLocale":"so"}); +addLocaleData({"locale":"sq","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":n10==4&&n100!=14?"many":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"sq-MK","parentLocale":"sq"}); +addLocaleData({"locale":"sq-XK","parentLocale":"sq"}); +addLocaleData({"locale":"sr","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}}); +addLocaleData({"locale":"sr-Cyrl","parentLocale":"sr"}); +addLocaleData({"locale":"sr-Cyrl-BA","parentLocale":"sr-Cyrl"}); +addLocaleData({"locale":"sr-Cyrl-ME","parentLocale":"sr-Cyrl"}); +addLocaleData({"locale":"sr-Cyrl-XK","parentLocale":"sr-Cyrl"}); +addLocaleData({"locale":"sr-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"sr-Latn-BA","parentLocale":"sr-Latn"}); +addLocaleData({"locale":"sr-Latn-ME","parentLocale":"sr-Latn"}); +addLocaleData({"locale":"sr-Latn-XK","parentLocale":"sr-Latn"}); +addLocaleData({"locale":"ss","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ssy","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"st","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"sv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return(n10==1||n10==2)&&n100!=11&&n100!=12?"one":"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"sv-AX","parentLocale":"sv"}); +addLocaleData({"locale":"sv-FI","parentLocale":"sv"}); +addLocaleData({"locale":"sw","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"sw-CD","parentLocale":"sw"}); +addLocaleData({"locale":"sw-KE","parentLocale":"sw"}); +addLocaleData({"locale":"sw-UG","parentLocale":"sw"}); +addLocaleData({"locale":"syr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ta","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ta-LK","parentLocale":"ta"}); +addLocaleData({"locale":"ta-MY","parentLocale":"ta"}); +addLocaleData({"locale":"ta-SG","parentLocale":"ta"}); +addLocaleData({"locale":"te","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"teo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"teo-KE","parentLocale":"teo"}); +addLocaleData({"locale":"th","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ti","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"ti-ER","parentLocale":"ti"}); +addLocaleData({"locale":"tig","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"tk","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"tl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),f10=f.slice(-1);if(ord)return n==1?"one":"other";return v0&&(i==1||i==2||i==3)||v0&&i10!=4&&i10!=6&&i10!=9||!v0&&f10!=4&&f10!=6&&f10!=9?"one":"other"}}); +addLocaleData({"locale":"tn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"to","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"tr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"tr-CY","parentLocale":"tr"}); +addLocaleData({"locale":"ts","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"twq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"tzm","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n==0||n==1||t0&&n>=11&&n<=99?"one":"other"}}); +addLocaleData({"locale":"ug","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"uk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),i10=i.slice(-1),i100=i.slice(-2);if(ord)return n10==3&&n100!=13?"few":"other";return v0&&i10==1&&i100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i10==0||v0&&(i10>=5&&i10<=9)||v0&&(i100>=11&&i100<=14)?"many":"other"}}); +addLocaleData({"locale":"ur","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"ur-IN","parentLocale":"ur"}); +addLocaleData({"locale":"uz","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"uz-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"uz-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"uz-Latn","parentLocale":"uz"}); +addLocaleData({"locale":"vai","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"vai-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"vai-Vaii","parentLocale":"vai"}); +addLocaleData({"locale":"ve","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"vi","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}}); +addLocaleData({"locale":"vo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"vun","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"wa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"wae","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"wo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"xh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"xog","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"yav","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"yi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"yo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"yo-BJ","parentLocale":"yo"}); +addLocaleData({"locale":"zgh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"zh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"zh-Hans","parentLocale":"zh"}); +addLocaleData({"locale":"zh-Hans-HK","parentLocale":"zh-Hans"}); +addLocaleData({"locale":"zh-Hans-MO","parentLocale":"zh-Hans"}); +addLocaleData({"locale":"zh-Hans-SG","parentLocale":"zh-Hans"}); +addLocaleData({"locale":"zh-Hant","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"zh-Hant-HK","parentLocale":"zh-Hant"}); +addLocaleData({"locale":"zh-Hant-MO","parentLocale":"zh-Hant-HK"}); +addLocaleData({"locale":"zu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); diff --git a/packages/kbn-i18n/src/server/i18n_loader.js b/packages/kbn-i18n/src/server/i18n_loader.js index c73e72fc9aae5..5148b07e9049b 100644 --- a/packages/kbn-i18n/src/server/i18n_loader.js +++ b/packages/kbn-i18n/src/server/i18n_loader.js @@ -17,20 +17,37 @@ * under the License. */ +/** + @typedef Messages - messages tree, where leafs are translated strings + @type {object} + @property {string} [locale] - locale of the messages + */ + import path from 'path'; import { readFile } from 'fs'; import { promisify } from 'util'; import { pick } from 'accept-language-parser'; +import JSON5 from 'json5'; const asyncReadFile = promisify(readFile); +const unique = (arr = []) => + arr.filter((value, index, array) => array.indexOf(value) === index); + +/** + * Abstraction that helps to load, parse and supply + * localization messages to i18n engine + */ export class I18nLoader { static TRANSLATION_FILE_EXTENSION = '.json'; - static unique(arr = []) { - return arr.filter((value, index, array) => array.indexOf(value) === index); - } - + /** + * Returns locale by the given translation file name + * @param {string} fullFileName + * @returns {string} locale + * @example + * getLocaleFromFileName('./path/to/translation/ru.json') // => 'ru' + */ static getLocaleFromFileName(fullFileName) { if (!fullFileName) { throw new Error('Filename is empty'); @@ -40,15 +57,20 @@ export class I18nLoader { if (fileExt !== I18nLoader.TRANSLATION_FILE_EXTENSION) { throw new Error( - `Translations must be in a JSON file. File being registered is ${fullFileName}` + `Translations must have 'json' extension. File being registered is ${fullFileName}` ); } return path.basename(fullFileName, I18nLoader.TRANSLATION_FILE_EXTENSION); } + /** + * Loads file and parses it as JSON5 + * @param {string} pathToFile + * @returns {Promise} + */ static async loadFile(pathToFile) { - return JSON.parse(await asyncReadFile(pathToFile, 'utf8')); + return JSON5.parse(await asyncReadFile(pathToFile, 'utf8')); } /** @@ -56,20 +78,19 @@ export class I18nLoader { * @private * @type {Map|{}} - Key is locale, value is array of registered paths */ - translationsRegistry = {}; + _translationsRegistry = {}; /** * Internal property for caching loaded translations files * @private - * @type {Map|{}} - Key is path to translation file, value is + * @type {Map|{}} - Key is path to translation file, value is * object with translation messages */ - loadedFiles = {}; + _loadedFiles = {}; /** - * The translation file is registered with i18n plugin. - * The plugin contains a list of registered translation file paths per language. - * @param {String} pluginTranslationFilePath - Absolute path to the translation file to register. + * Registers translation file with i18n loader + * @param {string} pluginTranslationFilePath - Absolute path to the translation file to register. */ registerTranslationFile(pluginTranslationFilePath) { if (!path.isAbsolute(pluginTranslationFilePath)) { @@ -81,57 +102,60 @@ export class I18nLoader { const locale = I18nLoader.getLocaleFromFileName(pluginTranslationFilePath); - this.translationsRegistry[locale] = I18nLoader.unique([ - ...(this.translationsRegistry[locale] || []), + this._translationsRegistry[locale] = unique([ + ...(this._translationsRegistry[locale] || []), pluginTranslationFilePath, ]); } + /** + * Registers array of translation files with i18n loader + * @param {string[]} arrayOfPaths - Array of absolute paths to the translation files to register. + */ registerTranslationFiles(arrayOfPaths = []) { arrayOfPaths.forEach(this.registerTranslationFile.bind(this)); } - getRegisteredTranslations() { - return Object.keys(this.translationsRegistry); - } - - pickLocaleByLanguageHeader(header) { - return pick(this.getRegisteredTranslations(), header); + /** + * Returns an array of locales that have been registered with i18n loader + * @returns {string[]} registeredTranslations + */ + getRegisteredLocales() { + return Object.keys(this._translationsRegistry); } /** - * Return translations for a suitable locale from a user side locale list - * @param {...string} languageTags - BCP 47 language tags. The tags are listed in priority order as set in the Accept-Language header. - * @returns {Promise} translations - promise for an object where - * keys are translation keys and - * values are translations - * This object will contain all registered translations for the highest priority locale which is registered with the i18n module. - * This object can be empty if no locale in the language tags can be matched against the registered locales. + * Returns translations for a suitable locale based on accept-language header. + * This object will contain all registered translations for the highest priority + * locale which is registered with the i18n loader. This object can be empty + * if no locale in the language tags can be matched against the registered locales. + * @param {string} header - accept-language header from an HTTP request + * @returns {Promise} translations - translation messages */ async getTranslationsByLanguageHeader(header) { return this.getTranslationsByLocale( - this.pickLocaleByLanguageHeader(header) + this._pickLocaleByLanguageHeader(header) ); } /** * Returns translation messages by specified locale - * @param locale - * @returns {Promise} + * @param {string} locale + * @returns {Promise} translations - translation messages */ async getTranslationsByLocale(locale) { - const files = this.translationsRegistry[locale] || []; - const notLoadedFiles = files.filter(file => !this.loadedFiles[file]); + const files = this._translationsRegistry[locale] || []; + const notLoadedFiles = files.filter(file => !this._loadedFiles[file]); if (notLoadedFiles.length) { - await this.loadAndCacheFiles(notLoadedFiles); + await this._loadAndCacheFiles(notLoadedFiles); } return files.length ? files.reduce( (messages, file) => ({ ...messages, - ...this.loadedFiles[file], + ...this._loadedFiles[file], }), { locale } ) @@ -140,11 +164,11 @@ export class I18nLoader { /** * Returns all translations for registered locales - * @return {Promise} translations - A Promise object where keys are - * the locale and values are Objects of translation keys and translations + * @return {Promise>} translations - A Promise object + * where keys are the locale and values are objects of translation messages */ async getAllTranslations() { - const locales = this.getRegisteredTranslations(); + const locales = this.getRegisteredLocales(); const translations = await Promise.all( locales.map(locale => this.getTranslationsByLocale(locale)) ); @@ -159,20 +183,31 @@ export class I18nLoader { } /** - * Loads translations files and adds them into "loadedFiles" cache + * Parses the accept-language header from an HTTP request and picks + * the best match of the locale from the registered locales + * @private + * @param {string} header - accept-language header from an HTTP request + * @returns {string} locale + */ + _pickLocaleByLanguageHeader(header) { + return pick(this.getRegisteredLocales(), header); + } + + /** + * Loads translations files and adds them into "_loadedFiles" cache * @private * @param {string[]} files * @returns {Promise} */ - async loadAndCacheFiles(files) { + async _loadAndCacheFiles(files) { const translations = await Promise.all(files.map(I18nLoader.loadFile)); - this.loadedFiles = files.reduce( + this._loadedFiles = files.reduce( (loadedFiles, file, index) => ({ ...loadedFiles, [file]: translations[index], }), - this.loadedFiles + this._loadedFiles ); } } diff --git a/packages/kbn-i18n/src/server/ui_i18n_mixin.js b/packages/kbn-i18n/src/server/ui_i18n_mixin.js index 33d37b23793d9..feabaa8dc7e83 100644 --- a/packages/kbn-i18n/src/server/ui_i18n_mixin.js +++ b/packages/kbn-i18n/src/server/ui_i18n_mixin.js @@ -17,6 +17,12 @@ * under the License. */ +/** + @typedef Messages - messages tree, where leafs are translated strings + @type {object} + @property {string} [locale] - locale of the messages + */ + import { I18nLoader } from './i18n_loader'; export function uiI18nMixin(kbnServer, server, config) { @@ -29,7 +35,7 @@ export function uiI18nMixin(kbnServer, server, config) { /** * Fetch the translations matching the Accept-Language header for a requests. * @name request.getUiTranslations - * @returns {Promise>} translations + * @returns {Promise} translations - translation messages */ server.decorate('request', 'getUiTranslations', async function() { const header = this.headers['accept-language']; @@ -48,7 +54,8 @@ export function uiI18nMixin(kbnServer, server, config) { /** * Return all translations for registered locales * @name server.getAllUiTranslations - * @return {Promise>>} + * @return {Promise>} translations - A Promise object + * where keys are the locale and values are objects of translation messages */ server.decorate('server', 'getAllUiTranslations', async () => { return await i18nLoader.getAllTranslations(); diff --git a/packages/kbn-i18n/yarn.lock b/packages/kbn-i18n/yarn.lock index cf0ac4bc277b1..805926e4c2213 100644 --- a/packages/kbn-i18n/yarn.lock +++ b/packages/kbn-i18n/yarn.lock @@ -52,7 +52,7 @@ intl-messageformat@^2.0.0, intl-messageformat@^2.1.0, intl-messageformat@^2.2.0: dependencies: intl-messageformat-parser "1.4.0" -intl-relativeformat@^2.0.0: +intl-relativeformat@^2.0.0, intl-relativeformat@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/intl-relativeformat/-/intl-relativeformat-2.1.0.tgz#010f1105802251f40ac47d0e3e1a201348a255df" dependencies: @@ -79,12 +79,22 @@ js-tokens@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + dependencies: + minimist "^1.2.0" + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" From dc50b75f5582ce5bff42c30df66434a101ebafcc Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Thu, 7 Jun 2018 15:33:55 +0300 Subject: [PATCH 011/186] Fix verify_translations task --- packages/kbn-i18n/src/server/i18n_loader.js | 15 +++++++++++++++ tasks/verify_translations.js | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/kbn-i18n/src/server/i18n_loader.js b/packages/kbn-i18n/src/server/i18n_loader.js index 5148b07e9049b..7de0b1e800de0 100644 --- a/packages/kbn-i18n/src/server/i18n_loader.js +++ b/packages/kbn-i18n/src/server/i18n_loader.js @@ -41,6 +41,21 @@ const unique = (arr = []) => export class I18nLoader { static TRANSLATION_FILE_EXTENSION = '.json'; + /** + * Registers passed translations files, loads them and returns promise with + * all translation messages + * @param {string[]} paths - Array of absolute paths to the translation files + * @returns {Promise>} translations - A Promise object + * where keys are the locale and values are objects of translation messages + */ + static async getAllTranslationsFromPaths(paths) { + const i18nLoader = new I18nLoader(); + + i18nLoader.registerTranslationFiles(paths); + + return await i18nLoader.getAllTranslations(); + } + /** * Returns locale by the given translation file name * @param {string} fullFileName diff --git a/tasks/verify_translations.js b/tasks/verify_translations.js index 045753fa8ade0..df75a4cd7dad4 100644 --- a/tasks/verify_translations.js +++ b/tasks/verify_translations.js @@ -17,10 +17,12 @@ * under the License. */ +// TODO: Integrate a new tool for translations checking +import { I18nLoader } from '@kbn/i18n/src/server'; + import { fromRoot, formatListAsProse } from '../src/utils'; import { findPluginSpecs } from '../src/plugin_discovery'; import { collectUiExports } from '../src/ui'; -import { I18n } from '../src/ui/ui_i18n/i18n'; import * as i18nVerify from './utils/i18n_verify_keys'; @@ -64,7 +66,7 @@ async function verifyTranslations(uiExports) { } // get all of the translations from uiExports - const translations = await I18n.getAllTranslationsFromPaths(uiExports.translationPaths); + const translations = await I18nLoader.getAllTranslationsFromPaths(uiExports.translationPaths); const keysWithoutTranslations = Object.entries( i18nVerify.getNonTranslatedKeys(keysUsedInViews, translations) ); From 929c406aedac2b60f7e9c5d56442ec19be26cef8 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Thu, 7 Jun 2018 16:38:43 +0300 Subject: [PATCH 012/186] I18n tests refactoring --- .../kbn-i18n/src/server/__tests__/i18n.js | 203 ++++++++---------- 1 file changed, 87 insertions(+), 116 deletions(-) diff --git a/packages/kbn-i18n/src/server/__tests__/i18n.js b/packages/kbn-i18n/src/server/__tests__/i18n.js index 36f4002bbf7f4..1bf4ce5dbedce 100644 --- a/packages/kbn-i18n/src/server/__tests__/i18n.js +++ b/packages/kbn-i18n/src/server/__tests__/i18n.js @@ -25,13 +25,11 @@ import { I18nLoader } from '../i18n_loader'; const FIXTURES = join(__dirname, 'fixtures'); -describe('ui/i18n module', function() { - +describe('kbn/i18n module', function() { describe('one plugin', function() { - const i18nObj = new I18nLoader(); - before('registerTranslations - one plugin', function() { + before('registerTranslationFile - one plugin', function() { const pluginName = 'test_plugin_1'; const pluginTranslationPath = join(FIXTURES, 'translations', pluginName); const translationFiles = [ @@ -42,124 +40,96 @@ describe('ui/i18n module', function() { }); describe('getTranslations', function() { - - it('should return the translations for en locale as registered', function () { - const languageTag = ['en']; + it('should return the translations for en locale as registered', function() { + const langHeader = 'en'; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', 'test_plugin_1-DEV': 'Run the server with development mode defaults', 'test_plugin_1-NO_RUN_SERVER': 'Dont run the dev server', - 'test_plugin_1-HOME': 'Run along home now!' + 'test_plugin_1-HOME': 'Run along home now!', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - it('should return the translations for de locale as registered', function () { - const languageTag = ['de']; + it('should return the translations for de locale as registered', function() { + const langHeader = 'de'; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults' + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - it('should pick the highest priority language for which translations exist', function () { - const languageTags = ['es-ES', 'de', 'en']; + it('should pick the highest priority language for which translations exist', function() { + const langHeader = 'es-ES,de;q=0.9,en;q=0.8'; const expectedTranslations = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults', + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }; - return checkTranslations(expectedTranslations, languageTags, i18nObj); + return checkTranslations(expectedTranslations, langHeader, i18nObj); }); - it('should return translations for highest priority locale where best case match is chosen from registered locales', function () { - const languageTags = ['es', 'de']; + it('should return translations for highest priority locale where best case match is chosen from registered locales', function() { + const langHeader = 'es,de;q=0.9'; const expectedTranslations = { - 'test_plugin_1-NO_SSL': 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!' + 'test_plugin_1-NO_SSL': + 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!', }; - i18nObj.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'es-ES.json')); - return checkTranslations(expectedTranslations, languageTags, i18nObj); + i18nObj.registerTranslationFile( + join(FIXTURES, 'translations', 'test_plugin_1', 'es-ES.json') + ); + return checkTranslations(expectedTranslations, langHeader, i18nObj); }); - it('should return an empty object for locales with no translations', function () { - const languageTags = ['ja-JA', 'fr']; - return checkTranslations({}, languageTags, i18nObj); + it('should return an empty object for locales with no translations', function() { + const langHeader = 'ja-JA,fr;q=0.9'; + return checkTranslations({}, langHeader, i18nObj); }); - }); - describe('getTranslationsForDefaultLocale', function () { - - it('should return translations for default locale which is set to the en locale', function () { - const i18nObj1 = new I18n('en'); - const expectedTranslations = { - 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the server with development mode defaults', - 'test_plugin_1-NO_RUN_SERVER': 'Dont run the dev server', - 'test_plugin_1-HOME': 'Run along home now!' - }; - i18nObj1.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'en.json')); - return checkTranslationsForDefaultLocale(expectedTranslations, i18nObj1); - }); - - it('should return translations for default locale which is set to the de locale', function () { - const i18nObj1 = new I18n('de'); - const expectedTranslations = { - 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults', - }; - i18nObj1.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'de.json')); - return checkTranslationsForDefaultLocale(expectedTranslations, i18nObj1); - }); - - }); - - describe('getAllTranslations', function () { - - it('should return all translations', function () { + describe('getAllTranslations', function() { + it('should return all translations', function() { const expectedTranslations = { de: { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults' + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }, en: { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the server with development mode defaults', + 'test_plugin_1-DEV': + 'Run the server with development mode defaults', 'test_plugin_1-NO_RUN_SERVER': 'Dont run the dev server', - 'test_plugin_1-HOME': 'Run along home now!' + 'test_plugin_1-HOME': 'Run along home now!', }, 'es-ES': { - 'test_plugin_1-NO_SSL': 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!' - } + 'test_plugin_1-NO_SSL': + 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!', + }, }; return checkAllTranslations(expectedTranslations, i18nObj); }); - }); - }); - describe('multiple plugins', function () { - - const i18nObj = new I18n(); + describe('multiple plugins', function() { + const i18nObj = new I18nLoader(); - beforeEach('registerTranslations - multiple plugin', function () { + beforeEach('registerTranslationFile - multiple plugin', function() { const pluginTranslationPath = join(FIXTURES, 'translations'); const translationFiles = [ join(pluginTranslationPath, 'test_plugin_1', 'de.json'), join(pluginTranslationPath, 'test_plugin_1', 'en.json'), - join(pluginTranslationPath, 'test_plugin_2', 'en.json') + join(pluginTranslationPath, 'test_plugin_2', 'en.json'), ]; - const filesLen = translationFiles.length; - for (let indx = 0; indx < filesLen; indx++) { - i18nObj.registerTranslations(translationFiles[indx]); - } + i18nObj.registerTranslationFiles(translationFiles); }); - describe('getTranslations', function () { - - it('should return the translations for en locale as registered', function () { - const languageTag = ['en']; + describe('getTranslations', function() { + it('should return the translations for en locale as registered', function() { + const langHeader = 'en'; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', 'test_plugin_1-DEV': 'Run the server with development mode defaults', @@ -168,75 +138,76 @@ describe('ui/i18n module', function() { 'test_plugin_2-XXXXXX': 'This is XXXXXX string', 'test_plugin_2-YYYY_PPPP': 'This is YYYY_PPPP string', 'test_plugin_2-FFFFFFFFFFFF': 'This is FFFFFFFFFFFF string', - 'test_plugin_2-ZZZ': 'This is ZZZ string' + 'test_plugin_2-ZZZ': 'This is ZZZ string', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - it('should return the translations for de locale as registered', function () { - const languageTag = ['de']; + it('should return the translations for de locale as registered', function() { + const langHeader = 'de'; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults' + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - it('should return the most recently registered translation for a key that has multiple translations', function () { - i18nObj.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_2', 'de.json')); - const languageTag = ['de']; + it('should return the most recently registered translation for a key that has multiple translations', function() { + i18nObj.registerTranslationFile( + join(FIXTURES, 'translations', 'test_plugin_2', 'de.json') + ); + const langHeader = 'de'; const expectedTranslationJson = { - 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS! I am regsitered afterwards!', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults' + 'test_plugin_1-NO_SSL': + 'Dont run the DE dev server using HTTPS! I am regsitered afterwards!', + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - }); - }); - describe('registerTranslations', function () { - - const i18nObj = new I18n(); + describe('registerTranslationFile', function() { + const i18nObj = new I18nLoader(); - it('should throw error when registering relative path', function () { - return expect(i18nObj.registerTranslations).withArgs('./some/path').to.throwError(); + it('should throw error when registering relative path', function() { + return expect(i18nObj.registerTranslationFile) + .withArgs('./some/path') + .to.throwError(); }); - it('should throw error when registering empty filename', function () { - return expect(i18nObj.registerTranslations).withArgs('').to.throwError(); + it('should throw error when registering empty filename', function() { + return expect(i18nObj.registerTranslationFile) + .withArgs('') + .to.throwError(); }); - it('should throw error when registering filename with no extension', function () { - return expect(i18nObj.registerTranslations).withArgs('file1').to.throwError(); + it('should throw error when registering filename with no extension', function() { + return expect(i18nObj.registerTranslationFile) + .withArgs('file1') + .to.throwError(); }); - it('should throw error when registering filename with non JSON extension', function () { - return expect(i18nObj.registerTranslations).withArgs('file1.txt').to.throwError(); + it('should throw error when registering filename with non JSON extension', function() { + return expect(i18nObj.registerTranslationFile) + .withArgs('file1.txt') + .to.throwError(); }); - }); - }); -function checkTranslations(expectedTranslations, languageTags, i18nObj) { - return i18nObj.getTranslations(...languageTags) - .then(function (actualTranslations) { +function checkTranslations(expectedTranslations, langHeader, i18nObj) { + return i18nObj + .getTranslationsByLanguageHeader(langHeader) + .then(function(actualTranslations) { expect(_.isEqual(actualTranslations, expectedTranslations)).to.be(true); }); } function checkAllTranslations(expectedTranslations, i18nObj) { - return i18nObj.getAllTranslations() - .then(function (actualTranslations) { - expect(_.isEqual(actualTranslations, expectedTranslations)).to.be(true); - }); -} - -function checkTranslationsForDefaultLocale(expectedTranslations, i18nObj) { - return i18nObj.getTranslationsForDefaultLocale() - .then(function (actualTranslations) { - expect(_.isEqual(actualTranslations, expectedTranslations)).to.be(true); - }); + return i18nObj.getAllTranslations().then(function(actualTranslations) { + expect(_.isEqual(actualTranslations, expectedTranslations)).to.be(true); + }); } From 1deea3a093017b3c965bf1b2e87a3fc3d640d615 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Thu, 7 Jun 2018 18:42:22 +0300 Subject: [PATCH 013/186] Add build scripts to kbn-i18n package --- packages/kbn-i18n/.babelrc | 3 + packages/kbn-i18n/README.md | 2 +- packages/kbn-i18n/package.json | 13 +- packages/kbn-i18n/yarn.lock | 1577 ++++++++++++++++++++++++++- src/ui/ui_render/ui_render_mixin.js | 2 +- 5 files changed, 1590 insertions(+), 7 deletions(-) create mode 100644 packages/kbn-i18n/.babelrc diff --git a/packages/kbn-i18n/.babelrc b/packages/kbn-i18n/.babelrc new file mode 100644 index 0000000000000..7da72d1779128 --- /dev/null +++ b/packages/kbn-i18n/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["@kbn/babel-preset/node_preset"] +} diff --git a/packages/kbn-i18n/README.md b/packages/kbn-i18n/README.md index 202f01e59c05d..b2ad18eee9822 100644 --- a/packages/kbn-i18n/README.md +++ b/packages/kbn-i18n/README.md @@ -313,7 +313,7 @@ for all 200+ languages is loaded along with the library) and pass the translatio messages into the constructor: ```js -import { I18n } from '@kbn/i18n/src/i18n'; +import { I18n } from '@kbn/i18n'; const i18n = new I18n(messages); ``` diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index 689fddd6a9014..372f15dcfe829 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -1,9 +1,20 @@ { "name": "@kbn/i18n", - "main": "./src/index.js", + "main": "./target/index.js", + "jsnext:main": "./src/index.js", "version": "1.0.0", "license": "Apache-2.0", "private": true, + "scripts": { + "build": "babel src --out-dir target", + "kbn:bootstrap": "yarn build", + "kbn:watch": "yarn build --watch" + }, + "devDependencies": { + "@kbn/babel-preset": "link:../kbn-babel-preset", + "@kbn/dev-utils": "link:../kbn-dev-utils", + "babel-cli": "^6.26.0" + }, "dependencies": { "accept-language-parser": "^1.5.0", "intl-format-cache": "^2.1.0", diff --git a/packages/kbn-i18n/yarn.lock b/packages/kbn-i18n/yarn.lock index 805926e4c2213..7bd2ad5047948 100644 --- a/packages/kbn-i18n/yarn.lock +++ b/packages/kbn-i18n/yarn.lock @@ -2,24 +2,876 @@ # yarn lockfile v1 +"@kbn/babel-preset@link:../kbn-babel-preset": + version "0.0.0" + uid "" + +"@kbn/dev-utils@link:../kbn-dev-utils": + version "0.0.0" + uid "" + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + accept-language-parser@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/accept-language-parser/-/accept-language-parser-1.5.0.tgz#8877c54040a8dcb59e0a07d9c1fde42298334791" +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +babel-cli@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" + dependencies: + babel-core "^6.26.0" + babel-polyfill "^6.26.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + commander "^2.11.0" + convert-source-map "^1.5.0" + fs-readdir-recursive "^1.0.0" + glob "^7.1.2" + lodash "^4.17.4" + output-file-sync "^1.1.2" + path-is-absolute "^1.0.1" + slash "^1.0.0" + source-map "^0.5.6" + v8flags "^2.1.1" + optionalDependencies: + chokidar "^1.6.1" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-builder-react-jsx@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz#39ff8313b75c8b65dceff1f31d383e0ff2a408a0" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + esutils "^2.0.2" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-add-module-exports@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-async-generators@^6.5.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-flow@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" + +babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" + +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-generator-functions@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-define@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-define/-/babel-plugin-transform-define-1.3.0.tgz#94c5f9459c810c738cc7c50cbd44a31829d6f319" + dependencies: + lodash "4.17.4" + traverse "0.6.6" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.2" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" + dependencies: + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-object-rest-spread@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + +babel-plugin-transform-react-display-name@^6.23.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-self@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz#df6d80a9da2612a121e6ddd7558bcbecf06e636e" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-source@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz#66ac12153f5cd2d17b3c19268f4bf0197f44ecd6" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3" + dependencies: + babel-helper-builder-react-jsx "^6.24.1" + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + +babel-preset-env@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.4.0.tgz#c8e02a3bcc7792f23cded68e0355b9d4c28f0f7a" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^1.4.0" + invariant "^2.2.2" + +babel-preset-flow@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d" + dependencies: + babel-plugin-transform-flow-strip-types "^6.22.0" + +babel-preset-react@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" + dependencies: + babel-plugin-syntax-jsx "^6.3.13" + babel-plugin-transform-react-display-name "^6.23.0" + babel-plugin-transform-react-jsx "^6.24.1" + babel-plugin-transform-react-jsx-self "^6.22.0" + babel-plugin-transform-react-jsx-source "^6.22.0" + babel-preset-flow "^6.23.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +binary-extensions@^1.0.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browserslist@^1.4.0: + version "1.7.7" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9" + dependencies: + caniuse-db "^1.0.30000639" + electron-to-chromium "^1.2.7" + +caniuse-db@^1.0.30000639: + version "1.0.30000850" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000850.tgz#965c816641576d08709bee12256a0550164b95d5" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +chownr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +color-convert@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +commander@^2.11.0: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +convert-source-map@^1.5.0, convert-source-map@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + core-js@^1.0.0: version "1.2.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" +core-js@^2.4.0, core-js@^2.5.0: + version "2.5.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +debug@^2.1.2, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +electron-to-chromium@^1.2.7: + version "1.3.48" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz#d3b0d8593814044e092ece2108fc3ac9aea4b900" + encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" dependencies: iconv-lite "~0.4.13" +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +execa@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" + dependencies: + cross-spawn "^6.0.0" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + fbjs@^0.8.16: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" @@ -32,12 +884,148 @@ fbjs@^0.8.16: setimmediate "^1.0.5" ua-parser-js "^0.7.9" -iconv-lite@~0.4.13: +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + +fs-readdir-recursive@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@^7.0.5, glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +graceful-fs@^4.1.2, graceful-fs@^4.1.4: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" dependencies: safer-buffer ">= 2.1.2 < 3" +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + intl-format-cache@^2.0.5, intl-format-cache@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-2.1.0.tgz#04a369fecbfad6da6005bae1f14333332dcf9316" @@ -58,16 +1046,98 @@ intl-relativeformat@^2.0.0, intl-relativeformat@^2.1.0: dependencies: intl-messageformat "^2.0.0" -invariant@^2.1.1: +invariant@^2.1.1, invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: loose-envify "^1.0.0" -is-stream@^1.0.1: +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + isomorphic-fetch@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" @@ -75,26 +1145,131 @@ isomorphic-fetch@^2.1.1: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" -js-tokens@^3.0.0: +js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + json5@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" dependencies: minimist "^1.2.0" +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +lodash@4.17.4: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +lodash@^4.17.4: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +minipass@^2.2.1, minipass@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" + dependencies: + minipass "^2.2.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +moment@^2.20.1: + version "2.22.2" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +nan@^2.9.2: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + +needle@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +nice-try@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -102,10 +1277,137 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" +node-pre-gyp@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz#6e4ef5bb5c5203c6552448828c852c40111aac46" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.0" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.1.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.0.0, normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-bundled@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + +npm-packlist@^1.1.6: + version "1.1.10" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +output-file-sync@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +private@^0.1.6, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -120,6 +1422,23 @@ prop-types@^15.5.8, prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" +randomatic@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +rc@^1.1.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + react-intl@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.4.0.tgz#66c14dc9df9a73b2fbbfbd6021726e80a613eb15" @@ -138,18 +1457,268 @@ react@^16.3.0: object-assign "^4.1.1" prop-types "^15.6.0" +readable-stream@^2.0.2, readable-stream@^2.0.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +regenerate@^1.2.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +rimraf@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +semver@^5.3.0, semver@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^5.3.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + dependencies: + has-flag "^3.0.0" + +tar@^4: + version "4.4.4" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.4.tgz#ec8409fae9f665a4355cc3b4087d0820232bb8cd" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.3.3" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +traverse@0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + +tree-kill@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + ua-parser-js@^0.7.9: version "0.7.18" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +v8flags@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + dependencies: + user-home "^1.1.1" + whatwg-fetch@>=0.10.0: version "2.0.4" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" diff --git a/src/ui/ui_render/ui_render_mixin.js b/src/ui/ui_render/ui_render_mixin.js index 06c74286023e2..ec2fde52dfd26 100644 --- a/src/ui/ui_render/ui_render_mixin.js +++ b/src/ui/ui_render/ui_render_mixin.js @@ -21,7 +21,7 @@ import { defaults } from 'lodash'; import { props, reduce as reduceAsync } from 'bluebird'; import Boom from 'boom'; import { resolve } from 'path'; -import { I18n } from '@kbn/i18n/src/i18n'; +import { I18n } from '@kbn/i18n'; import { AppBootstrap } from './bootstrap'; export function uiRenderMixin(kbnServer, server, config) { From fc77dd91f5f0f1413005a15cce7516c6f1d57ca3 Mon Sep 17 00:00:00 2001 From: maryia-lapata Date: Fri, 8 Jun 2018 15:03:46 +0300 Subject: [PATCH 014/186] integration i18n-ingine with index pattern tab: edit_index_pattern --- .eslintignore | 2 +- .../edit_index_pattern.html | 45 +++++---- .../edit_index_pattern/edit_index_pattern.js | 13 ++- .../edit_index_pattern/edit_sections.js | 8 +- .../edit_index_pattern/field_controls.html | 4 +- .../index_header/index_header.html | 12 +-- .../components/table/table.js | 93 +++++++++++++------ .../indexed_fields_table.js | 20 ++-- .../scripted_field_editor.html | 7 +- .../scripted_field_editor.js | 14 ++- .../components/call_outs/call_outs.js | 53 ++++++++--- .../components/header/header.js | 17 +++- .../components/table/table.js | 57 ++++++++---- .../scripted_fields_table.js | 59 +++++++----- .../components/add_filter/add_filter.js | 46 +++++---- .../components/header/header.js | 22 ++++- .../components/table/table.js | 59 ++++++++---- .../source_filters_table.js | 47 ++++++---- .../management/sections/indices/index.html | 14 +-- 19 files changed, 390 insertions(+), 202 deletions(-) diff --git a/.eslintignore b/.eslintignore index ef01aad717779..ceff2d9d22291 100644 --- a/.eslintignore +++ b/.eslintignore @@ -28,4 +28,4 @@ bower_components /x-pack/plugins/**/__tests__/fixtures/** **/*.js.snap !/.eslintrc.js -* + diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.html b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.html index 6ef99c10c25b3..b56ae2646f49a 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.html +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.html @@ -5,7 +5,7 @@ data-test-subj="editIndexPattern" class="kuiViewContent" role="region" - aria-label="Index pattern details" + aria-label="{{'management.indices.indexPattern.details_aria' | i18n: {defaultMessage: 'Index pattern details'} }}" > - Time Filter field name: {{indexPattern.timeFieldName}} +

- This page lists every field in the {{::indexPattern.title}} index and the field's associated core type as recorded by Elasticsearch. To change a field type, use the Elasticsearch + - Mapping API +

@@ -37,16 +42,18 @@ >
- - Support for repeating index patterns removed +
- Support for time-interval based index patterns has been removed! In the next major +
@@ -57,14 +64,16 @@ >
- - Mapping conflict - +
- {{conflictFields.length > 1 ? conflictFields.length : 'A'}} field{{conflictFields.length > 1 ? 's' : ''}} {{conflictFields.length > 1 ? 'are' : 'is'}} defined as several types (string, integer, etc) across the indices that match this pattern. You may still be able to use these conflict fields in parts of Kibana, but they will be unavailable for functions that require Kibana to know their type. Correcting this issue will require reindexing your data. +
@@ -96,9 +105,9 @@ @@ -115,7 +124,9 @@ ng-change="changeFilter('indexedFieldTypeFilter', indexedFieldTypeFilter)" ng-options="o for o in indexedFieldTypes" > - + @@ -130,7 +141,9 @@ ng-change="changeFilter('scriptedFieldLanguageFilter', scriptedFieldLanguageFilter)" ng-options="o for o in scriptedFieldLanguages" > - + diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.js index 1f91327545226..20b63601a4b55 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.js @@ -173,7 +173,7 @@ uiRoutes uiModules.get('apps/management') .controller('managementIndicesEdit', function ( - $scope, $location, $route, config, courier, Notifier, Private, AppState, docTitle, confirmModal) { + $scope, $location, $route, config, courier, Notifier, Private, AppState, docTitle, confirmModal, i18n) { const notify = new Notifier(); const $state = $scope.state = new AppState(); const { fieldWildcardMatcher } = Private(FieldWildcardProvider); @@ -234,15 +234,17 @@ uiModules.get('apps/management') $scope.refreshFields = function () { const confirmModalOptions = { - confirmButtonText: 'Refresh', + confirmButtonText: i18n('management.indices.editIndexPattern.refresh', { defaultMessage: 'Refresh' }), onConfirm: async () => { await $scope.indexPattern.init(true); $scope.fields = $scope.indexPattern.getNonScriptedFields(); }, - title: 'Refresh field list?' + title: i18n('management.indices.editIndexPattern.refresh.question', { defaultMessage: 'Refresh field list?' }) }; confirmModal( - 'This action resets the popularity counter of each field.', + i18n( + 'management.indices.editIndexPattern.refresh.describe', + { defaultMessage: 'This action resets the popularity counter of each field.' }), confirmModalOptions ); }; @@ -278,7 +280,8 @@ uiModules.get('apps/management') $scope.setIndexPatternsTimeField = function (field) { if (field.type !== 'date') { - notify.error('That field is a ' + field.type + ' not a date.'); + notify.error(i18n('management.indices.editIndexPattern.error.wrongType', + { values: { fieldType: field.type }, defaultMessage: 'That field is a {fieldType} not a date.' })); return; } $scope.indexPattern.timeFieldName = field.name; diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_sections.js b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_sections.js index cdc65a110636f..072df93df3b24 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_sections.js +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_sections.js @@ -19,7 +19,7 @@ import _ from 'lodash'; -export function IndicesEditSectionsProvider() { +export function IndicesEditSectionsProvider(i18n) { return function (indexPattern) { const fieldCount = _.countBy(indexPattern.fields, function (field) { @@ -34,17 +34,17 @@ export function IndicesEditSectionsProvider() { return [ { - title: 'Fields', + title: i18n('management.indices.editIndexPattern.tabs.fields', { defaultMessage: 'Fields' }), index: 'indexedFields', count: fieldCount.indexed }, { - title: 'Scripted fields', + title: i18n('management.indices.editIndexPattern.tabs.scripted', { defaultMessage: 'Scripted fields' }), index: 'scriptedFields', count: fieldCount.scripted }, { - title: 'Source filters', + title: i18n('management.indices.editIndexPattern.tabs.source', { defaultMessage: 'Source filters' }), index: 'sourceFilters', count: fieldCount.sourceFilters } diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/field_controls.html b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/field_controls.html index 794f1da2a7b79..6d3c6614c8926 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/field_controls.html +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/field_controls.html @@ -2,7 +2,7 @@ @@ -12,7 +12,7 @@ ng-if="field.scripted" ng-click="remove(field)" class="kuiButton kuiButton--danger kuiButton--small" - aria-label="Delete" + aria-label="{{'management.indices.indexPattern.btn.delete' | i18n: {defaultMessage: 'Delete'} }}" > diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/index_header/index_header.html b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/index_header/index_header.html index 2e2d828cd6e2e..eefc8eae9f81c 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/index_header/index_header.html +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/index_header/index_header.html @@ -18,8 +18,8 @@ From 598ad2e545fb8c8457fa3f04757ed3ecd23b3387 Mon Sep 17 00:00:00 2001 From: Maryia Lapata Date: Wed, 6 Jun 2018 17:14:34 +0300 Subject: [PATCH 063/186] Intergation of time step with i18n --- .../components/empty_state/empty_state.js | 38 ++++++++-- .../components/header/header.js | 6 +- .../components/loading_state/loading_state.js | 16 ++++- .../components/header/header.js | 12 ++-- .../components/indices_list/indices_list.js | 2 +- .../loading_indices/loading_indices.js | 4 +- .../status_message/status_message.js | 40 ++++++----- .../step_index_pattern/step_index_pattern.js | 6 +- .../action_buttons/action_buttons.js | 14 +++- .../advanced_options/advanced_options.js | 71 +++++++++++++------ .../components/header/header.js | 17 ++++- .../components/time_field/time_field.js | 63 ++++++++++++---- .../step_time_field/step_time_field.js | 11 ++- .../create_index_pattern_wizard/render.js | 2 +- 14 files changed, 220 insertions(+), 82 deletions(-) diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/empty_state/empty_state.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/empty_state/empty_state.js index 304f3875cc05e..9f5a9c787a447 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/empty_state/empty_state.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/empty_state/empty_state.js @@ -32,6 +32,10 @@ import { EuiButton, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export const EmptyState = ({ onRefresh, }) => ( @@ -40,26 +44,45 @@ export const EmptyState = ({ -

Couldn't find any Elasticsearch data

+

+ ' }} + /> +

- You'll need to index some data into Elasticsearch before you can create an index pattern. + ' }} + />   - Learn how + - {' or '} + - get started with some sample data sets. +

@@ -73,7 +96,10 @@ export const EmptyState = ({ onClick={onRefresh} data-test-subj="refreshIndicesButton" > - Check for new data +
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js index e51a50c0003c3..9b1e3f9b4e8fc 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js @@ -42,7 +42,7 @@ export const Header = ({

@@ -54,7 +54,7 @@ export const Header = ({

@@ -64,7 +64,7 @@ export const Header = ({ } checked={isIncludingSystemIndices} diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/loading_state/loading_state.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/loading_state/loading_state.js index 692f76cc29a2f..dd35f4dd4a6f5 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/loading_state/loading_state.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/loading_state/loading_state.js @@ -30,13 +30,22 @@ import { EuiTitle, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export const LoadingState = () => ( -

Checking for Elasticsearch data

+

+ +

@@ -49,7 +58,10 @@ export const LoadingState = () => ( - Reticulating splines... + diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js index 8ae3a707282fc..ede0a6c078ab1 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/header/header.js @@ -48,7 +48,7 @@ export const Header = ({

@@ -61,7 +61,7 @@ export const Header = ({ > } isInvalid={isInputInvalid} @@ -70,14 +70,14 @@ export const Header = ({

* }} />

', characterList: {characterList} }} /> @@ -90,7 +90,7 @@ export const Header = ({ diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js index 7691bc0e942ba..8531b3f231d88 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js @@ -103,7 +103,7 @@ export class IndicesList extends Component { onClick={this.openPerPageControl} > diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js index 845a277295c99..edbf6f8023349 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/loading_indices/loading_indices.js @@ -45,7 +45,7 @@ export const LoadingIndices = ({ ...rest }) => ( @@ -54,7 +54,7 @@ export const LoadingIndices = ({ ...rest }) => ( diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js index a75c4f30f13a0..c7559e96766a2 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/status_message/status_message.js @@ -50,7 +50,7 @@ export const StatusMessage = ({ statusMessage = ( @@ -79,7 +79,7 @@ export const StatusMessage = ({ statusMessage = ( @@ -94,21 +94,23 @@ export const StatusMessage = ({     - ) + exactMatchedIndices: ( + + + ) }} /> @@ -120,19 +122,19 @@ export const StatusMessage = ({ statusMessage = ( ', space:   }} /> @@ -145,10 +147,12 @@ export const StatusMessage = ({ statusMessage = ( ', allIndices: (', allIndices: ( + diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js index 1d6061c679447..08662813b753c 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js @@ -210,14 +210,14 @@ export class StepIndexPattern extends Component { return ( } iconType="help" color="warning" >

', query }} /> @@ -240,7 +240,7 @@ export class StepIndexPattern extends Component { } else if (!containsInvalidCharacters(query, ILLEGAL_CHARACTERS)) { errors.push(intl.formatMessage({ - id: 'management.indices.indexPattern.error.invalidCharacters', + id: 'management.indices.createIndexPattern.step.error.invalidCharacters', defaultMessage: 'An index pattern cannot contain spaces or the characters: {characterList}' }, { characterList })); containsErrors = true; diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.js index b8d11fbf238c8..5baaf71ca4553 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.js @@ -26,6 +26,10 @@ import { EuiButtonEmpty } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export const ActionButtons = ({ goToPreviousStep, submittable, @@ -37,7 +41,10 @@ export const ActionButtons = ({ iconType="arrowLeft" onClick={goToPreviousStep} > - Back + @@ -47,7 +54,10 @@ export const ActionButtons = ({ fill onClick={createIndexPattern} > - Create index pattern + diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.js index fbb0c3af41b70..d93d9a9bf12b5 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.js @@ -27,6 +27,10 @@ import { EuiSpacer, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { I18nContext, FormattedMessage } = ReactI18n; + export const AdvancedOptions = ({ isVisible, indexPatternId, @@ -39,32 +43,57 @@ export const AdvancedOptions = ({ onClick={toggleAdvancedOptions} > { isVisible - ? (Hide advanced options) - : (Show advanced options) + ? ( + + + + ) + : ( + + + + ) } { isVisible ? - - - Kibana will provide a unique identifier for each index pattern. - If you do not want to use this unique ID, enter a custom one. - - } - > - - - + + {intl => ( + + + + + } + > + + + + )} + : null }

diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/header/header.js index 00660a87c3289..27ed357515594 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/header/header.js @@ -25,20 +25,31 @@ import { EuiText, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export const Header = ({ indexPattern, }) => (

- Step 2 of 2: Configure settings +

- You've defined {indexPattern} as your index pattern. - Now you can specify some settings before we create it. + ', indexPattern: {indexPattern} }} + />
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.js index b720ca37d2b43..a7ce34fc87d16 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.js @@ -32,6 +32,10 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { I18nContext, FormattedMessage } = ReactI18n; + export const TimeField = ({ isVisible, fetchTimeFields, @@ -46,7 +50,12 @@ export const TimeField = ({ label={ - Time Filter field name + + + { isLoading ? ( @@ -57,7 +66,10 @@ export const TimeField = ({ className="timeFieldRefreshButton" onClick={fetchTimeFields} > - Refresh + ) } @@ -66,20 +78,39 @@ export const TimeField = ({ } helpText={
-

The Time Filter will use this field to filter your data by time.

-

You can choose not to have a time field, but you will not be able to narrow down your data by a time range.

+

+ +

+

+ +

} > { isLoading ? ( - + + {intl => ( + + )} + ) : ( : -

The indices which match this index pattern don't contain any time fields.

+

+ ' }} + /> +

} diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js index 7b82b62d06c70..2485dbbef46c7 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js @@ -35,6 +35,10 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; +import { ReactI18n } from '@kbn/i18n'; + +const { FormattedMessage } = ReactI18n; + export class StepTimeField extends Component { static propTypes = { indexPattern: PropTypes.string.isRequired, @@ -121,7 +125,12 @@ export class StepTimeField extends Component {
- Creating index pattern... + + +
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js index 3713188e40f8b..2af59c36315bb 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js @@ -24,7 +24,7 @@ import { CreateIndexPatternWizard } from './create_index_pattern_wizard'; import { ReactI18n } from '@kbn/i18n'; const CREATE_INDEX_PATTERN_DOM_ELEMENT_ID = 'createIndexPatternReact'; -const {I18nProvider} = ReactI18n; +const { I18nProvider } = ReactI18n; export function renderCreateIndexPatternWizard( initialQuery, From 78d133a6b62469f0e91f67da30d7ce4ca123f40d Mon Sep 17 00:00:00 2001 From: Bill McConaghy Date: Wed, 6 Jun 2018 12:00:05 -0400 Subject: [PATCH 064/186] Console cleanup (#19654) * refactoring to class style and moving components to own files * making top level components fetch sensitive to HTTP verb * fixing issue with _ endpoints getting mistaken as index names for autocomplete possibilities:wq: * removing stray console log * removing console log * PR feedback * accounting for _all in isNotAnIndexName --- .../console/public/src/autocomplete.js | 17 +- .../public/src/autocomplete/body_completer.js | 412 +++++++----------- .../components/accept_endpoint_component.js | 43 ++ .../components/autocomplete_component.js | 45 ++ .../components/conditional_proxy.js | 43 ++ .../components/constant_component.js | 50 +++ .../field_autocomplete_component.js | 50 +++ .../components/global_only_component.js | 46 ++ .../components/id_autocomplete_component.js | 45 ++ .../src/autocomplete/components/index.js | 33 ++ .../index_autocomplete_component.js | 43 ++ .../autocomplete/components/list_component.js | 94 ++++ .../components/object_component.js | 74 ++++ .../components/shared_component.js | 42 ++ .../components/simple_param_component.js | 32 ++ .../components/type_autocomplete_component.js | 47 ++ .../components/url_pattern_matcher.js | 136 ++++++ .../console/public/src/autocomplete/engine.js | 213 +-------- .../public/src/autocomplete/url_params.js | 74 ++-- .../src/autocomplete/url_pattern_matcher.js | 141 ------ src/core_plugins/console/public/src/kb.js | 219 +++------- src/core_plugins/console/public/src/kb/api.js | 6 +- .../public/tests/src/integration.test.js | 32 +- .../console/public/tests/src/kb.test.js | 2 +- .../public/tests/src/url_autocomplete.test.js | 66 ++- .../spec/xpack_graph_explore.json | 4 +- .../spec/xpack_migration.json | 8 +- .../console_extensions/spec/xpack_rollup.json | 8 +- 28 files changed, 1154 insertions(+), 871 deletions(-) create mode 100644 src/core_plugins/console/public/src/autocomplete/components/accept_endpoint_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/autocomplete_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/conditional_proxy.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/constant_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/field_autocomplete_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/global_only_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/id_autocomplete_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/index.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/index_autocomplete_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/list_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/object_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/shared_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/simple_param_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/type_autocomplete_component.js create mode 100644 src/core_plugins/console/public/src/autocomplete/components/url_pattern_matcher.js delete mode 100644 src/core_plugins/console/public/src/autocomplete/url_pattern_matcher.js diff --git a/src/core_plugins/console/public/src/autocomplete.js b/src/core_plugins/console/public/src/autocomplete.js index 9ffbe68dadf16..eb9838dbf8210 100644 --- a/src/core_plugins/console/public/src/autocomplete.js +++ b/src/core_plugins/console/public/src/autocomplete.js @@ -25,7 +25,7 @@ import { } from './kb'; import utils from './utils'; import { populateContext } from './autocomplete/engine'; -import { URL_PATH_END_MARKER } from './autocomplete/url_pattern_matcher'; +import { URL_PATH_END_MARKER } from './autocomplete/components'; import _ from 'lodash'; import ace from 'brace'; import 'brace/ext/language_tools'; @@ -529,7 +529,10 @@ export default function (editor) { context.token = ret.token; context.otherTokenValues = ret.otherTokenValues; context.urlTokenPath = ret.urlTokenPath; - populateContext(ret.urlTokenPath, context, editor, true, getTopLevelUrlCompleteComponents()); + const components = getTopLevelUrlCompleteComponents(context.method); + populateContext(ret.urlTokenPath, context, editor, true, components); + + context.autoCompleteSet = addMetaToTermsList(context.autoCompleteSet, 'endpoint'); } @@ -544,7 +547,7 @@ export default function (editor) { return context; } - populateContext(ret.urlTokenPath, context, editor, false, getTopLevelUrlCompleteComponents()); + populateContext(ret.urlTokenPath, context, editor, false, getTopLevelUrlCompleteComponents(context.method)); if (!context.endpoint) { console.log('couldn\'t resolve an endpoint.'); @@ -563,7 +566,7 @@ export default function (editor) { } populateContext(tokenPath, context, editor, true, - context.endpoint.paramsAutocomplete.getTopLevelComponents()); + context.endpoint.paramsAutocomplete.getTopLevelComponents(context.method)); return context; } @@ -579,7 +582,7 @@ export default function (editor) { return context; } - populateContext(ret.urlTokenPath, context, editor, false, getTopLevelUrlCompleteComponents()); + populateContext(ret.urlTokenPath, context, editor, false, getTopLevelUrlCompleteComponents(context.method)); context.bodyTokenPath = ret.bodyTokenPath; if (!ret.bodyTokenPath) { // zero length tokenPath is true @@ -741,6 +744,10 @@ export default function (editor) { if (t.type === 'url.part' || t.type === 'url.param' || t.type === 'url.value') { // we are on the same line as cursor and dealing with a url. Current token is not part of the context t = tokenIter.stepBackward(); + // This will force method parsing + while (t.type === 'whitespace') { + t = tokenIter.stepBackward(); + } } bodyTokenPath = null; // no not on a body line. } diff --git a/src/core_plugins/console/public/src/autocomplete/body_completer.js b/src/core_plugins/console/public/src/autocomplete/body_completer.js index 55d325ddc82aa..0fa37e3926dca 100644 --- a/src/core_plugins/console/public/src/autocomplete/body_completer.js +++ b/src/core_plugins/console/public/src/autocomplete/body_completer.js @@ -18,28 +18,124 @@ */ const _ = require('lodash'); -const engine = require('./engine'); +import { WalkingState, walkTokenPath, wrapComponentWithDefaults } from './engine'; +import { + ConstantComponent, + SharedComponent, + ObjectComponent, + ConditionalProxy, + GlobalOnlyComponent, +} from './components'; function CompilingContext(endpointId, parametrizedComponentFactories) { this.parametrizedComponentFactories = parametrizedComponentFactories; this.endpointId = endpointId; } +/** + * An object to resolve scope links (syntax endpoint.path1.path2) + * @param link the link either string (endpoint.path1.path2, or .path1.path2) or a function (context,editor) + * which returns a description to be compiled + * @constructor + * @param compilingContext + * + * + * For this to work we expect the context to include a method context.endpointComponentResolver(endpoint) + * which should return the top level components for the given endpoint + */ + + +function resolvePathToComponents(tokenPath, context, editor, components) { + const walkStates = walkTokenPath(tokenPath, [new WalkingState('ROOT', components, [])], context, editor); + const result = [].concat.apply([], _.pluck(walkStates, 'components')); + return result; +} + +class ScopeResolver extends SharedComponent { + constructor(link, compilingContext) { + super('__scope_link'); + if (_.isString(link) && link[0] === '.') { + // relative link, inject current endpoint + if (link === '.') { + link = compilingContext.endpointId; + } + else { + link = compilingContext.endpointId + link; + } + } + this.link = link; + this.compilingContext = compilingContext; + } + + resolveLinkToComponents(context, editor) { + if (_.isFunction(this.link)) { + const desc = this.link(context, editor); + return compileDescription(desc, this.compilingContext); + } + if (!_.isString(this.link)) { + throw new Error('unsupported link format', this.link); + } + + let path = this.link.replace(/\./g, '{').split(/(\{)/); + const endpoint = path[0]; + let components; + try { + if (endpoint === 'GLOBAL') { + // global rules need an extra indirection + if (path.length < 3) { + throw new Error('missing term in global link: ' + this.link); + } + const term = path[2]; + components = context.globalComponentResolver(term); + path = path.slice(3); + } + else { + path = path.slice(1); + components = context.endpointComponentResolver(endpoint); + } + } + catch (e) { + throw new Error('failed to resolve link [' + this.link + ']: ' + e); + } + return resolvePathToComponents(path, context, editor, components); + } + + getTerms(context, editor) { + const options = []; + const components = this.resolveLinkToComponents(context, editor); + _.each(components, function (component) { + options.push.apply(options, component.getTerms(context, editor)); + }); + return options; + } + + match(token, context, editor) { + const result = { + next: [] + }; + const components = this.resolveLinkToComponents(context, editor); + + _.each(components, function (component) { + const componentResult = component.match(token, context, editor); + if (componentResult && componentResult.next) { + result.next.push.apply(result.next, componentResult.next); + } + }); + + return result; + } +} function getTemplate(description) { if (description.__template) { return description.__template; - } - else if (description.__one_of) { + } else if (description.__one_of) { return getTemplate(description.__one_of[0]); - } - else if (description.__any_of) { + } else if (description.__any_of) { return []; - } - else if (description.__scope_link) { + } else if (description.__scope_link) { // assume an object for now. return {}; - } - else if (Array.isArray(description)) { + } else if (Array.isArray(description)) { if (description.length === 1) { if (_.isObject(description[0])) { // shortcut to save typing @@ -49,14 +145,11 @@ function getTemplate(description) { } } return []; - } - else if (_.isObject(description)) { + } else if (_.isObject(description)) { return {}; - } - else if (_.isString(description) && !/^\{.*\}$/.test(description)) { + } else if (_.isString(description) && !/^\{.*\}$/.test(description)) { return description; - } - else { + } else { return description; } } @@ -78,8 +171,7 @@ function getOptions(description) { function compileDescription(description, compilingContext) { if (Array.isArray(description)) { return [compileList(description, compilingContext)]; - } - else if (_.isObject(description)) { + } else if (_.isObject(description)) { // test for objects list as arrays are also objects if (description.__scope_link) { return [new ScopeResolver(description.__scope_link, compilingContext)]; @@ -88,9 +180,11 @@ function compileDescription(description, compilingContext) { return [compileList(description.__any_of, compilingContext)]; } if (description.__one_of) { - return _.flatten(_.map(description.__one_of, function (d) { - return compileDescription(d, compilingContext); - })); + return _.flatten( + _.map(description.__one_of, function (d) { + return compileDescription(d, compilingContext); + }) + ); } const obj = compileObject(description, compilingContext); if (description.__condition) { @@ -98,14 +192,11 @@ function compileDescription(description, compilingContext) { } else { return [obj]; } - } - else if (_.isString(description) && /^\{.*\}$/.test(description)) { + } else if (_.isString(description) && /^\{.*\}$/.test(description)) { return [compileParametrizedValue(description, compilingContext)]; + } else { + return [new ConstantComponent(description)]; } - else { - return [new engine.ConstantComponent(description)]; - } - } function compileParametrizedValue(value, compilingContext, template) { @@ -116,14 +207,13 @@ function compileParametrizedValue(value, compilingContext, template) { } component = component(value, null, template); if (!_.isUndefined(template)) { - component = engine.wrapComponentWithDefaults(component, { template: template }); + component = wrapComponentWithDefaults(component, { template: template }); } return component; - } function compileObject(objDescription, compilingContext) { - const objectC = new engine.ConstantComponent('{'); + const objectC = new ConstantComponent('{'); const constants = []; const patterns = []; _.each(objDescription, function (desc, key) { @@ -135,16 +225,18 @@ function compileObject(objDescription, compilingContext) { const options = getOptions(desc); let component; if (/^\{.*\}$/.test(key)) { - component = compileParametrizedValue(key, compilingContext, options.template); + component = compileParametrizedValue( + key, + compilingContext, + options.template + ); patterns.push(component); - } - else if (key === '*') { - component = new engine.SharedComponent(key); + } else if (key === '*') { + component = new SharedComponent(key); patterns.push(component); - } - else { + } else { options.name = key; - component = new engine.ConstantComponent(key, null, [options]); + component = new ConstantComponent(key, null, [options]); constants.push(component); } _.map(compileDescription(desc, compilingContext), function (subComponent) { @@ -156,7 +248,7 @@ function compileObject(objDescription, compilingContext) { } function compileList(listRule, compilingContext) { - const listC = new engine.ConstantComponent('['); + const listC = new ConstantComponent('['); _.each(listRule, function (desc) { _.each(compileDescription(desc, compilingContext), function (component) { listC.addComponent(component); @@ -169,7 +261,10 @@ function compileList(listRule, compilingContext) { function compileCondition(description, compiledObject) { if (description.lines_regex) { return new ConditionalProxy(function (context, editor) { - const lines = editor.getSession().getLines(context.requestStartRow, editor.getCursorPosition().row).join('\n'); + const lines = editor + .getSession() + .getLines(context.requestStartRow, editor.getCursorPosition().row) + .join('\n'); return new RegExp(description.lines_regex, 'm').test(lines); }, compiledObject); } else { @@ -177,228 +272,6 @@ function compileCondition(description, compiledObject) { } } -/** - * @param constants list of components that represent constant keys - * @param patternsAndWildCards list of components that represent patterns and should be matched only if - * there is no constant matches - */ -function ObjectComponent(name, constants, patternsAndWildCards) { - engine.AutocompleteComponent.call(this, name); - this.constants = constants; - this.patternsAndWildCards = patternsAndWildCards; -} - -ObjectComponent.prototype = _.create( - engine.AutocompleteComponent.prototype, - { 'constructor': ObjectComponent }); - - -(function (cls) { - cls.getTerms = function (context, editor) { - const options = []; - _.each(this.constants, function (component) { - options.push.apply(options, component.getTerms(context, editor)); - }); - _.each(this.patternsAndWildCards, function (component) { - options.push.apply(options, component.getTerms(context, editor)); - }); - return options; - }; - - cls.match = function (token, context, editor) { - const result = { - next: [] - }; - _.each(this.constants, function (component) { - const componentResult = component.match(token, context, editor); - if (componentResult && componentResult.next) { - result.next.push.apply(result.next, componentResult.next); - } - }); - - // try to link to GLOBAL rules - const globalRules = context.globalComponentResolver(token, false); - if (globalRules) { - result.next.push.apply(result.next, globalRules); - } - - if (result.next.length) { - return result; - } - _.each(this.patternsAndWildCards, function (component) { - const componentResult = component.match(token, context, editor); - if (componentResult && componentResult.next) { - result.next.push.apply(result.next, componentResult.next); - } - }); - - return result; - - }; -}(ObjectComponent.prototype)); - -/** - * An object to resolve scope links (syntax endpoint.path1.path2) - * @param link the link either string (endpoint.path1.path2, or .path1.path2) or a function (context,editor) - * which returns a description to be compiled - * @constructor - * @param compilingContext - * - * - * For this to work we expect the context to include a method context.endpointComponentResolver(endpoint) - * which should return the top level components for the given endpoint - */ -function ScopeResolver(link, compilingContext) { - engine.SharedComponent.call(this, '__scope_link', null); - if (_.isString(link) && link[0] === '.') { - // relative link, inject current endpoint - if (link === '.') { - link = compilingContext.endpointId; - } - else { - link = compilingContext.endpointId + link; - } - } - this.link = link; - this.compilingContext = compilingContext; -} - -ScopeResolver.prototype = _.create( - engine.SharedComponent.prototype, - { 'constructor': ScopeResolver }); - - -(function (cls) { - - cls.resolveLinkToComponents = function (context, editor) { - if (_.isFunction(this.link)) { - const desc = this.link(context, editor); - return compileDescription(desc, this.compilingContext); - } - if (!_.isString(this.link)) { - throw new Error('unsupported link format', this.link); - } - - let path = this.link.replace(/\./g, '{').split(/(\{)/); - const endpoint = path[0]; - let components; - try { - if (endpoint === 'GLOBAL') { - // global rules need an extra indirection - if (path.length < 3) { - throw new Error('missing term in global link: ' + this.link); - } - const term = path[2]; - components = context.globalComponentResolver(term); - path = path.slice(3); - } - else { - path = path.slice(1); - components = context.endpointComponentResolver(endpoint); - } - } - catch (e) { - throw new Error('failed to resolve link [' + this.link + ']: ' + e); - } - return engine.resolvePathToComponents(path, context, editor, components); - }; - - cls.getTerms = function (context, editor) { - const options = []; - const components = this.resolveLinkToComponents(context, editor); - _.each(components, function (component) { - options.push.apply(options, component.getTerms(context, editor)); - }); - return options; - }; - - cls.match = function (token, context, editor) { - const result = { - next: [] - }; - const components = this.resolveLinkToComponents(context, editor); - - _.each(components, function (component) { - const componentResult = component.match(token, context, editor); - if (componentResult && componentResult.next) { - result.next.push.apply(result.next, componentResult.next); - } - }); - - return result; - }; -}(ScopeResolver.prototype)); - - -function ConditionalProxy(predicate, delegate) { - engine.SharedComponent.call(this, '__condition', null); - this.predicate = predicate; - this.delegate = delegate; -} - -ConditionalProxy.prototype = _.create( - engine.SharedComponent.prototype, - { 'constructor': ConditionalProxy }); - - -(function (cls) { - - cls.getTerms = function (context, editor) { - if (this.predicate(context, editor)) { - return this.delegate.getTerms(context, editor); - } else { - return null; - } - }; - - cls.match = function (token, context, editor) { - if (this.predicate(context, editor)) { - return this.delegate.match(token, context, editor); - } else { - return false; - } - }; -}(ConditionalProxy.prototype)); - - -function GlobalOnlyComponent(name) { - engine.AutocompleteComponent.call(this, name); -} - -GlobalOnlyComponent.prototype = _.create( - engine.AutocompleteComponent.prototype, - { 'constructor': ObjectComponent }); - - -(function (cls) { - - cls.getTerms = function () { - return null; - }; - - cls.match = function (token, context) { - const result = { - next: [] - }; - - // try to link to GLOBAL rules - const globalRules = context.globalComponentResolver(token, false); - if (globalRules) { - result.next.push.apply(result.next, globalRules); - } - - if (result.next.length) { - return result; - } - // just loop back to us - result.next = [this]; - - return result; - - }; -}(GlobalOnlyComponent.prototype)); - - // a list of component that match anything but give auto complete suggestions based on global API entries. export function globalsOnlyAutocompleteComponents() { return [new GlobalOnlyComponent('__global__')]; @@ -412,11 +285,18 @@ export function globalsOnlyAutocompleteComponents() { * @param parametrizedComponentFactories a dict of the following structure * that will be used as a fall back for pattern keys (i.e.: {type} ,resolved without the $s) * { - * TYPE: function (part, parent, endpoint) { - * return new SharedComponent(part, parent) - * } - * } + * TYPE: function (part, parent, endpoint) { + * return new SharedComponent(part, parent) + * } + * } */ -export function compileBodyDescription(endpointId, description, parametrizedComponentFactories) { - return compileDescription(description, new CompilingContext(endpointId, parametrizedComponentFactories)); +export function compileBodyDescription( + endpointId, + description, + parametrizedComponentFactories +) { + return compileDescription( + description, + new CompilingContext(endpointId, parametrizedComponentFactories) + ); } diff --git a/src/core_plugins/console/public/src/autocomplete/components/accept_endpoint_component.js b/src/core_plugins/console/public/src/autocomplete/components/accept_endpoint_component.js new file mode 100644 index 0000000000000..b2d4888b34d6f --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/accept_endpoint_component.js @@ -0,0 +1,43 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import _ from 'lodash'; +import { SharedComponent } from './shared_component'; +export const URL_PATH_END_MARKER = '__url_path_end__'; + +export class AcceptEndpointComponent extends SharedComponent { + constructor(endpoint, parent) { + super(endpoint.id, parent); + this.endpoint = endpoint; + } + match(token, context, editor) { + if (token !== URL_PATH_END_MARKER) { + return null; + } + if (this.endpoint.methods && -1 === _.indexOf(this.endpoint.methods, context.method)) { + return null; + } + const r = super.match(token, context, editor); + r.context_values = r.context_values || {}; + r.context_values.endpoint = this.endpoint; + if (_.isNumber(this.endpoint.priority)) { + r.priority = this.endpoint.priority; + } + return r; + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/autocomplete_component.js b/src/core_plugins/console/public/src/autocomplete/components/autocomplete_component.js new file mode 100644 index 0000000000000..06ee1d7d9f2b4 --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/autocomplete_component.js @@ -0,0 +1,45 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export class AutocompleteComponent { + constructor(name) { + this.name = name; + } + /** called to get the possible suggestions for tokens, when this object is at the end of + * the resolving chain (and thus can suggest possible continuation paths) + */ + getTerms() { + return []; + } + /* + if the current matcher matches this term, this method should return an object with the following keys + { + context_values: { + values extract from term that should be added to the context + } + next: AutocompleteComponent(s) to use next + priority: optional priority to solve collisions between multiple paths. Min value is used across entire chain + } + */ + match() { + return { + next: this.next, + }; + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/conditional_proxy.js b/src/core_plugins/console/public/src/autocomplete/components/conditional_proxy.js new file mode 100644 index 0000000000000..9ee233d54c20a --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/conditional_proxy.js @@ -0,0 +1,43 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { SharedComponent } from './shared_component'; +export class ConditionalProxy extends SharedComponent { + constructor(predicate, delegate) { + super('__condition'); + this.predicate = predicate; + this.delegate = delegate; + } + + getTerms(context, editor) { + if (this.predicate(context, editor)) { + return this.delegate.getTerms(context, editor); + } else { + return null; + } + } + + match(token, context, editor) { + if (this.predicate(context, editor)) { + return this.delegate.match(token, context, editor); + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/core_plugins/console/public/src/autocomplete/components/constant_component.js b/src/core_plugins/console/public/src/autocomplete/components/constant_component.js new file mode 100644 index 0000000000000..582ae44084e0c --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/constant_component.js @@ -0,0 +1,50 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import _ from 'lodash'; +import { SharedComponent } from './shared_component'; +export class ConstantComponent extends SharedComponent { + constructor(name, parent, options) { + super(name, parent); + if (_.isString(options)) { + options = [options]; + } + this.options = options || [name]; + } + getTerms() { + return this.options; + } + + addOption(options) { + if (!Array.isArray(options)) { + options = [options]; + } + + [].push.apply(this.options, options); + this.options = _.uniq(this.options); + } + match(token, context, editor) { + if (token !== this.name) { + return null; + } + + return super.match(token, context, editor); + + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/field_autocomplete_component.js b/src/core_plugins/console/public/src/autocomplete/components/field_autocomplete_component.js new file mode 100644 index 0000000000000..b2424bebf1b9d --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/field_autocomplete_component.js @@ -0,0 +1,50 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import _ from 'lodash'; +import mappings from '../../mappings'; +import { ListComponent } from './list_component'; + +function FieldGenerator(context) { + return _.map(mappings.getFields(context.indices, context.types), function (field) { + return { name: field.name, meta: field.type }; + }); +} + +export class FieldAutocompleteComponent extends ListComponent { + constructor(name, parent, multiValued) { + super(name, FieldGenerator, parent, multiValued); + } + validateTokens(tokens) { + if (!this.multiValued && tokens.length > 1) { + return false; + } + + return !_.find(tokens, function (token) { + return token.match(/[^\w.?*]/); + }); + } + + getDefaultTermMeta() { + return 'field'; + } + + getContextKey() { + return 'fields'; + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/global_only_component.js b/src/core_plugins/console/public/src/autocomplete/components/global_only_component.js new file mode 100644 index 0000000000000..ee50e3634cc61 --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/global_only_component.js @@ -0,0 +1,46 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { SharedComponent } from './shared_component'; +export class GlobalOnlyComponent extends SharedComponent { + getTerms() { + return null; + } + + match(token, context) { + const result = { + next: [] + }; + + // try to link to GLOBAL rules + const globalRules = context.globalComponentResolver(token, false); + if (globalRules) { + result.next.push.apply(result.next, globalRules); + } + + if (result.next.length) { + return result; + } + // just loop back to us + result.next = [this]; + + return result; + + } +} \ No newline at end of file diff --git a/src/core_plugins/console/public/src/autocomplete/components/id_autocomplete_component.js b/src/core_plugins/console/public/src/autocomplete/components/id_autocomplete_component.js new file mode 100644 index 0000000000000..6fc694b92214f --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/id_autocomplete_component.js @@ -0,0 +1,45 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import _ from 'lodash'; +import { SharedComponent } from './shared_component'; +export class IdAutocompleteComponent extends SharedComponent { + constructor(name, parent, multi) { + super(name, parent); + this.multi_match = multi; + } + match(token, context, editor) { + if (!token) { + return null; + } + if (!this.multi_match && Array.isArray(token)) { + return null; + } + token = Array.isArray(token) ? token : [token]; + if (_.find(token, function (t) { + return t.match(/[\/,]/); + })) { + return null; + } + const r = super.match(token, context, editor); + r.context_values = r.context_values || {}; + r.context_values.id = token; + return r; + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/index.js b/src/core_plugins/console/public/src/autocomplete/components/index.js new file mode 100644 index 0000000000000..9103212777efc --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/index.js @@ -0,0 +1,33 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { AutocompleteComponent } from './autocomplete_component'; +export { SharedComponent } from './shared_component'; +export { ConstantComponent } from './constant_component'; +export { ListComponent } from './list_component'; +export { SimpleParamComponent } from './simple_param_component'; +export { ConditionalProxy } from './conditional_proxy'; +export { GlobalOnlyComponent } from './global_only_component'; +export { ObjectComponent } from './object_component'; +export { AcceptEndpointComponent, URL_PATH_END_MARKER } from './accept_endpoint_component'; +export { UrlPatternMatcher } from './url_pattern_matcher'; +export { IndexAutocompleteComponent } from './index_autocomplete_component'; +export { FieldAutocompleteComponent } from './field_autocomplete_component'; +export { TypeAutocompleteComponent } from './type_autocomplete_component'; +export { IdAutocompleteComponent } from './id_autocomplete_component'; diff --git a/src/core_plugins/console/public/src/autocomplete/components/index_autocomplete_component.js b/src/core_plugins/console/public/src/autocomplete/components/index_autocomplete_component.js new file mode 100644 index 0000000000000..ec1cfc60f9064 --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/index_autocomplete_component.js @@ -0,0 +1,43 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import _ from 'lodash'; +import mappings from '../../mappings'; +import { ListComponent } from './list_component'; +function nonValidIndexType(token) { + return !(token === '_all' || token[0] !== '_'); +} +export class IndexAutocompleteComponent extends ListComponent { + constructor(name, parent, multiValued) { + super(name, mappings.getIndices, parent, multiValued); + } + validateTokens(tokens) { + if (!this.multiValued && tokens.length > 1) { + return false; + } + return !_.find(tokens, nonValidIndexType); + } + + getDefaultTermMeta() { + return 'index'; + } + + getContextKey() { + return 'indices'; + } +} \ No newline at end of file diff --git a/src/core_plugins/console/public/src/autocomplete/components/list_component.js b/src/core_plugins/console/public/src/autocomplete/components/list_component.js new file mode 100644 index 0000000000000..d023779fac555 --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/list_component.js @@ -0,0 +1,94 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import _ from 'lodash'; +import { SharedComponent } from './shared_component'; +/** A component that suggests one of the give options, but accepts anything */ +export class ListComponent extends SharedComponent { + constructor(name, list, parent, multiValued, allowNonValidValues) { + super(name, parent); + this.listGenerator = Array.isArray(list) ? function () { + return list; + } : list; + this.multiValued = _.isUndefined(multiValued) ? true : multiValued; + this.allowNonValidValues = _.isUndefined(allowNonValidValues) ? false : allowNonValidValues; + } + getTerms(context, editor) { + if (!this.multiValued && context.otherTokenValues) { + // already have a value -> no suggestions + return []; + } + let alreadySet = context.otherTokenValues || []; + if (_.isString(alreadySet)) { + alreadySet = [alreadySet]; + } + let ret = _.difference(this.listGenerator(context, editor), alreadySet); + + if (this.getDefaultTermMeta()) { + const meta = this.getDefaultTermMeta(); + ret = _.map(ret, function (term) { + if (_.isString(term)) { + term = { 'name': term }; + } + return _.defaults(term, { meta: meta }); + }); + } + + return ret; + } + + validateTokens(tokens) { + if (!this.multiValued && tokens.length > 1) { + return false; + } + + // verify we have all tokens + const list = this.listGenerator(); + const notFound = _.any(tokens, function (token) { + return list.indexOf(token) === -1; + }); + + if (notFound) { + return false; + } + return true; + } + + getContextKey() { + return this.name; + } + + getDefaultTermMeta() { + return this.name; + } + + match(token, context, editor) { + if (!Array.isArray(token)) { + token = [token]; + } + if (!this.allowNonValidValues && !this.validateTokens(token, context, editor)) { + return null; + } + + const result = super.match(token, context, editor); + result.context_values = result.context_values || {}; + result.context_values[this.getContextKey()] = token; + return result; + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/object_component.js b/src/core_plugins/console/public/src/autocomplete/components/object_component.js new file mode 100644 index 0000000000000..4db392e60ff83 --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/object_component.js @@ -0,0 +1,74 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import _ from 'lodash'; +import { SharedComponent } from '.'; +/** + * @param constants list of components that represent constant keys + * @param patternsAndWildCards list of components that represent patterns and should be matched only if + * there is no constant matches + */ +export class ObjectComponent extends SharedComponent { + constructor(name, constants, patternsAndWildCards) { + super(name); + this.constants = constants; + this.patternsAndWildCards = patternsAndWildCards; + } + getTerms(context, editor) { + const options = []; + _.each(this.constants, function (component) { + options.push.apply(options, component.getTerms(context, editor)); + }); + _.each(this.patternsAndWildCards, function (component) { + options.push.apply(options, component.getTerms(context, editor)); + }); + return options; + } + + match(token, context, editor) { + const result = { + next: [] + }; + _.each(this.constants, function (component) { + const componentResult = component.match(token, context, editor); + if (componentResult && componentResult.next) { + result.next.push.apply(result.next, componentResult.next); + } + }); + + // try to link to GLOBAL rules + const globalRules = context.globalComponentResolver(token, false); + if (globalRules) { + result.next.push.apply(result.next, globalRules); + } + + if (result.next.length) { + return result; + } + _.each(this.patternsAndWildCards, function (component) { + const componentResult = component.match(token, context, editor); + if (componentResult && componentResult.next) { + result.next.push.apply(result.next, componentResult.next); + } + }); + + return result; + + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/shared_component.js b/src/core_plugins/console/public/src/autocomplete/components/shared_component.js new file mode 100644 index 0000000000000..f996a5de6672f --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/shared_component.js @@ -0,0 +1,42 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import _ from 'lodash'; +import { AutocompleteComponent } from './autocomplete_component'; +export class SharedComponent extends AutocompleteComponent { + constructor(name, parent) { + super(name); + this._nextDict = {}; + if (parent) { + parent.addComponent(this); + } + // for debugging purposes + this._parent = parent; + } + /* return the first component with a given name */ + getComponent(name) { + return (this._nextDict[name] || [undefined])[0]; + } + + addComponent(component) { + const current = this._nextDict[component.name] || []; + current.push(component); + this._nextDict[component.name] = current; + this.next = [].concat.apply([], _.values(this._nextDict)); + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/simple_param_component.js b/src/core_plugins/console/public/src/autocomplete/components/simple_param_component.js new file mode 100644 index 0000000000000..6a315c45066e6 --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/simple_param_component.js @@ -0,0 +1,32 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { SharedComponent } from './shared_component'; +export class SimpleParamComponent extends SharedComponent { + constructor(name, parent) { + super(name, parent); + } + match(token, context, editor) { + const result = super.match(token, context, editor); + result.context_values = result.context_values || {}; + result.context_values[this.name] = token; + return result; + } +} + diff --git a/src/core_plugins/console/public/src/autocomplete/components/type_autocomplete_component.js b/src/core_plugins/console/public/src/autocomplete/components/type_autocomplete_component.js new file mode 100644 index 0000000000000..4f1c85213b689 --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/type_autocomplete_component.js @@ -0,0 +1,47 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import _ from 'lodash'; +import { ListComponent } from './list_component'; +import mappings from '../../mappings'; +function TypeGenerator(context) { + return mappings.getTypes(context.indices); +} +function nonValidIndexType(token) { + return !(token === '_all' || token[0] !== '_'); +} +export class TypeAutocompleteComponent extends ListComponent { + constructor(name, parent, multiValued) { + super(name, TypeGenerator, parent, multiValued); + } + validateTokens(tokens) { + if (!this.multiValued && tokens.length > 1) { + return false; + } + + return !_.find(tokens, nonValidIndexType); + } + + getDefaultTermMeta() { + return 'type'; + } + + getContextKey() { + return 'types'; + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/components/url_pattern_matcher.js b/src/core_plugins/console/public/src/autocomplete/components/url_pattern_matcher.js new file mode 100644 index 0000000000000..32f8b95040f81 --- /dev/null +++ b/src/core_plugins/console/public/src/autocomplete/components/url_pattern_matcher.js @@ -0,0 +1,136 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import _ from 'lodash'; +import { + SharedComponent, + ConstantComponent, + AcceptEndpointComponent, + ListComponent, + SimpleParamComponent, +} from '.'; + +/** + * @param parametrizedComponentFactories a dict of the following structure + * that will be used as a fall back for pattern parameters (i.e.: {indices}) + * { + * indices: function (part, parent) { + * return new SharedComponent(part, parent) + * } + * } + * @constructor + */ +export class UrlPatternMatcher { + // This is not really a component, just a handy container to make iteration logic simpler + constructor(parametrizedComponentFactories) { + // We'll group endpoints by the methods which are attached to them, + //to avoid suggesting endpoints that are incompatible with the + //method that the user has entered. + ['HEAD', 'GET', 'PUT', 'POST', 'DELETE'].forEach((method) => { + this[method] = { + rootComponent: new SharedComponent('ROOT'), + parametrizedComponentFactories: parametrizedComponentFactories || {} + }; + }); + } + addEndpoint(pattern, endpoint) { + endpoint.methods.forEach((method) => { + let c; + let activeComponent = this[method].rootComponent; + const endpointComponents = endpoint.url_components || {}; + const partList = pattern.split('/'); + _.each( + partList, + function (part, partIndex) { + if (part.search(/^{.+}$/) >= 0) { + part = part.substr(1, part.length - 2); + if (activeComponent.getComponent(part)) { + // we already have something for this, reuse + activeComponent = activeComponent.getComponent(part); + return; + } + // a new path, resolve. + + if ((c = endpointComponents[part])) { + // endpoint specific. Support list + if (Array.isArray(c)) { + c = new ListComponent(part, c, activeComponent); + } else if (_.isObject(c) && c.type === 'list') { + c = new ListComponent( + part, + c.list, + activeComponent, + c.multiValued, + c.allow_non_valid + ); + } else { + console.warn( + 'incorrectly configured url component ', + part, + ' in endpoint', + endpoint + ); + c = new SharedComponent(part); + } + } else if ((c = this[method].parametrizedComponentFactories[part])) { + // c is a f + c = c(part, activeComponent); + } else { + // just accept whatever with not suggestions + c = new SimpleParamComponent(part, activeComponent); + } + + activeComponent = c; + } else { + // not pattern + let lookAhead = part; + let s; + + for (partIndex++; partIndex < partList.length; partIndex++) { + s = partList[partIndex]; + if (s.indexOf('{') >= 0) { + break; + } + lookAhead += '/' + s; + } + + if (activeComponent.getComponent(part)) { + // we already have something for this, reuse + activeComponent = activeComponent.getComponent(part); + activeComponent.addOption(lookAhead); + } else { + c = new ConstantComponent(part, activeComponent, lookAhead); + activeComponent = c; + } + } + }, + this + ); + // mark end of endpoint path + new AcceptEndpointComponent(endpoint, activeComponent); + }); + } + + getTopLevelComponents = function (method) { + const methodRoot = this[method]; + if (!methodRoot) { + return []; + } + return methodRoot.rootComponent.next; + }; +} diff --git a/src/core_plugins/console/public/src/autocomplete/engine.js b/src/core_plugins/console/public/src/autocomplete/engine.js index 23f0d990116c8..23a27d8eeef32 100644 --- a/src/core_plugins/console/public/src/autocomplete/engine.js +++ b/src/core_plugins/console/public/src/autocomplete/engine.js @@ -19,205 +19,10 @@ const _ = require('lodash'); -export function AutocompleteComponent(name) { - this.name = name; -} - -/** called to get the possible suggestions for tokens, when this object is at the end of - * the resolving chain (and thus can suggest possible continuation paths) - */ -AutocompleteComponent.prototype.getTerms = function () { - return []; -}; - -/* - if the current matcher matches this term, this method should return an object with the following keys - { - context_values: { - values extract from term that should be added to the context - } - next: AutocompleteComponent(s) to use next - priority: optional priority to solve collisions between multiple paths. Min value is used across entire chain - } - */ -AutocompleteComponent.prototype.match = function () { - return { - next: this.next - }; -}; - -function SharedComponent(name, parent) { - AutocompleteComponent.call(this, name); - this._nextDict = {}; - if (parent) { - parent.addComponent(this); - } - // for debugging purposes - this._parent = parent; -} - -SharedComponent.prototype = _.create( - AutocompleteComponent.prototype, - { 'constructor': SharedComponent }); - -(function (cls) { - /* return the first component with a given name */ - cls.getComponent = function (name) { - return (this._nextDict[name] || [undefined])[0]; - }; - - cls.addComponent = function (component) { - const current = this._nextDict[component.name] || []; - current.push(component); - this._nextDict[component.name] = current; - this.next = [].concat.apply([], _.values(this._nextDict)); - }; - -}(SharedComponent.prototype)); - -/** A component that suggests one of the give options, but accepts anything */ -function ListComponent(name, list, parent, multiValued, allowNonValidValues) { - SharedComponent.call(this, name, parent); - this.listGenerator = Array.isArray(list) ? function () { - return list; - } : list; - this.multiValued = _.isUndefined(multiValued) ? true : multiValued; - this.allowNonValidValues = _.isUndefined(allowNonValidValues) ? false : allowNonValidValues; -} - -ListComponent.prototype = _.create(SharedComponent.prototype, { 'constructor': ListComponent }); - - -(function (cls) { - cls.getTerms = function (context, editor) { - if (!this.multiValued && context.otherTokenValues) { - // already have a value -> no suggestions - return []; - } - let alreadySet = context.otherTokenValues || []; - if (_.isString(alreadySet)) { - alreadySet = [alreadySet]; - } - let ret = _.difference(this.listGenerator(context, editor), alreadySet); - - if (this.getDefaultTermMeta()) { - const meta = this.getDefaultTermMeta(); - ret = _.map(ret, function (term) { - if (_.isString(term)) { - term = { 'name': term }; - } - return _.defaults(term, { meta: meta }); - }); - } - - return ret; - }; - - cls.validateTokens = function (tokens) { - if (!this.multiValued && tokens.length > 1) { - return false; - } - - // verify we have all tokens - const list = this.listGenerator(); - const notFound = _.any(tokens, function (token) { - return list.indexOf(token) === -1; - }); - - if (notFound) { - return false; - } - return true; - }; - - cls.getContextKey = function () { - return this.name; - }; - - cls.getDefaultTermMeta = function () { - return this.name; - }; - - cls.match = function (token, context, editor) { - if (!Array.isArray(token)) { - token = [token]; - } - if (!this.allowNonValidValues && !this.validateTokens(token, context, editor)) { - return null; - } - - const result = Object.getPrototypeOf(cls).match.call(this, token, context, editor); - result.context_values = result.context_values || {}; - result.context_values[this.getContextKey()] = token; - return result; - }; -}(ListComponent.prototype)); - -function SimpleParamComponent(name, parent) { - SharedComponent.call(this, name, parent); -} - -SimpleParamComponent.prototype = _.create(SharedComponent.prototype, { 'constructor': SimpleParamComponent }); - -(function (cls) { - cls.match = function (token, context, editor) { - const result = Object.getPrototypeOf(cls).match.call(this, token, context, editor); - result.context_values = result.context_values || {}; - result.context_values[this.name] = token; - return result; - }; - -}(SimpleParamComponent.prototype)); - -function ConstantComponent(name, parent, options) { - SharedComponent.call(this, name, parent); - if (_.isString(options)) { - options = [options]; - } - this.options = options || [name]; -} - -ConstantComponent.prototype = _.create(SharedComponent.prototype, { 'constructor': ConstantComponent }); - -export { SharedComponent, ListComponent, SimpleParamComponent, ConstantComponent }; - -(function (cls) { - cls.getTerms = function () { - return this.options; - }; - - cls.addOption = function (options) { - if (!Array.isArray(options)) { - options = [options]; - } - - [].push.apply(this.options, options); - this.options = _.uniq(this.options); - }; - cls.match = function (token, context, editor) { - if (token !== this.name) { - return null; - } - - return Object.getPrototypeOf(cls).match.call(this, token, context, editor); - - }; -}(ConstantComponent.prototype)); - export function wrapComponentWithDefaults(component, defaults) { - function Wrapper() { - - } - - Wrapper.prototype = {}; - for (const key in component) { - if (_.isFunction(component[key])) { - Wrapper.prototype[key] = _.bindKey(component, key); - } - } - - Wrapper.prototype.getTerms = function (context, editor) { - let result = component.getTerms(context, editor); + const originalGetTerms = component.getTerms; + component.getTerms = function (context, editor) { + let result = originalGetTerms.call(component, context, editor); if (!result) { return result; } @@ -229,7 +34,7 @@ export function wrapComponentWithDefaults(component, defaults) { }, this); return result; }; - return new Wrapper(); + return component; } const tracer = function () { @@ -254,7 +59,7 @@ function passThroughContext(context, extensionList) { return result; } -function WalkingState(parentName, components, contextExtensionList, depth, priority) { +export function WalkingState(parentName, components, contextExtensionList, depth, priority) { this.parentName = parentName; this.components = components; this.contextExtensionList = contextExtensionList; @@ -263,7 +68,7 @@ function WalkingState(parentName, components, contextExtensionList, depth, prior } -function walkTokenPath(tokenPath, walkingStates, context, editor) { +export function walkTokenPath(tokenPath, walkingStates, context, editor) { if (!tokenPath || tokenPath.length === 0) { return walkingStates; } @@ -321,12 +126,6 @@ function walkTokenPath(tokenPath, walkingStates, context, editor) { return walkTokenPath(tokenPath.slice(1), nextWalkingStates, context, editor); } -export function resolvePathToComponents(tokenPath, context, editor, components) { - const walkStates = walkTokenPath(tokenPath, [new WalkingState('ROOT', components, [])], context, editor); - const result = [].concat.apply([], _.pluck(walkStates, 'components')); - return result; -} - export function populateContext(tokenPath, context, editor, includeAutoComplete, components) { let walkStates = walkTokenPath(tokenPath, [new WalkingState('ROOT', components, [])], context, editor); diff --git a/src/core_plugins/console/public/src/autocomplete/url_params.js b/src/core_plugins/console/public/src/autocomplete/url_params.js index 30edd380d98c1..78b1701582df9 100644 --- a/src/core_plugins/console/public/src/autocomplete/url_params.js +++ b/src/core_plugins/console/public/src/autocomplete/url_params.js @@ -18,17 +18,14 @@ */ const _ = require('lodash'); -const engine = require('./engine'); +import { ConstantComponent, ListComponent, SharedComponent } from './components'; -export function ParamComponent(name, parent, description) { - engine.ConstantComponent.call(this, name, parent); - this.description = description; -} - -ParamComponent.prototype = _.create(engine.ConstantComponent.prototype, { 'constructor': ParamComponent }); - -(function (cls) { - cls.getTerms = function () { +export class ParamComponent extends ConstantComponent { + constructor(name, parent, description) { + super(name, parent); + this.description = description; + } + getTerms() { const t = { name: this.name }; if (this.description === '__flag__') { t.meta = 'flag'; @@ -38,38 +35,33 @@ ParamComponent.prototype = _.create(engine.ConstantComponent.prototype, { 'const t.insertValue = this.name + '='; } return [t]; - }; - -}(ParamComponent.prototype)); - -export function UrlParams(description, defaults) { - // This is not really a component, just a handy container to make iteration logic simpler - this.rootComponent = new engine.SharedComponent('ROOT'); - if (_.isUndefined(defaults)) { - defaults = { - 'pretty': '__flag__', - 'format': ['json', 'yaml'], - 'filter_path': '', - }; } - description = _.clone(description || {}); - _.defaults(description, defaults); - _.each(description, function (pDescription, param) { - const component = new ParamComponent(param, this.rootComponent, pDescription); - if (Array.isArray(pDescription)) { - new engine.ListComponent(param, pDescription, component); - } - else if (pDescription === '__flag__') { - new engine.ListComponent(param, ['true', 'false'], component); - } - }, this); - } -(function (cls) { - - cls.getTopLevelComponents = function () { +export class UrlParams { + constructor(description, defaults) { + // This is not really a component, just a handy container to make iteration logic simpler + this.rootComponent = new SharedComponent('ROOT'); + if (_.isUndefined(defaults)) { + defaults = { + 'pretty': '__flag__', + 'format': ['json', 'yaml'], + 'filter_path': '', + }; + } + description = _.clone(description || {}); + _.defaults(description, defaults); + _.each(description, function (pDescription, param) { + const component = new ParamComponent(param, this.rootComponent, pDescription); + if (Array.isArray(pDescription)) { + new ListComponent(param, pDescription, component); + } + else if (pDescription === '__flag__') { + new ListComponent(param, ['true', 'false'], component); + } + }, this); + } + getTopLevelComponents() { return this.rootComponent.next; - }; - -}(UrlParams.prototype)); + } +} diff --git a/src/core_plugins/console/public/src/autocomplete/url_pattern_matcher.js b/src/core_plugins/console/public/src/autocomplete/url_pattern_matcher.js deleted file mode 100644 index 82d8decf23b7d..0000000000000 --- a/src/core_plugins/console/public/src/autocomplete/url_pattern_matcher.js +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -const _ = require('lodash'); -const engine = require('./engine'); - -export const URL_PATH_END_MARKER = '__url_path_end__'; - -function AcceptEndpointComponent(endpoint, parent) { - engine.SharedComponent.call(this, endpoint.id, parent); - this.endpoint = endpoint; -} - -AcceptEndpointComponent.prototype = _.create(engine.SharedComponent.prototype, { 'constructor': AcceptEndpointComponent }); - -(function (cls) { - - cls.match = function (token, context, editor) { - if (token !== URL_PATH_END_MARKER) { - return null; - } - if (this.endpoint.methods && -1 === _.indexOf(this.endpoint.methods, context.method)) { - return null; - } - const r = Object.getPrototypeOf(cls).match.call(this, token, context, editor); - r.context_values = r.context_values || {}; - r.context_values.endpoint = this.endpoint; - if (_.isNumber(this.endpoint.priority)) { - r.priority = this.endpoint.priority; - } - return r; - }; -}(AcceptEndpointComponent.prototype)); - - -/** - * @param parametrizedComponentFactories a dict of the following structure - * that will be used as a fall back for pattern parameters (i.e.: {indices}) - * { - * indices: function (part, parent) { - * return new SharedComponent(part, parent) - * } - * } - * @constructor - */ -export function UrlPatternMatcher(parametrizedComponentFactories) { - // This is not really a component, just a handy container to make iteration logic simpler - this.rootComponent = new engine.SharedComponent('ROOT'); - this.parametrizedComponentFactories = parametrizedComponentFactories || {}; -} - -(function (cls) { - cls.addEndpoint = function (pattern, endpoint) { - let c; - let activeComponent = this.rootComponent; - const endpointComponents = endpoint.url_components || {}; - const partList = pattern.split('/'); - _.each(partList, function (part, partIndex) { - if (part.search(/^{.+}$/) >= 0) { - part = part.substr(1, part.length - 2); - if (activeComponent.getComponent(part)) { - // we already have something for this, reuse - activeComponent = activeComponent.getComponent(part); - return; - } - // a new path, resolve. - - if ((c = endpointComponents[part])) { - // endpoint specific. Support list - if (Array.isArray(c)) { - c = new engine.ListComponent(part, c, activeComponent); - } - else if (_.isObject(c) && c.type === 'list') { - c = new engine.ListComponent(part, c.list, activeComponent, c.multiValued, c.allow_non_valid); - } - else { - console.warn('incorrectly configured url component ', part, ' in endpoint', endpoint); - c = new engine.SharedComponent(part); - } - } - else if ((c = this.parametrizedComponentFactories[part])) { - // c is a f - c = c(part, activeComponent); - } - else { - // just accept whatever with not suggestions - c = new engine.SimpleParamComponent(part, activeComponent); - } - - activeComponent = c; - } - else { - // not pattern - let lookAhead = part; - let s; - - for (partIndex++; partIndex < partList.length; partIndex++) { - s = partList[partIndex]; - if (s.indexOf('{') >= 0) { - break; - } - lookAhead += '/' + s; - - } - - if (activeComponent.getComponent(part)) { - // we already have something for this, reuse - activeComponent = activeComponent.getComponent(part); - activeComponent.addOption(lookAhead); - } - else { - c = new engine.ConstantComponent(part, activeComponent, lookAhead); - activeComponent = c; - } - } - }, this); - // mark end of endpoint path - new AcceptEndpointComponent(endpoint, activeComponent); - }; - - cls.getTopLevelComponents = function () { - return this.rootComponent.next; - }; - -}(UrlPatternMatcher.prototype)); diff --git a/src/core_plugins/console/public/src/kb.js b/src/core_plugins/console/public/src/kb.js index feb3d69ed0b07..4edafb2bf6037 100644 --- a/src/core_plugins/console/public/src/kb.js +++ b/src/core_plugins/console/public/src/kb.js @@ -16,173 +16,66 @@ * specific language governing permissions and limitations * under the License. */ +import { + TypeAutocompleteComponent, + IdAutocompleteComponent, + IndexAutocompleteComponent, + FieldAutocompleteComponent, + ListComponent +} from './autocomplete/components'; -const $ = require('jquery'); -const _ = require('lodash'); -const mappings = require('./mappings'); -const Api = require('./kb/api'); -const autocompleteEngine = require('./autocomplete/engine'); - -let ACTIVE_API = new Api(); - -function nonValidIndexType(token) { - return !(token === '_all' || token[0] !== '_'); -} - -function IndexAutocompleteComponent(name, parent, multiValued) { - autocompleteEngine.ListComponent.call(this, name, mappings.getIndices, parent, multiValued); -} - -IndexAutocompleteComponent.prototype = _.create( - autocompleteEngine.ListComponent.prototype, - { 'constructor': IndexAutocompleteComponent }); - -(function (cls) { - cls.validateTokens = function (tokens) { - if (!this.multiValued && tokens.length > 1) { - return false; - } - return !_.find(tokens, nonValidIndexType); - }; - - cls.getDefaultTermMeta = function () { - return 'index'; - }; - - cls.getContextKey = function () { - return 'indices'; - }; -}(IndexAutocompleteComponent.prototype)); +import $ from 'jquery'; +import _ from 'lodash'; +import Api from './kb/api'; -function TypeGenerator(context) { - return mappings.getTypes(context.indices); -} - -function TypeAutocompleteComponent(name, parent, multiValued) { - autocompleteEngine.ListComponent.call(this, name, TypeGenerator, parent, multiValued); -} - -TypeAutocompleteComponent.prototype = _.create( - autocompleteEngine.ListComponent.prototype, - { 'constructor': TypeAutocompleteComponent }); - -(function (cls) { - cls.validateTokens = function (tokens) { - if (!this.multiValued && tokens.length > 1) { - return false; - } - - return !_.find(tokens, nonValidIndexType); - }; - - cls.getDefaultTermMeta = function () { - return 'type'; - }; - - cls.getContextKey = function () { - return 'types'; - }; -}(TypeAutocompleteComponent.prototype)); - -function FieldGenerator(context) { - return _.map(mappings.getFields(context.indices, context.types), function (field) { - return { name: field.name, meta: field.type }; - }); -} - -function FieldAutocompleteComponent(name, parent, multiValued) { - autocompleteEngine.ListComponent.call(this, name, FieldGenerator, parent, multiValued); -} - -FieldAutocompleteComponent.prototype = _.create( - autocompleteEngine.ListComponent.prototype, - { 'constructor': FieldAutocompleteComponent }); - -(function (cls) { - cls.validateTokens = function (tokens) { - if (!this.multiValued && tokens.length > 1) { - return false; - } - - return !_.find(tokens, function (token) { - return token.match(/[^\w.?*]/); - }); - }; - - cls.getDefaultTermMeta = function () { - return 'field'; - }; - - cls.getContextKey = function () { - return 'fields'; - }; -}(FieldAutocompleteComponent.prototype)); - - -function IdAutocompleteComponent(name, parent, multi) { - autocompleteEngine.SharedComponent.call(this, name, parent); - this.multi_match = multi; -} - -IdAutocompleteComponent.prototype = _.create( - autocompleteEngine.SharedComponent.prototype, - { 'constructor': IdAutocompleteComponent }); - -(function (cls) { - cls.match = function (token, context, editor) { - if (!token) { - return null; - } - if (!this.multi_match && Array.isArray(token)) { - return null; - } - token = Array.isArray(token) ? token : [token]; - if (_.find(token, function (t) { - return t.match(/[\/,]/); - })) { - return null; - } - const r = Object.getPrototypeOf(cls).match.call(this, token, context, editor); - r.context_values = r.context_values || {}; - r.context_values.id = token; - return r; - }; -}(IdAutocompleteComponent.prototype)); +let ACTIVE_API = new Api(); +const isNotAnIndexName = name => name[0] === '_' && name !== '_all'; const parametrizedComponentFactories = { - - 'index': function (name, parent) { + index: function (name, parent) { + if (isNotAnIndexName(name)) return; return new IndexAutocompleteComponent(name, parent, false); }, - 'indices': function (name, parent) { + indices: function (name, parent) { + if (isNotAnIndexName(name)) return; return new IndexAutocompleteComponent(name, parent, true); }, - 'type': function (name, parent) { + type: function (name, parent) { return new TypeAutocompleteComponent(name, parent, false); }, - 'types': function (name, parent) { + types: function (name, parent) { return new TypeAutocompleteComponent(name, parent, true); }, - 'id': function (name, parent) { + id: function (name, parent) { return new IdAutocompleteComponent(name, parent); }, - 'ids': function (name, parent) { + ids: function (name, parent) { return new IdAutocompleteComponent(name, parent, true); }, - 'fields': function (name, parent) { + fields: function (name, parent) { return new FieldAutocompleteComponent(name, parent, true); }, - 'field': function (name, parent) { + field: function (name, parent) { return new FieldAutocompleteComponent(name, parent, false); }, - 'nodes': function (name, parent) { - return new autocompleteEngine.ListComponent(name, ['_local', '_master', 'data:true', 'data:false', - 'master:true', 'master:false'], parent); + nodes: function (name, parent) { + return new ListComponent( + name, + [ + '_local', + '_master', + 'data:true', + 'data:false', + 'master:true', + 'master:false', + ], + parent + ); + }, + node: function (name, parent) { + return new ListComponent(name, [], parent, false); }, - 'node': function (name, parent) { - return new autocompleteEngine.ListComponent(name, [], parent, false); - } }; export function getUnmatchedEndpointComponents() { @@ -201,18 +94,27 @@ export function getEndpointBodyCompleteComponents(endpoint) { return desc.bodyAutocompleteRootComponents; } -export function getTopLevelUrlCompleteComponents() { - return ACTIVE_API.getTopLevelUrlCompleteComponents(); +export function getTopLevelUrlCompleteComponents(method) { + return ACTIVE_API.getTopLevelUrlCompleteComponents(method); } export function getGlobalAutocompleteComponents(term, throwOnMissing) { return ACTIVE_API.getGlobalAutocompleteComponents(term, throwOnMissing); } -function loadApisFromJson(json, urlParametrizedComponentFactories, bodyParametrizedComponentFactories) { - urlParametrizedComponentFactories = urlParametrizedComponentFactories || parametrizedComponentFactories; - bodyParametrizedComponentFactories = bodyParametrizedComponentFactories || urlParametrizedComponentFactories; - const api = new Api(urlParametrizedComponentFactories, bodyParametrizedComponentFactories); +function loadApisFromJson( + json, + urlParametrizedComponentFactories, + bodyParametrizedComponentFactories +) { + urlParametrizedComponentFactories = + urlParametrizedComponentFactories || parametrizedComponentFactories; + bodyParametrizedComponentFactories = + bodyParametrizedComponentFactories || urlParametrizedComponentFactories; + const api = new Api( + urlParametrizedComponentFactories, + bodyParametrizedComponentFactories + ); const names = []; _.each(json, function (apiJson, name) { names.unshift(name); @@ -230,18 +132,21 @@ function loadApisFromJson(json, urlParametrizedComponentFactories, bodyParametri export function setActiveApi(api) { if (_.isString(api)) { $.ajax({ - url: '../api/console/api_server?sense_version=' + encodeURIComponent('@@SENSE_VERSION') + '&apis=' + encodeURIComponent(api), + url: + '../api/console/api_server?sense_version=' + + encodeURIComponent('@@SENSE_VERSION') + + '&apis=' + + encodeURIComponent(api), dataType: 'json', // disable automatic guessing - } - ).then( + }).then( function (data) { setActiveApi(loadApisFromJson(data)); }, function (jqXHR) { console.log('failed to load API \'' + api + '\': ' + jqXHR.responseText); - }); + } + ); return; - } console.log('setting active api to [' + api.name + ']'); @@ -251,5 +156,5 @@ export function setActiveApi(api) { setActiveApi('es_6_0'); export const _test = { - loadApisFromJson: loadApisFromJson + loadApisFromJson: loadApisFromJson, }; diff --git a/src/core_plugins/console/public/src/kb/api.js b/src/core_plugins/console/public/src/kb/api.js index 2c1824732f900..2c5becb79301c 100644 --- a/src/core_plugins/console/public/src/kb/api.js +++ b/src/core_plugins/console/public/src/kb/api.js @@ -18,7 +18,7 @@ */ const _ = require('lodash'); -import { UrlPatternMatcher } from '../autocomplete/url_pattern_matcher'; +import { UrlPatternMatcher } from '../autocomplete/components'; import { UrlParams } from '../autocomplete/url_params'; import { globalsOnlyAutocompleteComponents, compileBodyDescription } from '../autocomplete/body_completer'; @@ -78,8 +78,8 @@ function Api(urlParametrizedComponentFactories, bodyParametrizedComponentFactori }; - cls.getTopLevelUrlCompleteComponents = function () { - return this.urlPatternMatcher.getTopLevelComponents(); + cls.getTopLevelUrlCompleteComponents = function (method) { + return this.urlPatternMatcher.getTopLevelComponents(method); }; cls.getUnmatchedEndpointComponents = function () { diff --git a/src/core_plugins/console/public/tests/src/integration.test.js b/src/core_plugins/console/public/tests/src/integration.test.js index e1bf4c01fde28..126c01a9e14d8 100644 --- a/src/core_plugins/console/public/tests/src/integration.test.js +++ b/src/core_plugins/console/public/tests/src/integration.test.js @@ -50,7 +50,6 @@ describe('Integration', () => { }); function processContextTest(data, mapping, kbSchemes, requestLine, testToRun) { - test(testToRun.name, async function (done) { let rowOffset = 0; // add one for the extra method line let editorValue = data; @@ -70,19 +69,18 @@ describe('Integration', () => { const json = {}; json[test.name] = kbSchemes || {}; const testApi = kb._test.loadApisFromJson(json); - //if (kbSchemes) { + if (kbSchemes) { // if (kbSchemes.globals) { // $.each(kbSchemes.globals, function (parent, rules) { // testApi.addGlobalAutocompleteRules(parent, rules); // }); // } - // if (kbSchemes.endpoints) { - // $.each(kbSchemes.endpoints, function (endpoint, scheme) { - // _.defaults(scheme, {methods: null}); // disable method testing unless specified in test - // testApi.addEndpointDescription(endpoint, scheme); - // }); - // } - //} + if (kbSchemes.endpoints) { + $.each(kbSchemes.endpoints, function (endpoint, scheme) { + testApi.addEndpointDescription(endpoint, scheme); + }); + } + } kb.setActiveApi(testApi); const { cursor } = testToRun; const { row, column } = cursor; @@ -1021,16 +1019,19 @@ describe('Integration', () => { search_type: ['count', 'query_then_fetch'], scroll: '10m', }, + methods: ['GET'], data_autocomplete_rules: {}, }, '_cluster/stats': { patterns: ['_cluster/stats'], indices_mode: 'none', data_autocomplete_rules: {}, + methods: ['GET'], }, '_cluster/nodes/stats': { patterns: ['_cluster/nodes/stats'], data_autocomplete_rules: {}, + methods: ['GET'], }, }, }; @@ -1131,7 +1132,7 @@ describe('Integration', () => { contextTests(null, MAPPING, CLUSTER_KB, 'GET cl', [ { - name: 'Endpoints by subpart', + name: 'Endpoints by subpart GET', cursor: { row: 0, column: 6 }, autoCompleteSet: [ { name: '_cluster/nodes/stats', meta: 'endpoint' }, @@ -1143,20 +1144,15 @@ describe('Integration', () => { prefixToAdd: '', suffixToAdd: '', initialValue: 'cl', + method: 'GET' }, ]); contextTests(null, MAPPING, CLUSTER_KB, 'POST cl', [ { - name: 'Endpoints by subpart', + name: 'Endpoints by subpart POST', cursor: { row: 0, column: 7 }, - autoCompleteSet: [ - { name: '_cluster/nodes/stats', meta: 'endpoint' }, - { name: '_cluster/stats', meta: 'endpoint' }, - { name: '_search', meta: 'endpoint' }, - { name: 'index1', meta: 'index' }, - { name: 'index2', meta: 'index' }, - ], + no_context: true, prefixToAdd: '', suffixToAdd: '', initialValue: 'cl', diff --git a/src/core_plugins/console/public/tests/src/kb.test.js b/src/core_plugins/console/public/tests/src/kb.test.js index c13b0ea3df1ba..1618573f911ed 100644 --- a/src/core_plugins/console/public/tests/src/kb.test.js +++ b/src/core_plugins/console/public/tests/src/kb.test.js @@ -78,7 +78,7 @@ describe('Knowledge base', () => { context, null, expectedContext.autoCompleteSet, - kb.getTopLevelUrlCompleteComponents() + kb.getTopLevelUrlCompleteComponents('GET') ); // override context to just check on id diff --git a/src/core_plugins/console/public/tests/src/url_autocomplete.test.js b/src/core_plugins/console/public/tests/src/url_autocomplete.test.js index 174f939f77d80..bbb9f3e6ab98a 100644 --- a/src/core_plugins/console/public/tests/src/url_autocomplete.test.js +++ b/src/core_plugins/console/public/tests/src/url_autocomplete.test.js @@ -24,8 +24,10 @@ const _ = require('lodash'); import { URL_PATH_END_MARKER, UrlPatternMatcher, -} from '../../src/autocomplete/url_pattern_matcher'; -import { populateContext, ListComponent } from '../../src/autocomplete/engine'; + ListComponent +} from '../../src/autocomplete/components'; + +import { populateContext } from '../../src/autocomplete/engine'; describe('Url autocomplete', () => { function patternsTest( @@ -84,7 +86,7 @@ describe('Url autocomplete', () => { context, null, expectedContext.autoCompleteSet, - patternMatcher.getTopLevelComponents() + patternMatcher.getTopLevelComponents(context.method) ); // override context to just check on id @@ -111,17 +113,19 @@ describe('Url autocomplete', () => { const endpoints = { '1': { patterns: ['a/b'], + methods: ['GET'] }, }; patternsTest('simple single path - completion', endpoints, 'a/b$', { endpoint: '1', + method: 'GET' }); patternsTest( 'simple single path - completion, with auto complete', endpoints, 'a/b', - { autoCompleteSet: [] } + { method: 'GET', autoCompleteSet: [] } ); patternsTest( @@ -135,14 +139,14 @@ describe('Url autocomplete', () => { 'simple single path - partial, with auto complete', endpoints, 'a', - { autoCompleteSet: ['b'] } + { method: 'GET', autoCompleteSet: ['b'] } ); patternsTest( 'simple single path - partial, with auto complete', endpoints, [], - { autoCompleteSet: ['a/b'] } + { method: 'GET', autoCompleteSet: ['a/b'] } ); patternsTest('simple single path - different path', endpoints, 'a/c', {}); @@ -152,56 +156,61 @@ describe('Url autocomplete', () => { const endpoints = { '1': { patterns: ['a/b', 'a/b/{p}'], + methods: ['GET'] }, '2': { patterns: ['a/c'], + methods: ['GET'] }, }; patternsTest('shared path - completion 1', endpoints, 'a/b$', { endpoint: '1', + method: 'GET' }); patternsTest('shared path - completion 2', endpoints, 'a/c$', { endpoint: '2', + method: 'GET' }); patternsTest( 'shared path - completion 1 with param', endpoints, 'a/b/v$', - { endpoint: '1', p: 'v' } + { method: 'GET', endpoint: '1', p: 'v' } ); patternsTest('shared path - partial, with auto complete', endpoints, 'a', { autoCompleteSet: ['b', 'c'], + method: 'GET', }); patternsTest( 'shared path - partial, with auto complete of param, no options', endpoints, 'a/b', - { autoCompleteSet: [] } + { method: 'GET', autoCompleteSet: [] } ); patternsTest( 'shared path - partial, without auto complete', endpoints, 'a', - {} + { method: 'GET', } ); patternsTest( 'shared path - different path - with auto complete', endpoints, 'a/e', - { autoCompleteSet: [] } + { method: 'GET', autoCompleteSet: [] } ); patternsTest( 'shared path - different path - without auto complete', endpoints, 'a/e', - {} + { method: 'GET', } ); }()); @@ -212,51 +221,57 @@ describe('Url autocomplete', () => { url_components: { p: ['a', 'b'], }, + methods: [ 'GET' ] }, '2': { patterns: ['a/c'], + methods: [ 'GET' ] }, }; patternsTest('option testing - completion 1', endpoints, 'a/a$', { + method: 'GET', endpoint: '1', p: ['a'], }); patternsTest('option testing - completion 2', endpoints, 'a/b$', { + method: 'GET', endpoint: '1', p: ['b'], }); patternsTest('option testing - completion 3', endpoints, 'a/b,a$', { + method: 'GET', endpoint: '1', p: ['b', 'a'], }); patternsTest('option testing - completion 4', endpoints, 'a/c$', { + method: 'GET', endpoint: '2', }); - patternsTest('option testing - completion 5', endpoints, 'a/d$', {}); + patternsTest('option testing - completion 5', endpoints, 'a/d$', { method: 'GET', }); patternsTest( 'option testing - partial, with auto complete', endpoints, 'a', - { autoCompleteSet: [t('a', 'p'), t('b', 'p'), 'c'] } + { method: 'GET', autoCompleteSet: [t('a', 'p'), t('b', 'p'), 'c'] } ); patternsTest( 'option testing - partial, without auto complete', endpoints, 'a', - {} + { method: 'GET', } ); patternsTest( 'option testing - different path - with auto complete', endpoints, 'a/e', - { autoCompleteSet: [] } + { method: 'GET', autoCompleteSet: [] } ); }()); @@ -267,12 +282,15 @@ describe('Url autocomplete', () => { url_components: { p: ['a', 'b'], }, + methods: [ 'GET' ] }, '2': { patterns: ['b/{p}'], + methods: [ 'GET' ] }, '3': { patterns: ['b/{l}/c'], + methods: [ 'GET' ], url_components: { l: { type: 'list', @@ -292,7 +310,7 @@ describe('Url autocomplete', () => { 'global parameters testing - completion 1', endpoints, 'a/a$', - { endpoint: '1', p: ['a'] }, + { method: 'GET', endpoint: '1', p: ['a'] }, globalFactories ); @@ -300,7 +318,7 @@ describe('Url autocomplete', () => { 'global parameters testing - completion 2', endpoints, 'b/g1$', - { endpoint: '2', p: ['g1'] }, + { method: 'GET', endpoint: '2', p: ['g1'] }, globalFactories ); @@ -308,7 +326,7 @@ describe('Url autocomplete', () => { 'global parameters testing - partial, with auto complete', endpoints, 'a', - { autoCompleteSet: [t('a', 'p'), t('b', 'p')] }, + { method: 'GET', autoCompleteSet: [t('a', 'p'), t('b', 'p')] }, globalFactories ); @@ -317,6 +335,7 @@ describe('Url autocomplete', () => { endpoints, 'b', { + method: 'GET', autoCompleteSet: [ t('g1', 'p'), t('g2', 'p'), @@ -331,14 +350,14 @@ describe('Url autocomplete', () => { 'Non valid token acceptance - partial, with auto complete 1', endpoints, 'b/la', - { autoCompleteSet: ['c'], l: ['la'] }, + { method: 'GET', autoCompleteSet: ['c'], l: ['la'] }, globalFactories ); patternsTest( 'Non valid token acceptance - partial, with auto complete 2', endpoints, 'b/non_valid', - { autoCompleteSet: ['c'], l: ['non_valid'] }, + { method: 'GET', autoCompleteSet: ['c'], l: ['non_valid'] }, globalFactories ); }()); @@ -347,13 +366,16 @@ describe('Url autocomplete', () => { const endpoints = { '1': { patterns: ['a/b/{p}/c/e'], + methods: [ 'GET' ] }, }; patternsTest('look ahead - autocomplete before param 1', endpoints, 'a', { + method: 'GET', autoCompleteSet: ['b'], }); patternsTest('look ahead - autocomplete before param 2', endpoints, [], { + method: 'GET', autoCompleteSet: ['a/b'], }); @@ -361,14 +383,14 @@ describe('Url autocomplete', () => { 'look ahead - autocomplete after param 1', endpoints, 'a/b/v', - { autoCompleteSet: ['c/e'], p: 'v' } + { method: 'GET', autoCompleteSet: ['c/e'], p: 'v' } ); patternsTest( 'look ahead - autocomplete after param 2', endpoints, 'a/b/v/c', - { autoCompleteSet: ['e'], p: 'v' } + { method: 'GET', autoCompleteSet: ['e'], p: 'v' } ); }()); diff --git a/x-pack/plugins/console_extensions/spec/xpack_graph_explore.json b/x-pack/plugins/console_extensions/spec/xpack_graph_explore.json index 38dcd9c7d4cc6..8c47cdc954e99 100644 --- a/x-pack/plugins/console_extensions/spec/xpack_graph_explore.json +++ b/x-pack/plugins/console_extensions/spec/xpack_graph_explore.json @@ -1,10 +1,10 @@ { - "{index_name}/_xpack/graph/_explore": { + "{index}/_xpack/graph/_explore": { "methods": [ "POST" ], "patterns": [ - "{index_name}/_xpack/graph/_explore" + "{index}/_xpack/graph/_explore" ], "data_autocomplete_rules": { "query": {}, diff --git a/x-pack/plugins/console_extensions/spec/xpack_migration.json b/x-pack/plugins/console_extensions/spec/xpack_migration.json index 5aa54546ca3be..fe70069d17523 100644 --- a/x-pack/plugins/console_extensions/spec/xpack_migration.json +++ b/x-pack/plugins/console_extensions/spec/xpack_migration.json @@ -5,10 +5,10 @@ ], "patterns": [ "_xpack/migration/assistance", - "_xpack/migration/assistance/{index_name}" + "_xpack/migration/assistance/{index}" ] }, - "_xpack/migration/upgrade/{index_name}": { + "_xpack/migration/upgrade/{index}": { "url_params": { "wait_for_completion": ["true", "false"] }, @@ -16,7 +16,7 @@ "POST" ], "patterns": [ - "_xpack/migration/upgrade/{index_name}" + "_xpack/migration/upgrade/{index}" ] }, "_xpack/migration/deprecations": { @@ -25,7 +25,7 @@ ], "patterns": [ "_xpack/migration/deprecations", - "{index_name}/_xpack/migration/deprecations" + "{index}/_xpack/migration/deprecations" ] } } diff --git a/x-pack/plugins/console_extensions/spec/xpack_rollup.json b/x-pack/plugins/console_extensions/spec/xpack_rollup.json index df4253f6f2b8d..2accaed23ab45 100644 --- a/x-pack/plugins/console_extensions/spec/xpack_rollup.json +++ b/x-pack/plugins/console_extensions/spec/xpack_rollup.json @@ -55,17 +55,17 @@ "POST" ] }, - "_xpack/rollup/data/{index_name}": { + "_xpack/rollup/data/{index}": { "patterns": [ - "_xpack/rollup/data/{index_name}" + "_xpack/rollup/data/{index}" ], "methods": [ "GET" ] }, - "{index_name}/_rollup_search": { + "{index}/_rollup_search": { "patterns": [ - "{index_name}/_rollup_search" + "{index}/_rollup_search" ], "methods": [ "GET" From 3dafa273f5a90cb7c14728cfb1fcba654b1231d4 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Wed, 6 Jun 2018 19:12:55 +0300 Subject: [PATCH 065/186] i18n engine refactoring --- packages/kbn-i18n/src/angular/index.js | 1 - packages/kbn-i18n/src/angular/module.js | 30 ------ packages/kbn-i18n/src/i18n.js | 135 +++++++++++++----------- src/ui/public/i18n/index.js | 11 +- 4 files changed, 82 insertions(+), 95 deletions(-) delete mode 100644 packages/kbn-i18n/src/angular/module.js diff --git a/packages/kbn-i18n/src/angular/index.js b/packages/kbn-i18n/src/angular/index.js index b34bb05c86aa7..a7af6fbeffc35 100644 --- a/packages/kbn-i18n/src/angular/index.js +++ b/packages/kbn-i18n/src/angular/index.js @@ -20,4 +20,3 @@ export { i18nProvider } from './provider'; export { i18nFilter } from './filter'; export { i18nDirective } from './directive'; -export { i18nModule } from './module'; diff --git a/packages/kbn-i18n/src/angular/module.js b/packages/kbn-i18n/src/angular/module.js deleted file mode 100644 index cba27444efe3c..0000000000000 --- a/packages/kbn-i18n/src/angular/module.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import angular from 'angular'; - -import { i18nProvider } from './provider'; -import { i18nFilter } from './filter'; -import { i18nDirective } from './directive'; - -export const i18nModule = angular - .module('kbn-i18n', []) - .provider('i18n', i18nProvider) - .filter('i18n', i18nFilter) - .directive('i18nId', i18nDirective); diff --git a/packages/kbn-i18n/src/i18n.js b/packages/kbn-i18n/src/i18n.js index 5ea9e94b9dff0..734917c259313 100644 --- a/packages/kbn-i18n/src/i18n.js +++ b/packages/kbn-i18n/src/i18n.js @@ -27,67 +27,67 @@ import IntlMessageFormat from 'intl-messageformat'; import memoizeIntlConstructor from 'intl-format-cache'; -const getMessageById = (messages, id) => - id.split('.').reduce((val, key) => (val ? val[key] : null), messages); +// Add all locale data to `IntlMessageFormat`. +// TODO: Use dynamic import for asynchronous loading of specific locale data +import 'intl-messageformat/lib/locales'; +const isString = value => typeof value === 'string'; +const isObject = value => typeof value === 'object'; const hasValues = values => Object.keys(values).length > 0; -const addLocaleData = localeData => { - if (localeData && localeData.locale) { - IntlMessageFormat.__addLocaleData(localeData); - } -}; - const showError = error => { if (process.env.NODE_ENV !== 'production') { console.error(error); } }; -const getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); - export class I18n { static EN_LOCALE = 'en'; static LOCALE_DELIMITER = '-'; + static getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); - static normalizeLocale(locale = '') { + static getMessageById(messages, id) { + return id + .split('.') + .reduce((val, key) => (val ? val[key] : null), messages); + } + + static normalizeLocale(locale) { return locale.toLowerCase().replace('_', I18n.LOCALE_DELIMITER); } + _defaultLocale = I18n.EN_LOCALE; + _formats = {}; + _messages = {}; + /** * Platform agnostic abstraction that helps to supply locale data to * UI frameworks and provides methods for the direct translation. * @param {Messages} messages - * @param {string} [locale = messages.locale||'en'] + * @param {string} [locale = messages.locale] */ - constructor(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { - this.currentLocale = I18n.normalizeLocale(locale); - this.messages = { [this.currentLocale]: messages }; - this.defaultLocale = I18n.EN_LOCALE; - this.formats = {}; - IntlMessageFormat.defaultLocale = this.defaultLocale; - - if (messages.localeData) { - addLocaleData(messages.localeData); - } + constructor(messages = {}, locale = messages.locale) { + this.setLocale(locale || this._defaultLocale); + this.addMessages(messages, this._currentLocale); + IntlMessageFormat.defaultLocale = this._defaultLocale; } /** * Provides a way to register translations with the engine * @param {Messages} messages - * @param {string} [locale = messages.locale||'en'] + * @param {string} [locale = messages.locale] */ - addMessages(messages = {}, locale = messages.locale || I18n.EN_LOCALE) { + addMessages(messages = {}, locale = messages.locale) { + if (!locale) { + showError('[I18n] A `locale` must be provided to add messages.'); + } + const normalizedLocale = I18n.normalizeLocale(locale); - this.messages[normalizedLocale] = { - ...this.messages[normalizedLocale], + this._messages[normalizedLocale] = { + ...this._messages[normalizedLocale], ...messages, }; - - if (messages.localeData) { - addLocaleData(messages.localeData); - } } /** @@ -95,7 +95,7 @@ export class I18n { * @returns {Messages} messages */ getMessages() { - return this.messages[this.currentLocale]; + return this._messages[this._currentLocale]; } /** @@ -103,7 +103,11 @@ export class I18n { * @param {string} locale */ setLocale(locale) { - this.currentLocale = I18n.normalizeLocale(locale); + if (!locale || !isString(locale)) { + showError('[I18n] A `locale` must be not non-empty string.'); + } else { + this._currentLocale = I18n.normalizeLocale(locale); + } } /** @@ -111,7 +115,7 @@ export class I18n { * @returns {string} locale */ getLocale() { - return this.currentLocale; + return this._currentLocale; } /** @@ -119,8 +123,12 @@ export class I18n { * @param {string} locale */ setDefaultLocale(locale) { - this.defaultLocale = I18n.normalizeLocale(locale); - IntlMessageFormat.defaultLocale = this.defaultLocale; + if (!locale || !isString(locale)) { + showError('[I18n] A `locale` must be not non-empty string.'); + } else { + this._defaultLocale = I18n.normalizeLocale(locale); + IntlMessageFormat.defaultLocale = this._defaultLocale; + } } /** @@ -128,7 +136,7 @@ export class I18n { * @returns {string} defaultLocale */ getDefaultLocale() { - return this.defaultLocale; + return this._defaultLocale; } /** @@ -136,7 +144,11 @@ export class I18n { * @param {object} formats */ setFormats(formats) { - this.formats = formats; + if (!isObject(formats) || !hasValues(formats)) { + showError('[I18n] A `formats` must be not non-empty object.'); + } else { + this._formats = formats; + } } /** @@ -144,7 +156,7 @@ export class I18n { * @returns {object} formats */ getFormats() { - return this.formats; + return this._formats; } /** @@ -152,7 +164,7 @@ export class I18n { * @returns {string[]} locales */ getRegisteredLocales() { - return Object.keys(this.messages); + return Object.keys(this._messages); } /** @@ -168,23 +180,21 @@ export class I18n { showError('[I18n] An `id` must be provided to translate a message.'); } - const message = getMessageById(this.getMessages(), id); + const message = I18n.getMessageById(this.getMessages(), id); if (!hasValues(values) && process.env.NODE_ENV === 'production') { return message || defaultMessage || id; } - let formattedMessage; - if (message) { try { - const msg = getMessageFormat( + const msg = I18n.getMessageFormat( message, this.getLocale(), this.getFormats() ); - formattedMessage = msg.format(values); + return msg.format(values); } catch (e) { showError( `[I18n] Error formatting message: "${id}" for locale: "${this.getLocale()}"` + @@ -192,24 +202,25 @@ export class I18n { `\n${e}` ); } - } else { - if (!defaultMessage || this.getLocale() !== this.getDefaultLocale()) { - showError( - `[I18n] Missing message: "${id}" for locale: "${this.getLocale()}"` + - (defaultMessage ? ', using default message as fallback.' : '') - ); - } + } else if ( + !defaultMessage || + this.getLocale() !== this.getDefaultLocale() + ) { + showError( + `[I18n] Missing message: "${id}" for locale: "${this.getLocale()}"` + + (defaultMessage ? ', using default message as fallback.' : '') + ); } - if (!formattedMessage && defaultMessage) { + if (defaultMessage) { try { - const msg = getMessageFormat( + const msg = I18n.getMessageFormat( defaultMessage, this.getDefaultLocale(), this.getFormats() ); - formattedMessage = msg.format(values); + return msg.format(values); } catch (e) { showError( `[I18n] Error formatting the default message for: "${id}"\n${e}` @@ -217,16 +228,14 @@ export class I18n { } } - if (!formattedMessage) { - showError( - `[I18n] Cannot format message: "${id}", ` + - `using message ${ - message || defaultMessage ? 'source' : 'id' - } as fallback.` - ); - } + showError( + `[I18n] Cannot format message: "${id}", ` + + `using message ${ + message || defaultMessage ? 'source' : 'id' + } as fallback.` + ); - return formattedMessage || message || defaultMessage || id; + return message || defaultMessage || id; } } diff --git a/src/ui/public/i18n/index.js b/src/ui/public/i18n/index.js index 3f90e0c1c4f1e..8e6e305593044 100644 --- a/src/ui/public/i18n/index.js +++ b/src/ui/public/i18n/index.js @@ -22,6 +22,12 @@ import { AngularI18n, i18n } from '@kbn/i18n'; import { uiModules } from 'ui/modules'; import { metadata } from 'ui/metadata'; +const { + i18nProvider, + i18nFilter, + i18nDirective, +} = AngularI18n; + if (metadata.translations) { i18n.addMessages(metadata.translations); @@ -30,4 +36,7 @@ if (metadata.translations) { } } -uiModules.get('i18n', [AngularI18n.i18nModule.name]); +uiModules.get('i18n') + .provider('i18n', i18nProvider) + .filter('i18n', i18nFilter) + .directive('i18nId', i18nDirective); From 4e628af3654e879a08fb7efe3f9cc37429053c4f Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Wed, 6 Jun 2018 13:30:57 -0400 Subject: [PATCH 066/186] Typescriptify dashboard panel actions (#19675) --- .../panel_actions/build_context_menu.js | 4 +- .../get_customize_panel_action.js | 40 +++-- .../panel_actions/get_edit_panel_action.js | 21 ++- .../panel_actions/get_remove_panel_action.js | 23 +-- .../get_toggle_expand_panel_action.js | 19 ++- .../dashboard_context_menu_panel.ts | 53 ++++++ .../dashboard_panel_action.js | 86 ---------- .../dashboard_panel_action.ts | 155 ++++++++++++++++++ ...js => dashboard_panel_actions_registry.ts} | 3 +- .../{index.js => index.ts} | 6 +- ...shboard_context_menu_panel.js => types.ts} | 28 ++-- src/ui/public/embeddable/index.ts | 1 + 12 files changed, 286 insertions(+), 153 deletions(-) create mode 100644 src/ui/public/dashboard_panel_actions/dashboard_context_menu_panel.ts delete mode 100644 src/ui/public/dashboard_panel_actions/dashboard_panel_action.js create mode 100644 src/ui/public/dashboard_panel_actions/dashboard_panel_action.ts rename src/ui/public/dashboard_panel_actions/{dashboard_panel_actions_registry.js => dashboard_panel_actions_registry.ts} (96%) rename src/ui/public/dashboard_panel_actions/{index.js => index.ts} (90%) rename src/ui/public/dashboard_panel_actions/{dashboard_context_menu_panel.js => types.ts} (62%) diff --git a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/build_context_menu.js b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/build_context_menu.js index 31128bfbc1918..75d087ed73796 100644 --- a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/build_context_menu.js +++ b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/build_context_menu.js @@ -120,8 +120,8 @@ function convertPanelActionToContextMenuItem({ action, containerState, embeddabl name: action.displayName, icon: action.icon, panel: _.get(action, 'childContextMenuPanel.id'), - onClick: () => action.onClick({ containerState, embeddable }), - disabled: action.isDisabled({ containerState, embeddable }), + onClick: () => action.onClick({ embeddable, containerState }), + disabled: action.isDisabled({ embeddable, containerState }), 'data-test-subj': `dashboardPanelAction-${action.id}`, }; } diff --git a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_customize_panel_action.js b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_customize_panel_action.js index e44dc61b5061d..85692e71821d5 100644 --- a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_customize_panel_action.js +++ b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_customize_panel_action.js @@ -34,21 +34,27 @@ import { DashboardViewMode } from '../../../dashboard_view_mode'; * @return {DashboardPanelAction} */ export function getCustomizePanelAction({ onResetPanelTitle, onUpdatePanelTitle, title, closeContextMenu }) { - return new DashboardPanelAction({ - displayName: 'Customize panel', - id: 'customizePanel', - parentPanelId: 'mainMenu', - icon: , - isVisible: ({ containerState }) => (containerState.viewMode === DashboardViewMode.EDIT), - childContextMenuPanel: new DashboardContextMenuPanel({ - id: 'panelSubOptionsMenu', - title: 'Customize panel', - getContent: () => (), - }), - }); + return new DashboardPanelAction( + { + id: 'customizePanel', + displayName: 'Customize panel', + parentPanelId: 'mainMenu', + }, + { + icon: , + isVisible: ({ containerState }) => (containerState.viewMode === DashboardViewMode.EDIT), + childContextMenuPanel: new DashboardContextMenuPanel( + { + id: 'panelSubOptionsMenu', + title: 'Customize panel', + }, + { + getContent: () => (), + }), + }); } diff --git a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_edit_panel_action.js b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_edit_panel_action.js index 62c8398ab147e..d1746a843a6b5 100644 --- a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_edit_panel_action.js +++ b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_edit_panel_action.js @@ -31,13 +31,16 @@ import { DashboardViewMode } from '../../../dashboard_view_mode'; * @return {DashboardPanelAction} */ export function getEditPanelAction() { - return new DashboardPanelAction({ - displayName: 'Edit visualization', - id: 'editPanel', - icon: , - parentPanelId: 'mainMenu', - onClick: ({ embeddable }) => { window.location = embeddable.metadata.editUrl; }, - isVisible: ({ containerState }) => (containerState.viewMode === DashboardViewMode.EDIT), - isDisabled: ({ embeddable }) => (!embeddable || !embeddable.metadata || !embeddable.metadata.editUrl), - }); + return new DashboardPanelAction( + { + displayName: 'Edit visualization', + id: 'editPanel', + parentPanelId: 'mainMenu', + }, + { + icon: , + onClick: ({ embeddable }) => { window.location = embeddable.metadata.editUrl; }, + isVisible: ({ containerState }) => (containerState.viewMode === DashboardViewMode.EDIT), + isDisabled: ({ embeddable }) => (!embeddable || !embeddable.metadata || !embeddable.metadata.editUrl), + }); } diff --git a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_remove_panel_action.js b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_remove_panel_action.js index 1401fb2a68539..dd9856cd52018 100644 --- a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_remove_panel_action.js +++ b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_remove_panel_action.js @@ -31,14 +31,17 @@ import { DashboardViewMode } from '../../../dashboard_view_mode'; * @return {DashboardPanelAction} */ export function getRemovePanelAction(onDeletePanel) { - return new DashboardPanelAction({ - displayName: 'Delete from dashboard', - id: 'deletePanel', - parentPanelId: 'mainMenu', - icon: , - isVisible: ({ containerState }) => ( - containerState.viewMode === DashboardViewMode.EDIT && !containerState.isPanelExpanded - ), - onClick: onDeletePanel, - }); + return new DashboardPanelAction( + { + displayName: 'Delete from dashboard', + id: 'deletePanel', + parentPanelId: 'mainMenu', + }, + { + icon: , + isVisible: ({ containerState }) => ( + containerState.viewMode === DashboardViewMode.EDIT && !containerState.isPanelExpanded + ), + onClick: onDeletePanel, + }); } diff --git a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_toggle_expand_panel_action.js b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_toggle_expand_panel_action.js index 9621a19b9c0a9..8cf1606c296a0 100644 --- a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_toggle_expand_panel_action.js +++ b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_actions/get_toggle_expand_panel_action.js @@ -31,12 +31,15 @@ import { DashboardPanelAction } from 'ui/dashboard_panel_actions'; * @return {DashboardPanelAction} */ export function getToggleExpandPanelAction({ isExpanded, toggleExpandedPanel }) { - return new DashboardPanelAction({ - displayName: isExpanded ? 'Minimize' : 'Full screen', - id: 'togglePanel', - parentPanelId: 'mainMenu', - // TODO: Update to minimize icon when https://github.com/elastic/eui/issues/837 is complete. - icon: , - onClick: toggleExpandedPanel, - }); + return new DashboardPanelAction( + { + displayName: isExpanded ? 'Minimize' : 'Full screen', + id: 'togglePanel', + parentPanelId: 'mainMenu', + }, + { + // TODO: Update to minimize icon when https://github.com/elastic/eui/issues/837 is complete. + icon: , + onClick: toggleExpandedPanel, + }); } diff --git a/src/ui/public/dashboard_panel_actions/dashboard_context_menu_panel.ts b/src/ui/public/dashboard_panel_actions/dashboard_context_menu_panel.ts new file mode 100644 index 0000000000000..ee3e0969cf82d --- /dev/null +++ b/src/ui/public/dashboard_panel_actions/dashboard_context_menu_panel.ts @@ -0,0 +1,53 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { PanelActionAPI } from './types'; + +interface DashboardContextMenuPanelOptions { + getContent?: (panelActionAPI: PanelActionAPI) => HTMLElement | undefined; +} + +interface DashboardContextMenuPanelConfig { + id: string; + title: string; +} + +export abstract class DashboardContextMenuPanel { + public readonly id: string; + public readonly title: string; + + constructor( + config: DashboardContextMenuPanelConfig, + options: DashboardContextMenuPanelOptions = {} + ) { + this.id = config.id; + this.title = config.title; + + if (options.getContent) { + this.getContent = options.getContent; + } + } + + /** + * Optional, could be composed of actions instead of content. + */ + public getContent(panelActionAPI: PanelActionAPI): HTMLElement | undefined { + return; + } +} diff --git a/src/ui/public/dashboard_panel_actions/dashboard_panel_action.js b/src/ui/public/dashboard_panel_actions/dashboard_panel_action.js deleted file mode 100644 index 15f3178d1eda1..0000000000000 --- a/src/ui/public/dashboard_panel_actions/dashboard_panel_action.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export class DashboardPanelAction { - /** - * - * @param {string} id - * @param {string} displayName - * @param {function} onClick - * @param {DashboardContextMenuPanel} childContextMenuPanel - optional child panel to open when clicked. - * @param {function} isDisabled - optionally set a custom disabled function - * @param {function} isVisible - optionally set a custom isVisible function - * @param {string} parentPanelId - set if this action belongs on a nested child panel - * @param {Element} icon - */ - constructor( - { - id, - displayName, - onClick, - childContextMenuPanel, - isDisabled, - isVisible, - parentPanelId, - icon, - } = {}) { - this.id = id; - this.icon = icon; - this.displayName = displayName; - this.childContextMenuPanel = childContextMenuPanel; - this.parentPanelId = parentPanelId; - - if (onClick) { - this.onClick = onClick; - } - - if (isDisabled) { - this.isDisabled = isDisabled; - } - - if (isVisible) { - this.isVisible = isVisible; - } - } - - /** - * @param {Embeddable} embeddable - * @param ContainerState} containerState - */ - onClick(/*{ embeddable, containerState }*/) {} - - /** - * Defaults to always visible. - * @param {Embeddable} embeddable - * @param ContainerState} containerState - * @return {boolean} - */ - isVisible(/*{ embeddable, containerState }*/) { - return true; - } - - /** - * Defaults to always enabled. - * @param {Embeddable} embeddable - * @param {ContainerState} containerState - */ - isDisabled(/*{ embeddable, containerState }*/) { - return false; - } -} diff --git a/src/ui/public/dashboard_panel_actions/dashboard_panel_action.ts b/src/ui/public/dashboard_panel_actions/dashboard_panel_action.ts new file mode 100644 index 0000000000000..bb25299b02696 --- /dev/null +++ b/src/ui/public/dashboard_panel_actions/dashboard_panel_action.ts @@ -0,0 +1,155 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { DashboardContextMenuPanel } from './dashboard_context_menu_panel'; +import { PanelActionAPI } from './types'; + +interface DashboardPanelActionOptions { + /** + * An optional action to take when the action is clicked on. Either this or childContextMenuPanel should be + * given. + */ + onClick?: (actionAPI: PanelActionAPI) => void; + + /** + * An optional child context menu to display when the action is clicked. + */ + childContextMenuPanel?: DashboardContextMenuPanel; + + /** + * Whether this action should be disabled based on the parameters given. + * @param {PanelActionAPI} panelActionAPI + * @return {boolean} + */ + isDisabled?: (actionAPI: PanelActionAPI) => boolean; + + /** + * Whether this action should be visible based on the parameters given. + * @param {PanelActionAPI} panelActionAPI + * @return {boolean} + */ + isVisible?: (panelActionAPI: PanelActionAPI) => boolean; + + /** + * Determines which DashboardContextMenuPanel this action is displayed on. + */ + parentPanelId?: string; + + /** + * Optional icon to display to the left of the action. + */ + icon?: Node; +} + +interface DashboardPanelActionsConfig { + id: string; + + /** + * Display name of the action in the menu + */ + displayName: string; + + /** + * Determines which DashboardContextMenuPanel this action is displayed on. + */ + parentPanelId: string; +} + +export abstract class DashboardPanelAction { + public readonly id: string; + + /** + * Optional icon to display to the left of the action. + */ + public readonly icon?: Node; + + /** + * Display name of the action in the menu + */ + public readonly displayName: string; + + /** + * Optional child context menu to open when the action is clicked. + */ + public readonly childContextMenuPanel?: DashboardContextMenuPanel; + + /** + * Determines which DashboardContextMenuPanel this action is displayed on. + */ + public readonly parentPanelId: string; + + /** + * + * @param {string} config.id + * @param {string} config.displayName + * @param {string} config.parentPanelId - set if this action belongs on a nested child panel + * @param {function} options.onClick + * @param {DashboardContextMenuPanel} options.childContextMenuPanel - optional child panel to open when clicked. + * @param {function} options.isDisabled - optionally set a custom disabled function + * @param {function} options.isVisible - optionally set a custom isVisible function + * @param {Element} options.icon + */ + protected constructor( + config: DashboardPanelActionsConfig, + options: DashboardPanelActionOptions = {} + ) { + this.id = config.id; + this.displayName = config.displayName; + this.parentPanelId = config.parentPanelId; + + this.icon = options.icon; + this.childContextMenuPanel = options.childContextMenuPanel; + + if (options.onClick) { + this.onClick = options.onClick; + } + + if (options.isDisabled) { + this.isDisabled = options.isDisabled; + } + + if (options.isVisible) { + this.isVisible = options.isVisible; + } + } + + /** + * @param {PanelActionAPI} panelActionAPI + */ + public onClick(panelActionAPI: PanelActionAPI): void { + return; + } + + /** + * Whether this action should be visible based on the parameters given. Defaults to always visible. + * @param {PanelActionAPI} panelActionAPI + * @return {boolean} + */ + public isVisible(panelActionAPI: PanelActionAPI): boolean { + return true; + } + + /** + * Whether this action should be disabled based on the parameters given. Defaults to always enabled. + * @param {PanelActionAPI} panelActionAPI + */ + public isDisabled(panelActionAPI: PanelActionAPI): boolean { + return false; + } +} diff --git a/src/ui/public/dashboard_panel_actions/dashboard_panel_actions_registry.js b/src/ui/public/dashboard_panel_actions/dashboard_panel_actions_registry.ts similarity index 96% rename from src/ui/public/dashboard_panel_actions/dashboard_panel_actions_registry.js rename to src/ui/public/dashboard_panel_actions/dashboard_panel_actions_registry.ts index 4d3c017b3cf05..eb51f6f4a3137 100644 --- a/src/ui/public/dashboard_panel_actions/dashboard_panel_actions_registry.js +++ b/src/ui/public/dashboard_panel_actions/dashboard_panel_actions_registry.ts @@ -17,9 +17,10 @@ * under the License. */ +// @ts-ignore: implicit any for JS file import { uiRegistry } from 'ui/registry/_registry'; export const DashboardPanelActionsRegistryProvider = uiRegistry({ - name: 'dashboardPanelActions', index: ['name'], + name: 'dashboardPanelActions', }); diff --git a/src/ui/public/dashboard_panel_actions/index.js b/src/ui/public/dashboard_panel_actions/index.ts similarity index 90% rename from src/ui/public/dashboard_panel_actions/index.js rename to src/ui/public/dashboard_panel_actions/index.ts index 759ece6ec56a6..a11538441a434 100644 --- a/src/ui/public/dashboard_panel_actions/index.js +++ b/src/ui/public/dashboard_panel_actions/index.ts @@ -17,6 +17,8 @@ * under the License. */ -export { DashboardPanelAction } from './dashboard_panel_action'; -export { DashboardPanelActionsRegistryProvider } from './dashboard_panel_actions_registry'; export { DashboardContextMenuPanel } from './dashboard_context_menu_panel'; +export { DashboardPanelAction } from './dashboard_panel_action'; +export { + DashboardPanelActionsRegistryProvider, +} from './dashboard_panel_actions_registry'; diff --git a/src/ui/public/dashboard_panel_actions/dashboard_context_menu_panel.js b/src/ui/public/dashboard_panel_actions/types.ts similarity index 62% rename from src/ui/public/dashboard_panel_actions/dashboard_context_menu_panel.js rename to src/ui/public/dashboard_panel_actions/types.ts index 03537d846f3b9..7bd8b6e442821 100644 --- a/src/ui/public/dashboard_panel_actions/dashboard_context_menu_panel.js +++ b/src/ui/public/dashboard_panel_actions/types.ts @@ -17,27 +17,19 @@ * under the License. */ -export class DashboardContextMenuPanel { +import { ContainerState, Embeddable } from 'ui/embeddable'; + +/** + * Exposes information about the current state of the panel and the embeddable rendered internally. + */ +export interface PanelActionAPI { /** - * @param {string} id - * @param {string} title - * @param {function} getContent + * The embeddable that resides inside this action. */ - constructor({ id, title, getContent }) { - this.id = id; - this.title = title; - - if (getContent) { - this.getContent = getContent; - } - } + embeddable: Embeddable; /** - * Optional, could be composed of actions instead of content. - * @param {Embeddable} embeddable - * @param {ContainerState} containerState + * Information about the current state of the panel and dashboard. */ - getContent(/*{ embeddable, containerState }*/) { - return null; - } + containerState: ContainerState; } diff --git a/src/ui/public/embeddable/index.ts b/src/ui/public/embeddable/index.ts index 5517a14efedea..408a0d5127d16 100644 --- a/src/ui/public/embeddable/index.ts +++ b/src/ui/public/embeddable/index.ts @@ -22,3 +22,4 @@ export * from './embeddable'; export { EmbeddableFactoriesRegistryProvider, } from './embeddable_factories_registry'; +export { ContainerState } from './types'; From 4278da552aab643a689fa394fdcf17593bc4eac8 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Thu, 7 Jun 2018 15:07:25 +0300 Subject: [PATCH 067/186] Fix locales data loading and add more jsdoc comments --- packages/kbn-i18n/package.json | 2 + packages/kbn-i18n/src/i18n.js | 34 +- packages/kbn-i18n/src/locales.js | 565 ++++++++++++++++++ packages/kbn-i18n/src/server/i18n_loader.js | 117 ++-- packages/kbn-i18n/src/server/ui_i18n_mixin.js | 11 +- packages/kbn-i18n/yarn.lock | 12 +- 6 files changed, 690 insertions(+), 51 deletions(-) create mode 100644 packages/kbn-i18n/src/locales.js diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index db77940517f2a..689fddd6a9014 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -8,6 +8,8 @@ "accept-language-parser": "^1.5.0", "intl-format-cache": "^2.1.0", "intl-messageformat": "^2.2.0", + "intl-relativeformat": "^2.1.0", + "json5": "^1.0.1", "prop-types": "^15.5.8", "react": "^16.3.0", "react-intl": "^2.4.0" diff --git a/packages/kbn-i18n/src/i18n.js b/packages/kbn-i18n/src/i18n.js index 734917c259313..1846c12287d04 100644 --- a/packages/kbn-i18n/src/i18n.js +++ b/packages/kbn-i18n/src/i18n.js @@ -18,40 +18,58 @@ */ /** - @typedef Messages + @typedef Messages - messages tree, where leafs are translated strings @type {object} @property {string} [locale] - locale of the messages - @property {object} [localeData] - localization rules for IntlMessageFormat */ import IntlMessageFormat from 'intl-messageformat'; +import IntlRelativeFormat from 'intl-relativeformat'; import memoizeIntlConstructor from 'intl-format-cache'; // Add all locale data to `IntlMessageFormat`. // TODO: Use dynamic import for asynchronous loading of specific locale data -import 'intl-messageformat/lib/locales'; +import './locales'; const isString = value => typeof value === 'string'; const isObject = value => typeof value === 'object'; const hasValues = values => Object.keys(values).length > 0; - const showError = error => { if (process.env.NODE_ENV !== 'production') { console.error(error); } }; +/** + * Platform agnostic abstraction that helps to supply locale data to + * UI frameworks and provides methods for the direct translation. + */ export class I18n { static EN_LOCALE = 'en'; static LOCALE_DELIMITER = '-'; static getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); + static getRelativeFormat = memoizeIntlConstructor(IntlRelativeFormat); + /** + * Returns message by the given message id. + * @param {Messages} messages - messages tree + * @param {string} id - path to the message that consists of properties + * names separated by dots + * @returns {string} message - translated message from messages tree + * @example + * getMessageById({ a: { b: { c: 'test' } } }, 'a.b.c'); // => 'test' + */ static getMessageById(messages, id) { return id .split('.') .reduce((val, key) => (val ? val[key] : null), messages); } + /** + * Normalizes locale to make it consistent with IntlMessageFormat locales + * @param {string} locale + * @returns {string} normalizedLocale + */ static normalizeLocale(locale) { return locale.toLowerCase().replace('_', I18n.LOCALE_DELIMITER); } @@ -61,15 +79,16 @@ export class I18n { _messages = {}; /** - * Platform agnostic abstraction that helps to supply locale data to - * UI frameworks and provides methods for the direct translation. - * @param {Messages} messages + * Creates i18n engine instance and fills messages registry with a passed messages + * @constructor + * @param {Messages} [messages] * @param {string} [locale = messages.locale] */ constructor(messages = {}, locale = messages.locale) { this.setLocale(locale || this._defaultLocale); this.addMessages(messages, this._currentLocale); IntlMessageFormat.defaultLocale = this._defaultLocale; + IntlRelativeFormat.defaultLocale = this._defaultLocale; } /** @@ -128,6 +147,7 @@ export class I18n { } else { this._defaultLocale = I18n.normalizeLocale(locale); IntlMessageFormat.defaultLocale = this._defaultLocale; + IntlRelativeFormat.defaultLocale = this._defaultLocale; } } diff --git a/packages/kbn-i18n/src/locales.js b/packages/kbn-i18n/src/locales.js new file mode 100644 index 0000000000000..d9612a467b240 --- /dev/null +++ b/packages/kbn-i18n/src/locales.js @@ -0,0 +1,565 @@ +/* eslint-disable */ + +// TODO: Get rid of this file + +import IntlMessageFormat from 'intl-messageformat'; +import IntlRelativeFormat from 'intl-relativeformat'; + +function addLocaleData(localeData) { + IntlMessageFormat.__addLocaleData(localeData); + IntlRelativeFormat.__addLocaleData(localeData); +} + +addLocaleData({"locale":"af","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"af-NA","parentLocale":"af"}); +addLocaleData({"locale":"agq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ak","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"am","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"ar","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return n==0?"zero":n==1?"one":n==2?"two":n100>=3&&n100<=10?"few":n100>=11&&n100<=99?"many":"other"}}); +addLocaleData({"locale":"ar-AE","parentLocale":"ar"}); +addLocaleData({"locale":"ar-BH","parentLocale":"ar"}); +addLocaleData({"locale":"ar-DJ","parentLocale":"ar"}); +addLocaleData({"locale":"ar-DZ","parentLocale":"ar"}); +addLocaleData({"locale":"ar-EG","parentLocale":"ar"}); +addLocaleData({"locale":"ar-EH","parentLocale":"ar"}); +addLocaleData({"locale":"ar-ER","parentLocale":"ar"}); +addLocaleData({"locale":"ar-IL","parentLocale":"ar"}); +addLocaleData({"locale":"ar-IQ","parentLocale":"ar"}); +addLocaleData({"locale":"ar-JO","parentLocale":"ar"}); +addLocaleData({"locale":"ar-KM","parentLocale":"ar"}); +addLocaleData({"locale":"ar-KW","parentLocale":"ar"}); +addLocaleData({"locale":"ar-LB","parentLocale":"ar"}); +addLocaleData({"locale":"ar-LY","parentLocale":"ar"}); +addLocaleData({"locale":"ar-MA","parentLocale":"ar"}); +addLocaleData({"locale":"ar-MR","parentLocale":"ar"}); +addLocaleData({"locale":"ar-OM","parentLocale":"ar"}); +addLocaleData({"locale":"ar-PS","parentLocale":"ar"}); +addLocaleData({"locale":"ar-QA","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SA","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SD","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SO","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SS","parentLocale":"ar"}); +addLocaleData({"locale":"ar-SY","parentLocale":"ar"}); +addLocaleData({"locale":"ar-TD","parentLocale":"ar"}); +addLocaleData({"locale":"ar-TN","parentLocale":"ar"}); +addLocaleData({"locale":"ar-YE","parentLocale":"ar"}); +addLocaleData({"locale":"as","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5||n==7||n==8||n==9||n==10?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"asa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ast","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"az","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],i10=i.slice(-1),i100=i.slice(-2),i1000=i.slice(-3);if(ord)return i10==1||i10==2||i10==5||i10==7||i10==8||(i100==20||i100==50||i100==70||i100==80)?"one":i10==3||i10==4||(i1000==100||i1000==200||i1000==300||i1000==400||i1000==500||i1000==600||i1000==700||i1000==800||i1000==900)?"few":i==0||i10==6||(i100==40||i100==60||i100==90)?"many":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"az-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"az-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"az-Latn","parentLocale":"az"}); +addLocaleData({"locale":"bas","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"be","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return(n10==2||n10==3)&&n100!=12&&n100!=13?"few":"other";return n10==1&&n100!=11?"one":n10>=2&&n10<=4&&(n100<12||n100>14)?"few":t0&&n10==0||n10>=5&&n10<=9||n100>=11&&n100<=14?"many":"other"}}); +addLocaleData({"locale":"bem","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"bez","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"bg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"bh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"bm","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"bm-Nkoo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"bn","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5||n==7||n==8||n==9||n==10?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"bn-IN","parentLocale":"bn"}); +addLocaleData({"locale":"bo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"bo-IN","parentLocale":"bo"}); +addLocaleData({"locale":"br","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),n1000000=t0&&s[0].slice(-6);if(ord)return"other";return n10==1&&n100!=11&&n100!=71&&n100!=91?"one":n10==2&&n100!=12&&n100!=72&&n100!=92?"two":(n10==3||n10==4||n10==9)&&(n100<10||n100>19)&&(n100<70||n100>79)&&(n100<90||n100>99)?"few":n!=0&&t0&&n1000000==0?"many":"other"}}); +addLocaleData({"locale":"brx","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"bs","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}}); +addLocaleData({"locale":"bs-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"bs-Latn","parentLocale":"bs"}); +addLocaleData({"locale":"ca","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return n==1||n==3?"one":n==2?"two":n==4?"few":"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"ca-AD","parentLocale":"ca"}); +addLocaleData({"locale":"ca-ES-VALENCIA","parentLocale":"ca-ES"}); +addLocaleData({"locale":"ca-ES","parentLocale":"ca"}); +addLocaleData({"locale":"ca-FR","parentLocale":"ca"}); +addLocaleData({"locale":"ca-IT","parentLocale":"ca"}); +addLocaleData({"locale":"ce","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"cgg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"chr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ckb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ckb-IR","parentLocale":"ckb"}); +addLocaleData({"locale":"cs","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1];if(ord)return"other";return n==1&&v0?"one":i>=2&&i<=4&&v0?"few":!v0?"many":"other"}}); +addLocaleData({"locale":"cu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"cy","pluralRuleFunction":function (n,ord){if(ord)return n==0||n==7||n==8||n==9?"zero":n==1?"one":n==2?"two":n==3||n==4?"few":n==5||n==6?"many":"other";return n==0?"zero":n==1?"one":n==2?"two":n==3?"few":n==6?"many":"other"}}); +addLocaleData({"locale":"da","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],t0=Number(s[0])==n;if(ord)return"other";return n==1||!t0&&(i==0||i==1)?"one":"other"}}); +addLocaleData({"locale":"da-GL","parentLocale":"da"}); +addLocaleData({"locale":"dav","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"de","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"de-AT","parentLocale":"de"}); +addLocaleData({"locale":"de-BE","parentLocale":"de"}); +addLocaleData({"locale":"de-CH","parentLocale":"de"}); +addLocaleData({"locale":"de-LI","parentLocale":"de"}); +addLocaleData({"locale":"de-LU","parentLocale":"de"}); +addLocaleData({"locale":"dje","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"dsb","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i100=i.slice(-2),f100=f.slice(-2);if(ord)return"other";return v0&&i100==1||f100==1?"one":v0&&i100==2||f100==2?"two":v0&&(i100==3||i100==4)||(f100==3||f100==4)?"few":"other"}}); +addLocaleData({"locale":"dua","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"dv","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"dyo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"dz","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ebu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ee","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ee-TG","parentLocale":"ee"}); +addLocaleData({"locale":"el","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"el-CY","parentLocale":"el"}); +addLocaleData({"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"en-001","parentLocale":"en"}); +addLocaleData({"locale":"en-150","parentLocale":"en-001"}); +addLocaleData({"locale":"en-AG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-AI","parentLocale":"en-001"}); +addLocaleData({"locale":"en-AS","parentLocale":"en"}); +addLocaleData({"locale":"en-AT","parentLocale":"en-150"}); +addLocaleData({"locale":"en-AU","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BB","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BE","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BI","parentLocale":"en"}); +addLocaleData({"locale":"en-BM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BW","parentLocale":"en-001"}); +addLocaleData({"locale":"en-BZ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CA","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CH","parentLocale":"en-150"}); +addLocaleData({"locale":"en-CK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CX","parentLocale":"en-001"}); +addLocaleData({"locale":"en-CY","parentLocale":"en-001"}); +addLocaleData({"locale":"en-DE","parentLocale":"en-150"}); +addLocaleData({"locale":"en-DG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-DK","parentLocale":"en-150"}); +addLocaleData({"locale":"en-DM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-Dsrt","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"en-ER","parentLocale":"en-001"}); +addLocaleData({"locale":"en-FI","parentLocale":"en-150"}); +addLocaleData({"locale":"en-FJ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-FK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-FM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GB","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GD","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GH","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GI","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-GU","parentLocale":"en"}); +addLocaleData({"locale":"en-GY","parentLocale":"en-001"}); +addLocaleData({"locale":"en-HK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IE","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IL","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IN","parentLocale":"en-001"}); +addLocaleData({"locale":"en-IO","parentLocale":"en-001"}); +addLocaleData({"locale":"en-JE","parentLocale":"en-001"}); +addLocaleData({"locale":"en-JM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-KE","parentLocale":"en-001"}); +addLocaleData({"locale":"en-KI","parentLocale":"en-001"}); +addLocaleData({"locale":"en-KN","parentLocale":"en-001"}); +addLocaleData({"locale":"en-KY","parentLocale":"en-001"}); +addLocaleData({"locale":"en-LC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-LR","parentLocale":"en-001"}); +addLocaleData({"locale":"en-LS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MH","parentLocale":"en"}); +addLocaleData({"locale":"en-MO","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MP","parentLocale":"en"}); +addLocaleData({"locale":"en-MS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MT","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MU","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MW","parentLocale":"en-001"}); +addLocaleData({"locale":"en-MY","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NA","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NF","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NL","parentLocale":"en-150"}); +addLocaleData({"locale":"en-NR","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NU","parentLocale":"en-001"}); +addLocaleData({"locale":"en-NZ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PH","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PN","parentLocale":"en-001"}); +addLocaleData({"locale":"en-PR","parentLocale":"en"}); +addLocaleData({"locale":"en-PW","parentLocale":"en-001"}); +addLocaleData({"locale":"en-RW","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SB","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SD","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SE","parentLocale":"en-150"}); +addLocaleData({"locale":"en-SG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SH","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SI","parentLocale":"en-150"}); +addLocaleData({"locale":"en-SL","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SX","parentLocale":"en-001"}); +addLocaleData({"locale":"en-SZ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-Shaw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"en-TC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TK","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TO","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TT","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TV","parentLocale":"en-001"}); +addLocaleData({"locale":"en-TZ","parentLocale":"en-001"}); +addLocaleData({"locale":"en-UG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-UM","parentLocale":"en"}); +addLocaleData({"locale":"en-US","parentLocale":"en"}); +addLocaleData({"locale":"en-VC","parentLocale":"en-001"}); +addLocaleData({"locale":"en-VG","parentLocale":"en-001"}); +addLocaleData({"locale":"en-VI","parentLocale":"en"}); +addLocaleData({"locale":"en-VU","parentLocale":"en-001"}); +addLocaleData({"locale":"en-WS","parentLocale":"en-001"}); +addLocaleData({"locale":"en-ZA","parentLocale":"en-001"}); +addLocaleData({"locale":"en-ZM","parentLocale":"en-001"}); +addLocaleData({"locale":"en-ZW","parentLocale":"en-001"}); +addLocaleData({"locale":"eo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"es","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"es-419","parentLocale":"es"}); +addLocaleData({"locale":"es-AR","parentLocale":"es-419"}); +addLocaleData({"locale":"es-BO","parentLocale":"es-419"}); +addLocaleData({"locale":"es-CL","parentLocale":"es-419"}); +addLocaleData({"locale":"es-CO","parentLocale":"es-419"}); +addLocaleData({"locale":"es-CR","parentLocale":"es-419"}); +addLocaleData({"locale":"es-CU","parentLocale":"es-419"}); +addLocaleData({"locale":"es-DO","parentLocale":"es-419"}); +addLocaleData({"locale":"es-EA","parentLocale":"es"}); +addLocaleData({"locale":"es-EC","parentLocale":"es-419"}); +addLocaleData({"locale":"es-GQ","parentLocale":"es"}); +addLocaleData({"locale":"es-GT","parentLocale":"es-419"}); +addLocaleData({"locale":"es-HN","parentLocale":"es-419"}); +addLocaleData({"locale":"es-IC","parentLocale":"es"}); +addLocaleData({"locale":"es-MX","parentLocale":"es-419"}); +addLocaleData({"locale":"es-NI","parentLocale":"es-419"}); +addLocaleData({"locale":"es-PA","parentLocale":"es-419"}); +addLocaleData({"locale":"es-PE","parentLocale":"es-419"}); +addLocaleData({"locale":"es-PH","parentLocale":"es"}); +addLocaleData({"locale":"es-PR","parentLocale":"es-419"}); +addLocaleData({"locale":"es-PY","parentLocale":"es-419"}); +addLocaleData({"locale":"es-SV","parentLocale":"es-419"}); +addLocaleData({"locale":"es-US","parentLocale":"es-419"}); +addLocaleData({"locale":"es-UY","parentLocale":"es-419"}); +addLocaleData({"locale":"es-VE","parentLocale":"es-419"}); +addLocaleData({"locale":"et","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"eu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ewo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"fa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"fa-AF","parentLocale":"fa"}); +addLocaleData({"locale":"ff","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<2?"one":"other"}}); +addLocaleData({"locale":"ff-CM","parentLocale":"ff"}); +addLocaleData({"locale":"ff-GN","parentLocale":"ff"}); +addLocaleData({"locale":"ff-MR","parentLocale":"ff"}); +addLocaleData({"locale":"fi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"fil","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),f10=f.slice(-1);if(ord)return n==1?"one":"other";return v0&&(i==1||i==2||i==3)||v0&&i10!=4&&i10!=6&&i10!=9||!v0&&f10!=4&&f10!=6&&f10!=9?"one":"other"}}); +addLocaleData({"locale":"fo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"fo-DK","parentLocale":"fo"}); +addLocaleData({"locale":"fr","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return n>=0&&n<2?"one":"other"}}); +addLocaleData({"locale":"fr-BE","parentLocale":"fr"}); +addLocaleData({"locale":"fr-BF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-BI","parentLocale":"fr"}); +addLocaleData({"locale":"fr-BJ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-BL","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CA","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CD","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CG","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CH","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CI","parentLocale":"fr"}); +addLocaleData({"locale":"fr-CM","parentLocale":"fr"}); +addLocaleData({"locale":"fr-DJ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-DZ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GA","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GN","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GP","parentLocale":"fr"}); +addLocaleData({"locale":"fr-GQ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-HT","parentLocale":"fr"}); +addLocaleData({"locale":"fr-KM","parentLocale":"fr"}); +addLocaleData({"locale":"fr-LU","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MA","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MC","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MG","parentLocale":"fr"}); +addLocaleData({"locale":"fr-ML","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MQ","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MR","parentLocale":"fr"}); +addLocaleData({"locale":"fr-MU","parentLocale":"fr"}); +addLocaleData({"locale":"fr-NC","parentLocale":"fr"}); +addLocaleData({"locale":"fr-NE","parentLocale":"fr"}); +addLocaleData({"locale":"fr-PF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-PM","parentLocale":"fr"}); +addLocaleData({"locale":"fr-RE","parentLocale":"fr"}); +addLocaleData({"locale":"fr-RW","parentLocale":"fr"}); +addLocaleData({"locale":"fr-SC","parentLocale":"fr"}); +addLocaleData({"locale":"fr-SN","parentLocale":"fr"}); +addLocaleData({"locale":"fr-SY","parentLocale":"fr"}); +addLocaleData({"locale":"fr-TD","parentLocale":"fr"}); +addLocaleData({"locale":"fr-TG","parentLocale":"fr"}); +addLocaleData({"locale":"fr-TN","parentLocale":"fr"}); +addLocaleData({"locale":"fr-VU","parentLocale":"fr"}); +addLocaleData({"locale":"fr-WF","parentLocale":"fr"}); +addLocaleData({"locale":"fr-YT","parentLocale":"fr"}); +addLocaleData({"locale":"fur","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"fy","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"ga","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return n==1?"one":"other";return n==1?"one":n==2?"two":t0&&n>=3&&n<=6?"few":t0&&n>=7&&n<=10?"many":"other"}}); +addLocaleData({"locale":"gd","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n==1||n==11?"one":n==2||n==12?"two":t0&&n>=3&&n<=10||t0&&n>=13&&n<=19?"few":"other"}}); +addLocaleData({"locale":"gl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"gsw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"gsw-FR","parentLocale":"gsw"}); +addLocaleData({"locale":"gsw-LI","parentLocale":"gsw"}); +addLocaleData({"locale":"gu","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"guw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"guz","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"gv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return v0&&i10==1?"one":v0&&i10==2?"two":v0&&(i100==0||i100==20||i100==40||i100==60||i100==80)?"few":!v0?"many":"other"}}); +addLocaleData({"locale":"ha","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ha-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ha-GH","parentLocale":"ha"}); +addLocaleData({"locale":"ha-NE","parentLocale":"ha"}); +addLocaleData({"locale":"haw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"he","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return"other";return n==1&&v0?"one":i==2&&v0?"two":v0&&(n<0||n>10)&&t0&&n10==0?"many":"other"}}); +addLocaleData({"locale":"hi","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"hr","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}}); +addLocaleData({"locale":"hr-BA","parentLocale":"hr"}); +addLocaleData({"locale":"hsb","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i100=i.slice(-2),f100=f.slice(-2);if(ord)return"other";return v0&&i100==1||f100==1?"one":v0&&i100==2||f100==2?"two":v0&&(i100==3||i100==4)||(f100==3||f100==4)?"few":"other"}}); +addLocaleData({"locale":"hu","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5?"one":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"hy","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return n>=0&&n<2?"one":"other"}}); +addLocaleData({"locale":"id","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ig","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ii","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"in","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"is","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],t0=Number(s[0])==n,i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return t0&&i10==1&&i100!=11||!t0?"one":"other"}}); +addLocaleData({"locale":"it","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return n==11||n==8||n==80||n==800?"many":"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"it-CH","parentLocale":"it"}); +addLocaleData({"locale":"it-SM","parentLocale":"it"}); +addLocaleData({"locale":"iu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"iu-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"iw","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return"other";return n==1&&v0?"one":i==2&&v0?"two":v0&&(n<0||n>10)&&t0&&n10==0?"many":"other"}}); +addLocaleData({"locale":"ja","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"jbo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"jgo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ji","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"jmc","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"jv","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"jw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ka","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],i100=i.slice(-2);if(ord)return i==1?"one":i==0||(i100>=2&&i100<=20||i100==40||i100==60||i100==80)?"many":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kab","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<2?"one":"other"}}); +addLocaleData({"locale":"kaj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kam","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"kcg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kde","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"kea","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"khq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ki","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"kk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return n10==6||n10==9||t0&&n10==0&&n!=0?"many":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kkj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kl","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kln","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"km","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"kn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"ko","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ko-KP","parentLocale":"ko"}); +addLocaleData({"locale":"kok","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ks","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ksb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ksf","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ksh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0?"zero":n==1?"one":"other"}}); +addLocaleData({"locale":"ku","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"kw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"ky","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"lag","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0];if(ord)return"other";return n==0?"zero":(i==0||i==1)&&n!=0?"one":"other"}}); +addLocaleData({"locale":"lb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"lg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"lkt","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ln","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"ln-AO","parentLocale":"ln"}); +addLocaleData({"locale":"ln-CF","parentLocale":"ln"}); +addLocaleData({"locale":"ln-CG","parentLocale":"ln"}); +addLocaleData({"locale":"lo","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}}); +addLocaleData({"locale":"lrc","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"lrc-IQ","parentLocale":"lrc"}); +addLocaleData({"locale":"lt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return"other";return n10==1&&(n100<11||n100>19)?"one":n10>=2&&n10<=9&&(n100<11||n100>19)?"few":f!=0?"many":"other"}}); +addLocaleData({"locale":"lu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"luo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"luy","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"lv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",v=f.length,t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),f100=f.slice(-2),f10=f.slice(-1);if(ord)return"other";return t0&&n10==0||n100>=11&&n100<=19||v==2&&(f100>=11&&f100<=19)?"zero":n10==1&&n100!=11||v==2&&f10==1&&f100!=11||v!=2&&f10==1?"one":"other"}}); +addLocaleData({"locale":"mas","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"mas-TZ","parentLocale":"mas"}); +addLocaleData({"locale":"mer","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mfe","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"mgh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mgo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"mk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1);if(ord)return i10==1&&i100!=11?"one":i10==2&&i100!=12?"two":(i10==7||i10==8)&&i100!=17&&i100!=18?"many":"other";return v0&&i10==1||f10==1?"one":"other"}}); +addLocaleData({"locale":"ml","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"mn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"mn-Mong","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mo","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":"other";return n==1&&v0?"one":!v0||n==0||n!=1&&(n100>=1&&n100<=19)?"few":"other"}}); +addLocaleData({"locale":"mr","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":"other";return n>=0&&n<=1?"one":"other"}}); +addLocaleData({"locale":"ms","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}}); +addLocaleData({"locale":"ms-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ms-BN","parentLocale":"ms"}); +addLocaleData({"locale":"ms-SG","parentLocale":"ms"}); +addLocaleData({"locale":"mt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return n==1?"one":n==0||n100>=2&&n100<=10?"few":n100>=11&&n100<=19?"many":"other"}}); +addLocaleData({"locale":"mua","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"my","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"mzn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"nah","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"naq","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"nb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nb-SJ","parentLocale":"nb"}); +addLocaleData({"locale":"nd","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ne","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return t0&&n>=1&&n<=4?"one":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ne-IN","parentLocale":"ne"}); +addLocaleData({"locale":"nl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"nl-AW","parentLocale":"nl"}); +addLocaleData({"locale":"nl-BE","parentLocale":"nl"}); +addLocaleData({"locale":"nl-BQ","parentLocale":"nl"}); +addLocaleData({"locale":"nl-CW","parentLocale":"nl"}); +addLocaleData({"locale":"nl-SR","parentLocale":"nl"}); +addLocaleData({"locale":"nl-SX","parentLocale":"nl"}); +addLocaleData({"locale":"nmg","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"nn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nnh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"no","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nqo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"nr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nso","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"nus","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ny","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"nyn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"om","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"om-KE","parentLocale":"om"}); +addLocaleData({"locale":"or","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"os","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"os-RU","parentLocale":"os"}); +addLocaleData({"locale":"pa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"pa-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"pa-Guru","parentLocale":"pa"}); +addLocaleData({"locale":"pap","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"pl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return n==1&&v0?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i!=1&&(i10==0||i10==1)||v0&&(i10>=5&&i10<=9)||v0&&(i100>=12&&i100<=14)?"many":"other"}}); +addLocaleData({"locale":"prg","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",v=f.length,t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),f100=f.slice(-2),f10=f.slice(-1);if(ord)return"other";return t0&&n10==0||n100>=11&&n100<=19||v==2&&(f100>=11&&f100<=19)?"zero":n10==1&&n100!=11||v==2&&f10==1&&f100!=11||v!=2&&f10==1?"one":"other"}}); +addLocaleData({"locale":"ps","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"pt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return t0&&n>=0&&n<=2&&n!=2?"one":"other"}}); +addLocaleData({"locale":"pt-AO","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-PT","parentLocale":"pt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"pt-CV","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-GW","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-MO","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-MZ","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-ST","parentLocale":"pt-PT"}); +addLocaleData({"locale":"pt-TL","parentLocale":"pt-PT"}); +addLocaleData({"locale":"qu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"qu-BO","parentLocale":"qu"}); +addLocaleData({"locale":"qu-EC","parentLocale":"qu"}); +addLocaleData({"locale":"rm","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"rn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ro","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":"other";return n==1&&v0?"one":!v0||n==0||n!=1&&(n100>=1&&n100<=19)?"few":"other"}}); +addLocaleData({"locale":"ro-MD","parentLocale":"ro"}); +addLocaleData({"locale":"rof","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ru","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i10==0||v0&&(i10>=5&&i10<=9)||v0&&(i100>=11&&i100<=14)?"many":"other"}}); +addLocaleData({"locale":"ru-BY","parentLocale":"ru"}); +addLocaleData({"locale":"ru-KG","parentLocale":"ru"}); +addLocaleData({"locale":"ru-KZ","parentLocale":"ru"}); +addLocaleData({"locale":"ru-MD","parentLocale":"ru"}); +addLocaleData({"locale":"ru-UA","parentLocale":"ru"}); +addLocaleData({"locale":"rw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"rwk","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"sah","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"saq","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"sbp","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"sdh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"se","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"se-FI","parentLocale":"se"}); +addLocaleData({"locale":"se-SE","parentLocale":"se"}); +addLocaleData({"locale":"seh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ses","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"sg","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"sh","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}}); +addLocaleData({"locale":"shi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n>=0&&n<=1?"one":t0&&n>=2&&n<=10?"few":"other"}}); +addLocaleData({"locale":"shi-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"shi-Tfng","parentLocale":"shi"}); +addLocaleData({"locale":"si","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"";if(ord)return"other";return n==0||n==1||i==0&&f==1?"one":"other"}}); +addLocaleData({"locale":"sk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1];if(ord)return"other";return n==1&&v0?"one":i>=2&&i<=4&&v0?"few":!v0?"many":"other"}}); +addLocaleData({"locale":"sl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i100=i.slice(-2);if(ord)return"other";return v0&&i100==1?"one":v0&&i100==2?"two":v0&&(i100==3||i100==4)||!v0?"few":"other"}}); +addLocaleData({"locale":"sma","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"smi","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"smj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"smn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"sms","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}}); +addLocaleData({"locale":"sn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"so","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"so-DJ","parentLocale":"so"}); +addLocaleData({"locale":"so-ET","parentLocale":"so"}); +addLocaleData({"locale":"so-KE","parentLocale":"so"}); +addLocaleData({"locale":"sq","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":n10==4&&n100!=14?"many":"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"sq-MK","parentLocale":"sq"}); +addLocaleData({"locale":"sq-XK","parentLocale":"sq"}); +addLocaleData({"locale":"sr","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}}); +addLocaleData({"locale":"sr-Cyrl","parentLocale":"sr"}); +addLocaleData({"locale":"sr-Cyrl-BA","parentLocale":"sr-Cyrl"}); +addLocaleData({"locale":"sr-Cyrl-ME","parentLocale":"sr-Cyrl"}); +addLocaleData({"locale":"sr-Cyrl-XK","parentLocale":"sr-Cyrl"}); +addLocaleData({"locale":"sr-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"sr-Latn-BA","parentLocale":"sr-Latn"}); +addLocaleData({"locale":"sr-Latn-ME","parentLocale":"sr-Latn"}); +addLocaleData({"locale":"sr-Latn-XK","parentLocale":"sr-Latn"}); +addLocaleData({"locale":"ss","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ssy","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"st","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"sv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return(n10==1||n10==2)&&n100!=11&&n100!=12?"one":"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"sv-AX","parentLocale":"sv"}); +addLocaleData({"locale":"sv-FI","parentLocale":"sv"}); +addLocaleData({"locale":"sw","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"sw-CD","parentLocale":"sw"}); +addLocaleData({"locale":"sw-KE","parentLocale":"sw"}); +addLocaleData({"locale":"sw-UG","parentLocale":"sw"}); +addLocaleData({"locale":"syr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ta","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"ta-LK","parentLocale":"ta"}); +addLocaleData({"locale":"ta-MY","parentLocale":"ta"}); +addLocaleData({"locale":"ta-SG","parentLocale":"ta"}); +addLocaleData({"locale":"te","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"teo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"teo-KE","parentLocale":"teo"}); +addLocaleData({"locale":"th","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"ti","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"ti-ER","parentLocale":"ti"}); +addLocaleData({"locale":"tig","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"tk","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"tl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),f10=f.slice(-1);if(ord)return n==1?"one":"other";return v0&&(i==1||i==2||i==3)||v0&&i10!=4&&i10!=6&&i10!=9||!v0&&f10!=4&&f10!=6&&f10!=9?"one":"other"}}); +addLocaleData({"locale":"tn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"to","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"tr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"tr-CY","parentLocale":"tr"}); +addLocaleData({"locale":"ts","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"twq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"tzm","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n==0||n==1||t0&&n>=11&&n<=99?"one":"other"}}); +addLocaleData({"locale":"ug","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"uk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),i10=i.slice(-1),i100=i.slice(-2);if(ord)return n10==3&&n100!=13?"few":"other";return v0&&i10==1&&i100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i10==0||v0&&(i10>=5&&i10<=9)||v0&&(i100>=11&&i100<=14)?"many":"other"}}); +addLocaleData({"locale":"ur","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"ur-IN","parentLocale":"ur"}); +addLocaleData({"locale":"uz","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"uz-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"uz-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"uz-Latn","parentLocale":"uz"}); +addLocaleData({"locale":"vai","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"vai-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"vai-Vaii","parentLocale":"vai"}); +addLocaleData({"locale":"ve","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"vi","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}}); +addLocaleData({"locale":"vo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"vun","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"wa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}}); +addLocaleData({"locale":"wae","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"wo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"xh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"xog","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}}); +addLocaleData({"locale":"yav","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"yi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}}); +addLocaleData({"locale":"yo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"yo-BJ","parentLocale":"yo"}); +addLocaleData({"locale":"zgh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"zh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"zh-Hans","parentLocale":"zh"}); +addLocaleData({"locale":"zh-Hans-HK","parentLocale":"zh-Hans"}); +addLocaleData({"locale":"zh-Hans-MO","parentLocale":"zh-Hans"}); +addLocaleData({"locale":"zh-Hans-SG","parentLocale":"zh-Hans"}); +addLocaleData({"locale":"zh-Hant","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}}); +addLocaleData({"locale":"zh-Hant-HK","parentLocale":"zh-Hant"}); +addLocaleData({"locale":"zh-Hant-MO","parentLocale":"zh-Hant-HK"}); +addLocaleData({"locale":"zu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); diff --git a/packages/kbn-i18n/src/server/i18n_loader.js b/packages/kbn-i18n/src/server/i18n_loader.js index c73e72fc9aae5..5148b07e9049b 100644 --- a/packages/kbn-i18n/src/server/i18n_loader.js +++ b/packages/kbn-i18n/src/server/i18n_loader.js @@ -17,20 +17,37 @@ * under the License. */ +/** + @typedef Messages - messages tree, where leafs are translated strings + @type {object} + @property {string} [locale] - locale of the messages + */ + import path from 'path'; import { readFile } from 'fs'; import { promisify } from 'util'; import { pick } from 'accept-language-parser'; +import JSON5 from 'json5'; const asyncReadFile = promisify(readFile); +const unique = (arr = []) => + arr.filter((value, index, array) => array.indexOf(value) === index); + +/** + * Abstraction that helps to load, parse and supply + * localization messages to i18n engine + */ export class I18nLoader { static TRANSLATION_FILE_EXTENSION = '.json'; - static unique(arr = []) { - return arr.filter((value, index, array) => array.indexOf(value) === index); - } - + /** + * Returns locale by the given translation file name + * @param {string} fullFileName + * @returns {string} locale + * @example + * getLocaleFromFileName('./path/to/translation/ru.json') // => 'ru' + */ static getLocaleFromFileName(fullFileName) { if (!fullFileName) { throw new Error('Filename is empty'); @@ -40,15 +57,20 @@ export class I18nLoader { if (fileExt !== I18nLoader.TRANSLATION_FILE_EXTENSION) { throw new Error( - `Translations must be in a JSON file. File being registered is ${fullFileName}` + `Translations must have 'json' extension. File being registered is ${fullFileName}` ); } return path.basename(fullFileName, I18nLoader.TRANSLATION_FILE_EXTENSION); } + /** + * Loads file and parses it as JSON5 + * @param {string} pathToFile + * @returns {Promise} + */ static async loadFile(pathToFile) { - return JSON.parse(await asyncReadFile(pathToFile, 'utf8')); + return JSON5.parse(await asyncReadFile(pathToFile, 'utf8')); } /** @@ -56,20 +78,19 @@ export class I18nLoader { * @private * @type {Map|{}} - Key is locale, value is array of registered paths */ - translationsRegistry = {}; + _translationsRegistry = {}; /** * Internal property for caching loaded translations files * @private - * @type {Map|{}} - Key is path to translation file, value is + * @type {Map|{}} - Key is path to translation file, value is * object with translation messages */ - loadedFiles = {}; + _loadedFiles = {}; /** - * The translation file is registered with i18n plugin. - * The plugin contains a list of registered translation file paths per language. - * @param {String} pluginTranslationFilePath - Absolute path to the translation file to register. + * Registers translation file with i18n loader + * @param {string} pluginTranslationFilePath - Absolute path to the translation file to register. */ registerTranslationFile(pluginTranslationFilePath) { if (!path.isAbsolute(pluginTranslationFilePath)) { @@ -81,57 +102,60 @@ export class I18nLoader { const locale = I18nLoader.getLocaleFromFileName(pluginTranslationFilePath); - this.translationsRegistry[locale] = I18nLoader.unique([ - ...(this.translationsRegistry[locale] || []), + this._translationsRegistry[locale] = unique([ + ...(this._translationsRegistry[locale] || []), pluginTranslationFilePath, ]); } + /** + * Registers array of translation files with i18n loader + * @param {string[]} arrayOfPaths - Array of absolute paths to the translation files to register. + */ registerTranslationFiles(arrayOfPaths = []) { arrayOfPaths.forEach(this.registerTranslationFile.bind(this)); } - getRegisteredTranslations() { - return Object.keys(this.translationsRegistry); - } - - pickLocaleByLanguageHeader(header) { - return pick(this.getRegisteredTranslations(), header); + /** + * Returns an array of locales that have been registered with i18n loader + * @returns {string[]} registeredTranslations + */ + getRegisteredLocales() { + return Object.keys(this._translationsRegistry); } /** - * Return translations for a suitable locale from a user side locale list - * @param {...string} languageTags - BCP 47 language tags. The tags are listed in priority order as set in the Accept-Language header. - * @returns {Promise} translations - promise for an object where - * keys are translation keys and - * values are translations - * This object will contain all registered translations for the highest priority locale which is registered with the i18n module. - * This object can be empty if no locale in the language tags can be matched against the registered locales. + * Returns translations for a suitable locale based on accept-language header. + * This object will contain all registered translations for the highest priority + * locale which is registered with the i18n loader. This object can be empty + * if no locale in the language tags can be matched against the registered locales. + * @param {string} header - accept-language header from an HTTP request + * @returns {Promise} translations - translation messages */ async getTranslationsByLanguageHeader(header) { return this.getTranslationsByLocale( - this.pickLocaleByLanguageHeader(header) + this._pickLocaleByLanguageHeader(header) ); } /** * Returns translation messages by specified locale - * @param locale - * @returns {Promise} + * @param {string} locale + * @returns {Promise} translations - translation messages */ async getTranslationsByLocale(locale) { - const files = this.translationsRegistry[locale] || []; - const notLoadedFiles = files.filter(file => !this.loadedFiles[file]); + const files = this._translationsRegistry[locale] || []; + const notLoadedFiles = files.filter(file => !this._loadedFiles[file]); if (notLoadedFiles.length) { - await this.loadAndCacheFiles(notLoadedFiles); + await this._loadAndCacheFiles(notLoadedFiles); } return files.length ? files.reduce( (messages, file) => ({ ...messages, - ...this.loadedFiles[file], + ...this._loadedFiles[file], }), { locale } ) @@ -140,11 +164,11 @@ export class I18nLoader { /** * Returns all translations for registered locales - * @return {Promise} translations - A Promise object where keys are - * the locale and values are Objects of translation keys and translations + * @return {Promise>} translations - A Promise object + * where keys are the locale and values are objects of translation messages */ async getAllTranslations() { - const locales = this.getRegisteredTranslations(); + const locales = this.getRegisteredLocales(); const translations = await Promise.all( locales.map(locale => this.getTranslationsByLocale(locale)) ); @@ -159,20 +183,31 @@ export class I18nLoader { } /** - * Loads translations files and adds them into "loadedFiles" cache + * Parses the accept-language header from an HTTP request and picks + * the best match of the locale from the registered locales + * @private + * @param {string} header - accept-language header from an HTTP request + * @returns {string} locale + */ + _pickLocaleByLanguageHeader(header) { + return pick(this.getRegisteredLocales(), header); + } + + /** + * Loads translations files and adds them into "_loadedFiles" cache * @private * @param {string[]} files * @returns {Promise} */ - async loadAndCacheFiles(files) { + async _loadAndCacheFiles(files) { const translations = await Promise.all(files.map(I18nLoader.loadFile)); - this.loadedFiles = files.reduce( + this._loadedFiles = files.reduce( (loadedFiles, file, index) => ({ ...loadedFiles, [file]: translations[index], }), - this.loadedFiles + this._loadedFiles ); } } diff --git a/packages/kbn-i18n/src/server/ui_i18n_mixin.js b/packages/kbn-i18n/src/server/ui_i18n_mixin.js index 33d37b23793d9..feabaa8dc7e83 100644 --- a/packages/kbn-i18n/src/server/ui_i18n_mixin.js +++ b/packages/kbn-i18n/src/server/ui_i18n_mixin.js @@ -17,6 +17,12 @@ * under the License. */ +/** + @typedef Messages - messages tree, where leafs are translated strings + @type {object} + @property {string} [locale] - locale of the messages + */ + import { I18nLoader } from './i18n_loader'; export function uiI18nMixin(kbnServer, server, config) { @@ -29,7 +35,7 @@ export function uiI18nMixin(kbnServer, server, config) { /** * Fetch the translations matching the Accept-Language header for a requests. * @name request.getUiTranslations - * @returns {Promise>} translations + * @returns {Promise} translations - translation messages */ server.decorate('request', 'getUiTranslations', async function() { const header = this.headers['accept-language']; @@ -48,7 +54,8 @@ export function uiI18nMixin(kbnServer, server, config) { /** * Return all translations for registered locales * @name server.getAllUiTranslations - * @return {Promise>>} + * @return {Promise>} translations - A Promise object + * where keys are the locale and values are objects of translation messages */ server.decorate('server', 'getAllUiTranslations', async () => { return await i18nLoader.getAllTranslations(); diff --git a/packages/kbn-i18n/yarn.lock b/packages/kbn-i18n/yarn.lock index cf0ac4bc277b1..805926e4c2213 100644 --- a/packages/kbn-i18n/yarn.lock +++ b/packages/kbn-i18n/yarn.lock @@ -52,7 +52,7 @@ intl-messageformat@^2.0.0, intl-messageformat@^2.1.0, intl-messageformat@^2.2.0: dependencies: intl-messageformat-parser "1.4.0" -intl-relativeformat@^2.0.0: +intl-relativeformat@^2.0.0, intl-relativeformat@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/intl-relativeformat/-/intl-relativeformat-2.1.0.tgz#010f1105802251f40ac47d0e3e1a201348a255df" dependencies: @@ -79,12 +79,22 @@ js-tokens@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + dependencies: + minimist "^1.2.0" + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" From d8e2eba5e33121abcc3fbc51f3e1f967b354dfc4 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Thu, 7 Jun 2018 15:33:55 +0300 Subject: [PATCH 068/186] Fix verify_translations task --- packages/kbn-i18n/src/server/i18n_loader.js | 15 +++++++++++++++ tasks/verify_translations.js | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/kbn-i18n/src/server/i18n_loader.js b/packages/kbn-i18n/src/server/i18n_loader.js index 5148b07e9049b..7de0b1e800de0 100644 --- a/packages/kbn-i18n/src/server/i18n_loader.js +++ b/packages/kbn-i18n/src/server/i18n_loader.js @@ -41,6 +41,21 @@ const unique = (arr = []) => export class I18nLoader { static TRANSLATION_FILE_EXTENSION = '.json'; + /** + * Registers passed translations files, loads them and returns promise with + * all translation messages + * @param {string[]} paths - Array of absolute paths to the translation files + * @returns {Promise>} translations - A Promise object + * where keys are the locale and values are objects of translation messages + */ + static async getAllTranslationsFromPaths(paths) { + const i18nLoader = new I18nLoader(); + + i18nLoader.registerTranslationFiles(paths); + + return await i18nLoader.getAllTranslations(); + } + /** * Returns locale by the given translation file name * @param {string} fullFileName diff --git a/tasks/verify_translations.js b/tasks/verify_translations.js index 045753fa8ade0..df75a4cd7dad4 100644 --- a/tasks/verify_translations.js +++ b/tasks/verify_translations.js @@ -17,10 +17,12 @@ * under the License. */ +// TODO: Integrate a new tool for translations checking +import { I18nLoader } from '@kbn/i18n/src/server'; + import { fromRoot, formatListAsProse } from '../src/utils'; import { findPluginSpecs } from '../src/plugin_discovery'; import { collectUiExports } from '../src/ui'; -import { I18n } from '../src/ui/ui_i18n/i18n'; import * as i18nVerify from './utils/i18n_verify_keys'; @@ -64,7 +66,7 @@ async function verifyTranslations(uiExports) { } // get all of the translations from uiExports - const translations = await I18n.getAllTranslationsFromPaths(uiExports.translationPaths); + const translations = await I18nLoader.getAllTranslationsFromPaths(uiExports.translationPaths); const keysWithoutTranslations = Object.entries( i18nVerify.getNonTranslatedKeys(keysUsedInViews, translations) ); From c76cb5f4e30c9797045aec2b5d8e33e525d96d68 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Thu, 7 Jun 2018 16:38:43 +0300 Subject: [PATCH 069/186] I18n tests refactoring --- .../kbn-i18n/src/server/__tests__/i18n.js | 203 ++++++++---------- 1 file changed, 87 insertions(+), 116 deletions(-) diff --git a/packages/kbn-i18n/src/server/__tests__/i18n.js b/packages/kbn-i18n/src/server/__tests__/i18n.js index 36f4002bbf7f4..1bf4ce5dbedce 100644 --- a/packages/kbn-i18n/src/server/__tests__/i18n.js +++ b/packages/kbn-i18n/src/server/__tests__/i18n.js @@ -25,13 +25,11 @@ import { I18nLoader } from '../i18n_loader'; const FIXTURES = join(__dirname, 'fixtures'); -describe('ui/i18n module', function() { - +describe('kbn/i18n module', function() { describe('one plugin', function() { - const i18nObj = new I18nLoader(); - before('registerTranslations - one plugin', function() { + before('registerTranslationFile - one plugin', function() { const pluginName = 'test_plugin_1'; const pluginTranslationPath = join(FIXTURES, 'translations', pluginName); const translationFiles = [ @@ -42,124 +40,96 @@ describe('ui/i18n module', function() { }); describe('getTranslations', function() { - - it('should return the translations for en locale as registered', function () { - const languageTag = ['en']; + it('should return the translations for en locale as registered', function() { + const langHeader = 'en'; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', 'test_plugin_1-DEV': 'Run the server with development mode defaults', 'test_plugin_1-NO_RUN_SERVER': 'Dont run the dev server', - 'test_plugin_1-HOME': 'Run along home now!' + 'test_plugin_1-HOME': 'Run along home now!', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - it('should return the translations for de locale as registered', function () { - const languageTag = ['de']; + it('should return the translations for de locale as registered', function() { + const langHeader = 'de'; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults' + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - it('should pick the highest priority language for which translations exist', function () { - const languageTags = ['es-ES', 'de', 'en']; + it('should pick the highest priority language for which translations exist', function() { + const langHeader = 'es-ES,de;q=0.9,en;q=0.8'; const expectedTranslations = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults', + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }; - return checkTranslations(expectedTranslations, languageTags, i18nObj); + return checkTranslations(expectedTranslations, langHeader, i18nObj); }); - it('should return translations for highest priority locale where best case match is chosen from registered locales', function () { - const languageTags = ['es', 'de']; + it('should return translations for highest priority locale where best case match is chosen from registered locales', function() { + const langHeader = 'es,de;q=0.9'; const expectedTranslations = { - 'test_plugin_1-NO_SSL': 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!' + 'test_plugin_1-NO_SSL': + 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!', }; - i18nObj.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'es-ES.json')); - return checkTranslations(expectedTranslations, languageTags, i18nObj); + i18nObj.registerTranslationFile( + join(FIXTURES, 'translations', 'test_plugin_1', 'es-ES.json') + ); + return checkTranslations(expectedTranslations, langHeader, i18nObj); }); - it('should return an empty object for locales with no translations', function () { - const languageTags = ['ja-JA', 'fr']; - return checkTranslations({}, languageTags, i18nObj); + it('should return an empty object for locales with no translations', function() { + const langHeader = 'ja-JA,fr;q=0.9'; + return checkTranslations({}, langHeader, i18nObj); }); - }); - describe('getTranslationsForDefaultLocale', function () { - - it('should return translations for default locale which is set to the en locale', function () { - const i18nObj1 = new I18n('en'); - const expectedTranslations = { - 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the server with development mode defaults', - 'test_plugin_1-NO_RUN_SERVER': 'Dont run the dev server', - 'test_plugin_1-HOME': 'Run along home now!' - }; - i18nObj1.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'en.json')); - return checkTranslationsForDefaultLocale(expectedTranslations, i18nObj1); - }); - - it('should return translations for default locale which is set to the de locale', function () { - const i18nObj1 = new I18n('de'); - const expectedTranslations = { - 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults', - }; - i18nObj1.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'de.json')); - return checkTranslationsForDefaultLocale(expectedTranslations, i18nObj1); - }); - - }); - - describe('getAllTranslations', function () { - - it('should return all translations', function () { + describe('getAllTranslations', function() { + it('should return all translations', function() { const expectedTranslations = { de: { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults' + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }, en: { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the server with development mode defaults', + 'test_plugin_1-DEV': + 'Run the server with development mode defaults', 'test_plugin_1-NO_RUN_SERVER': 'Dont run the dev server', - 'test_plugin_1-HOME': 'Run along home now!' + 'test_plugin_1-HOME': 'Run along home now!', }, 'es-ES': { - 'test_plugin_1-NO_SSL': 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!' - } + 'test_plugin_1-NO_SSL': + 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!', + }, }; return checkAllTranslations(expectedTranslations, i18nObj); }); - }); - }); - describe('multiple plugins', function () { - - const i18nObj = new I18n(); + describe('multiple plugins', function() { + const i18nObj = new I18nLoader(); - beforeEach('registerTranslations - multiple plugin', function () { + beforeEach('registerTranslationFile - multiple plugin', function() { const pluginTranslationPath = join(FIXTURES, 'translations'); const translationFiles = [ join(pluginTranslationPath, 'test_plugin_1', 'de.json'), join(pluginTranslationPath, 'test_plugin_1', 'en.json'), - join(pluginTranslationPath, 'test_plugin_2', 'en.json') + join(pluginTranslationPath, 'test_plugin_2', 'en.json'), ]; - const filesLen = translationFiles.length; - for (let indx = 0; indx < filesLen; indx++) { - i18nObj.registerTranslations(translationFiles[indx]); - } + i18nObj.registerTranslationFiles(translationFiles); }); - describe('getTranslations', function () { - - it('should return the translations for en locale as registered', function () { - const languageTag = ['en']; + describe('getTranslations', function() { + it('should return the translations for en locale as registered', function() { + const langHeader = 'en'; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', 'test_plugin_1-DEV': 'Run the server with development mode defaults', @@ -168,75 +138,76 @@ describe('ui/i18n module', function() { 'test_plugin_2-XXXXXX': 'This is XXXXXX string', 'test_plugin_2-YYYY_PPPP': 'This is YYYY_PPPP string', 'test_plugin_2-FFFFFFFFFFFF': 'This is FFFFFFFFFFFF string', - 'test_plugin_2-ZZZ': 'This is ZZZ string' + 'test_plugin_2-ZZZ': 'This is ZZZ string', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - it('should return the translations for de locale as registered', function () { - const languageTag = ['de']; + it('should return the translations for de locale as registered', function() { + const langHeader = 'de'; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults' + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - it('should return the most recently registered translation for a key that has multiple translations', function () { - i18nObj.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_2', 'de.json')); - const languageTag = ['de']; + it('should return the most recently registered translation for a key that has multiple translations', function() { + i18nObj.registerTranslationFile( + join(FIXTURES, 'translations', 'test_plugin_2', 'de.json') + ); + const langHeader = 'de'; const expectedTranslationJson = { - 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS! I am regsitered afterwards!', - 'test_plugin_1-DEV': 'Run the DE server with development mode defaults' + 'test_plugin_1-NO_SSL': + 'Dont run the DE dev server using HTTPS! I am regsitered afterwards!', + 'test_plugin_1-DEV': + 'Run the DE server with development mode defaults', }; - return checkTranslations(expectedTranslationJson, languageTag, i18nObj); + return checkTranslations(expectedTranslationJson, langHeader, i18nObj); }); - }); - }); - describe('registerTranslations', function () { - - const i18nObj = new I18n(); + describe('registerTranslationFile', function() { + const i18nObj = new I18nLoader(); - it('should throw error when registering relative path', function () { - return expect(i18nObj.registerTranslations).withArgs('./some/path').to.throwError(); + it('should throw error when registering relative path', function() { + return expect(i18nObj.registerTranslationFile) + .withArgs('./some/path') + .to.throwError(); }); - it('should throw error when registering empty filename', function () { - return expect(i18nObj.registerTranslations).withArgs('').to.throwError(); + it('should throw error when registering empty filename', function() { + return expect(i18nObj.registerTranslationFile) + .withArgs('') + .to.throwError(); }); - it('should throw error when registering filename with no extension', function () { - return expect(i18nObj.registerTranslations).withArgs('file1').to.throwError(); + it('should throw error when registering filename with no extension', function() { + return expect(i18nObj.registerTranslationFile) + .withArgs('file1') + .to.throwError(); }); - it('should throw error when registering filename with non JSON extension', function () { - return expect(i18nObj.registerTranslations).withArgs('file1.txt').to.throwError(); + it('should throw error when registering filename with non JSON extension', function() { + return expect(i18nObj.registerTranslationFile) + .withArgs('file1.txt') + .to.throwError(); }); - }); - }); -function checkTranslations(expectedTranslations, languageTags, i18nObj) { - return i18nObj.getTranslations(...languageTags) - .then(function (actualTranslations) { +function checkTranslations(expectedTranslations, langHeader, i18nObj) { + return i18nObj + .getTranslationsByLanguageHeader(langHeader) + .then(function(actualTranslations) { expect(_.isEqual(actualTranslations, expectedTranslations)).to.be(true); }); } function checkAllTranslations(expectedTranslations, i18nObj) { - return i18nObj.getAllTranslations() - .then(function (actualTranslations) { - expect(_.isEqual(actualTranslations, expectedTranslations)).to.be(true); - }); -} - -function checkTranslationsForDefaultLocale(expectedTranslations, i18nObj) { - return i18nObj.getTranslationsForDefaultLocale() - .then(function (actualTranslations) { - expect(_.isEqual(actualTranslations, expectedTranslations)).to.be(true); - }); + return i18nObj.getAllTranslations().then(function(actualTranslations) { + expect(_.isEqual(actualTranslations, expectedTranslations)).to.be(true); + }); } From 7addc08c8dc9915ae1e85d942088b5fd2c1bb458 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 7 Jun 2018 16:07:43 +0200 Subject: [PATCH 070/186] Fix broken linked save searches (#19722) * Fix bug * Retry navigation --- src/ui/public/vis/request_handlers/courier.js | 2 +- .../apps/visualize/_linked_saved_searches.js | 65 +++++++++++++++++++ test/functional/apps/visualize/index.js | 1 + .../functional/page_objects/visualize_page.js | 5 ++ 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 test/functional/apps/visualize/_linked_saved_searches.js diff --git a/src/ui/public/vis/request_handlers/courier.js b/src/ui/public/vis/request_handlers/courier.js index 85835cbd22b93..ca03bb0cec872 100644 --- a/src/ui/public/vis/request_handlers/courier.js +++ b/src/ui/public/vis/request_handlers/courier.js @@ -71,7 +71,7 @@ const CourierRequestHandlerProvider = function (Private, courier, timefilter) { // Add the explicit passed timeRange as a filter to the requestSearchSource. requestSearchSource.filter(() => { - return timefilter.get(searchSource.index(), timeRange); + return timefilter.get(searchSource.get('index'), timeRange); }); removeSearchSourceParentTimefilter(requestSearchSource); diff --git a/test/functional/apps/visualize/_linked_saved_searches.js b/test/functional/apps/visualize/_linked_saved_searches.js new file mode 100644 index 0000000000000..51239958845bf --- /dev/null +++ b/test/functional/apps/visualize/_linked_saved_searches.js @@ -0,0 +1,65 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import expect from 'expect.js'; + +export default function ({ getPageObjects, getService }) { + const retry = getService('retry'); + const PageObjects = getPageObjects(['common', 'discover', 'visualize', 'header']); + + describe('visualize app', function describeIndexTests() { + const fromTime = '2015-09-19 06:31:44.000'; + const toTime = '2015-09-23 18:31:44.000'; + + describe('linked saved searched', () => { + + const savedSearchName = 'vis_saved_search'; + + before(async () => { + await PageObjects.common.navigateToUrl('discover', ''); + await PageObjects.discover.saveSearch(savedSearchName); + }); + + it('should create a visualization from a saved search', async () => { + retry.try(async () => { + // Sometimes navigation to the page fails, so we have this in a retry + await PageObjects.common.navigateToUrl('visualize', 'new'); + await PageObjects.visualize.waitForVisualizationSelectPage(); + }); + await PageObjects.visualize.clickDataTable(); + await PageObjects.visualize.clickSavedSearch(savedSearchName); + await PageObjects.header.setAbsoluteRange(fromTime, toTime); + await PageObjects.header.waitUntilLoadingHasFinished(); + const data = await PageObjects.visualize.getDataTableData(); + expect(data.trim()).to.be('14,004'); + }); + + it('should respect the time filter when linked to a saved search', async () => { + await PageObjects.header.setAbsoluteRange('2015-09-19 06:31:44.000', '2015-09-21 10:00:00.000'); + await PageObjects.header.waitUntilLoadingHasFinished(); + const data = await PageObjects.visualize.getDataTableData(); + expect(data.trim()).to.be('6,086'); + }); + }); + + after(async () => { + await PageObjects.header.setAbsoluteRange(fromTime, toTime); + }); + }); +} diff --git a/test/functional/apps/visualize/index.js b/test/functional/apps/visualize/index.js index ca6edba9b8bfe..60dde1880615a 100644 --- a/test/functional/apps/visualize/index.js +++ b/test/functional/apps/visualize/index.js @@ -53,5 +53,6 @@ export default function ({ getService, loadTestFile }) { loadTestFile(require.resolve('./_histogram_request_start')); loadTestFile(require.resolve('./_vega_chart')); loadTestFile(require.resolve('./_lab_mode')); + loadTestFile(require.resolve('./_linked_saved_searches.js')); }); } diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index 679096c88b47b..dcac2f35d4be2 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -375,6 +375,11 @@ export function VisualizePageProvider({ getService, getPageObjects }) { await PageObjects.header.waitUntilLoadingHasFinished(); } + async clickSavedSearch(savedSearchName) { + await find.clickByPartialLinkText(savedSearchName); + await PageObjects.header.waitUntilLoadingHasFinished(); + } + async setValue(newValue) { await find.clickByCssSelector('button[ng-click="numberListCntr.add()"]', defaultFindTimeout * 2); const input = await find.byCssSelector('input[ng-model="numberListCntr.getList()[$index]"]'); From 15ff618f2ed9785f62f46924a4565a58e497cab0 Mon Sep 17 00:00:00 2001 From: Maxim Tolochko Date: Thu, 7 Jun 2018 18:42:22 +0300 Subject: [PATCH 071/186] Add build scripts to kbn-i18n package --- packages/kbn-i18n/.babelrc | 3 + packages/kbn-i18n/README.md | 2 +- packages/kbn-i18n/package.json | 13 +- packages/kbn-i18n/yarn.lock | 1577 ++++++++++++++++++++++++++- src/ui/ui_render/ui_render_mixin.js | 2 +- 5 files changed, 1590 insertions(+), 7 deletions(-) create mode 100644 packages/kbn-i18n/.babelrc diff --git a/packages/kbn-i18n/.babelrc b/packages/kbn-i18n/.babelrc new file mode 100644 index 0000000000000..7da72d1779128 --- /dev/null +++ b/packages/kbn-i18n/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["@kbn/babel-preset/node_preset"] +} diff --git a/packages/kbn-i18n/README.md b/packages/kbn-i18n/README.md index 202f01e59c05d..b2ad18eee9822 100644 --- a/packages/kbn-i18n/README.md +++ b/packages/kbn-i18n/README.md @@ -313,7 +313,7 @@ for all 200+ languages is loaded along with the library) and pass the translatio messages into the constructor: ```js -import { I18n } from '@kbn/i18n/src/i18n'; +import { I18n } from '@kbn/i18n'; const i18n = new I18n(messages); ``` diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index 689fddd6a9014..372f15dcfe829 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -1,9 +1,20 @@ { "name": "@kbn/i18n", - "main": "./src/index.js", + "main": "./target/index.js", + "jsnext:main": "./src/index.js", "version": "1.0.0", "license": "Apache-2.0", "private": true, + "scripts": { + "build": "babel src --out-dir target", + "kbn:bootstrap": "yarn build", + "kbn:watch": "yarn build --watch" + }, + "devDependencies": { + "@kbn/babel-preset": "link:../kbn-babel-preset", + "@kbn/dev-utils": "link:../kbn-dev-utils", + "babel-cli": "^6.26.0" + }, "dependencies": { "accept-language-parser": "^1.5.0", "intl-format-cache": "^2.1.0", diff --git a/packages/kbn-i18n/yarn.lock b/packages/kbn-i18n/yarn.lock index 805926e4c2213..7bd2ad5047948 100644 --- a/packages/kbn-i18n/yarn.lock +++ b/packages/kbn-i18n/yarn.lock @@ -2,24 +2,876 @@ # yarn lockfile v1 +"@kbn/babel-preset@link:../kbn-babel-preset": + version "0.0.0" + uid "" + +"@kbn/dev-utils@link:../kbn-dev-utils": + version "0.0.0" + uid "" + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + accept-language-parser@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/accept-language-parser/-/accept-language-parser-1.5.0.tgz#8877c54040a8dcb59e0a07d9c1fde42298334791" +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +babel-cli@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" + dependencies: + babel-core "^6.26.0" + babel-polyfill "^6.26.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + commander "^2.11.0" + convert-source-map "^1.5.0" + fs-readdir-recursive "^1.0.0" + glob "^7.1.2" + lodash "^4.17.4" + output-file-sync "^1.1.2" + path-is-absolute "^1.0.1" + slash "^1.0.0" + source-map "^0.5.6" + v8flags "^2.1.1" + optionalDependencies: + chokidar "^1.6.1" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-builder-react-jsx@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz#39ff8313b75c8b65dceff1f31d383e0ff2a408a0" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + esutils "^2.0.2" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-add-module-exports@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-async-generators@^6.5.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-flow@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" + +babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" + +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-generator-functions@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-define@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-define/-/babel-plugin-transform-define-1.3.0.tgz#94c5f9459c810c738cc7c50cbd44a31829d6f319" + dependencies: + lodash "4.17.4" + traverse "0.6.6" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.2" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" + dependencies: + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-object-rest-spread@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + +babel-plugin-transform-react-display-name@^6.23.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-self@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz#df6d80a9da2612a121e6ddd7558bcbecf06e636e" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-source@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz#66ac12153f5cd2d17b3c19268f4bf0197f44ecd6" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3" + dependencies: + babel-helper-builder-react-jsx "^6.24.1" + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + +babel-preset-env@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.4.0.tgz#c8e02a3bcc7792f23cded68e0355b9d4c28f0f7a" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^1.4.0" + invariant "^2.2.2" + +babel-preset-flow@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d" + dependencies: + babel-plugin-transform-flow-strip-types "^6.22.0" + +babel-preset-react@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" + dependencies: + babel-plugin-syntax-jsx "^6.3.13" + babel-plugin-transform-react-display-name "^6.23.0" + babel-plugin-transform-react-jsx "^6.24.1" + babel-plugin-transform-react-jsx-self "^6.22.0" + babel-plugin-transform-react-jsx-source "^6.22.0" + babel-preset-flow "^6.23.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +binary-extensions@^1.0.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browserslist@^1.4.0: + version "1.7.7" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9" + dependencies: + caniuse-db "^1.0.30000639" + electron-to-chromium "^1.2.7" + +caniuse-db@^1.0.30000639: + version "1.0.30000850" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000850.tgz#965c816641576d08709bee12256a0550164b95d5" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +chownr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +color-convert@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +commander@^2.11.0: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +convert-source-map@^1.5.0, convert-source-map@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + core-js@^1.0.0: version "1.2.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" +core-js@^2.4.0, core-js@^2.5.0: + version "2.5.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +debug@^2.1.2, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +electron-to-chromium@^1.2.7: + version "1.3.48" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz#d3b0d8593814044e092ece2108fc3ac9aea4b900" + encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" dependencies: iconv-lite "~0.4.13" +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +execa@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" + dependencies: + cross-spawn "^6.0.0" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + fbjs@^0.8.16: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" @@ -32,12 +884,148 @@ fbjs@^0.8.16: setimmediate "^1.0.5" ua-parser-js "^0.7.9" -iconv-lite@~0.4.13: +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + +fs-readdir-recursive@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@^7.0.5, glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +graceful-fs@^4.1.2, graceful-fs@^4.1.4: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" dependencies: safer-buffer ">= 2.1.2 < 3" +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + intl-format-cache@^2.0.5, intl-format-cache@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-2.1.0.tgz#04a369fecbfad6da6005bae1f14333332dcf9316" @@ -58,16 +1046,98 @@ intl-relativeformat@^2.0.0, intl-relativeformat@^2.1.0: dependencies: intl-messageformat "^2.0.0" -invariant@^2.1.1: +invariant@^2.1.1, invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: loose-envify "^1.0.0" -is-stream@^1.0.1: +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + isomorphic-fetch@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" @@ -75,26 +1145,131 @@ isomorphic-fetch@^2.1.1: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" -js-tokens@^3.0.0: +js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + json5@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" dependencies: minimist "^1.2.0" +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +lodash@4.17.4: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +lodash@^4.17.4: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +minipass@^2.2.1, minipass@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" + dependencies: + minipass "^2.2.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +moment@^2.20.1: + version "2.22.2" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +nan@^2.9.2: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + +needle@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +nice-try@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -102,10 +1277,137 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" +node-pre-gyp@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz#6e4ef5bb5c5203c6552448828c852c40111aac46" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.0" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.1.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.0.0, normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-bundled@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + +npm-packlist@^1.1.6: + version "1.1.10" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +output-file-sync@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +private@^0.1.6, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -120,6 +1422,23 @@ prop-types@^15.5.8, prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" +randomatic@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +rc@^1.1.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + react-intl@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.4.0.tgz#66c14dc9df9a73b2fbbfbd6021726e80a613eb15" @@ -138,18 +1457,268 @@ react@^16.3.0: object-assign "^4.1.1" prop-types "^15.6.0" +readable-stream@^2.0.2, readable-stream@^2.0.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +regenerate@^1.2.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +rimraf@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +semver@^5.3.0, semver@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^5.3.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + dependencies: + has-flag "^3.0.0" + +tar@^4: + version "4.4.4" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.4.tgz#ec8409fae9f665a4355cc3b4087d0820232bb8cd" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.3.3" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +traverse@0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + +tree-kill@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + ua-parser-js@^0.7.9: version "0.7.18" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +v8flags@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + dependencies: + user-home "^1.1.1" + whatwg-fetch@>=0.10.0: version "2.0.4" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" diff --git a/src/ui/ui_render/ui_render_mixin.js b/src/ui/ui_render/ui_render_mixin.js index 06c74286023e2..ec2fde52dfd26 100644 --- a/src/ui/ui_render/ui_render_mixin.js +++ b/src/ui/ui_render/ui_render_mixin.js @@ -21,7 +21,7 @@ import { defaults } from 'lodash'; import { props, reduce as reduceAsync } from 'bluebird'; import Boom from 'boom'; import { resolve } from 'path'; -import { I18n } from '@kbn/i18n/src/i18n'; +import { I18n } from '@kbn/i18n'; import { AppBootstrap } from './bootstrap'; export function uiRenderMixin(kbnServer, server, config) { From bc274f2d9d4c1b319267daacfc011b85372cf826 Mon Sep 17 00:00:00 2001 From: liza-mae Date: Thu, 7 Jun 2018 11:17:16 -0600 Subject: [PATCH 072/186] Remove flaky selectors: .ng-scope, .ng-binding and .ng-isolate.scope (#19688) --- test/functional/page_objects/discover_page.js | 2 +- test/functional/page_objects/header_page.js | 2 +- test/functional/page_objects/monitoring_page.js | 2 +- test/functional/page_objects/visualize_page.js | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/functional/page_objects/discover_page.js b/test/functional/page_objects/discover_page.js index cd85e17d89bd2..49e431609b098 100644 --- a/test/functional/page_objects/discover_page.js +++ b/test/functional/page_objects/discover_page.js @@ -198,7 +198,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }) { getDocHeader() { return getRemote() - .findByCssSelector('thead.ng-isolate-scope > tr:nth-child(1)') + .findByCssSelector('thead > tr:nth-child(1)') .getVisibleText(); } diff --git a/test/functional/page_objects/header_page.js b/test/functional/page_objects/header_page.js index 1003121aa364d..219622dfea483 100644 --- a/test/functional/page_objects/header_page.js +++ b/test/functional/page_objects/header_page.js @@ -225,7 +225,7 @@ export function HeaderPageProvider({ getService, getPageObjects }) { async getToastMessage(findTimeout = defaultFindTimeout) { const toastMessage = - await find.displayedByCssSelector('kbn-truncated.toast-message.ng-isolate-scope', findTimeout); + await find.displayedByCssSelector('kbn-truncated.toast-message', findTimeout); const messageText = await toastMessage.getVisibleText(); log.debug(`getToastMessage: ${messageText}`); return messageText; diff --git a/test/functional/page_objects/monitoring_page.js b/test/functional/page_objects/monitoring_page.js index 5935044a037ae..9407c163e5f87 100644 --- a/test/functional/page_objects/monitoring_page.js +++ b/test/functional/page_objects/monitoring_page.js @@ -39,7 +39,7 @@ export function MonitoringPageProvider({ getService }) { getToasterContents() { return getRemote() - .findByCssSelector('div.toaster-container.ng-isolate-scope') + .findByCssSelector('div.toaster-container') .getVisibleText(); } diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index dcac2f35d4be2..2536c99e8b15f 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -128,7 +128,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { } async getChartTypeCount() { - const tags = await find.allByCssSelector('a.wizard-vis-type.ng-scope'); + const tags = await find.allByCssSelector('a.wizard-vis-type'); return tags.length; } @@ -399,7 +399,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { // clickBucket(bucketType) 'X-Axis', 'Split Area', 'Split Chart' async clickBucket(bucketName) { const chartTypes = await retry.try( - async () => await find.allByCssSelector('li.list-group-item.list-group-menu-item.ng-binding.ng-scope')); + async () => await find.allByCssSelector('li.list-group-item.list-group-menu-item')); log.debug('found bucket types ' + chartTypes.length); async function getChartType(chart) { @@ -447,7 +447,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { const aggItem = await find.byCssSelector(`[data-test-subj="${agg}"]`); await aggItem.click(); const fieldSelect = await find - .byCssSelector(`#visAggEditorParams${index} > [agg-param="agg.type.params[0]"] > div > div > div.ui-select-match.ng-scope > span`); + .byCssSelector(`#visAggEditorParams${index} > [agg-param="agg.type.params[0]"] > div > div > div.ui-select-match > span`); // open field selection list await fieldSelect.click(); // select our field @@ -515,7 +515,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { async orderBy(fieldValue) { await find.clickByCssSelector( 'select.form-control.ng-pristine.ng-valid.ng-untouched.ng-valid-required[ng-model="agg.params.orderBy"]' - + `option.ng-binding.ng-scope:contains("${fieldValue}")`); + + `option:contains("${fieldValue}")`); } async selectOrderBy(fieldValue) { @@ -822,12 +822,12 @@ export function VisualizePageProvider({ getService, getPageObjects }) { } async getMarkdownData() { - const markdown = await retry.try(async () => find.byCssSelector('visualize.ng-isolate-scope')); + const markdown = await retry.try(async () => find.byCssSelector('visualize')); return await markdown.getVisibleText(); } async clickColumns() { - await find.clickByCssSelector('div.schemaEditors.ng-scope > div > div > button:nth-child(2)'); + await find.clickByCssSelector('div.schemaEditors > div > div > button:nth-child(2)'); } async waitForVisualization() { From af891680695fb8e5644542a0fc36d6999f3a80f0 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Thu, 7 Jun 2018 13:32:11 -0500 Subject: [PATCH 073/186] bump kbn-pm (#19623) --- packages/kbn-pm/dist/index.js | 21699 ++++++++++++++++---------------- 1 file changed, 11065 insertions(+), 10634 deletions(-) diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 5fd05f6daecc3..82df4eb5256a7 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -61,7 +61,7 @@ module.exports = /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 324); +/******/ return __webpack_require__(__webpack_require__.s = 325); /******/ }) /************************************************************************/ /******/ ([ @@ -71,9 +71,9 @@ module.exports = "use strict"; var root_1 = __webpack_require__(12); -var toSubscriber_1 = __webpack_require__(440); -var observable_1 = __webpack_require__(40); -var pipe_1 = __webpack_require__(60); +var toSubscriber_1 = __webpack_require__(441); +var observable_1 = __webpack_require__(41); +var pipe_1 = __webpack_require__(61); /** * A representation of any set of values over any amount of time. This is the most basic building block * of RxJS. @@ -2223,7 +2223,7 @@ function loadLocale(name) { try { oldLocale = globalLocale._abbr; var aliasedRequire = require; - __webpack_require__(380)("./" + name); + __webpack_require__(415)("./" + name); getSetGlobalLocale(oldLocale); } catch (e) {} } @@ -4915,7 +4915,7 @@ return hooks; }))); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(52)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(53)(module))) /***/ }), /* 2 */ @@ -4928,10 +4928,10 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var isFunction_1 = __webpack_require__(38); +var isFunction_1 = __webpack_require__(39); var Subscription_1 = __webpack_require__(8); -var Observer_1 = __webpack_require__(221); -var rxSubscriber_1 = __webpack_require__(39); +var Observer_1 = __webpack_require__(222); +var rxSubscriber_1 = __webpack_require__(40); /** * Implements the {@link Observer} interface and extends the * {@link Subscription} class. While the {@link Observer} is the public API for @@ -5237,13 +5237,13 @@ exports.OuterSubscriber = OuterSubscriber; "use strict"; var root_1 = __webpack_require__(12); -var isArrayLike_1 = __webpack_require__(223); -var isPromise_1 = __webpack_require__(224); -var isObject_1 = __webpack_require__(219); +var isArrayLike_1 = __webpack_require__(224); +var isPromise_1 = __webpack_require__(225); +var isObject_1 = __webpack_require__(220); var Observable_1 = __webpack_require__(0); -var iterator_1 = __webpack_require__(26); -var InnerSubscriber_1 = __webpack_require__(449); -var observable_1 = __webpack_require__(40); +var iterator_1 = __webpack_require__(27); +var InnerSubscriber_1 = __webpack_require__(450); +var observable_1 = __webpack_require__(41); function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex); if (destination.closed) { @@ -5321,8 +5321,8 @@ exports.subscribeToResult = subscribeToResult; "use strict"; -var AsyncAction_1 = __webpack_require__(31); -var AsyncScheduler_1 = __webpack_require__(32); +var AsyncAction_1 = __webpack_require__(32); +var AsyncScheduler_1 = __webpack_require__(33); /** * * Async Scheduler @@ -5381,11 +5381,11 @@ module.exports = require("fs"); "use strict"; var isArray_1 = __webpack_require__(16); -var isObject_1 = __webpack_require__(219); -var isFunction_1 = __webpack_require__(38); +var isObject_1 = __webpack_require__(220); +var isFunction_1 = __webpack_require__(39); var tryCatch_1 = __webpack_require__(11); var errorObject_1 = __webpack_require__(10); -var UnsubscriptionError_1 = __webpack_require__(220); +var UnsubscriptionError_1 = __webpack_require__(221); /** * Represents a disposable resource, such as the execution of an Observable. A * Subscription has one important method, `unsubscribe`, that takes no argument @@ -5587,9 +5587,9 @@ var __extends = (this && this.__extends) || function (d, b) { var Observable_1 = __webpack_require__(0); var Subscriber_1 = __webpack_require__(2); var Subscription_1 = __webpack_require__(8); -var ObjectUnsubscribedError_1 = __webpack_require__(41); -var SubjectSubscription_1 = __webpack_require__(222); -var rxSubscriber_1 = __webpack_require__(39); +var ObjectUnsubscribedError_1 = __webpack_require__(42); +var SubjectSubscription_1 = __webpack_require__(223); +var rxSubscriber_1 = __webpack_require__(40); /** * @class SubjectSubscriber */ @@ -5819,11 +5819,11 @@ module.exports = require("util"); "use strict"; -const escapeStringRegexp = __webpack_require__(328); -const ansiStyles = __webpack_require__(329); -const stdoutColor = __webpack_require__(333).stdout; +const escapeStringRegexp = __webpack_require__(327); +const ansiStyles = __webpack_require__(328); +const stdoutColor = __webpack_require__(332).stdout; -const template = __webpack_require__(336); +const template = __webpack_require__(335); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -6075,14 +6075,54 @@ exports.isArray = Array.isArray || (function (x) { return x && typeof x.length = "use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +const log = exports.log = { + /** + * Log something to the console. Ideally we would use a real logger in + * kbn-pm, but that's a pretty big change for now. + * @param ...args + */ + write(...args) { + // tslint:disable no-console + console.log(...args); + } +}; + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Observable_1 = __webpack_require__(0); -var ScalarObservable_1 = __webpack_require__(62); -var EmptyObservable_1 = __webpack_require__(18); +var ScalarObservable_1 = __webpack_require__(63); +var EmptyObservable_1 = __webpack_require__(19); var isScheduler_1 = __webpack_require__(15); /** * We need this JSDoc comment for affecting ESDoc. @@ -6198,7 +6238,7 @@ exports.ArrayObservable = ArrayObservable; //# sourceMappingURL=ArrayObservable.js.map /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6285,12 +6325,12 @@ exports.EmptyObservable = EmptyObservable; //# sourceMappingURL=EmptyObservable.js.map /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ConnectableObservable_1 = __webpack_require__(271); +var ConnectableObservable_1 = __webpack_require__(272); /* tslint:enable:max-line-length */ /** * Returns an Observable that emits the results of invoking a specified selector on items @@ -6350,13 +6390,13 @@ exports.MulticastOperator = MulticastOperator; //# sourceMappingURL=multicast.js.map /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports) { module.exports = require("stream"); /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6447,7 +6487,281 @@ module.exports = (obj, opts) => { /***/ }), -/* 22 */ +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +var fs = __webpack_require__(7) +var polyfills = __webpack_require__(342) +var legacy = __webpack_require__(344) +var queue = [] + +var util = __webpack_require__(13) + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(queue) + __webpack_require__(24).equal(queue.length, 0) + }) +} + +module.exports = patch(__webpack_require__(79)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { + module.exports = patch(fs) +} + +// Always patch fs.close/closeSync, because we want to +// retry() whenever a close happens *anywhere* in the program. +// This is essential when multiple graceful-fs instances are +// in play at the same time. +module.exports.close = +fs.close = (function (fs$close) { return function (fd, cb) { + return fs$close.call(fs, fd, function (err) { + if (!err) + retry() + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) +}})(fs.close) + +module.exports.closeSync = +fs.closeSync = (function (fs$closeSync) { return function (fd) { + // Note that graceful-fs also retries when fs.closeSync() fails. + // Looks like a bug to me, although it's probably a harmless one. + var rval = fs$closeSync.apply(fs, arguments) + retry() + return rval +}})(fs.closeSync) + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + fs.FileReadStream = ReadStream; // Legacy name. + fs.FileWriteStream = WriteStream; // Legacy name. + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + var args = [path] + if (typeof options !== 'function') { + args.push(options) + } else { + cb = options + } + args.push(go$readdir$cb) + + return go$readdir(args) + + function go$readdir$cb (err, files) { + if (files && files.sort) + files.sort() + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [args]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + } + } + + function go$readdir (args) { + return fs$readdir.apply(fs, args) + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + + var fs$WriteStream = fs.WriteStream + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + + fs.ReadStream = ReadStream + fs.WriteStream = WriteStream + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + queue.push(elem) +} + +function retry () { + var elem = queue.shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} + + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +module.exports = require("assert"); + +/***/ }), +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6492,7 +6806,7 @@ exports.buildProjectGraph = buildProjectGraph; exports.topologicallyBatchProjects = topologicallyBatchProjects; exports.includeTransitiveProjects = includeTransitiveProjects; -var _glob = __webpack_require__(23); +var _glob = __webpack_require__(26); var _glob2 = _interopRequireDefault(_glob); @@ -6502,13 +6816,31 @@ var _path2 = _interopRequireDefault(_path); var _util = __webpack_require__(13); -var _errors = __webpack_require__(55); +var _errors = __webpack_require__(58); -var _project = __webpack_require__(83); +var _project = __webpack_require__(86); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + const glob = (0, _util.promisify)(_glob2.default); @@ -6593,7 +6925,7 @@ function includeTransitiveProjects(subsetOfProjects, allProjects, { onlyProducti } /***/ }), -/* 23 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { // Approach: @@ -6639,26 +6971,26 @@ function includeTransitiveProjects(subsetOfProjects, allProjects, { onlyProducti module.exports = glob var fs = __webpack_require__(7) -var rp = __webpack_require__(78) -var minimatch = __webpack_require__(53) +var rp = __webpack_require__(81) +var minimatch = __webpack_require__(56) var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(79) -var EE = __webpack_require__(36).EventEmitter +var inherits = __webpack_require__(82) +var EE = __webpack_require__(37).EventEmitter var path = __webpack_require__(3) var assert = __webpack_require__(24) -var isAbsolute = __webpack_require__(54) -var globSync = __webpack_require__(344) -var common = __webpack_require__(80) +var isAbsolute = __webpack_require__(57) +var globSync = __webpack_require__(350) +var common = __webpack_require__(83) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp -var inflight = __webpack_require__(345) +var inflight = __webpack_require__(351) var util = __webpack_require__(13) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -var once = __webpack_require__(82) +var once = __webpack_require__(85) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} @@ -7389,281 +7721,7 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { /***/ }), -/* 24 */ -/***/ (function(module, exports) { - -module.exports = require("assert"); - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -var fs = __webpack_require__(7) -var polyfills = __webpack_require__(386) -var legacy = __webpack_require__(388) -var queue = [] - -var util = __webpack_require__(13) - -function noop () {} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) - } - -if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(queue) - __webpack_require__(24).equal(queue.length, 0) - }) -} - -module.exports = patch(__webpack_require__(208)) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { - module.exports = patch(fs) -} - -// Always patch fs.close/closeSync, because we want to -// retry() whenever a close happens *anywhere* in the program. -// This is essential when multiple graceful-fs instances are -// in play at the same time. -module.exports.close = -fs.close = (function (fs$close) { return function (fd, cb) { - return fs$close.call(fs, fd, function (err) { - if (!err) - retry() - - if (typeof cb === 'function') - cb.apply(this, arguments) - }) -}})(fs.close) - -module.exports.closeSync = -fs.closeSync = (function (fs$closeSync) { return function (fd) { - // Note that graceful-fs also retries when fs.closeSync() fails. - // Looks like a bug to me, although it's probably a harmless one. - var rval = fs$closeSync.apply(fs, arguments) - retry() - return rval -}})(fs.closeSync) - -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch - fs.FileReadStream = ReadStream; // Legacy name. - fs.FileWriteStream = WriteStream; // Legacy name. - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$readFile(path, options, cb) - - function go$readFile (path, options, cb) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$writeFile(path, data, options, cb) - - function go$writeFile (path, data, options, cb) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$appendFile(path, data, options, cb) - - function go$appendFile (path, data, options, cb) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$readdir = fs.readdir - fs.readdir = readdir - function readdir (path, options, cb) { - var args = [path] - if (typeof options !== 'function') { - args.push(options) - } else { - cb = options - } - args.push(go$readdir$cb) - - return go$readdir(args) - - function go$readdir$cb (err, files) { - if (files && files.sort) - files.sort() - - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readdir, [args]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - } - } - - function go$readdir (args) { - return fs$readdir.apply(fs, args) - } - - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } - - var fs$ReadStream = fs.ReadStream - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - - var fs$WriteStream = fs.WriteStream - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open - - fs.ReadStream = ReadStream - fs.WriteStream = WriteStream - - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) - } - - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() - - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } - - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) - } - - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } - - function createReadStream (path, options) { - return new ReadStream(path, options) - } - - function createWriteStream (path, options) { - return new WriteStream(path, options) - } - - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null - - return go$open(path, flags, mode, cb) - - function go$open (path, flags, mode, cb) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - return fs -} - -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - queue.push(elem) -} - -function retry () { - var elem = queue.shift() - if (elem) { - debug('RETRY', elem[0].name, elem[1]) - elem[0].apply(null, elem[1]) - } -} - - -/***/ }), -/* 26 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7707,15 +7765,15 @@ exports.$$iterator = exports.iterator; //# sourceMappingURL=iterator.js.map /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isScheduler_1 = __webpack_require__(15); -var of_1 = __webpack_require__(225); -var from_1 = __webpack_require__(226); -var concatAll_1 = __webpack_require__(63); +var of_1 = __webpack_require__(226); +var from_1 = __webpack_require__(227); +var concatAll_1 = __webpack_require__(64); /* tslint:enable:max-line-length */ /** * Creates an output Observable which sequentially emits all values from given @@ -7824,7 +7882,7 @@ exports.concat = concat; //# sourceMappingURL=concat.js.map /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7957,7 +8015,7 @@ exports.Notification = Notification; //# sourceMappingURL=Notification.js.map /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8136,7 +8194,7 @@ exports.MergeMapSubscriber = MergeMapSubscriber; //# sourceMappingURL=mergeMap.js.map /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8154,7 +8212,7 @@ exports.isNumeric = isNumeric; //# sourceMappingURL=isNumeric.js.map /***/ }), -/* 31 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8165,7 +8223,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var root_1 = __webpack_require__(12); -var Action_1 = __webpack_require__(479); +var Action_1 = __webpack_require__(480); /** * We need this JSDoc comment for affecting ESDoc. * @ignore @@ -8302,7 +8360,7 @@ exports.AsyncAction = AsyncAction; //# sourceMappingURL=AsyncAction.js.map /***/ }), -/* 32 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8312,7 +8370,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var Scheduler_1 = __webpack_require__(480); +var Scheduler_1 = __webpack_require__(481); var AsyncScheduler = (function (_super) { __extends(AsyncScheduler, _super); function AsyncScheduler() { @@ -8359,7 +8417,7 @@ exports.AsyncScheduler = AsyncScheduler; //# sourceMappingURL=AsyncScheduler.js.map /***/ }), -/* 33 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8454,7 +8512,7 @@ var MapSubscriber = (function (_super) { //# sourceMappingURL=map.js.map /***/ }), -/* 34 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8488,15 +8546,15 @@ exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError; //# sourceMappingURL=ArgumentOutOfRangeError.js.map /***/ }), -/* 35 */ +/* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var scan_1 = __webpack_require__(72); -var takeLast_1 = __webpack_require__(73); -var defaultIfEmpty_1 = __webpack_require__(67); -var pipe_1 = __webpack_require__(60); +var scan_1 = __webpack_require__(73); +var takeLast_1 = __webpack_require__(74); +var defaultIfEmpty_1 = __webpack_require__(68); +var pipe_1 = __webpack_require__(61); /* tslint:enable:max-line-length */ /** * Applies an accumulator function over the source Observable, and returns the @@ -8563,13 +8621,13 @@ exports.reduce = reduce; //# sourceMappingURL=reduce.js.map /***/ }), -/* 36 */ +/* 37 */ /***/ (function(module, exports) { module.exports = require("events"); /***/ }), -/* 37 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8580,17 +8638,35 @@ Object.defineProperty(exports, "__esModule", { }); exports.isLinkDependency = exports.createProductionPackageJson = undefined; -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + exports.readPackageJson = readPackageJson; exports.writePackageJson = writePackageJson; exports.transformDependencies = transformDependencies; -var _readPkg = __webpack_require__(384); +var _readPkg = __webpack_require__(352); var _readPkg2 = _interopRequireDefault(_readPkg); -var _writePkg = __webpack_require__(410); +var _writePkg = __webpack_require__(375); var _writePkg2 = _interopRequireDefault(_writePkg); @@ -8629,7 +8705,7 @@ function transformDependencies(dependencies = {}) { } /***/ }), -/* 38 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8641,7 +8717,7 @@ exports.isFunction = isFunction; //# sourceMappingURL=isFunction.js.map /***/ }), -/* 39 */ +/* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8657,7 +8733,7 @@ exports.$$rxSubscriber = exports.rxSubscriber; //# sourceMappingURL=rxSubscriber.js.map /***/ }), -/* 40 */ +/* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8689,7 +8765,7 @@ exports.$$observable = exports.observable; //# sourceMappingURL=observable.js.map /***/ }), -/* 41 */ +/* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8722,7 +8798,7 @@ exports.ObjectUnsubscribedError = ObjectUnsubscribedError; //# sourceMappingURL=ObjectUnsubscribedError.js.map /***/ }), -/* 42 */ +/* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8781,7 +8857,7 @@ exports.AsyncSubject = AsyncSubject; //# sourceMappingURL=AsyncSubject.js.map /***/ }), -/* 43 */ +/* 44 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8791,7 +8867,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var ArrayObservable_1 = __webpack_require__(17); +var ArrayObservable_1 = __webpack_require__(18); var isArray_1 = __webpack_require__(16); var OuterSubscriber_1 = __webpack_require__(4); var subscribeToResult_1 = __webpack_require__(5); @@ -8938,7 +9014,7 @@ exports.CombineLatestSubscriber = CombineLatestSubscriber; //# sourceMappingURL=combineLatest.js.map /***/ }), -/* 44 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8949,7 +9025,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var Notification_1 = __webpack_require__(28); +var Notification_1 = __webpack_require__(29); /** * * Re-emits all notifications from source Observable with specified scheduler. @@ -9059,13 +9135,13 @@ exports.ObserveOnMessage = ObserveOnMessage; //# sourceMappingURL=observeOn.js.map /***/ }), -/* 45 */ +/* 46 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var mergeMap_1 = __webpack_require__(29); -var identity_1 = __webpack_require__(229); +var mergeMap_1 = __webpack_require__(30); +var identity_1 = __webpack_require__(230); /** * Converts a higher-order Observable into a first-order Observable which * concurrently delivers all values that are emitted on the inner Observables. @@ -9118,15 +9194,15 @@ exports.mergeAll = mergeAll; //# sourceMappingURL=mergeAll.js.map /***/ }), -/* 46 */ +/* 47 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var ArrayObservable_1 = __webpack_require__(17); +var ArrayObservable_1 = __webpack_require__(18); var isScheduler_1 = __webpack_require__(15); -var mergeAll_1 = __webpack_require__(45); +var mergeAll_1 = __webpack_require__(46); /* tslint:enable:max-line-length */ /** * Creates an output Observable which concurrently emits all values from every @@ -9214,7 +9290,7 @@ exports.merge = merge; //# sourceMappingURL=merge.js.map /***/ }), -/* 47 */ +/* 48 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9226,7 +9302,7 @@ exports.isDate = isDate; //# sourceMappingURL=isDate.js.map /***/ }), -/* 48 */ +/* 49 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9236,12 +9312,12 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var ArrayObservable_1 = __webpack_require__(17); +var ArrayObservable_1 = __webpack_require__(18); var isArray_1 = __webpack_require__(16); var Subscriber_1 = __webpack_require__(2); var OuterSubscriber_1 = __webpack_require__(4); var subscribeToResult_1 = __webpack_require__(5); -var iterator_1 = __webpack_require__(26); +var iterator_1 = __webpack_require__(27); /* tslint:enable:max-line-length */ /** * @param observables @@ -9513,7 +9589,7 @@ var ZipBufferIterator = (function (_super) { //# sourceMappingURL=zip.js.map /***/ }), -/* 49 */ +/* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9524,11 +9600,11 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subject_1 = __webpack_require__(9); -var queue_1 = __webpack_require__(232); +var queue_1 = __webpack_require__(233); var Subscription_1 = __webpack_require__(8); -var observeOn_1 = __webpack_require__(44); -var ObjectUnsubscribedError_1 = __webpack_require__(41); -var SubjectSubscription_1 = __webpack_require__(222); +var observeOn_1 = __webpack_require__(45); +var ObjectUnsubscribedError_1 = __webpack_require__(42); +var SubjectSubscription_1 = __webpack_require__(223); /** * @class ReplaySubject */ @@ -9621,7 +9697,7 @@ var ReplayEvent = (function () { //# sourceMappingURL=ReplaySubject.js.map /***/ }), -/* 50 */ +/* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9655,7 +9731,7 @@ exports.EmptyError = EmptyError; //# sourceMappingURL=EmptyError.js.map /***/ }), -/* 51 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9803,7 +9879,7 @@ var ThrottleSubscriber = (function (_super) { //# sourceMappingURL=throttle.js.map /***/ }), -/* 52 */ +/* 53 */ /***/ (function(module, exports) { module.exports = function(module) { @@ -9831,7 +9907,255 @@ module.exports = function(module) { /***/ }), -/* 53 */ +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSymlink = exports.isFile = exports.isDirectory = exports.mkdirp = exports.readFile = exports.chmod = undefined; + +let statTest = (() => { + var _ref = _asyncToGenerator(function* (path, block) { + try { + return block((yield stat(path))); + } catch (e) { + if (e.code === 'ENOENT') { + return false; + } + throw e; + } + }); + + return function statTest(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); +/** + * Test if a path points to a directory. + * @param path + */ + + +let isDirectory = exports.isDirectory = (() => { + var _ref2 = _asyncToGenerator(function* (path) { + return yield statTest(path, function (stats) { + return stats.isDirectory(); + }); + }); + + return function isDirectory(_x3) { + return _ref2.apply(this, arguments); + }; +})(); +/** + * Test if a path points to a regular file. + * @param path + */ + + +let isFile = exports.isFile = (() => { + var _ref3 = _asyncToGenerator(function* (path) { + return yield statTest(path, function (stats) { + return stats.isFile(); + }); + }); + + return function isFile(_x4) { + return _ref3.apply(this, arguments); + }; +})(); +/** + * Create a symlink at dest that points to src. Adapted from + * https://github.com/lerna/lerna/blob/2f1b87d9e2295f587e4ac74269f714271d8ed428/src/FileSystemUtilities.js#L103. + * + * @param src + * @param dest + * @param type 'dir', 'file', 'junction', or 'exec'. 'exec' on + * windows will use the `cmd-shim` module since symlinks can't be used + * for executable files on windows. + */ + + +let createSymlink = exports.createSymlink = (() => { + var _ref4 = _asyncToGenerator(function* (src, dest, type) { + if (process.platform === 'win32') { + if (type === 'exec') { + yield cmdShim(src, dest); + } else { + yield forceCreate(src, dest, type); + } + } else { + const posixType = type === 'exec' ? 'file' : type; + const relativeSource = (0, _path.relative)((0, _path.dirname)(dest), src); + yield forceCreate(relativeSource, dest, posixType); + } + }); + + return function createSymlink(_x5, _x6, _x7) { + return _ref4.apply(this, arguments); + }; +})(); + +let forceCreate = (() => { + var _ref5 = _asyncToGenerator(function* (src, dest, type) { + try { + // If something exists at `dest` we need to remove it first. + yield unlink(dest); + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } + } + yield symlink(src, dest, type); + }); + + return function forceCreate(_x8, _x9, _x10) { + return _ref5.apply(this, arguments); + }; +})(); + +var _cmdShim = __webpack_require__(341); + +var _cmdShim2 = _interopRequireDefault(_cmdShim); + +var _fs = __webpack_require__(7); + +var _fs2 = _interopRequireDefault(_fs); + +var _mkdirp = __webpack_require__(80); + +var _mkdirp2 = _interopRequireDefault(_mkdirp); + +var _path = __webpack_require__(3); + +var _util = __webpack_require__(13); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +const stat = (0, _util.promisify)(_fs2.default.stat); +const readFile = (0, _util.promisify)(_fs2.default.readFile); +const unlink = (0, _util.promisify)(_fs2.default.unlink); +const symlink = (0, _util.promisify)(_fs2.default.symlink); +const chmod = (0, _util.promisify)(_fs2.default.chmod); +const cmdShim = (0, _util.promisify)(_cmdShim2.default); +const mkdirp = (0, _util.promisify)(_mkdirp2.default); +exports.chmod = chmod; +exports.readFile = readFile; +exports.mkdirp = mkdirp; + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +let parallelizeBatches = exports.parallelizeBatches = (() => { + var _ref = _asyncToGenerator(function* (batches, fn) { + for (const batch of batches) { + // We need to make sure the entire batch has completed before we can move on + // to the next batch + yield parallelize(batch, fn); + } + }); + + return function parallelizeBatches(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); + +let parallelize = exports.parallelize = (() => { + var _ref2 = _asyncToGenerator(function* (items, fn, concurrency = 4) { + if (items.length === 0) { + return; + } + return new Promise(function (resolve, reject) { + let scheduleItem = (() => { + var _ref3 = _asyncToGenerator(function* (item) { + activePromises++; + try { + yield fn(item); + activePromises--; + if (values.length > 0) { + // We have more work to do, so we schedule the next promise + scheduleItem(values.shift()); + } else if (activePromises === 0) { + // We have no more values left, and all items have completed, so we've + // completed all the work. + resolve(); + } + } catch (error) { + reject(error); + } + }); + + return function scheduleItem(_x5) { + return _ref3.apply(this, arguments); + }; + })(); + + let activePromises = 0; + const values = items.slice(0); + + values.splice(0, concurrency).map(scheduleItem); + }); + }); + + return function parallelize(_x3, _x4) { + return _ref2.apply(this, arguments); + }; +})(); + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + +/***/ }), +/* 56 */ /***/ (function(module, exports, __webpack_require__) { module.exports = minimatch @@ -9843,7 +10167,7 @@ try { } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(340) +var expand = __webpack_require__(346) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, @@ -10760,7 +11084,7 @@ function regExpEscape (s) { /***/ }), -/* 54 */ +/* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10787,7 +11111,7 @@ module.exports.win32 = win32; /***/ }), -/* 55 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10796,6 +11120,24 @@ module.exports.win32 = win32; Object.defineProperty(exports, "__esModule", { value: true }); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ class CliError extends Error { constructor(message, meta = {}) { super(message); @@ -10805,22 +11147,16 @@ class CliError extends Error { exports.CliError = CliError; /***/ }), -/* 56 */ -/***/ (function(module, exports) { - -module.exports = require("child_process"); - -/***/ }), -/* 57 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. var assert = __webpack_require__(24) -var signals = __webpack_require__(372) +var signals = __webpack_require__(379) -var EE = __webpack_require__(36) +var EE = __webpack_require__(37) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter @@ -10974,224 +11310,18 @@ function processEmit (ev, arg) { /***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createSymlink = exports.isFile = exports.isDirectory = exports.mkdirp = exports.readFile = exports.chmod = undefined; - -let statTest = (() => { - var _ref = _asyncToGenerator(function* (path, block) { - try { - return block((yield stat(path))); - } catch (e) { - if (e.code === 'ENOENT') { - return false; - } - throw e; - } - }); - - return function statTest(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); -/** - * Test if a path points to a directory. - * @param path - */ - - -let isDirectory = exports.isDirectory = (() => { - var _ref2 = _asyncToGenerator(function* (path) { - return yield statTest(path, function (stats) { - return stats.isDirectory(); - }); - }); - - return function isDirectory(_x3) { - return _ref2.apply(this, arguments); - }; -})(); -/** - * Test if a path points to a regular file. - * @param path - */ - - -let isFile = exports.isFile = (() => { - var _ref3 = _asyncToGenerator(function* (path) { - return yield statTest(path, function (stats) { - return stats.isFile(); - }); - }); - - return function isFile(_x4) { - return _ref3.apply(this, arguments); - }; -})(); -/** - * Create a symlink at dest that points to src. Adapted from - * https://github.com/lerna/lerna/blob/2f1b87d9e2295f587e4ac74269f714271d8ed428/src/FileSystemUtilities.js#L103. - * - * @param src - * @param dest - * @param type 'dir', 'file', 'junction', or 'exec'. 'exec' on - * windows will use the `cmd-shim` module since symlinks can't be used - * for executable files on windows. - */ - - -let createSymlink = exports.createSymlink = (() => { - var _ref4 = _asyncToGenerator(function* (src, dest, type) { - if (process.platform === 'win32') { - if (type === 'exec') { - yield cmdShim(src, dest); - } else { - yield forceCreate(src, dest, type); - } - } else { - const posixType = type === 'exec' ? 'file' : type; - const relativeSource = (0, _path.relative)((0, _path.dirname)(dest), src); - yield forceCreate(relativeSource, dest, posixType); - } - }); - - return function createSymlink(_x5, _x6, _x7) { - return _ref4.apply(this, arguments); - }; -})(); - -let forceCreate = (() => { - var _ref5 = _asyncToGenerator(function* (src, dest, type) { - try { - // If something exists at `dest` we need to remove it first. - yield unlink(dest); - } catch (error) { - if (error.code !== 'ENOENT') { - throw error; - } - } - yield symlink(src, dest, type); - }); - - return function forceCreate(_x8, _x9, _x10) { - return _ref5.apply(this, arguments); - }; -})(); - -var _fs = __webpack_require__(7); - -var _fs2 = _interopRequireDefault(_fs); - -var _path = __webpack_require__(3); - -var _util = __webpack_require__(13); - -var _cmdShim = __webpack_require__(417); - -var _cmdShim2 = _interopRequireDefault(_cmdShim); - -var _mkdirp = __webpack_require__(214); - -var _mkdirp2 = _interopRequireDefault(_mkdirp); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -const stat = (0, _util.promisify)(_fs2.default.stat); -const readFile = (0, _util.promisify)(_fs2.default.readFile); -const unlink = (0, _util.promisify)(_fs2.default.unlink); -const symlink = (0, _util.promisify)(_fs2.default.symlink); -const chmod = (0, _util.promisify)(_fs2.default.chmod); -const cmdShim = (0, _util.promisify)(_cmdShim2.default); -const mkdirp = (0, _util.promisify)(_mkdirp2.default); -exports.chmod = chmod; -exports.readFile = readFile; -exports.mkdirp = mkdirp; - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -let parallelizeBatches = exports.parallelizeBatches = (() => { - var _ref = _asyncToGenerator(function* (batches, fn) { - for (const batch of batches) { - // We need to make sure the entire batch has completed before we can move on - // to the next batch - yield parallelize(batch, fn); - } - }); - - return function parallelizeBatches(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); - -let parallelize = exports.parallelize = (() => { - var _ref2 = _asyncToGenerator(function* (items, fn, concurrency = 4) { - if (items.length === 0) { - return; - } - return new Promise(function (resolve, reject) { - let scheduleItem = (() => { - var _ref3 = _asyncToGenerator(function* (item) { - activePromises++; - try { - yield fn(item); - activePromises--; - if (values.length > 0) { - // We have more work to do, so we schedule the next promise - scheduleItem(values.shift()); - } else if (activePromises === 0) { - // We have no more values left, and all items have completed, so we've - // completed all the work. - resolve(); - } - } catch (error) { - reject(error); - } - }); - - return function scheduleItem(_x5) { - return _ref3.apply(this, arguments); - }; - })(); - - let activePromises = 0; - const values = items.slice(0); - - values.splice(0, concurrency).map(scheduleItem); - }); - }); - - return function parallelize(_x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); +/* 60 */ +/***/ (function(module, exports) { -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +module.exports = require("child_process"); /***/ }), -/* 60 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var noop_1 = __webpack_require__(61); +var noop_1 = __webpack_require__(62); /* tslint:enable:max-line-length */ function pipe() { var fns = []; @@ -11217,7 +11347,7 @@ exports.pipeFromArray = pipeFromArray; //# sourceMappingURL=pipe.js.map /***/ }), -/* 61 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11228,7 +11358,7 @@ exports.noop = noop; //# sourceMappingURL=noop.js.map /***/ }), -/* 62 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11292,12 +11422,12 @@ exports.ScalarObservable = ScalarObservable; //# sourceMappingURL=ScalarObservable.js.map /***/ }), -/* 63 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var mergeAll_1 = __webpack_require__(45); +var mergeAll_1 = __webpack_require__(46); /** * Converts a higher-order Observable into a first-order Observable by * concatenating the inner Observables in order. @@ -11353,7 +11483,7 @@ exports.concatAll = concatAll; //# sourceMappingURL=concatAll.js.map /***/ }), -/* 64 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11364,7 +11494,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var isArray_1 = __webpack_require__(16); -var ArrayObservable_1 = __webpack_require__(17); +var ArrayObservable_1 = __webpack_require__(18); var OuterSubscriber_1 = __webpack_require__(4); var subscribeToResult_1 = __webpack_require__(5); function race() { @@ -11448,7 +11578,7 @@ exports.RaceSubscriber = RaceSubscriber; //# sourceMappingURL=race.js.map /***/ }), -/* 65 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11458,7 +11588,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var FromObservable_1 = __webpack_require__(227); +var FromObservable_1 = __webpack_require__(228); var isArray_1 = __webpack_require__(16); var OuterSubscriber_1 = __webpack_require__(4); var subscribeToResult_1 = __webpack_require__(5); @@ -11591,12 +11721,12 @@ var OnErrorResumeNextSubscriber = (function (_super) { //# sourceMappingURL=onErrorResumeNext.js.map /***/ }), -/* 66 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var mergeMap_1 = __webpack_require__(29); +var mergeMap_1 = __webpack_require__(30); /* tslint:enable:max-line-length */ /** * Projects each source value to an Observable which is merged in the output @@ -11664,7 +11794,7 @@ exports.concatMap = concatMap; //# sourceMappingURL=concatMap.js.map /***/ }), -/* 67 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11747,7 +11877,7 @@ var DefaultIfEmptySubscriber = (function (_super) { //# sourceMappingURL=defaultIfEmpty.js.map /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11861,7 +11991,7 @@ var DistinctUntilChangedSubscriber = (function (_super) { //# sourceMappingURL=distinctUntilChanged.js.map /***/ }), -/* 69 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11961,7 +12091,7 @@ var FilterSubscriber = (function (_super) { //# sourceMappingURL=filter.js.map /***/ }), -/* 70 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12067,7 +12197,7 @@ exports.FindValueSubscriber = FindValueSubscriber; //# sourceMappingURL=find.js.map /***/ }), -/* 71 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12191,7 +12321,7 @@ var AuditSubscriber = (function (_super) { //# sourceMappingURL=audit.js.map /***/ }), -/* 72 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12318,7 +12448,7 @@ var ScanSubscriber = (function (_super) { //# sourceMappingURL=scan.js.map /***/ }), -/* 73 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12329,8 +12459,8 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var ArgumentOutOfRangeError_1 = __webpack_require__(34); -var EmptyObservable_1 = __webpack_require__(18); +var ArgumentOutOfRangeError_1 = __webpack_require__(35); +var EmptyObservable_1 = __webpack_require__(19); /** * Emits only the last `count` values emitted by the source Observable. * @@ -12433,7 +12563,7 @@ var TakeLastSubscriber = (function (_super) { //# sourceMappingURL=takeLast.js.map /***/ }), -/* 74 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12524,7 +12654,7 @@ var RefCountSubscriber = (function (_super) { //# sourceMappingURL=refCount.js.map /***/ }), -/* 75 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12672,13 +12802,13 @@ var SwitchMapSubscriber = (function (_super) { //# sourceMappingURL=switchMap.js.map /***/ }), -/* 76 */ +/* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var map_1 = __webpack_require__(33); +var map_1 = __webpack_require__(34); /** * @param scheduler * @return {Observable>|WebSocketSubject|Observable} @@ -12703,11 +12833,11 @@ exports.Timestamp = Timestamp; //# sourceMappingURL=timestamp.js.map /***/ }), -/* 77 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { /* MIT license */ -var cssKeywords = __webpack_require__(331); +var cssKeywords = __webpack_require__(330); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). @@ -13570,7 +13700,139 @@ convert.rgb.gray = function (rgb) { /***/ }), -/* 78 */ +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var fs = __webpack_require__(7) + +module.exports = clone(fs) + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(3); +var fs = __webpack_require__(7); +var _0777 = parseInt('0777', 8); + +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + +function mkdirP (p, opts, f, made) { + if (typeof opts === 'function') { + f = opts; + opts = {}; + } + else if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 & (~process.umask()); + } + if (!made) made = null; + + var cb = f || function () {}; + p = path.resolve(p); + + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p; + return cb(null, made); + } + switch (er.code) { + case 'ENOENT': + mkdirP(path.dirname(p), opts, function (er, made) { + if (er) cb(er, made); + else mkdirP(p, opts, cb, made); + }); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) cb(er, made) + else cb(null, made); + }); + break; + } + }); +} + +mkdirP.sync = function sync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 & (~process.umask()); + } + if (!made) made = null; + + p = path.resolve(p); + + try { + xfs.mkdirSync(p, mode); + made = made || p; + } + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = sync(path.dirname(p), opts, made); + sync(p, opts, made); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat; + try { + stat = xfs.statSync(p); + } + catch (err1) { + throw err0; + } + if (!stat.isDirectory()) throw err0; + break; + } + } + + return made; +}; + + +/***/ }), +/* 81 */ /***/ (function(module, exports, __webpack_require__) { module.exports = realpath @@ -13586,7 +13848,7 @@ var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(339) +var old = __webpack_require__(345) function newError (er) { return er && er.syscall === 'realpath' && ( @@ -13642,7 +13904,7 @@ function unmonkeypatch () { /***/ }), -/* 79 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { try { @@ -13650,12 +13912,12 @@ try { if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { - module.exports = __webpack_require__(343); + module.exports = __webpack_require__(349); } /***/ }), -/* 80 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { exports.alphasort = alphasort @@ -13673,8 +13935,8 @@ function ownProp (obj, field) { } var path = __webpack_require__(3) -var minimatch = __webpack_require__(53) -var isAbsolute = __webpack_require__(54) +var minimatch = __webpack_require__(56) +var isAbsolute = __webpack_require__(57) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { @@ -13901,7 +14163,7 @@ function childrenIgnored (self, path) { /***/ }), -/* 81 */ +/* 84 */ /***/ (function(module, exports) { // Returns a wrapper function that returns a wrapped callback @@ -13940,10 +14202,10 @@ function wrappy (fn, cb) { /***/ }), -/* 82 */ +/* 85 */ /***/ (function(module, exports, __webpack_require__) { -var wrappy = __webpack_require__(81) +var wrappy = __webpack_require__(84) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) @@ -13988,7 +14250,7 @@ function onceStrict (fn) { /***/ }), -/* 83 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14001,25 +14263,43 @@ exports.Project = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -var _path = __webpack_require__(3); +var _chalk = __webpack_require__(14); -var _path2 = _interopRequireDefault(_path); +var _chalk2 = _interopRequireDefault(_chalk); + +var _path = __webpack_require__(3); var _util = __webpack_require__(13); -var _chalk = __webpack_require__(14); +var _errors = __webpack_require__(58); -var _chalk2 = _interopRequireDefault(_chalk); +var _log = __webpack_require__(17); -var _scripts = __webpack_require__(346); +var _package_json = __webpack_require__(38); -var _package_json = __webpack_require__(37); - -var _errors = __webpack_require__(55); +var _scripts = __webpack_require__(382); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + class Project { static fromPath(path) { @@ -14031,9 +14311,9 @@ class Project { constructor(packageJson, projectPath) { this.json = Object.freeze(packageJson); this.path = projectPath; - this.packageJsonLocation = _path2.default.resolve(this.path, 'package.json'); - this.nodeModulesLocation = _path2.default.resolve(this.path, 'node_modules'); - this.targetLocation = _path2.default.resolve(this.path, 'target'); + this.packageJsonLocation = (0, _path.resolve)(this.path, 'package.json'); + this.nodeModulesLocation = (0, _path.resolve)(this.path, 'node_modules'); + this.targetLocation = (0, _path.resolve)(this.path, 'target'); this.productionDependencies = this.json.dependencies || {}; this.devDependencies = this.json.devDependencies || {}; this.allDependencies = _extends({}, this.devDependencies, this.productionDependencies); @@ -14043,7 +14323,7 @@ class Project { return this.json.name; } ensureValidProjectDependency(project) { - const relativePathToProject = normalizePath(_path2.default.relative(this.path, project.path)); + const relativePathToProject = normalizePath((0, _path.relative)(this.path, project.path)); const versionInPackageJson = this.allDependencies[project.name]; const expectedVersionInPackageJson = `link:${relativePathToProject}`; if (versionInPackageJson === expectedVersionInPackageJson) { @@ -14051,9 +14331,9 @@ class Project { } const updateMsg = 'Update its package.json to the expected value below.'; const meta = { - package: `${this.name} (${this.packageJsonLocation})`, + actual: `"${project.name}": "${versionInPackageJson}"`, expected: `"${project.name}": "${expectedVersionInPackageJson}"`, - actual: `"${project.name}": "${versionInPackageJson}"` + package: `${this.name} (${this.packageJsonLocation})` }; if ((0, _package_json.isLinkDependency)(versionInPackageJson)) { throw new _errors.CliError(`[${this.name}] depends on [${project.name}] using 'link:', but the path is wrong. ${updateMsg}`, meta); @@ -14069,7 +14349,7 @@ class Project { * instead of everything located in the project directory. */ getIntermediateBuildDirectory() { - return _path2.default.resolve(this.path, this.getBuildConfig().intermediateBuildDirectory || '.'); + return (0, _path.resolve)(this.path, this.getBuildConfig().intermediateBuildDirectory || '.'); } hasScript(name) { return name in this.scripts; @@ -14081,26 +14361,26 @@ class Project { } if (typeof raw === 'string') { return { - [this.name]: _path2.default.resolve(this.path, raw) + [this.name]: (0, _path.resolve)(this.path, raw) }; } if (typeof raw === 'object') { const binsConfig = {}; for (const binName of Object.keys(raw)) { - binsConfig[binName] = _path2.default.resolve(this.path, raw[binName]); + binsConfig[binName] = (0, _path.resolve)(this.path, raw[binName]); } return binsConfig; } throw new _errors.CliError(`[${this.name}] has an invalid "bin" field in its package.json, ` + `expected an object or a string`, { - package: `${this.name} (${this.packageJsonLocation})`, - binConfig: (0, _util.inspect)(raw) + binConfig: (0, _util.inspect)(raw), + package: `${this.name} (${this.packageJsonLocation})` }); } runScript(scriptName, args = []) { var _this = this; return _asyncToGenerator(function* () { - console.log(_chalk2.default.bold(`\n\nRunning script [${_chalk2.default.green(scriptName)}] in [${_chalk2.default.green(_this.name)}]:\n`)); + _log.log.write(_chalk2.default.bold(`\n\nRunning script [${_chalk2.default.green(scriptName)}] in [${_chalk2.default.green(_this.name)}]:\n`)); return (0, _scripts.runScriptInPackage)(scriptName, args, _this); })(); } @@ -14114,7 +14394,7 @@ class Project { var _this2 = this; return _asyncToGenerator(function* () { - console.log(_chalk2.default.bold(`\n\nInstalling dependencies in [${_chalk2.default.green(_this2.name)}]:\n`)); + _log.log.write(_chalk2.default.bold(`\n\nInstalling dependencies in [${_chalk2.default.green(_this2.name)}]:\n`)); return (0, _scripts.installInDir)(_this2.path, extraArgs); })(); } @@ -14126,15 +14406,293 @@ function normalizePath(path) { } /***/ }), -/* 84 */ +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = normalize + +var fixer = __webpack_require__(360) +normalize.fixer = fixer + +var makeWarning = __webpack_require__(373) + +var fieldsToFix = ['name','version','description','repository','modules','scripts' + ,'files','bin','man','bugs','keywords','readme','homepage','license'] +var otherThingsToFix = ['dependencies','people', 'typos'] + +var thingsToFix = fieldsToFix.map(function(fieldName) { + return ucFirst(fieldName) + "Field" +}) +// two ways to do this in CoffeeScript on only one line, sub-70 chars: +// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field" +// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) +thingsToFix = thingsToFix.concat(otherThingsToFix) + +function normalize (data, warn, strict) { + if(warn === true) warn = null, strict = true + if(!strict) strict = false + if(!warn || data.private) warn = function(msg) { /* noop */ } + + if (data.scripts && + data.scripts.install === "node-gyp rebuild" && + !data.scripts.preinstall) { + data.gypfile = true + } + fixer.warn = function() { warn(makeWarning.apply(null, arguments)) } + thingsToFix.forEach(function(thingName) { + fixer["fix" + ucFirst(thingName)](data, strict) + }) + data._id = data.name + "@" + data.version +} + +function ucFirst (string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} + + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +module.exports = require("url"); + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var gitHosts = module.exports = { + github: { + // First two are insecure and generally shouldn't be used any more, but + // they are still supported. + 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'github.com', + 'treepath': 'tree', + 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', + 'bugstemplate': 'https://{domain}/{user}/{project}/issues', + 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', + 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' + }, + bitbucket: { + 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'bitbucket.org', + 'treepath': 'src', + 'tarballtemplate': 'https://{domain}/{user}/{project}/get/{committish}.tar.gz' + }, + gitlab: { + 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gitlab.com', + 'treepath': 'tree', + 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README', + 'bugstemplate': 'https://{domain}/{user}/{project}/issues', + 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}' + }, + gist: { + 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gist.github.com', + 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/, + 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}', + 'bugstemplate': 'https://{domain}/{project}', + 'gittemplate': 'git://{domain}/{project}.git{#committish}', + 'sshtemplate': 'git@{domain}:/{project}.git{#committish}', + 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}', + 'browsetemplate': 'https://{domain}/{project}{/committish}', + 'docstemplate': 'https://{domain}/{project}{/committish}', + 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}', + 'shortcuttemplate': '{type}:{project}{#committish}', + 'pathtemplate': '{project}{#committish}', + 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' + } +} + +var gitHostDefaults = { + 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}', + 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}', + 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}', + 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme', + 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}', + 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', + 'shortcuttemplate': '{type}:{user}/{project}{#committish}', + 'pathtemplate': '{user}/{project}{#committish}', + 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/ +} + +Object.keys(gitHosts).forEach(function (name) { + Object.keys(gitHostDefaults).forEach(function (key) { + if (gitHosts[name][key]) return + gitHosts[name][key] = gitHostDefaults[key] + }) + gitHosts[name].protocols_re = RegExp('^(' + + gitHosts[name].protocols.map(function (protocol) { + return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') + }).join('|') + '):$') +}) + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const isPlainObj = __webpack_require__(380); + +module.exports = (obj, opts) => { + if (!isPlainObj(obj)) { + throw new TypeError('Expected a plain object'); + } + + opts = opts || {}; + + // DEPRECATED + if (typeof opts === 'function') { + throw new TypeError('Specify the compare function as an option instead'); + } + + const deep = opts.deep; + const seenInput = []; + const seenOutput = []; + + const sortKeys = x => { + const seenIndex = seenInput.indexOf(x); + + if (seenIndex !== -1) { + return seenOutput[seenIndex]; + } + + const ret = {}; + const keys = Object.keys(x).sort(opts.compare); + + seenInput.push(x); + seenOutput.push(ret); + + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const val = x[key]; + + if (deep && Array.isArray(val)) { + const retArr = []; + + for (let j = 0; j < val.length; j++) { + retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j]; + } + + ret[key] = retArr; + continue; + } + + ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; + } + + return ret; + }; + + return sortKeys(obj); +}; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const fs = __webpack_require__(7); +const path = __webpack_require__(3); +const pify = __webpack_require__(22); + +const defaults = { + mode: 0o777 & (~process.umask()), + fs +}; + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const checkPath = pth => { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); + + if (pathHasInvalidWinCharacters) { + const err = new Error(`Path contains invalid characters: ${pth}`); + err.code = 'EINVAL'; + throw err; + } + } +}; + +module.exports = (input, opts) => Promise.resolve().then(() => { + checkPath(input); + opts = Object.assign({}, defaults, opts); + const fsP = pify(opts.fs); + + const make = pth => { + return fsP.mkdir(pth, opts.mode) + .then(() => pth) + .catch(err => { + if (err.code === 'ENOENT') { + if (err.message.includes('null bytes') || path.dirname(pth) === pth) { + throw err; + } + + return make(path.dirname(pth)).then(() => make(pth)); + } + + return fsP.stat(pth) + .then(stats => stats.isDirectory() ? pth : Promise.reject()) + .catch(() => { + throw err; + }); + }); + }; + + return make(path.resolve(input)); +}); + +module.exports.sync = (input, opts) => { + checkPath(input); + opts = Object.assign({}, defaults, opts); + + const make = pth => { + try { + opts.fs.mkdirSync(pth, opts.mode); + } catch (err) { + if (err.code === 'ENOENT') { + if (err.message.includes('null bytes') || path.dirname(pth) === pth) { + throw err; + } + + make(path.dirname(pth)); + return make(pth); + } + + try { + if (!opts.fs.statSync(pth).isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch (_) { + throw err; + } + } + + return pth; + }; + + return make(path.resolve(input)); +}; + + +/***/ }), +/* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var path = __webpack_require__(3); -var which = __webpack_require__(351); -var LRU = __webpack_require__(85); +var which = __webpack_require__(387); +var LRU = __webpack_require__(93); var commandCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec @@ -14164,7 +14722,7 @@ module.exports = resolveCommand; /***/ }), -/* 85 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14174,11 +14732,11 @@ module.exports = LRUCache // This will be a proper iterable 'Map' in engines that support it, // or a fakey-fake PseudoMap in older versions. -var Map = __webpack_require__(355) +var Map = __webpack_require__(391) var util = __webpack_require__(13) // A linked list to keep track of recently-used-ness -var Yallist = __webpack_require__(357) +var Yallist = __webpack_require__(393) // use symbols if possible, otherwise just _props var hasSymbol = typeof Symbol === 'function' @@ -14638,7 +15196,7 @@ function Entry (key, value, length, now, maxAge) { /***/ }), -/* 86 */ +/* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14675,7 +15233,34 @@ module.exports = escapeArgument; /***/ }), -/* 87 */ +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const chalk = __webpack_require__(14); + +const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; + +const main = { + info: chalk.blue('ℹ'), + success: chalk.green('✔'), + warning: chalk.yellow('⚠'), + error: chalk.red('✖') +}; + +const fallbacks = { + info: chalk.blue('i'), + success: chalk.green('√'), + warning: chalk.yellow('‼'), + error: chalk.red('×') +}; + +module.exports = isSupported ? main : fallbacks; + + +/***/ }), +/* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14686,13 +15271,13 @@ module.exports = escapeArgument; -var stream = __webpack_require__(20); +var stream = __webpack_require__(21); var util = __webpack_require__(13); var fs = __webpack_require__(7); -var byline = __webpack_require__(376); -var through = __webpack_require__(378); -var duplexer = __webpack_require__(379); +var byline = __webpack_require__(411); +var through = __webpack_require__(413); +var duplexer = __webpack_require__(414); var moment = __webpack_require__(1); module.exports = Logger; @@ -14854,7 +15439,7 @@ function lineMerger(host) { /***/ }), -/* 88 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -14933,7 +15518,7 @@ return af; /***/ }), -/* 89 */ +/* 98 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15081,7 +15666,7 @@ return ar; /***/ }), -/* 90 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15146,7 +15731,7 @@ return arDz; /***/ }), -/* 91 */ +/* 100 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15211,7 +15796,7 @@ return arKw; /***/ }), -/* 92 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15343,7 +15928,7 @@ return arLy; /***/ }), -/* 93 */ +/* 102 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15409,7 +15994,7 @@ return arMa; /***/ }), -/* 94 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15520,7 +16105,7 @@ return arSa; /***/ }), -/* 95 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15585,7 +16170,7 @@ return arTn; /***/ }), -/* 96 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15696,7 +16281,7 @@ return az; /***/ }), -/* 97 */ +/* 106 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15836,7 +16421,7 @@ return be; /***/ }), -/* 98 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15932,7 +16517,7 @@ return bg; /***/ }), -/* 99 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -15997,7 +16582,7 @@ return bm; /***/ }), -/* 100 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -16122,7 +16707,7 @@ return bn; /***/ }), -/* 101 */ +/* 110 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -16247,7 +16832,7 @@ return bo; /***/ }), -/* 102 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -16361,7 +16946,7 @@ return br; /***/ }), -/* 103 */ +/* 112 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -16519,7 +17104,7 @@ return bs; /***/ }), -/* 104 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -16613,7 +17198,7 @@ return ca; /***/ }), -/* 105 */ +/* 114 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -16798,7 +17383,7 @@ return cs; /***/ }), -/* 106 */ +/* 115 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -16867,7 +17452,7 @@ return cv; /***/ }), -/* 107 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -16954,7 +17539,7 @@ return cy; /***/ }), -/* 108 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17020,7 +17605,7 @@ return da; /***/ }), -/* 109 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17104,7 +17689,7 @@ return de; /***/ }), -/* 110 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17189,7 +17774,7 @@ return deAt; /***/ }), -/* 111 */ +/* 120 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17273,7 +17858,7 @@ return deCh; /***/ }), -/* 112 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17379,7 +17964,7 @@ return dv; /***/ }), -/* 113 */ +/* 122 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17485,7 +18070,7 @@ return el; /***/ }), -/* 114 */ +/* 123 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17558,7 +18143,7 @@ return enAu; /***/ }), -/* 115 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17627,7 +18212,7 @@ return enCa; /***/ }), -/* 116 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17700,7 +18285,7 @@ return enGb; /***/ }), -/* 117 */ +/* 126 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17773,7 +18358,7 @@ return enIe; /***/ }), -/* 118 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17846,7 +18431,7 @@ return enNz; /***/ }), -/* 119 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -17925,7 +18510,7 @@ return eo; /***/ }), -/* 120 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18023,7 +18608,7 @@ return es; /***/ }), -/* 121 */ +/* 130 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18120,7 +18705,7 @@ return esDo; /***/ }), -/* 122 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18209,7 +18794,7 @@ return esUs; /***/ }), -/* 123 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18296,7 +18881,7 @@ return et; /***/ }), -/* 124 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18368,7 +18953,7 @@ return eu; /***/ }), -/* 125 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18481,7 +19066,7 @@ return fa; /***/ }), -/* 126 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18596,7 +19181,7 @@ return fi; /***/ }), -/* 127 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18662,7 +19247,7 @@ return fo; /***/ }), -/* 128 */ +/* 137 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18751,7 +19336,7 @@ return fr; /***/ }), -/* 129 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18831,7 +19416,7 @@ return frCa; /***/ }), -/* 130 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18915,7 +19500,7 @@ return frCh; /***/ }), -/* 131 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -18996,7 +19581,7 @@ return fy; /***/ }), -/* 132 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -19078,7 +19663,7 @@ return gd; /***/ }), -/* 133 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -19161,7 +19746,7 @@ return gl; /***/ }), -/* 134 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -19290,7 +19875,7 @@ return gomLatn; /***/ }), -/* 135 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -19420,7 +20005,7 @@ return gu; /***/ }), -/* 136 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -19525,7 +20110,7 @@ return he; /***/ }), -/* 137 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -19655,7 +20240,7 @@ return hi; /***/ }), -/* 138 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -19815,7 +20400,7 @@ return hr; /***/ }), -/* 139 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -19931,7 +20516,7 @@ return hu; /***/ }), -/* 140 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20032,7 +20617,7 @@ return hyAm; /***/ }), -/* 141 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20121,7 +20706,7 @@ return id; /***/ }), -/* 142 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20259,7 +20844,7 @@ return is; /***/ }), -/* 143 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20335,7 +20920,7 @@ return it; /***/ }), -/* 144 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20421,7 +21006,7 @@ return ja; /***/ }), -/* 145 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20510,7 +21095,7 @@ return jv; /***/ }), -/* 146 */ +/* 155 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20605,7 +21190,7 @@ return ka; /***/ }), -/* 147 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20698,7 +21283,7 @@ return kk; /***/ }), -/* 148 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20762,7 +21347,7 @@ return km; /***/ }), -/* 149 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20894,7 +21479,7 @@ return kn; /***/ }), -/* 150 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -20982,7 +21567,7 @@ return ko; /***/ }), -/* 151 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21076,7 +21661,7 @@ return ky; /***/ }), -/* 152 */ +/* 161 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21219,7 +21804,7 @@ return lb; /***/ }), -/* 153 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21295,7 +21880,7 @@ return lo; /***/ }), -/* 154 */ +/* 163 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21419,7 +22004,7 @@ return lt; /***/ }), -/* 155 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21523,7 +22108,7 @@ return lv; /***/ }), -/* 156 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21641,7 +22226,7 @@ return me; /***/ }), -/* 157 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21711,7 +22296,7 @@ return mi; /***/ }), -/* 158 */ +/* 167 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21807,7 +22392,7 @@ return mk; /***/ }), -/* 159 */ +/* 168 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21894,7 +22479,7 @@ return ml; /***/ }), -/* 160 */ +/* 169 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22061,7 +22646,7 @@ return mr; /***/ }), -/* 161 */ +/* 170 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22149,7 +22734,7 @@ return ms; /***/ }), -/* 162 */ +/* 171 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22238,7 +22823,7 @@ return msMy; /***/ }), -/* 163 */ +/* 172 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22304,7 +22889,7 @@ return mt; /***/ }), -/* 164 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22406,7 +22991,7 @@ return my; /***/ }), -/* 165 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22475,7 +23060,7 @@ return nb; /***/ }), -/* 166 */ +/* 175 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22604,7 +23189,7 @@ return ne; /***/ }), -/* 167 */ +/* 176 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22698,7 +23283,7 @@ return nl; /***/ }), -/* 168 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22792,7 +23377,7 @@ return nlBe; /***/ }), -/* 169 */ +/* 178 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22858,7 +23443,7 @@ return nn; /***/ }), -/* 170 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22988,7 +23573,7 @@ return paIn; /***/ }), -/* 171 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23120,7 +23705,7 @@ return pl; /***/ }), -/* 172 */ +/* 181 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23191,7 +23776,7 @@ return pt; /***/ }), -/* 173 */ +/* 182 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23258,7 +23843,7 @@ return ptBr; /***/ }), -/* 174 */ +/* 183 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23340,7 +23925,7 @@ return ro; /***/ }), -/* 175 */ +/* 184 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23530,7 +24115,7 @@ return ru; /***/ }), -/* 176 */ +/* 185 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23634,7 +24219,7 @@ return sd; /***/ }), -/* 177 */ +/* 186 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23701,7 +24286,7 @@ return se; /***/ }), -/* 178 */ +/* 187 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23778,7 +24363,7 @@ return si; /***/ }), -/* 179 */ +/* 188 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23941,7 +24526,7 @@ return sk; /***/ }), -/* 180 */ +/* 189 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24120,7 +24705,7 @@ return sl; /***/ }), -/* 181 */ +/* 190 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24196,7 +24781,7 @@ return sq; /***/ }), -/* 182 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24313,7 +24898,7 @@ return sr; /***/ }), -/* 183 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24430,7 +25015,7 @@ return srCyrl; /***/ }), -/* 184 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24525,7 +25110,7 @@ return ss; /***/ }), -/* 185 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24600,7 +25185,7 @@ return sv; /***/ }), -/* 186 */ +/* 195 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24665,7 +25250,7 @@ return sw; /***/ }), -/* 187 */ +/* 196 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24801,7 +25386,7 @@ return ta; /***/ }), -/* 188 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24896,7 +25481,7 @@ return te; /***/ }), -/* 189 */ +/* 198 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24970,7 +25555,7 @@ return tet; /***/ }), -/* 190 */ +/* 199 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25043,7 +25628,7 @@ return th; /***/ }), -/* 191 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25111,7 +25696,7 @@ return tlPh; /***/ }), -/* 192 */ +/* 201 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25239,7 +25824,7 @@ return tlh; /***/ }), -/* 193 */ +/* 202 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25335,7 +25920,7 @@ return tr; /***/ }), -/* 194 */ +/* 203 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25433,7 +26018,7 @@ return tzl; /***/ }), -/* 195 */ +/* 204 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25497,7 +26082,7 @@ return tzm; /***/ }), -/* 196 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25561,7 +26146,7 @@ return tzmLatn; /***/ }), -/* 197 */ +/* 206 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25719,7 +26304,7 @@ return uk; /***/ }), -/* 198 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25824,7 +26409,7 @@ return ur; /***/ }), -/* 199 */ +/* 208 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25888,7 +26473,7 @@ return uz; /***/ }), -/* 200 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25952,7 +26537,7 @@ return uzLatn; /***/ }), -/* 201 */ +/* 210 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26037,7 +26622,7 @@ return vi; /***/ }), -/* 202 */ +/* 211 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26111,7 +26696,7 @@ return xPseudo; /***/ }), -/* 203 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26177,7 +26762,7 @@ return yo; /***/ }), -/* 204 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26294,7 +26879,7 @@ return zhCn; /***/ }), -/* 205 */ +/* 214 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26405,7 +26990,7 @@ return zhHk; /***/ }), -/* 206 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26515,455 +27100,18 @@ return zhTw; /***/ }), -/* 207 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const chalk = __webpack_require__(14); - -const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; - -const main = { - info: chalk.blue('ℹ'), - success: chalk.green('✔'), - warning: chalk.yellow('⚠'), - error: chalk.red('✖') -}; - -const fallbacks = { - info: chalk.blue('i'), - success: chalk.green('√'), - warning: chalk.yellow('‼'), - error: chalk.red('×') -}; - -module.exports = isSupported ? main : fallbacks; - - -/***/ }), -/* 208 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var fs = __webpack_require__(7) - -module.exports = clone(fs) - -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj - - if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } - else - var copy = Object.create(null) - - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) - - return copy -} - - -/***/ }), -/* 209 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = normalize - -var fixer = __webpack_require__(395) -normalize.fixer = fixer - -var makeWarning = __webpack_require__(408) - -var fieldsToFix = ['name','version','description','repository','modules','scripts' - ,'files','bin','man','bugs','keywords','readme','homepage','license'] -var otherThingsToFix = ['dependencies','people', 'typos'] - -var thingsToFix = fieldsToFix.map(function(fieldName) { - return ucFirst(fieldName) + "Field" -}) -// two ways to do this in CoffeeScript on only one line, sub-70 chars: -// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field" -// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) -thingsToFix = thingsToFix.concat(otherThingsToFix) - -function normalize (data, warn, strict) { - if(warn === true) warn = null, strict = true - if(!strict) strict = false - if(!warn || data.private) warn = function(msg) { /* noop */ } - - if (data.scripts && - data.scripts.install === "node-gyp rebuild" && - !data.scripts.preinstall) { - data.gypfile = true - } - fixer.warn = function() { warn(makeWarning.apply(null, arguments)) } - thingsToFix.forEach(function(thingName) { - fixer["fix" + ucFirst(thingName)](data, strict) - }) - data._id = data.name + "@" + data.version -} - -function ucFirst (string) { - return string.charAt(0).toUpperCase() + string.slice(1); -} - - -/***/ }), -/* 210 */ -/***/ (function(module, exports) { - -module.exports = require("url"); - -/***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var gitHosts = module.exports = { - github: { - // First two are insecure and generally shouldn't be used any more, but - // they are still supported. - 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ], - 'domain': 'github.com', - 'treepath': 'tree', - 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', - 'bugstemplate': 'https://{domain}/{user}/{project}/issues', - 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', - 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' - }, - bitbucket: { - 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], - 'domain': 'bitbucket.org', - 'treepath': 'src', - 'tarballtemplate': 'https://{domain}/{user}/{project}/get/{committish}.tar.gz' - }, - gitlab: { - 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], - 'domain': 'gitlab.com', - 'treepath': 'tree', - 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README', - 'bugstemplate': 'https://{domain}/{user}/{project}/issues', - 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}' - }, - gist: { - 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], - 'domain': 'gist.github.com', - 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/, - 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}', - 'bugstemplate': 'https://{domain}/{project}', - 'gittemplate': 'git://{domain}/{project}.git{#committish}', - 'sshtemplate': 'git@{domain}:/{project}.git{#committish}', - 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}', - 'browsetemplate': 'https://{domain}/{project}{/committish}', - 'docstemplate': 'https://{domain}/{project}{/committish}', - 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}', - 'shortcuttemplate': '{type}:{project}{#committish}', - 'pathtemplate': '{project}{#committish}', - 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' - } -} - -var gitHostDefaults = { - 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}', - 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}', - 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}', - 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme', - 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}', - 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', - 'shortcuttemplate': '{type}:{user}/{project}{#committish}', - 'pathtemplate': '{user}/{project}{#committish}', - 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/ -} - -Object.keys(gitHosts).forEach(function (name) { - Object.keys(gitHostDefaults).forEach(function (key) { - if (gitHosts[name][key]) return - gitHosts[name][key] = gitHostDefaults[key] - }) - gitHosts[name].protocols_re = RegExp('^(' + - gitHosts[name].protocols.map(function (protocol) { - return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') - }).join('|') + '):$') -}) - - -/***/ }), -/* 212 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const isPlainObj = __webpack_require__(414); - -module.exports = (obj, opts) => { - if (!isPlainObj(obj)) { - throw new TypeError('Expected a plain object'); - } - - opts = opts || {}; - - // DEPRECATED - if (typeof opts === 'function') { - throw new TypeError('Specify the compare function as an option instead'); - } - - const deep = opts.deep; - const seenInput = []; - const seenOutput = []; - - const sortKeys = x => { - const seenIndex = seenInput.indexOf(x); - - if (seenIndex !== -1) { - return seenOutput[seenIndex]; - } - - const ret = {}; - const keys = Object.keys(x).sort(opts.compare); - - seenInput.push(x); - seenOutput.push(ret); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const val = x[key]; - - if (deep && Array.isArray(val)) { - const retArr = []; - - for (let j = 0; j < val.length; j++) { - retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j]; - } - - ret[key] = retArr; - continue; - } - - ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; - } - - return ret; - }; - - return sortKeys(obj); -}; - - -/***/ }), -/* 213 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const fs = __webpack_require__(7); -const path = __webpack_require__(3); -const pify = __webpack_require__(21); - -const defaults = { - mode: 0o777 & (~process.umask()), - fs -}; - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); - - if (pathHasInvalidWinCharacters) { - const err = new Error(`Path contains invalid characters: ${pth}`); - err.code = 'EINVAL'; - throw err; - } - } -}; - -module.exports = (input, opts) => Promise.resolve().then(() => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - const fsP = pify(opts.fs); - - const make = pth => { - return fsP.mkdir(pth, opts.mode) - .then(() => pth) - .catch(err => { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - return make(path.dirname(pth)).then(() => make(pth)); - } - - return fsP.stat(pth) - .then(stats => stats.isDirectory() ? pth : Promise.reject()) - .catch(() => { - throw err; - }); - }); - }; - - return make(path.resolve(input)); -}); - -module.exports.sync = (input, opts) => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const make = pth => { - try { - opts.fs.mkdirSync(pth, opts.mode); - } catch (err) { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - make(path.dirname(pth)); - return make(pth); - } - - try { - if (!opts.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw err; - } - } - - return pth; - }; - - return make(path.resolve(input)); -}; - - -/***/ }), -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { - -var path = __webpack_require__(3); -var fs = __webpack_require__(7); -var _0777 = parseInt('0777', 8); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, opts, f, made) { - if (typeof opts === 'function') { - f = opts; - opts = {}; - } - else if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - p = path.resolve(p); - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), opts, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, opts, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 & (~process.umask()); - } - if (!made) made = null; - - p = path.resolve(p); - - try { - xfs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), opts, made); - sync(p, opts, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = xfs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; - - -/***/ }), -/* 215 */ +/* 216 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(3); -const globby = __webpack_require__(419); -const isPathCwd = __webpack_require__(423); -const isPathInCwd = __webpack_require__(424); -const pify = __webpack_require__(21); -const rimraf = __webpack_require__(427); -const pMap = __webpack_require__(428); +const globby = __webpack_require__(420); +const isPathCwd = __webpack_require__(424); +const isPathInCwd = __webpack_require__(425); +const pify = __webpack_require__(22); +const rimraf = __webpack_require__(428); +const pMap = __webpack_require__(429); const rimrafP = pify(rimraf); @@ -27029,22 +27177,22 @@ module.exports.sync = (patterns, opts) => { /***/ }), -/* 216 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = typeof Promise === 'function' ? Promise : __webpack_require__(420); +module.exports = typeof Promise === 'function' ? Promise : __webpack_require__(421); /***/ }), -/* 217 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var arrayUniq = __webpack_require__(421); +var arrayUniq = __webpack_require__(422); module.exports = function () { return arrayUniq([].concat.apply([], arguments)); @@ -27052,7 +27200,7 @@ module.exports = function () { /***/ }), -/* 218 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27149,7 +27297,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { /***/ }), -/* 219 */ +/* 220 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27161,7 +27309,7 @@ exports.isObject = isObject; //# sourceMappingURL=isObject.js.map /***/ }), -/* 220 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27192,7 +27340,7 @@ exports.UnsubscriptionError = UnsubscriptionError; //# sourceMappingURL=UnsubscriptionError.js.map /***/ }), -/* 221 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27206,7 +27354,7 @@ exports.empty = { //# sourceMappingURL=Observer.js.map /***/ }), -/* 222 */ +/* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27252,7 +27400,7 @@ exports.SubjectSubscription = SubjectSubscription; //# sourceMappingURL=SubjectSubscription.js.map /***/ }), -/* 223 */ +/* 224 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27261,7 +27409,7 @@ exports.isArrayLike = (function (x) { return x && typeof x.length === 'number'; //# sourceMappingURL=isArrayLike.js.map /***/ }), -/* 224 */ +/* 225 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27273,27 +27421,27 @@ exports.isPromise = isPromise; //# sourceMappingURL=isPromise.js.map /***/ }), -/* 225 */ +/* 226 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ArrayObservable_1 = __webpack_require__(17); +var ArrayObservable_1 = __webpack_require__(18); exports.of = ArrayObservable_1.ArrayObservable.of; //# sourceMappingURL=of.js.map /***/ }), -/* 226 */ +/* 227 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var FromObservable_1 = __webpack_require__(227); +var FromObservable_1 = __webpack_require__(228); exports.from = FromObservable_1.FromObservable.create; //# sourceMappingURL=from.js.map /***/ }), -/* 227 */ +/* 228 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27304,16 +27452,16 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var isArray_1 = __webpack_require__(16); -var isArrayLike_1 = __webpack_require__(223); -var isPromise_1 = __webpack_require__(224); -var PromiseObservable_1 = __webpack_require__(228); -var IteratorObservable_1 = __webpack_require__(451); -var ArrayObservable_1 = __webpack_require__(17); -var ArrayLikeObservable_1 = __webpack_require__(452); -var iterator_1 = __webpack_require__(26); +var isArrayLike_1 = __webpack_require__(224); +var isPromise_1 = __webpack_require__(225); +var PromiseObservable_1 = __webpack_require__(229); +var IteratorObservable_1 = __webpack_require__(452); +var ArrayObservable_1 = __webpack_require__(18); +var ArrayLikeObservable_1 = __webpack_require__(453); +var iterator_1 = __webpack_require__(27); var Observable_1 = __webpack_require__(0); -var observeOn_1 = __webpack_require__(44); -var observable_1 = __webpack_require__(40); +var observeOn_1 = __webpack_require__(45); +var observable_1 = __webpack_require__(41); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -27421,7 +27569,7 @@ exports.FromObservable = FromObservable; //# sourceMappingURL=FromObservable.js.map /***/ }), -/* 228 */ +/* 229 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27548,7 +27696,7 @@ function dispatchError(arg) { //# sourceMappingURL=PromiseObservable.js.map /***/ }), -/* 229 */ +/* 230 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27560,17 +27708,17 @@ exports.identity = identity; //# sourceMappingURL=identity.js.map /***/ }), -/* 230 */ +/* 231 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var TimerObservable_1 = __webpack_require__(502); +var TimerObservable_1 = __webpack_require__(503); exports.timer = TimerObservable_1.TimerObservable.create; //# sourceMappingURL=timer.js.map /***/ }), -/* 231 */ +/* 232 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27585,7 +27733,7 @@ var tryCatch_1 = __webpack_require__(11); var errorObject_1 = __webpack_require__(10); var Observable_1 = __webpack_require__(0); var Subscriber_1 = __webpack_require__(2); -var map_1 = __webpack_require__(33); +var map_1 = __webpack_require__(34); function getCORSRequest() { if (root_1.root.XMLHttpRequest) { return new root_1.root.XMLHttpRequest(); @@ -28002,13 +28150,13 @@ exports.AjaxTimeoutError = AjaxTimeoutError; //# sourceMappingURL=AjaxObservable.js.map /***/ }), -/* 232 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var QueueAction_1 = __webpack_require__(510); -var QueueScheduler_1 = __webpack_require__(511); +var QueueAction_1 = __webpack_require__(511); +var QueueScheduler_1 = __webpack_require__(512); /** * * Queue Scheduler @@ -28074,7 +28222,7 @@ exports.queue = new QueueScheduler_1.QueueScheduler(QueueAction_1.QueueAction); //# sourceMappingURL=queue.js.map /***/ }), -/* 233 */ +/* 234 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28158,7 +28306,7 @@ var BufferSubscriber = (function (_super) { //# sourceMappingURL=buffer.js.map /***/ }), -/* 234 */ +/* 235 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28306,7 +28454,7 @@ var BufferSkipCountSubscriber = (function (_super) { //# sourceMappingURL=bufferCount.js.map /***/ }), -/* 235 */ +/* 236 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28513,7 +28661,7 @@ function dispatchBufferClose(arg) { //# sourceMappingURL=bufferTime.js.map /***/ }), -/* 236 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28673,7 +28821,7 @@ var BufferToggleSubscriber = (function (_super) { //# sourceMappingURL=bufferToggle.js.map /***/ }), -/* 237 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28803,7 +28951,7 @@ var BufferWhenSubscriber = (function (_super) { //# sourceMappingURL=bufferWhen.js.map /***/ }), -/* 238 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28925,12 +29073,12 @@ var CatchSubscriber = (function (_super) { //# sourceMappingURL=catchError.js.map /***/ }), -/* 239 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var combineLatest_1 = __webpack_require__(43); +var combineLatest_1 = __webpack_require__(44); function combineAll(project) { return function (source) { return source.lift(new combineLatest_1.CombineLatestOperator(project)); }; } @@ -28938,13 +29086,13 @@ exports.combineAll = combineAll; //# sourceMappingURL=combineAll.js.map /***/ }), -/* 240 */ +/* 241 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var concat_1 = __webpack_require__(27); -var concat_2 = __webpack_require__(27); +var concat_1 = __webpack_require__(28); +var concat_2 = __webpack_require__(28); exports.concatStatic = concat_2.concat; /* tslint:enable:max-line-length */ /** @@ -29007,12 +29155,12 @@ exports.concat = concat; //# sourceMappingURL=concat.js.map /***/ }), -/* 241 */ +/* 242 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var concatMap_1 = __webpack_require__(66); +var concatMap_1 = __webpack_require__(67); /* tslint:enable:max-line-length */ /** * Projects each source value to the same Observable which is merged multiple @@ -29077,7 +29225,7 @@ exports.concatMapTo = concatMapTo; //# sourceMappingURL=concatMapTo.js.map /***/ }), -/* 242 */ +/* 243 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29194,7 +29342,7 @@ var CountSubscriber = (function (_super) { //# sourceMappingURL=count.js.map /***/ }), -/* 243 */ +/* 244 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29277,7 +29425,7 @@ var DeMaterializeSubscriber = (function (_super) { //# sourceMappingURL=dematerialize.js.map /***/ }), -/* 244 */ +/* 245 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29410,7 +29558,7 @@ var DebounceSubscriber = (function (_super) { //# sourceMappingURL=debounce.js.map /***/ }), -/* 245 */ +/* 246 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29532,7 +29680,7 @@ function dispatchNext(subscriber) { //# sourceMappingURL=debounceTime.js.map /***/ }), -/* 246 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29543,9 +29691,9 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var async_1 = __webpack_require__(6); -var isDate_1 = __webpack_require__(47); +var isDate_1 = __webpack_require__(48); var Subscriber_1 = __webpack_require__(2); -var Notification_1 = __webpack_require__(28); +var Notification_1 = __webpack_require__(29); /** * Delays the emission of items from the source Observable by a given timeout or * until a given Date. @@ -29673,7 +29821,7 @@ var DelayMessage = (function () { //# sourceMappingURL=delay.js.map /***/ }), -/* 247 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29873,7 +30021,7 @@ var SubscriptionDelaySubscriber = (function (_super) { //# sourceMappingURL=delayWhen.js.map /***/ }), -/* 248 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29885,7 +30033,7 @@ var __extends = (this && this.__extends) || function (d, b) { }; var OuterSubscriber_1 = __webpack_require__(4); var subscribeToResult_1 = __webpack_require__(5); -var Set_1 = __webpack_require__(553); +var Set_1 = __webpack_require__(554); /** * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items. * @@ -29999,12 +30147,12 @@ exports.DistinctSubscriber = DistinctSubscriber; //# sourceMappingURL=distinct.js.map /***/ }), -/* 249 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var distinctUntilChanged_1 = __webpack_require__(68); +var distinctUntilChanged_1 = __webpack_require__(69); /* tslint:enable:max-line-length */ /** * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item, @@ -30070,7 +30218,7 @@ exports.distinctUntilKeyChanged = distinctUntilKeyChanged; //# sourceMappingURL=distinctUntilKeyChanged.js.map /***/ }), -/* 250 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30189,7 +30337,7 @@ var DoSubscriber = (function (_super) { //# sourceMappingURL=tap.js.map /***/ }), -/* 251 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30284,7 +30432,7 @@ var SwitchFirstSubscriber = (function (_super) { //# sourceMappingURL=exhaust.js.map /***/ }), -/* 252 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30428,7 +30576,7 @@ var SwitchFirstMapSubscriber = (function (_super) { //# sourceMappingURL=exhaustMap.js.map /***/ }), -/* 253 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30585,7 +30733,7 @@ exports.ExpandSubscriber = ExpandSubscriber; //# sourceMappingURL=expand.js.map /***/ }), -/* 254 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30596,7 +30744,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var ArgumentOutOfRangeError_1 = __webpack_require__(34); +var ArgumentOutOfRangeError_1 = __webpack_require__(35); /** * Emits the single value at the specified `index` in a sequence of emissions * from the source Observable. @@ -30691,7 +30839,7 @@ var ElementAtSubscriber = (function (_super) { //# sourceMappingURL=elementAt.js.map /***/ }), -/* 255 */ +/* 256 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30740,12 +30888,12 @@ var FinallySubscriber = (function (_super) { //# sourceMappingURL=finalize.js.map /***/ }), -/* 256 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var find_1 = __webpack_require__(70); +var find_1 = __webpack_require__(71); /** * Emits only the index of the first value emitted by the source Observable that * meets some condition. @@ -30787,7 +30935,7 @@ exports.findIndex = findIndex; //# sourceMappingURL=findIndex.js.map /***/ }), -/* 257 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30798,7 +30946,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var EmptyError_1 = __webpack_require__(50); +var EmptyError_1 = __webpack_require__(51); /** * Emits only the first value (or the first value that meets some condition) * emitted by the source Observable. @@ -30945,7 +31093,7 @@ var FirstSubscriber = (function (_super) { //# sourceMappingURL=first.js.map /***/ }), -/* 258 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30959,8 +31107,8 @@ var Subscriber_1 = __webpack_require__(2); var Subscription_1 = __webpack_require__(8); var Observable_1 = __webpack_require__(0); var Subject_1 = __webpack_require__(9); -var Map_1 = __webpack_require__(580); -var FastMap_1 = __webpack_require__(582); +var Map_1 = __webpack_require__(581); +var FastMap_1 = __webpack_require__(583); /* tslint:enable:max-line-length */ /** * Groups the items emitted by an Observable according to a specified criterion, @@ -31227,7 +31375,7 @@ var InnerRefCountSubscription = (function (_super) { //# sourceMappingURL=groupBy.js.map /***/ }), -/* 259 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31238,7 +31386,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var noop_1 = __webpack_require__(61); +var noop_1 = __webpack_require__(62); /** * Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`. * @@ -31281,7 +31429,7 @@ var IgnoreElementsSubscriber = (function (_super) { //# sourceMappingURL=ignoreElements.js.map /***/ }), -/* 260 */ +/* 261 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31330,14 +31478,14 @@ var IsEmptySubscriber = (function (_super) { //# sourceMappingURL=isEmpty.js.map /***/ }), -/* 261 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var audit_1 = __webpack_require__(71); -var timer_1 = __webpack_require__(230); +var audit_1 = __webpack_require__(72); +var timer_1 = __webpack_require__(231); /** * Ignores source values for `duration` milliseconds, then emits the most recent * value from the source Observable, then repeats this process. @@ -31388,7 +31536,7 @@ exports.auditTime = auditTime; //# sourceMappingURL=auditTime.js.map /***/ }), -/* 262 */ +/* 263 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31399,7 +31547,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var EmptyError_1 = __webpack_require__(50); +var EmptyError_1 = __webpack_require__(51); /* tslint:enable:max-line-length */ /** * Returns an Observable that emits only the last item emitted by the source Observable. @@ -31513,7 +31661,7 @@ var LastSubscriber = (function (_super) { //# sourceMappingURL=last.js.map /***/ }), -/* 263 */ +/* 264 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31593,7 +31741,7 @@ var EverySubscriber = (function (_super) { //# sourceMappingURL=every.js.map /***/ }), -/* 264 */ +/* 265 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31662,7 +31810,7 @@ var MapToSubscriber = (function (_super) { //# sourceMappingURL=mapTo.js.map /***/ }), -/* 265 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31673,7 +31821,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var Notification_1 = __webpack_require__(28); +var Notification_1 = __webpack_require__(29); /** * Represents all of the notifications from the source Observable as `next` * emissions marked with their original types within {@link Notification} @@ -31760,12 +31908,12 @@ var MaterializeSubscriber = (function (_super) { //# sourceMappingURL=materialize.js.map /***/ }), -/* 266 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var reduce_1 = __webpack_require__(35); +var reduce_1 = __webpack_require__(36); /** * The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function), * and when source Observable completes it emits a single item: the item with the largest value. @@ -31807,13 +31955,13 @@ exports.max = max; //# sourceMappingURL=max.js.map /***/ }), -/* 267 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var merge_1 = __webpack_require__(46); -var merge_2 = __webpack_require__(46); +var merge_1 = __webpack_require__(47); +var merge_2 = __webpack_require__(47); exports.mergeStatic = merge_2.merge; /* tslint:enable:max-line-length */ /** @@ -31873,7 +32021,7 @@ exports.merge = merge; //# sourceMappingURL=merge.js.map /***/ }), -/* 268 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32034,7 +32182,7 @@ exports.MergeMapToSubscriber = MergeMapToSubscriber; //# sourceMappingURL=mergeMapTo.js.map /***/ }), -/* 269 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32169,12 +32317,12 @@ exports.MergeScanSubscriber = MergeScanSubscriber; //# sourceMappingURL=mergeScan.js.map /***/ }), -/* 270 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var reduce_1 = __webpack_require__(35); +var reduce_1 = __webpack_require__(36); /** * The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function), * and when source Observable completes it emits a single item: the item with the smallest value. @@ -32216,7 +32364,7 @@ exports.min = min; //# sourceMappingURL=min.js.map /***/ }), -/* 271 */ +/* 272 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32230,7 +32378,7 @@ var Subject_1 = __webpack_require__(9); var Observable_1 = __webpack_require__(0); var Subscriber_1 = __webpack_require__(2); var Subscription_1 = __webpack_require__(8); -var refCount_1 = __webpack_require__(74); +var refCount_1 = __webpack_require__(75); /** * @class ConnectableObservable */ @@ -32392,7 +32540,7 @@ var RefCountSubscriber = (function (_super) { //# sourceMappingURL=ConnectableObservable.js.map /***/ }), -/* 272 */ +/* 273 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32475,13 +32623,13 @@ var PairwiseSubscriber = (function (_super) { //# sourceMappingURL=pairwise.js.map /***/ }), -/* 273 */ +/* 274 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var not_1 = __webpack_require__(627); -var filter_1 = __webpack_require__(69); +var not_1 = __webpack_require__(628); +var filter_1 = __webpack_require__(70); /** * Splits the source Observable into two, one with values that satisfy a * predicate, and another with values that don't satisfy the predicate. @@ -32533,12 +32681,12 @@ exports.partition = partition; //# sourceMappingURL=partition.js.map /***/ }), -/* 274 */ +/* 275 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var map_1 = __webpack_require__(33); +var map_1 = __webpack_require__(34); /** * Maps each source value (an object) to its specified nested property. * @@ -32596,13 +32744,13 @@ function plucker(props, length) { //# sourceMappingURL=pluck.js.map /***/ }), -/* 275 */ +/* 276 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Subject_1 = __webpack_require__(9); -var multicast_1 = __webpack_require__(19); +var multicast_1 = __webpack_require__(20); /* tslint:enable:max-line-length */ /** * Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called @@ -32626,13 +32774,13 @@ exports.publish = publish; //# sourceMappingURL=publish.js.map /***/ }), -/* 276 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var BehaviorSubject_1 = __webpack_require__(277); -var multicast_1 = __webpack_require__(19); +var BehaviorSubject_1 = __webpack_require__(278); +var multicast_1 = __webpack_require__(20); /** * @param value * @return {ConnectableObservable} @@ -32646,7 +32794,7 @@ exports.publishBehavior = publishBehavior; //# sourceMappingURL=publishBehavior.js.map /***/ }), -/* 277 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32657,7 +32805,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subject_1 = __webpack_require__(9); -var ObjectUnsubscribedError_1 = __webpack_require__(41); +var ObjectUnsubscribedError_1 = __webpack_require__(42); /** * @class BehaviorSubject */ @@ -32701,13 +32849,13 @@ exports.BehaviorSubject = BehaviorSubject; //# sourceMappingURL=BehaviorSubject.js.map /***/ }), -/* 278 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ReplaySubject_1 = __webpack_require__(49); -var multicast_1 = __webpack_require__(19); +var ReplaySubject_1 = __webpack_require__(50); +var multicast_1 = __webpack_require__(20); /* tslint:enable:max-line-length */ function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) { if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') { @@ -32721,13 +32869,13 @@ exports.publishReplay = publishReplay; //# sourceMappingURL=publishReplay.js.map /***/ }), -/* 279 */ +/* 280 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var AsyncSubject_1 = __webpack_require__(42); -var multicast_1 = __webpack_require__(19); +var AsyncSubject_1 = __webpack_require__(43); +var multicast_1 = __webpack_require__(20); function publishLast() { return function (source) { return multicast_1.multicast(new AsyncSubject_1.AsyncSubject())(source); }; } @@ -32735,13 +32883,13 @@ exports.publishLast = publishLast; //# sourceMappingURL=publishLast.js.map /***/ }), -/* 280 */ +/* 281 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isArray_1 = __webpack_require__(16); -var race_1 = __webpack_require__(64); +var race_1 = __webpack_require__(65); /* tslint:enable:max-line-length */ /** * Returns an Observable that mirrors the first source Observable to emit an item @@ -32769,7 +32917,7 @@ exports.race = race; //# sourceMappingURL=race.js.map /***/ }), -/* 281 */ +/* 282 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32780,7 +32928,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var EmptyObservable_1 = __webpack_require__(18); +var EmptyObservable_1 = __webpack_require__(19); /** * Returns an Observable that repeats the stream of items emitted by the source Observable at most count times. * @@ -32847,7 +32995,7 @@ var RepeatSubscriber = (function (_super) { //# sourceMappingURL=repeat.js.map /***/ }), -/* 282 */ +/* 283 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32961,7 +33109,7 @@ var RepeatWhenSubscriber = (function (_super) { //# sourceMappingURL=repeatWhen.js.map /***/ }), -/* 283 */ +/* 284 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33032,7 +33180,7 @@ var RetrySubscriber = (function (_super) { //# sourceMappingURL=retry.js.map /***/ }), -/* 284 */ +/* 285 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33139,7 +33287,7 @@ var RetryWhenSubscriber = (function (_super) { //# sourceMappingURL=retryWhen.js.map /***/ }), -/* 285 */ +/* 286 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33233,7 +33381,7 @@ var SampleSubscriber = (function (_super) { //# sourceMappingURL=sample.js.map /***/ }), -/* 286 */ +/* 287 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33330,7 +33478,7 @@ function dispatchNotification(state) { //# sourceMappingURL=sampleTime.js.map /***/ }), -/* 287 */ +/* 288 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33500,13 +33648,13 @@ var SequenceEqualCompareToSubscriber = (function (_super) { //# sourceMappingURL=sequenceEqual.js.map /***/ }), -/* 288 */ +/* 289 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var multicast_1 = __webpack_require__(19); -var refCount_1 = __webpack_require__(74); +var multicast_1 = __webpack_require__(20); +var refCount_1 = __webpack_require__(75); var Subject_1 = __webpack_require__(9); function shareSubjectFactory() { return new Subject_1.Subject(); @@ -33531,12 +33679,12 @@ exports.share = share; //# sourceMappingURL=share.js.map /***/ }), -/* 289 */ +/* 290 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ReplaySubject_1 = __webpack_require__(49); +var ReplaySubject_1 = __webpack_require__(50); /** * @method shareReplay * @owner Observable @@ -33582,7 +33730,7 @@ function shareReplayOperator(bufferSize, windowTime, scheduler) { //# sourceMappingURL=shareReplay.js.map /***/ }), -/* 290 */ +/* 291 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33593,7 +33741,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var EmptyError_1 = __webpack_require__(50); +var EmptyError_1 = __webpack_require__(51); /** * Returns an Observable that emits the single item emitted by the source Observable that matches a specified * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no @@ -33681,7 +33829,7 @@ var SingleSubscriber = (function (_super) { //# sourceMappingURL=single.js.map /***/ }), -/* 291 */ +/* 292 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33738,7 +33886,7 @@ var SkipSubscriber = (function (_super) { //# sourceMappingURL=skip.js.map /***/ }), -/* 292 */ +/* 293 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33749,7 +33897,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var ArgumentOutOfRangeError_1 = __webpack_require__(34); +var ArgumentOutOfRangeError_1 = __webpack_require__(35); /** * Skip the last `count` values emitted by the source Observable. * @@ -33837,7 +33985,7 @@ var SkipLastSubscriber = (function (_super) { //# sourceMappingURL=skipLast.js.map /***/ }), -/* 293 */ +/* 294 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33914,7 +34062,7 @@ var SkipUntilSubscriber = (function (_super) { //# sourceMappingURL=skipUntil.js.map /***/ }), -/* 294 */ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33986,15 +34134,15 @@ var SkipWhileSubscriber = (function (_super) { //# sourceMappingURL=skipWhile.js.map /***/ }), -/* 295 */ +/* 296 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ArrayObservable_1 = __webpack_require__(17); -var ScalarObservable_1 = __webpack_require__(62); -var EmptyObservable_1 = __webpack_require__(18); -var concat_1 = __webpack_require__(27); +var ArrayObservable_1 = __webpack_require__(18); +var ScalarObservable_1 = __webpack_require__(63); +var EmptyObservable_1 = __webpack_require__(19); +var concat_1 = __webpack_require__(28); var isScheduler_1 = __webpack_require__(15); /* tslint:enable:max-line-length */ /** @@ -34040,13 +34188,13 @@ exports.startWith = startWith; //# sourceMappingURL=startWith.js.map /***/ }), -/* 296 */ +/* 297 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var AsapAction_1 = __webpack_require__(678); -var AsapScheduler_1 = __webpack_require__(680); +var AsapAction_1 = __webpack_require__(679); +var AsapScheduler_1 = __webpack_require__(681); /** * * Asap Scheduler @@ -34085,13 +34233,13 @@ exports.asap = new AsapScheduler_1.AsapScheduler(AsapAction_1.AsapAction); //# sourceMappingURL=asap.js.map /***/ }), -/* 297 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var switchMap_1 = __webpack_require__(75); -var identity_1 = __webpack_require__(229); +var switchMap_1 = __webpack_require__(76); +var identity_1 = __webpack_require__(230); function switchAll() { return switchMap_1.switchMap(identity_1.identity); } @@ -34099,7 +34247,7 @@ exports.switchAll = switchAll; //# sourceMappingURL=switchAll.js.map /***/ }), -/* 298 */ +/* 299 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34230,7 +34378,7 @@ var SwitchMapToSubscriber = (function (_super) { //# sourceMappingURL=switchMapTo.js.map /***/ }), -/* 299 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34241,8 +34389,8 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscriber_1 = __webpack_require__(2); -var ArgumentOutOfRangeError_1 = __webpack_require__(34); -var EmptyObservable_1 = __webpack_require__(18); +var ArgumentOutOfRangeError_1 = __webpack_require__(35); +var EmptyObservable_1 = __webpack_require__(19); /** * Emits only the first `count` values emitted by the source Observable. * @@ -34327,7 +34475,7 @@ var TakeSubscriber = (function (_super) { //# sourceMappingURL=take.js.map /***/ }), -/* 300 */ +/* 301 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34408,7 +34556,7 @@ var TakeUntilSubscriber = (function (_super) { //# sourceMappingURL=takeUntil.js.map /***/ }), -/* 301 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34506,7 +34654,7 @@ var TakeWhileSubscriber = (function (_super) { //# sourceMappingURL=takeWhile.js.map /***/ }), -/* 302 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34518,7 +34666,7 @@ var __extends = (this && this.__extends) || function (d, b) { }; var Subscriber_1 = __webpack_require__(2); var async_1 = __webpack_require__(6); -var throttle_1 = __webpack_require__(51); +var throttle_1 = __webpack_require__(52); /** * Emits a value from the source Observable, then ignores subsequent source * values for `duration` milliseconds, then repeats this process. @@ -34628,13 +34776,13 @@ function dispatchNext(arg) { //# sourceMappingURL=throttleTime.js.map /***/ }), -/* 303 */ +/* 304 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var timeInterval_1 = __webpack_require__(304); +var timeInterval_1 = __webpack_require__(305); exports.TimeInterval = timeInterval_1.TimeInterval; /** * @param scheduler @@ -34650,7 +34798,7 @@ exports.timeInterval = timeInterval; //# sourceMappingURL=timeInterval.js.map /***/ }), -/* 304 */ +/* 305 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34709,7 +34857,7 @@ var TimeIntervalSubscriber = (function (_super) { //# sourceMappingURL=timeInterval.js.map /***/ }), -/* 305 */ +/* 306 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34720,9 +34868,9 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var async_1 = __webpack_require__(6); -var isDate_1 = __webpack_require__(47); +var isDate_1 = __webpack_require__(48); var Subscriber_1 = __webpack_require__(2); -var TimeoutError_1 = __webpack_require__(306); +var TimeoutError_1 = __webpack_require__(307); /** * * Errors if Observable does not emit a value in given time span. @@ -34856,7 +35004,7 @@ var TimeoutSubscriber = (function (_super) { //# sourceMappingURL=timeout.js.map /***/ }), -/* 306 */ +/* 307 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34887,7 +35035,7 @@ exports.TimeoutError = TimeoutError; //# sourceMappingURL=TimeoutError.js.map /***/ }), -/* 307 */ +/* 308 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34898,7 +35046,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var async_1 = __webpack_require__(6); -var isDate_1 = __webpack_require__(47); +var isDate_1 = __webpack_require__(48); var OuterSubscriber_1 = __webpack_require__(4); var subscribeToResult_1 = __webpack_require__(5); /* tslint:enable:max-line-length */ @@ -35021,12 +35169,12 @@ var TimeoutWithSubscriber = (function (_super) { //# sourceMappingURL=timeoutWith.js.map /***/ }), -/* 308 */ +/* 309 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var reduce_1 = __webpack_require__(35); +var reduce_1 = __webpack_require__(36); function toArrayReducer(arr, item, index) { if (index === 0) { return [item]; @@ -35041,7 +35189,7 @@ exports.toArray = toArray; //# sourceMappingURL=toArray.js.map /***/ }), -/* 309 */ +/* 310 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35159,7 +35307,7 @@ var WindowSubscriber = (function (_super) { //# sourceMappingURL=window.js.map /***/ }), -/* 310 */ +/* 311 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35298,7 +35446,7 @@ var WindowCountSubscriber = (function (_super) { //# sourceMappingURL=windowCount.js.map /***/ }), -/* 311 */ +/* 312 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35311,7 +35459,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Subject_1 = __webpack_require__(9); var async_1 = __webpack_require__(6); var Subscriber_1 = __webpack_require__(2); -var isNumeric_1 = __webpack_require__(30); +var isNumeric_1 = __webpack_require__(31); var isScheduler_1 = __webpack_require__(15); function windowTime(windowTimeSpan) { var scheduler = async_1.async; @@ -35467,7 +35615,7 @@ function dispatchWindowClose(state) { //# sourceMappingURL=windowTime.js.map /***/ }), -/* 312 */ +/* 313 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35653,7 +35801,7 @@ var WindowToggleSubscriber = (function (_super) { //# sourceMappingURL=windowToggle.js.map /***/ }), -/* 313 */ +/* 314 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35788,7 +35936,7 @@ var WindowSubscriber = (function (_super) { //# sourceMappingURL=windowWhen.js.map /***/ }), -/* 314 */ +/* 315 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35926,12 +36074,12 @@ var WithLatestFromSubscriber = (function (_super) { //# sourceMappingURL=withLatestFrom.js.map /***/ }), -/* 315 */ +/* 316 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var zip_1 = __webpack_require__(48); +var zip_1 = __webpack_require__(49); function zipAll(project) { return function (source) { return source.lift(new zip_1.ZipOperator(project)); }; } @@ -35939,12 +36087,12 @@ exports.zipAll = zipAll; //# sourceMappingURL=zipAll.js.map /***/ }), -/* 316 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var SubscriptionLog_1 = __webpack_require__(317); +var SubscriptionLog_1 = __webpack_require__(318); var SubscriptionLoggable = (function () { function SubscriptionLoggable() { this.subscriptions = []; @@ -35964,7 +36112,7 @@ exports.SubscriptionLoggable = SubscriptionLoggable; //# sourceMappingURL=SubscriptionLoggable.js.map /***/ }), -/* 317 */ +/* 318 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35981,7 +36129,7 @@ exports.SubscriptionLog = SubscriptionLog; //# sourceMappingURL=SubscriptionLog.js.map /***/ }), -/* 318 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36000,7 +36148,7 @@ exports.applyMixins = applyMixins; //# sourceMappingURL=applyMixins.js.map /***/ }), -/* 319 */ +/* 320 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36010,8 +36158,8 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var AsyncAction_1 = __webpack_require__(31); -var AsyncScheduler_1 = __webpack_require__(32); +var AsyncAction_1 = __webpack_require__(32); +var AsyncScheduler_1 = __webpack_require__(33); var VirtualTimeScheduler = (function (_super) { __extends(VirtualTimeScheduler, _super); function VirtualTimeScheduler(SchedulerAction, maxFrames) { @@ -36119,18 +36267,18 @@ exports.VirtualAction = VirtualAction; //# sourceMappingURL=VirtualTimeScheduler.js.map /***/ }), -/* 320 */ +/* 321 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const ansiRegex = __webpack_require__(736); +const ansiRegex = __webpack_require__(738); module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; /***/ }), -/* 321 */ +/* 322 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36160,15 +36308,32 @@ function getProjectPaths(rootPath, options) { projectPaths.push((0, _path.resolve)(rootPath, '../kibana-extra/*/plugins/*')); } return projectPaths; -} +} /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ /***/ }), -/* 322 */ +/* 323 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const NestedError = __webpack_require__(323); +const NestedError = __webpack_require__(324); class CpFileError extends NestedError { constructor(message, nested) { @@ -36182,10 +36347,10 @@ module.exports = CpFileError; /***/ }), -/* 323 */ +/* 324 */ /***/ (function(module, exports, __webpack_require__) { -var inherits = __webpack_require__(79); +var inherits = __webpack_require__(82); var NestedError = function (message, nested) { this.nested = nested; @@ -36236,7 +36401,7 @@ module.exports = NestedError; /***/ }), -/* 324 */ +/* 325 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36246,7 +36411,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _cli = __webpack_require__(325); +var _cli = __webpack_require__(326); Object.defineProperty(exports, 'run', { enumerable: true, @@ -36255,7 +36420,7 @@ Object.defineProperty(exports, 'run', { } }); -var _production = __webpack_require__(740); +var _production = __webpack_require__(741); Object.defineProperty(exports, 'buildProductionProjects', { enumerable: true, @@ -36270,7 +36435,7 @@ Object.defineProperty(exports, 'prepareExternalProjectDependencies', { } }); -var _package_json = __webpack_require__(37); +var _package_json = __webpack_require__(38); Object.defineProperty(exports, 'transformDependencies', { enumerable: true, @@ -36280,7 +36445,7 @@ Object.defineProperty(exports, 'transformDependencies', { }); /***/ }), -/* 325 */ +/* 326 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36297,14 +36462,14 @@ let run = exports.run = (() => { // starts forwarding the `--` directly to this script, see // https://github.com/yarnpkg/yarn/blob/b2d3e1a8fe45ef376b716d597cc79b38702a9320/src/cli/index.js#L174-L182 if (argv.includes('--')) { - console.log(_chalk2.default.red(`Using "--" is not allowed, as it doesn't work with 'yarn kbn'.`)); + _log.log.write(_chalk2.default.red(`Using "--" is not allowed, as it doesn't work with 'yarn kbn'.`)); process.exit(1); } const options = (0, _getopts2.default)(argv, { alias: { + e: 'exclude', h: 'help', - i: 'include', - e: 'exclude' + i: 'include' } }); const args = options._; @@ -36320,7 +36485,7 @@ let run = exports.run = (() => { const commandOptions = { options, extraArgs, rootPath }; const command = _commands.commands[commandName]; if (command === undefined) { - console.log(_chalk2.default.red(`[${commandName}] is not a valid command, see 'kbn --help'`)); + _log.log.write(_chalk2.default.red(`[${commandName}] is not a valid command, see 'kbn --help'`)); process.exit(1); } yield (0, _run.runCommand)(command, commandOptions); @@ -36331,31 +36496,51 @@ let run = exports.run = (() => { }; })(); -var _getopts = __webpack_require__(326); +var _chalk = __webpack_require__(14); -var _getopts2 = _interopRequireDefault(_getopts); +var _chalk2 = _interopRequireDefault(_chalk); -var _dedent = __webpack_require__(327); +var _dedent = __webpack_require__(336); var _dedent2 = _interopRequireDefault(_dedent); -var _chalk = __webpack_require__(14); +var _getopts = __webpack_require__(337); -var _chalk2 = _interopRequireDefault(_chalk); +var _getopts2 = _interopRequireDefault(_getopts); var _path = __webpack_require__(3); -var _commands = __webpack_require__(337); +var _commands = __webpack_require__(338); -var _run = __webpack_require__(733); +var _run = __webpack_require__(734); + +var _log = __webpack_require__(17); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + function help() { const availableCommands = Object.keys(_commands.commands).map(commandName => _commands.commands[commandName]).map(command => `${command.name} - ${command.description}`); - console.log(_dedent2.default` + _log.log.write(_dedent2.default` usage: kbn [] By default commands are run for Kibana itself, all packages in the 'packages/' @@ -36374,174 +36559,6 @@ function help() { `); } -/***/ }), -/* 326 */ -/***/ (function(module, exports) { - -const SHORTSPLIT = /$|[!-@\[-`{-~].*/g -const EMPTY = [] - -function array(any) { - return Array.isArray(any) ? any : [any] -} - -function aliases(aliases) { - var out = {} - - for (var key in aliases) { - var alias = (out[key] = array(aliases[key])) - - for (var i = 0, len = alias.length; i < len; i++) { - var curr = (out[alias[i]] = [key]) - - for (var j = 0; j < len; j++) { - if (i !== j) { - curr.push(alias[j]) - } - } - } - } - - return out -} - -function booleans(aliases, booleans) { - var out = {} - - if (booleans !== undefined) { - for (var i = 0, len = booleans.length; i < len; i++) { - var key = booleans[i] - var alias = aliases[key] - - out[key] = true - - if (alias === undefined) { - aliases[key] = EMPTY - } else { - for (var j = 0, end = alias.length; j < end; j++) { - out[alias[j]] = true - } - } - } - } - - return out -} - -function defaults(aliases, defaults) { - var out = {} - - for (var key in defaults) { - var value = defaults[key] - var alias = aliases[key] - - if (out[key] === undefined) { - out[key] = value - - if (alias === undefined) { - aliases[key] = EMPTY - } else { - for (var i = 0, len = alias.length; i < len; i++) { - out[alias[i]] = value - } - } - } - } - - return out -} - -function set(out, key, value, aliases, unknown) { - var curr = out[key] - var alias = aliases[key] - var known = alias !== undefined - - if (known || unknown === undefined || false !== unknown(key)) { - if (curr === undefined) { - out[key] = value - } else { - if (Array.isArray(curr)) { - curr.push(value) - } else { - out[key] = [curr, value] - } - } - - if (known) { - for (var i = 0, len = alias.length; i < len; ) { - out[alias[i++]] = out[key] - } - } - } -} - -module.exports = function(argv, opts) { - var unknown = (opts = opts || {}).unknown - var alias = aliases(opts.alias) - var values = defaults(alias, opts.default) - var bools = booleans(alias, opts.boolean) - var out = { _: [] } - - for (var i = 0, j = 0, len = argv.length, _ = out._; i < len; i++) { - var arg = argv[i] - - if (arg === "--") { - while (++i < len) { - _.push(argv[i]) - } - } else if (arg === "-" || arg[0] !== "-") { - _.push(arg) - } else { - if (arg[1] === "-") { - var end = arg.indexOf("=", 2) - - if (0 <= end) { - set(out, arg.slice(2, end), arg.slice(end + 1), alias, unknown) - } else { - if ("n" === arg[2] && "o" === arg[3] && "-" === arg[4]) { - set(out, arg.slice(5), false, alias, unknown) - } else { - var key = arg.slice(2) - set( - out, - key, - len === (j = i + 1) || - argv[j][0] === "-" || - bools[key] !== undefined || - argv[(i = j)], - alias, - unknown - ) - } - } - } else { - SHORTSPLIT.lastIndex = 2 - var match = SHORTSPLIT.exec(arg) - var end = match.index - var value = - match[0] || - len === (j = i + 1) || - argv[j][0] === "-" || - bools[arg[end - 1]] !== undefined || - argv[(i = j)] - - for (j = 1; j < end; ) { - set(out, arg[j], ++j !== end || value, alias, unknown) - } - } - } - } - - for (var key in values) { - if (out[key] === undefined) { - out[key] = values[key] - } - } - - return out -} - - /***/ }), /* 327 */ /***/ (function(module, exports, __webpack_require__) { @@ -36549,72 +36566,6 @@ module.exports = function(argv, opts) { "use strict"; -function dedent(strings) { - - var raw = void 0; - if (typeof strings === "string") { - // dedent can be used as a plain function - raw = [strings]; - } else { - raw = strings.raw; - } - - // first, perform interpolation - var result = ""; - for (var i = 0; i < raw.length; i++) { - result += raw[i]. - // join lines when there is a suppressed newline - replace(/\\\n[ \t]*/g, ""). - - // handle escaped backticks - replace(/\\`/g, "`"); - - if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) { - result += arguments.length <= i + 1 ? undefined : arguments[i + 1]; - } - } - - // now strip indentation - var lines = result.split("\n"); - var mindent = null; - lines.forEach(function (l) { - var m = l.match(/^(\s+)\S+/); - if (m) { - var indent = m[1].length; - if (!mindent) { - // this is the first indented line - mindent = indent; - } else { - mindent = Math.min(mindent, indent); - } - } - }); - - if (mindent !== null) { - result = lines.map(function (l) { - return l[0] === " " ? l.slice(mindent) : l; - }).join("\n"); - } - - // dedent eats leading and trailing whitespace too - result = result.trim(); - - // handle escaped newlines at the end to ensure they don't get stripped too - return result.replace(/\\n/g, "\n"); -} - -if (true) { - module.exports = dedent; -} - - -/***/ }), -/* 328 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; module.exports = function (str) { @@ -36627,12 +36578,12 @@ module.exports = function (str) { /***/ }), -/* 329 */ +/* 328 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(330); +const colorConvert = __webpack_require__(329); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -36784,14 +36735,14 @@ Object.defineProperty(module, 'exports', { get: assembleStyles }); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(52)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(53)(module))) /***/ }), -/* 330 */ +/* 329 */ /***/ (function(module, exports, __webpack_require__) { -var conversions = __webpack_require__(77); -var route = __webpack_require__(332); +var conversions = __webpack_require__(78); +var route = __webpack_require__(331); var convert = {}; @@ -36871,7 +36822,7 @@ module.exports = convert; /***/ }), -/* 331 */ +/* 330 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37030,10 +36981,10 @@ module.exports = { /***/ }), -/* 332 */ +/* 331 */ /***/ (function(module, exports, __webpack_require__) { -var conversions = __webpack_require__(77); +var conversions = __webpack_require__(78); /* this function routes a model to all other models. @@ -37133,13 +37084,13 @@ module.exports = function (fromModel) { /***/ }), -/* 333 */ +/* 332 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__(334); -const hasFlag = __webpack_require__(335); +const os = __webpack_require__(333); +const hasFlag = __webpack_require__(334); const env = process.env; @@ -37269,13 +37220,13 @@ module.exports = { /***/ }), -/* 334 */ +/* 333 */ /***/ (function(module, exports) { module.exports = require("os"); /***/ }), -/* 335 */ +/* 334 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37290,7 +37241,7 @@ module.exports = (flag, argv) => { /***/ }), -/* 336 */ +/* 335 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37424,35 +37375,287 @@ module.exports = (chalk, tmp) => { }; +/***/ }), +/* 336 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function dedent(strings) { + + var raw = void 0; + if (typeof strings === "string") { + // dedent can be used as a plain function + raw = [strings]; + } else { + raw = strings.raw; + } + + // first, perform interpolation + var result = ""; + for (var i = 0; i < raw.length; i++) { + result += raw[i]. + // join lines when there is a suppressed newline + replace(/\\\n[ \t]*/g, ""). + + // handle escaped backticks + replace(/\\`/g, "`"); + + if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) { + result += arguments.length <= i + 1 ? undefined : arguments[i + 1]; + } + } + + // now strip indentation + var lines = result.split("\n"); + var mindent = null; + lines.forEach(function (l) { + var m = l.match(/^(\s+)\S+/); + if (m) { + var indent = m[1].length; + if (!mindent) { + // this is the first indented line + mindent = indent; + } else { + mindent = Math.min(mindent, indent); + } + } + }); + + if (mindent !== null) { + result = lines.map(function (l) { + return l[0] === " " ? l.slice(mindent) : l; + }).join("\n"); + } + + // dedent eats leading and trailing whitespace too + result = result.trim(); + + // handle escaped newlines at the end to ensure they don't get stripped too + return result.replace(/\\n/g, "\n"); +} + +if (true) { + module.exports = dedent; +} + + /***/ }), /* 337 */ +/***/ (function(module, exports) { + +const SHORTSPLIT = /$|[!-@\[-`{-~].*/g +const EMPTY = [] + +function array(any) { + return Array.isArray(any) ? any : [any] +} + +function aliases(aliases) { + var out = {} + + for (var key in aliases) { + var alias = (out[key] = array(aliases[key])) + + for (var i = 0, len = alias.length; i < len; i++) { + var curr = (out[alias[i]] = [key]) + + for (var j = 0; j < len; j++) { + if (i !== j) { + curr.push(alias[j]) + } + } + } + } + + return out +} + +function booleans(aliases, booleans) { + var out = {} + + if (booleans !== undefined) { + for (var i = 0, len = booleans.length; i < len; i++) { + var key = booleans[i] + var alias = aliases[key] + + out[key] = true + + if (alias === undefined) { + aliases[key] = EMPTY + } else { + for (var j = 0, end = alias.length; j < end; j++) { + out[alias[j]] = true + } + } + } + } + + return out +} + +function defaults(aliases, defaults) { + var out = {} + + for (var key in defaults) { + var value = defaults[key] + var alias = aliases[key] + + if (out[key] === undefined) { + out[key] = value + + if (alias === undefined) { + aliases[key] = EMPTY + } else { + for (var i = 0, len = alias.length; i < len; i++) { + out[alias[i]] = value + } + } + } + } + + return out +} + +function set(out, key, value, aliases, unknown) { + var curr = out[key] + var alias = aliases[key] + var known = alias !== undefined + + if (known || unknown === undefined || false !== unknown(key)) { + if (curr === undefined) { + out[key] = value + } else { + if (Array.isArray(curr)) { + curr.push(value) + } else { + out[key] = [curr, value] + } + } + + if (known) { + for (var i = 0, len = alias.length; i < len; ) { + out[alias[i++]] = out[key] + } + } + } +} + +module.exports = function(argv, opts) { + var unknown = (opts = opts || {}).unknown + var alias = aliases(opts.alias) + var values = defaults(alias, opts.default) + var bools = booleans(alias, opts.boolean) + var out = { _: [] } + + for (var i = 0, j = 0, len = argv.length, _ = out._; i < len; i++) { + var arg = argv[i] + + if (arg === "--") { + while (++i < len) { + _.push(argv[i]) + } + } else if (arg === "-" || arg[0] !== "-") { + _.push(arg) + } else { + if (arg[1] === "-") { + var end = arg.indexOf("=", 2) + + if (0 <= end) { + set(out, arg.slice(2, end), arg.slice(end + 1), alias, unknown) + } else { + if ("n" === arg[2] && "o" === arg[3] && "-" === arg[4]) { + set(out, arg.slice(5), false, alias, unknown) + } else { + var key = arg.slice(2) + set( + out, + key, + len === (j = i + 1) || + argv[j][0] === "-" || + bools[key] !== undefined || + argv[(i = j)], + alias, + unknown + ) + } + } + } else { + SHORTSPLIT.lastIndex = 2 + var match = SHORTSPLIT.exec(arg) + var end = match.index + var value = + match[0] || + len === (j = i + 1) || + argv[j][0] === "-" || + bools[arg[end - 1]] !== undefined || + argv[(i = j)] + + for (j = 1; j < end; ) { + set(out, arg[j], ++j !== end || value, alias, unknown) + } + } + } + } + + for (var key in values) { + if (out[key] === undefined) { + out[key] = values[key] + } + } + + return out +} + + +/***/ }), +/* 338 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { - value: true + value: true }); exports.commands = undefined; -var _bootstrap = __webpack_require__(338); +var _bootstrap = __webpack_require__(339); -var _clean = __webpack_require__(418); +var _clean = __webpack_require__(419); -var _run = __webpack_require__(436); +var _run = __webpack_require__(437); -var _watch = __webpack_require__(437); +var _watch = __webpack_require__(438); +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ const commands = exports.commands = { - bootstrap: _bootstrap.BootstrapCommand, - clean: _clean.CleanCommand, - run: _run.RunCommand, - watch: _watch.WatchCommand + bootstrap: _bootstrap.BootstrapCommand, + clean: _clean.CleanCommand, + run: _run.RunCommand, + watch: _watch.WatchCommand }; /***/ }), -/* 338 */ +/* 339 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37467,25 +37670,45 @@ var _chalk = __webpack_require__(14); var _chalk2 = _interopRequireDefault(_chalk); -var _projects = __webpack_require__(22); +var _link_project_executables = __webpack_require__(340); + +var _log = __webpack_require__(17); -var _link_project_executables = __webpack_require__(416); +var _parallelize = __webpack_require__(55); -var _parallelize = __webpack_require__(59); +var _projects = __webpack_require__(25); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + const BootstrapCommand = exports.BootstrapCommand = { - name: 'bootstrap', description: 'Install dependencies and crosslink projects', + name: 'bootstrap', run(projects, projectGraph, { options }) { return _asyncToGenerator(function* () { const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); const frozenLockfile = options['frozen-lockfile'] === true; const extraArgs = frozenLockfile ? ['--frozen-lockfile'] : []; - console.log(_chalk2.default.bold('\nRunning installs in topological order:')); + _log.log.write(_chalk2.default.bold('\nRunning installs in topological order:')); for (const batch of batchedProjects) { for (const project of batch) { if (project.hasDependencies()) { @@ -37493,7 +37716,7 @@ const BootstrapCommand = exports.BootstrapCommand = { } } } - console.log(_chalk2.default.bold('\nInstalls completed, linking package executables:\n')); + _log.log.write(_chalk2.default.bold('\nInstalls completed, linking package executables:\n')); yield (0, _link_project_executables.linkProjectExecutables)(projects, projectGraph); /** * At the end of the bootstrapping process we call all `kbn:bootstrap` scripts @@ -37501,7 +37724,7 @@ const BootstrapCommand = exports.BootstrapCommand = { * transpiled before they can be used. Ideally we shouldn't do this unless we * have to, as it will slow down the bootstrapping process. */ - console.log(_chalk2.default.bold('\nLinking executables completed, running `kbn:bootstrap` scripts\n')); + _log.log.write(_chalk2.default.bold('\nLinking executables completed, running `kbn:bootstrap` scripts\n')); yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { var _ref = _asyncToGenerator(function* (pkg) { if (pkg.hasScript('kbn:bootstrap')) { @@ -37513,7513 +37736,4749 @@ const BootstrapCommand = exports.BootstrapCommand = { return _ref.apply(this, arguments); }; })()); - console.log(_chalk2.default.green.bold('\nBootstrapping completed!\n')); + _log.log.write(_chalk2.default.green.bold('\nBootstrapping completed!\n')); })(); } }; /***/ }), -/* 339 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var pathModule = __webpack_require__(3); -var isWindows = process.platform === 'win32'; -var fs = __webpack_require__(7); +"use strict"; -// JavaScript implementation of realpath, ported from node pre-v6 -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.linkProjectExecutables = undefined; -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; +/** + * Yarn does not link the executables from dependencies that are installed + * using `link:` https://github.com/yarnpkg/yarn/pull/5046 + * + * We simulate this functionality by walking through each project's project + * dependencies, and manually linking their executables if defined. The logic + * for linking was mostly adapted from lerna: https://github.com/lerna/lerna/blob/1d7eb9eeff65d5a7de64dea73613b1bf6bfa8d57/src/PackageUtilities.js#L348 + */ +let linkProjectExecutables = exports.linkProjectExecutables = (() => { + var _ref = _asyncToGenerator(function* (projectsByName, projectGraph) { + for (const [projectName, projectDeps] of projectGraph) { + const project = projectsByName.get(projectName); + const binsDir = (0, _path.resolve)(project.nodeModulesLocation, '.bin'); + for (const projectDep of projectDeps) { + const executables = projectDep.getExecutables(); + for (const name of Object.keys(executables)) { + const srcPath = executables[name]; + // existing logic from lerna -- ensure that the bin we are going to + // point to exists or ignore it + if (!(yield (0, _fs.isFile)(srcPath))) { + continue; + } + const dest = (0, _path.resolve)(binsDir, name); + // Get relative project path with normalized path separators. + const projectRelativePath = (0, _path.relative)(project.path, srcPath).split(_path.sep).join('/'); + _log.log.write(_chalk2.default`{dim [${project.name}]} ${name} -> {dim ${projectRelativePath}}`); + yield (0, _fs.mkdirp)((0, _path.dirname)(dest)); + yield (0, _fs.createSymlink)(srcPath, dest, 'exec'); + yield (0, _fs.chmod)(dest, '755'); + } + } + } + }); - return callback; + return function linkProjectExecutables(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } +var _path = __webpack_require__(3); - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} +var _chalk = __webpack_require__(14); -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} +var _chalk2 = _interopRequireDefault(_chalk); -var normalize = pathModule.normalize; +var _fs = __webpack_require__(54); -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} +var _log = __webpack_require__(17); -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } +/***/ }), +/* 341 */ +/***/ (function(module, exports, __webpack_require__) { - var original = p, - seenLinks = {}, - knownHard = {}; +// On windows, create a .cmd file. +// Read the #! in the file to see what it uses. The vast majority +// of the time, this will be either: +// "#!/usr/bin/env " +// or: +// "#! " +// +// Write a binroot/pkg.bin + ".cmd" file that has this line in it: +// @ %~dp0 %* - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; +module.exports = cmdShim +cmdShim.ifExists = cmdShimIfExists - start(); +var fs = __webpack_require__(23) - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; +var mkdir = __webpack_require__(80) + , path = __webpack_require__(3) + , shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/ - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } +function cmdShimIfExists (from, to, cb) { + fs.stat(from, function (er) { + if (er) return cb() + cmdShim(from, to, cb) + }) +} - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; +// Try to unlink, but ignore errors. +// Any problems will surface later. +function rm (path, cb) { + fs.unlink(path, function(er) { + cb() + }) +} - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } +function cmdShim (from, to, cb) { + fs.stat(from, function (er, stat) { + if (er) + return cb(er) - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } + cmdShim_(from, to, cb) + }) +} - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } +function cmdShim_ (from, to, cb) { + var then = times(2, next, cb) + rm(to, then) + rm(to + ".cmd", then) - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); + function next(er) { + writeShim(from, to, cb) } +} - if (cache) cache[original] = p; - - return p; -}; - +function writeShim (from, to, cb) { + // make a cmd file and a sh script + // First, check if the bin is a #! of some sort. + // If not, then assume it's something that'll be compiled, or some other + // sort of script, and just call it directly. + mkdir(path.dirname(to), function (er) { + if (er) + return cb(er) + fs.readFile(from, "utf8", function (er, data) { + if (er) return writeShim_(from, to, null, null, cb) + var firstLine = data.trim().split(/\r*\n/)[0] + , shebang = firstLine.match(shebangExpr) + if (!shebang) return writeShim_(from, to, null, null, cb) + var prog = shebang[1] + , args = shebang[2] || "" + return writeShim_(from, to, prog, args, cb) + }) + }) +} -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; +function writeShim_ (from, to, prog, args, cb) { + var shTarget = path.relative(path.dirname(to), from) + , target = shTarget.split("/").join("\\") + , longProg + , shProg = prog && prog.split("\\").join("/") + , shLongProg + shTarget = shTarget.split("\\").join("/") + args = args || "" + if (!prog) { + prog = "\"%~dp0\\" + target + "\"" + shProg = "\"$basedir/" + shTarget + "\"" + args = "" + target = "" + shTarget = "" + } else { + longProg = "\"%~dp0\\" + prog + ".exe\"" + shLongProg = "\"$basedir/" + prog + "\"" + target = "\"%~dp0\\" + target + "\"" + shTarget = "\"$basedir/" + shTarget + "\"" } - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); + // @IF EXIST "%~dp0\node.exe" ( + // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* + // ) ELSE ( + // SETLOCAL + // SET PATHEXT=%PATHEXT:;.JS;=;% + // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* + // ) + var cmd + if (longProg) { + cmd = "@IF EXIST " + longProg + " (\r\n" + + " " + longProg + " " + args + " " + target + " %*\r\n" + + ") ELSE (\r\n" + + " @SETLOCAL\r\n" + + " @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n" + + " " + prog + " " + args + " " + target + " %*\r\n" + + ")" + } else { + cmd = "@" + prog + " " + args + " " + target + " %*\r\n" } - var original = p, - seenLinks = {}, - knownHard = {}; + // #!/bin/sh + // basedir=`dirname "$0"` + // + // case `uname` in + // *CYGWIN*) basedir=`cygpath -w "$basedir"`;; + // esac + // + // if [ -x "$basedir/node.exe" ]; then + // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@" + // ret=$? + // else + // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" + // ret=$? + // fi + // exit $ret - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; + var sh = "#!/bin/sh\n" - start(); + if (shLongProg) { + sh = sh + + "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n" + + "\n" + + "case `uname` in\n" + + " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n" + + "esac\n" + + "\n" - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; + sh = sh + + "if [ -x "+shLongProg+" ]; then\n" + + " " + shLongProg + " " + args + " " + shTarget + " \"$@\"\n" + + " ret=$?\n" + + "else \n" + + " " + shProg + " " + args + " " + shTarget + " \"$@\"\n" + + " ret=$?\n" + + "fi\n" + + "exit $ret\n" + } else { + sh = shProg + " " + args + " " + shTarget + " \"$@\"\n" + + "exit $?\n" + } - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } + var then = times(2, next, cb) + fs.writeFile(to + ".cmd", cmd, "utf8", then) + fs.writeFile(to, sh, "utf8", then) + function next () { + chmodShim(to, cb) } +} - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); +function chmodShim (to, cb) { + var then = times(2, cb, cb) + fs.chmod(to, 0755, then) + fs.chmod(to + ".cmd", 0755, then) +} + +function times(n, ok, cb) { + var errState = null + return function(er) { + if (!errState) { + if (er) + cb(errState = er) + else if (--n === 0) + ok() } + } +} - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } +/***/ }), +/* 342 */ +/***/ (function(module, exports, __webpack_require__) { - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } +var fs = __webpack_require__(79) +var constants = __webpack_require__(343) - return fs.lstat(base, gotStat); - } +var origCwd = process.cwd +var cwd = null - function gotStat(err, stat) { - if (err) return cb(err); +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } +module.exports = patch - function gotTarget(err, target, base) { - if (err) return cb(err); +function patch (fs) { + // (re-)implement some things that are known busted or missing. - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) } - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) } -}; - -/***/ }), -/* 340 */ -/***/ (function(module, exports, __webpack_require__) { + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. -var concatMap = __webpack_require__(341); -var balanced = __webpack_require__(342); + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) -module.exports = expandTop; + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. - var parts = []; - var m = balanced('{', '}', str); + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } - if (!m) - return str.split(','); + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + }})(fs.read) - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) +} - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); +function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) } - parts.push.apply(parts, p); + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - return parts; + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } } -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } +function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } - return expand(escapeBraces(str), true).map(unescapeBraces); -} + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } -function identity(e) { - return e; + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } } -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); +function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } } -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; +function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } } -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) } +} - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er } } +} - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - var N; +function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, cb) { + return orig.call(fs, target, function (er, stats) { + if (!stats) return cb.apply(this, arguments) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + if (cb) cb.apply(this, arguments) + }) + } +} - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); +function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target) { + var stats = orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } +} - N = []; +// ENOSYS means that the fs doesn't support the op. Just ignore +// that, because it doesn't matter. +// +// if there's no getuid, or if getuid() is something other +// than 0, and the error is EINVAL or EPERM, then just ignore +// it. +// +// This specific case is a silent failure in cp, install, tar, +// and most other unix tools that manage permissions. +// +// When running as root, or if other types of errors are +// encountered, then it's strict. +function chownErOk (er) { + if (!er) + return true - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } + if (er.code === "ENOSYS") + return true - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true } - return expansions; + return false } - /***/ }), -/* 341 */ +/* 343 */ /***/ (function(module, exports) { -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - +module.exports = require("constants"); /***/ }), -/* 342 */ +/* 344 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var Stream = __webpack_require__(21).Stream -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); +module.exports = legacy - var r = range(a, b, str); +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} + Stream.call(this); -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; + var self = this; - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; - bi = str.indexOf(b, i + 1); - } + options = options || {}; - i = ai < bi && ai >= 0 ? ai : bi; + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; } - if (begs.length) { - result = [ left, right ]; - } - } + if (this.encoding) this.setEncoding(this.encoding); - return result; -} + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + if (this.start > this.end) { + throw new Error('start must be <= end'); + } -/***/ }), -/* 343 */ -/***/ (function(module, exports) { + this.pos = this.start; + } -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } -/***/ }), -/* 344 */ -/***/ (function(module, exports, __webpack_require__) { + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } -module.exports = globSync -globSync.GlobSync = GlobSync + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); -var fs = __webpack_require__(7) -var rp = __webpack_require__(78) -var minimatch = __webpack_require__(53) -var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__(23).Glob -var util = __webpack_require__(13) -var path = __webpack_require__(3) -var assert = __webpack_require__(24) -var isAbsolute = __webpack_require__(54) -var common = __webpack_require__(80) -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored + Stream.call(this); -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') + this.path = path; + this.fd = null; + this.writable = true; - return new GlobSync(pattern, options).found -} + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') + options = options || {}; - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } - setopts(this, pattern, options) + this.pos = this.start; + } - if (this.noprocess) - return this + this.busy = false; + this._queue = []; - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } } - this._finish() } -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} +/***/ }), +/* 345 */ +/***/ (function(module, exports, __webpack_require__) { -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. +var pathModule = __webpack_require__(3); +var isWindows = process.platform === 'win32'; +var fs = __webpack_require__(7); - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return +// JavaScript implementation of realpath, ported from node pre-v6 - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } } - var remain = pattern.slice(n) + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} - var abs = this._makeAbs(read) +var normalize = pathModule.normalize; - //if ignored, skip processing - if (childrenIgnored(this, read)) - return +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; } +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } - // if the abs isn't a dir, then nothing can match! - if (!entries) - return + var original = p, + seenLinks = {}, + knownHard = {}; - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; } } - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; } - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } } - this._emitMatch(index, e) + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; } - // This was the last one, and no stats were needed - return - } - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); } -} - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return + if (cache) cache[original] = p; - var abs = this._makeAbs(e) + return p; +}; - if (this.mark) - e = this._mark(e) - if (this.absolute) { - e = abs +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; } - if (this.matches[index][e]) - return + // make p is absolute + p = pathModule.resolve(p); - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); } - this.matches[index][e] = true + var original = p, + seenLinks = {}, + knownHard = {}; - if (this.stat) - this._stat(e) -} + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + start(); -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); } } - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } - if (Array.isArray(c)) - return c + return fs.lstat(base, gotStat); } - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} + function gotStat(err, stat) { + if (err) return cb(err); -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); } - } - this.cache[abs] = entries + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); - // mark and cache dir-ness - return entries -} + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break + function gotTarget(err, target, base) { + if (err) return cb(err); - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); } -} +}; -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) +/***/ }), +/* 346 */ +/***/ (function(module, exports, __webpack_require__) { - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return +var concatMap = __webpack_require__(347); +var balanced = __webpack_require__(348); - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) +module.exports = expandTop; - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; - var len = entries.length - var isSym = this.symlinks[abs] +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) + var parts = []; + var m = balanced('{', '}', str); - if (!this.matches[index]) - this.matches[index] = Object.create(null) + if (!m) + return str.split(','); - // If it doesn't exist, then just mark the lack of results - if (!exists) - return + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); } - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') + parts.push.apply(parts, p); - // Mark this as a match - this._emitMatch(index, prefix) + return parts; } -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' +function expandTop(str) { + if (!str) + return []; - if (f.length > this.maxLength) - return false + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] + return expand(escapeBraces(str), true).map(unescapeBraces); +} - if (Array.isArray(c)) - c = 'DIR' +function identity(e) { + return e; +} - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} - if (needDir && c === 'FILE') - return false +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } +function expand(str, isTop) { + var expansions = []; - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); } + return [str]; + } - if (lstat && lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); } - } else { - stat = lstat } } - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. - if (needDir && c === 'FILE') - return false + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; - return c -} + var N; -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} + N = []; + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } -/***/ }), -/* 345 */ -/***/ (function(module, exports, __webpack_require__) { + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } -var wrappy = __webpack_require__(81) -var reqs = Object.create(null) -var once = __webpack_require__(82) + return expansions; +} -module.exports = wrappy(inflight) -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) +/***/ }), +/* 347 */ +/***/ (function(module, exports) { - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); } - }) -} - -function slice (args) { - var length = args.length - var array = [] + return res; +}; - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; /***/ }), -/* 346 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.runScriptInPackage = exports.installInDir = undefined; - -/** - * Install all dependencies in the given directory - */ -let installInDir = exports.installInDir = (() => { - var _ref = _asyncToGenerator(function* (directory, extraArgs = []) { - const options = ['install', '--non-interactive', '--mutex file', ...extraArgs]; - // We pass the mutex flag to ensure only one instance of yarn runs at any - // given time (e.g. to avoid conflicts). - yield (0, _child_process.spawn)('yarn', options, { - cwd: directory - }); - }); + var r = range(a, b, str); - return function installInDir(_x) { - return _ref.apply(this, arguments); - }; -})(); -/** - * Run script in the given directory - */ + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} -let runScriptInPackage = exports.runScriptInPackage = (() => { - var _ref2 = _asyncToGenerator(function* (script, args, pkg) { - const execOpts = { - cwd: pkg.path - }; - yield (0, _child_process.spawn)('yarn', ['run', script, ...args], execOpts); - }); +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; - return function runScriptInPackage(_x2, _x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); -/** - * Run script in the given directory - */ + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } -exports.runScriptInPackageStreaming = runScriptInPackageStreaming; + bi = str.indexOf(b, i + 1); + } -var _child_process = __webpack_require__(347); + i = ai < bi && ai >= 0 ? ai : bi; + } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + if (begs.length) { + result = [ left, right ]; + } + } -function runScriptInPackageStreaming(script, args, pkg) { - const execOpts = { - cwd: pkg.path - }; - return (0, _child_process.spawnStreaming)('yarn', ['run', script, ...args], execOpts, { - prefix: pkg.name - }); + return result; } -/***/ }), -/* 347 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); +/***/ }), +/* 349 */ +/***/ (function(module, exports) { -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} -exports.spawn = spawn; -exports.spawnStreaming = spawnStreaming; -var _execa = __webpack_require__(348); +/***/ }), +/* 350 */ +/***/ (function(module, exports, __webpack_require__) { -var _execa2 = _interopRequireDefault(_execa); +module.exports = globSync +globSync.GlobSync = GlobSync -var _chalk = __webpack_require__(14); +var fs = __webpack_require__(7) +var rp = __webpack_require__(81) +var minimatch = __webpack_require__(56) +var Minimatch = minimatch.Minimatch +var Glob = __webpack_require__(26).Glob +var util = __webpack_require__(13) +var path = __webpack_require__(3) +var assert = __webpack_require__(24) +var isAbsolute = __webpack_require__(57) +var common = __webpack_require__(83) +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored -var _chalk2 = _interopRequireDefault(_chalk); +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') -var _strongLogTransformer = __webpack_require__(375); + return new GlobSync(pattern, options).found +} -var _strongLogTransformer2 = _interopRequireDefault(_strongLogTransformer); +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') -var _logSymbols = __webpack_require__(207); + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') -var _logSymbols2 = _interopRequireDefault(_logSymbols); + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + setopts(this, pattern, options) -function generateColors() { - const colorWheel = [_chalk2.default.cyan, _chalk2.default.magenta, _chalk2.default.blue, _chalk2.default.yellow, _chalk2.default.green, _chalk2.default.red]; - const count = colorWheel.length; - let children = 0; - return () => colorWheel[children++ % count]; -} -function spawn(command, args, opts) { - return (0, _execa2.default)(command, args, _extends({}, opts, { - stdio: 'inherit' - })); + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() } -const nextColor = generateColors(); -function spawnStreaming(command, args, opts, { prefix }) { - const spawned = (0, _execa2.default)(command, args, _extends({}, opts, { - stdio: ['ignore', 'pipe', 'pipe'] - })); - const color = nextColor(); - const prefixedStdout = (0, _strongLogTransformer2.default)({ tag: `${color.bold(prefix)}:` }); - const prefixedStderr = (0, _strongLogTransformer2.default)({ - tag: `${_logSymbols2.default.error} ${color.bold(prefix)}:`, - mergeMultiline: true - }); - spawned.stdout.pipe(prefixedStdout).pipe(process.stdout); - spawned.stderr.pipe(prefixedStderr).pipe(process.stderr); - return spawned; + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) } -/***/ }), -/* 348 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) -const path = __webpack_require__(3); -const childProcess = __webpack_require__(56); -const util = __webpack_require__(13); -const crossSpawn = __webpack_require__(349); -const stripEof = __webpack_require__(365); -const npmRunPath = __webpack_require__(366); -const isStream = __webpack_require__(368); -const _getStream = __webpack_require__(369); -const pFinally = __webpack_require__(371); -const onExit = __webpack_require__(57); -const errname = __webpack_require__(373); -const stdio = __webpack_require__(374); + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. -const TEN_MEGABYTES = 1000 * 1000 * 10; + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return -function handleArgs(cmd, args, opts) { - let parsed; + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break - opts = Object.assign({ - extendEnv: true, - env: {} - }, opts); + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } - if (opts.extendEnv) { - opts.env = Object.assign({}, process.env, opts.env); - } + var remain = pattern.slice(n) - if (opts.__winShell === true) { - delete opts.__winShell; - parsed = { - command: cmd, - args, - options: opts, - file: cmd, - original: cmd - }; - } else { - parsed = crossSpawn._parse(cmd, args, opts); - } + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix - opts = Object.assign({ - maxBuffer: TEN_MEGABYTES, - stripEof: true, - preferLocal: true, - localDir: parsed.options.cwd || process.cwd(), - encoding: 'utf8', - reject: true, - cleanup: true - }, parsed.options); + var abs = this._makeAbs(read) - opts.stdio = stdio(opts); + //if ignored, skip processing + if (childrenIgnored(this, read)) + return - if (opts.preferLocal) { - opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); - } + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} - if (opts.detached) { - // #115 - opts.cleanup = false; - } - if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { - // #116 - parsed.args.unshift('/q'); - } +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) - return { - cmd: parsed.command, - args: parsed.args, - opts, - parsed - }; -} + // if the abs isn't a dir, then nothing can match! + if (!entries) + return -function handleInput(spawned, opts) { - const input = opts.input; + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' - if (input === null || input === undefined) { - return; - } + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -} + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return -function handleOutput(opts, val) { - if (val && opts.stripEof) { - val = stripEof(val); - } + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. - return val; + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } } -function handleShell(fn, cmd, opts) { - let file = '/bin/sh'; - let args = ['-c', cmd]; - opts = Object.assign({}, opts); +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return - if (process.platform === 'win32') { - opts.__winShell = true; - file = process.env.comspec || 'cmd.exe'; - args = ['/s', '/c', `"${cmd}"`]; - opts.windowsVerbatimArguments = true; - } + var abs = this._makeAbs(e) - if (opts.shell) { - file = opts.shell; - delete opts.shell; - } + if (this.mark) + e = this._mark(e) - return fn(file, args, opts); -} + if (this.absolute) { + e = abs + } -function getStream(process, stream, encoding, maxBuffer) { - if (!process[stream]) { - return null; - } + if (this.matches[index][e]) + return - let ret; + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } - if (encoding) { - ret = _getStream(process[stream], { - encoding, - maxBuffer - }); - } else { - ret = _getStream.buffer(process[stream], {maxBuffer}); - } + this.matches[index][e] = true - return ret.catch(err => { - err.stream = stream; - err.message = `${stream} ${err.message}`; - throw err; - }); + if (this.stat) + this._stat(e) } -function makeError(result, options) { - const stdout = result.stdout; - const stderr = result.stderr; - let err = result.error; - const code = result.code; - const signal = result.signal; +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) - const parsed = options.parsed; - const joinedCmd = options.joinedCmd; - const timedOut = options.timedOut || false; + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } - if (!err) { - let output = ''; + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym - if (Array.isArray(parsed.opts.stdio)) { - if (parsed.opts.stdio[2] !== 'inherit') { - output += output.length > 0 ? stderr : `\n${stderr}`; - } + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) - if (parsed.opts.stdio[1] !== 'inherit') { - output += `\n${stdout}`; - } - } else if (parsed.opts.stdio !== 'inherit') { - output = `\n${stderr}${stdout}`; - } + return entries +} - err = new Error(`Command failed: ${joinedCmd}${output}`); - err.code = code < 0 ? errname(code) : code; - } +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries - err.stdout = stdout; - err.stderr = stderr; - err.failed = true; - err.signal = signal || null; - err.cmd = joinedCmd; - err.timedOut = timedOut; + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) - return err; + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } } -function joinCmd(cmd, args) { - let joinedCmd = cmd; +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } - if (Array.isArray(args) && args.length > 0) { - joinedCmd += ' ' + args.join(' '); - } + this.cache[abs] = entries - return joinedCmd; + // mark and cache dir-ness + return entries } -module.exports = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - const encoding = parsed.opts.encoding; - const maxBuffer = parsed.opts.maxBuffer; - const joinedCmd = joinCmd(cmd, args); +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break - let spawned; - try { - spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); - } catch (err) { - return Promise.reject(err); - } + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break - let removeExitHandler; - if (parsed.opts.cleanup) { - removeExitHandler = onExit(() => { - spawned.kill(); - }); - } + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} - let timeoutId = null; - let timedOut = false; +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - const cleanupTimeout = () => { - if (timeoutId) { - clearTimeout(timeoutId); - timeoutId = null; - } - }; + var entries = this._readdir(abs, inGlobStar) - if (parsed.opts.timeout > 0) { - timeoutId = setTimeout(() => { - timeoutId = null; - timedOut = true; - spawned.kill(parsed.opts.killSignal); - }, parsed.opts.timeout); - } + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return - const processDone = new Promise(resolve => { - spawned.on('exit', (code, signal) => { - cleanupTimeout(); - resolve({code, signal}); - }); + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) - spawned.on('error', err => { - cleanupTimeout(); - resolve({error: err}); - }); + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) - if (spawned.stdin) { - spawned.stdin.on('error', err => { - cleanupTimeout(); - resolve({error: err}); - }); - } - }); + var len = entries.length + var isSym = this.symlinks[abs] - function destroy() { - if (spawned.stdout) { - spawned.stdout.destroy(); - } + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return - if (spawned.stderr) { - spawned.stderr.destroy(); - } - } + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue - const handlePromise = () => pFinally(Promise.all([ - processDone, - getStream(spawned, 'stdout', encoding, maxBuffer), - getStream(spawned, 'stderr', encoding, maxBuffer) - ]).then(arr => { - const result = arr[0]; - result.stdout = arr[1]; - result.stderr = arr[2]; + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) - if (removeExitHandler) { - removeExitHandler(); - } + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} - if (result.error || result.code !== 0 || result.signal !== null) { - const err = makeError(result, { - joinedCmd, - parsed, - timedOut - }); +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) - // TODO: missing some timeout logic for killed - // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 - // err.killed = spawned.killed || killed; - err.killed = err.killed || spawned.killed; + if (!this.matches[index]) + this.matches[index] = Object.create(null) - if (!parsed.opts.reject) { - return err; - } + // If it doesn't exist, then just mark the lack of results + if (!exists) + return - throw err; - } + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } - return { - stdout: handleOutput(parsed.opts, result.stdout), - stderr: handleOutput(parsed.opts, result.stderr), - code: 0, - failed: false, - killed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; - }), destroy); + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); + // Mark this as a match + this._emitMatch(index, prefix) +} - handleInput(spawned, parsed.opts); +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' - spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); - spawned.catch = onrejected => handlePromise().catch(onrejected); + if (f.length > this.maxLength) + return false - return spawned; -}; + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] -module.exports.stdout = function () { - // TODO: set `stderr: 'ignore'` when that option is implemented - return module.exports.apply(null, arguments).then(x => x.stdout); -}; + if (Array.isArray(c)) + c = 'DIR' -module.exports.stderr = function () { - // TODO: set `stdout: 'ignore'` when that option is implemented - return module.exports.apply(null, arguments).then(x => x.stderr); -}; + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c -module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); + if (needDir && c === 'FILE') + return false -module.exports.sync = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - const joinedCmd = joinCmd(cmd, args); + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } - if (isStream(parsed.opts.input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } - const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); - result.code = result.status; + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } - if (result.error || result.status !== 0 || result.signal !== null) { - const err = makeError(result, { - joinedCmd, - parsed - }); + this.statCache[abs] = stat - if (!parsed.opts.reject) { - return err; - } + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' - throw err; - } + this.cache[abs] = this.cache[abs] || c - return { - stdout: handleOutput(parsed.opts, result.stdout), - stderr: handleOutput(parsed.opts, result.stderr), - code: 0, - failed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; -}; + if (needDir && c === 'FILE') + return false -module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); + return c +} -module.exports.spawn = util.deprecate(module.exports, 'execa.spawn() is deprecated. Use execa() instead.'); +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} /***/ }), -/* 349 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var cp = __webpack_require__(56); -var parse = __webpack_require__(350); -var enoent = __webpack_require__(363); - -var cpSpawnSync = cp.spawnSync; - -function spawn(command, args, options) { - var parsed; - var spawned; - - // Parse the arguments - parsed = parse(command, args, options); - - // Spawn the child process - spawned = cp.spawn(parsed.command, parsed.args, parsed.options); +var wrappy = __webpack_require__(84) +var reqs = Object.create(null) +var once = __webpack_require__(85) - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); +module.exports = wrappy(inflight) - return spawned; +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } } -function spawnSync(command, args, options) { - var parsed; - var result; +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) - if (!cpSpawnSync) { - try { - cpSpawnSync = __webpack_require__(364); // eslint-disable-line global-require - } catch (ex) { - throw new Error( - 'In order to use spawnSync on node 0.10 or older, you must ' + - 'install spawn-sync:\n\n' + - ' npm install spawn-sync --save' - ); - } + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } } - - // Parse the arguments - parsed = parse(command, args, options); - - // Spawn the child process - result = cpSpawnSync(parsed.command, parsed.args, parsed.options); - - // Analyze if the command does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); - - return result; + }) } -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; +function slice (args) { + var length = args.length + var array = [] -module.exports._parse = parse; -module.exports._enoent = enoent; + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} /***/ }), -/* 350 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +const path = __webpack_require__(3); +const loadJsonFile = __webpack_require__(353); +const pathType = __webpack_require__(359); -var resolveCommand = __webpack_require__(84); -var hasEmptyArgumentBug = __webpack_require__(358); -var escapeArgument = __webpack_require__(86); -var escapeCommand = __webpack_require__(359); -var readShebang = __webpack_require__(360); - -var isWin = process.platform === 'win32'; -var skipShellRegExp = /\.(?:com|exe)$/i; +module.exports = (fp, opts) => { + if (typeof fp !== 'string') { + opts = fp; + fp = '.'; + } -// Supported in Node >= 6 and >= 4.8 -var supportsShellOption = parseInt(process.version.substr(1).split('.')[0], 10) >= 6 || - parseInt(process.version.substr(1).split('.')[0], 10) === 4 && parseInt(process.version.substr(1).split('.')[1], 10) >= 8; + opts = opts || {}; -function parseNonShell(parsed) { - var shebang; - var needsShell; - var applyQuotes; + return pathType.dir(fp) + .then(isDir => { + if (isDir) { + fp = path.join(fp, 'package.json'); + } - if (!isWin) { - return parsed; - } + return loadJsonFile(fp); + }) + .then(x => { + if (opts.normalize !== false) { + __webpack_require__(87)(x); + } - // Detect & add support for shebangs - parsed.file = resolveCommand(parsed.command); - parsed.file = parsed.file || resolveCommand(parsed.command, true); - shebang = parsed.file && readShebang(parsed.file); + return x; + }); +}; - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; - needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(resolveCommand(shebang) || resolveCommand(shebang, true)); - } else { - needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(parsed.file); - } +module.exports.sync = (fp, opts) => { + if (typeof fp !== 'string') { + opts = fp; + fp = '.'; + } - // If a shell is required, use cmd.exe and take care of escaping everything correctly - if (needsShell) { - // Escape command & arguments - applyQuotes = (parsed.command !== 'echo'); // Do not quote arguments for the special "echo" command - parsed.command = escapeCommand(parsed.command); - parsed.args = parsed.args.map(function (arg) { - return escapeArgument(arg, applyQuotes); - }); + opts = opts || {}; + fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp; - // Make use of cmd.exe - parsed.args = ['/d', '/s', '/c', '"' + parsed.command + (parsed.args.length ? ' ' + parsed.args.join(' ') : '') + '"']; - parsed.command = process.env.comspec || 'cmd.exe'; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } + const x = loadJsonFile.sync(fp); - return parsed; -} + if (opts.normalize !== false) { + __webpack_require__(87)(x); + } -function parseShell(parsed) { - var shellCommand; + return x; +}; - // If node supports the shell option, there's no need to mimic its behavior - if (supportsShellOption) { - return parsed; - } - // Mimic node shell option, see: https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 - shellCommand = [parsed.command].concat(parsed.args).join(' '); +/***/ }), +/* 353 */ +/***/ (function(module, exports, __webpack_require__) { - if (isWin) { - parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; - parsed.args = ['/d', '/s', '/c', '"' + shellCommand + '"']; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } else { - if (typeof parsed.options.shell === 'string') { - parsed.command = parsed.options.shell; - } else if (process.platform === 'android') { - parsed.command = '/system/bin/sh'; - } else { - parsed.command = '/bin/sh'; - } +"use strict"; - parsed.args = ['-c', shellCommand]; - } +const path = __webpack_require__(3); +const fs = __webpack_require__(23); +const stripBom = __webpack_require__(354); +const parseJson = __webpack_require__(355); +const pify = __webpack_require__(22); - return parsed; -} +const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp)); -// ------------------------------------------------ +module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp)); +module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp); -function parse(command, args, options) { - var parsed; - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } +/***/ }), +/* 354 */ +/***/ (function(module, exports, __webpack_require__) { - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = options || {}; +"use strict"; - // Build our parsed object - parsed = { - command: command, - args: args, - options: options, - file: undefined, - original: command, - }; +module.exports = x => { + if (typeof x !== 'string') { + throw new TypeError('Expected a string, got ' + typeof x); + } - // Delegate further parsing to shell or non-shell - return options.shell ? parseShell(parsed) : parseNonShell(parsed); -} + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM) + if (x.charCodeAt(0) === 0xFEFF) { + return x.slice(1); + } -module.exports = parse; + return x; +}; /***/ }), -/* 351 */ +/* 355 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = which -which.sync = whichSync +"use strict"; -var isWindows = process.platform === 'win32' || - process.env.OSTYPE === 'cygwin' || - process.env.OSTYPE === 'msys' +const errorEx = __webpack_require__(356); +const fallback = __webpack_require__(358); -var path = __webpack_require__(3) -var COLON = isWindows ? ';' : ':' -var isexe = __webpack_require__(352) +const JSONError = errorEx('JSONError', { + fileName: errorEx.append('in %s') +}); -function getNotFoundError (cmd) { - var er = new Error('not found: ' + cmd) - er.code = 'ENOENT' +module.exports = (input, reviver, filename) => { + if (typeof reviver === 'string') { + filename = reviver; + reviver = null; + } - return er -} + try { + try { + return JSON.parse(input, reviver); + } catch (err) { + fallback(input, reviver); -function getPathInfo (cmd, opt) { - var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] + throw err; + } + } catch (err) { + err.message = err.message.replace(/\n/g, ''); - pathEnv = pathEnv.split(colon) + const jsonErr = new JSONError(err); + if (filename) { + jsonErr.fileName = filename; + } - var pathExtExe = '' - if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') - pathExt = pathExtExe.split(colon) + throw jsonErr; + } +}; - // Always test the cmd itself first. isexe will check to make sure - // it's found in the pathExt set. - if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') - pathExt.unshift('') - } +/***/ }), +/* 356 */ +/***/ (function(module, exports, __webpack_require__) { - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) - pathEnv = [''] - - return { - env: pathEnv, - ext: pathExt, - extExe: pathExtExe - } -} - -function which (cmd, opt, cb) { - if (typeof opt === 'function') { - cb = opt - opt = {} - } +"use strict"; - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - ;(function F (i, l) { - if (i === l) { - if (opt.all && found.length) - return cb(null, found) - else - return cb(getNotFoundError(cmd)) - } +var util = __webpack_require__(13); +var isArrayish = __webpack_require__(357); - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) +var errorEx = function errorEx(name, properties) { + if (!name || name.constructor !== String) { + properties = name || {}; + name = Error.name; + } - var p = path.join(pathPart, cmd) - if (!pathPart && (/^\.[\\\/]/).test(cmd)) { - p = cmd.slice(0, 2) + p - } - ;(function E (ii, ll) { - if (ii === ll) return F(i + 1, l) - var ext = pathExt[ii] - isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { - if (!er && is) { - if (opt.all) - found.push(p + ext) - else - return cb(null, p + ext) - } - return E(ii + 1, ll) - }) - })(0, pathExt.length) - })(0, pathEnv.length) -} + var errorExError = function ErrorEXError(message) { + if (!this) { + return new ErrorEXError(message); + } -function whichSync (cmd, opt) { - opt = opt || {} + message = message instanceof Error + ? message.message + : (message || this.message); - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] + Error.call(this, message); + Error.captureStackTrace(this, errorExError); - for (var i = 0, l = pathEnv.length; i < l; i ++) { - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) + this.name = name; - var p = path.join(pathPart, cmd) - if (!pathPart && /^\.[\\\/]/.test(cmd)) { - p = cmd.slice(0, 2) + p - } - for (var j = 0, ll = pathExt.length; j < ll; j ++) { - var cur = p + pathExt[j] - var is - try { - is = isexe.sync(cur, { pathExt: pathExtExe }) - if (is) { - if (opt.all) - found.push(cur) - else - return cur - } - } catch (ex) {} - } - } + Object.defineProperty(this, 'message', { + configurable: true, + enumerable: false, + get: function () { + var newMessage = message.split(/\r?\n/g); - if (opt.all && found.length) - return found + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } - if (opt.nothrow) - return null + var modifier = properties[key]; - throw getNotFoundError(cmd) -} + if ('message' in modifier) { + newMessage = modifier.message(this[key], newMessage) || newMessage; + if (!isArrayish(newMessage)) { + newMessage = [newMessage]; + } + } + } + return newMessage.join('\n'); + }, + set: function (v) { + message = v; + } + }); -/***/ }), -/* 352 */ -/***/ (function(module, exports, __webpack_require__) { + var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); + var stackGetter = stackDescriptor.get; + var stackValue = stackDescriptor.value; + delete stackDescriptor.value; + delete stackDescriptor.writable; -var fs = __webpack_require__(7) -var core -if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = __webpack_require__(353) -} else { - core = __webpack_require__(354) -} + stackDescriptor.get = function () { + var stack = (stackGetter) + ? stackGetter.call(this).split(/\r?\n+/g) + : stackValue.split(/\r?\n+/g); -module.exports = isexe -isexe.sync = sync + // starting in Node 7, the stack builder caches the message. + // just replace it. + stack[0] = this.name + ': ' + this.message; -function isexe (path, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } + var lineCount = 1; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } - if (!cb) { - if (typeof Promise !== 'function') { - throw new TypeError('callback not provided') - } + var modifier = properties[key]; - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er) - } else { - resolve(is) - } - }) - }) - } + if ('line' in modifier) { + var line = modifier.line(this[key]); + if (line) { + stack.splice(lineCount++, 0, ' ' + line); + } + } - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === 'EACCES' || options && options.ignoreErrors) { - er = null - is = false - } - } - cb(er, is) - }) -} + if ('stack' in modifier) { + modifier.stack(this[key], stack); + } + } -function sync (path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}) - } catch (er) { - if (options && options.ignoreErrors || er.code === 'EACCES') { - return false - } else { - throw er - } - } -} + return stack.join('\n'); + }; + Object.defineProperty(this, 'stack', stackDescriptor); + }; -/***/ }), -/* 353 */ -/***/ (function(module, exports, __webpack_require__) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(errorExError.prototype, Error.prototype); + Object.setPrototypeOf(errorExError, Error); + } else { + util.inherits(errorExError, Error); + } -module.exports = isexe -isexe.sync = sync + return errorExError; +}; -var fs = __webpack_require__(7) +errorEx.append = function (str, def) { + return { + message: function (v, message) { + v = v || def; -function checkPathExt (path, options) { - var pathext = options.pathExt !== undefined ? - options.pathExt : process.env.PATHEXT + if (v) { + message[0] += ' ' + str.replace('%s', v.toString()); + } - if (!pathext) { - return true - } + return message; + } + }; +}; - pathext = pathext.split(';') - if (pathext.indexOf('') !== -1) { - return true - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase() - if (p && path.substr(-p.length).toLowerCase() === p) { - return true - } - } - return false -} +errorEx.line = function (str, def) { + return { + line: function (v) { + v = v || def; -function checkStat (stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false - } - return checkPathExt(path, options) -} + if (v) { + return str.replace('%s', v.toString()); + } -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)) - }) -} + return null; + } + }; +}; -function sync (path, options) { - return checkStat(fs.statSync(path), path, options) -} +module.exports = errorEx; /***/ }), -/* 354 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = isexe -isexe.sync = sync - -var fs = __webpack_require__(7) - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), options) -} - -function checkStat (stat, options) { - return stat.isFile() && checkMode(stat, options) -} - -function checkMode (stat, options) { - var mod = stat.mode - var uid = stat.uid - var gid = stat.gid - - var myUid = options.uid !== undefined ? - options.uid : process.getuid && process.getuid() - var myGid = options.gid !== undefined ? - options.gid : process.getgid && process.getgid() +"use strict"; - var u = parseInt('100', 8) - var g = parseInt('010', 8) - var o = parseInt('001', 8) - var ug = u | g - var ret = (mod & o) || - (mod & g) && gid === myGid || - (mod & u) && uid === myUid || - (mod & ug) && myUid === 0 +module.exports = function isArrayish(obj) { + if (!obj) { + return false; + } - return ret -} + return obj instanceof Array || Array.isArray(obj) || + (obj.length >= 0 && obj.splice instanceof Function); +}; /***/ }), -/* 355 */ +/* 358 */ /***/ (function(module, exports, __webpack_require__) { -if (process.env.npm_package_name === 'pseudomap' && - process.env.npm_lifecycle_script === 'test') - process.env.TEST_PSEUDOMAP = 'true' +"use strict"; -if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { - module.exports = Map -} else { - module.exports = __webpack_require__(356) + +module.exports = parseJson +function parseJson (txt, reviver, context) { + context = context || 20 + try { + return JSON.parse(txt, reviver) + } catch (e) { + const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i) + const errIdx = syntaxErr + ? +syntaxErr[1] + : e.message.match(/^Unexpected end of JSON.*/i) + ? txt.length - 1 + : null + if (errIdx != null) { + const start = errIdx <= context + ? 0 + : errIdx - context + const end = errIdx + context >= txt.length + ? txt.length + : errIdx + context + e.message += ` while parsing near '${ + start === 0 ? '' : '...' + }${txt.slice(start, end)}${ + end === txt.length ? '' : '...' + }'` + } else { + e.message += ` while parsing '${txt.slice(0, context * 2)}'` + } + throw e + } } /***/ }), -/* 356 */ -/***/ (function(module, exports) { +/* 359 */ +/***/ (function(module, exports, __webpack_require__) { -var hasOwnProperty = Object.prototype.hasOwnProperty +"use strict"; -module.exports = PseudoMap +const fs = __webpack_require__(7); +const pify = __webpack_require__(22); -function PseudoMap (set) { - if (!(this instanceof PseudoMap)) // whyyyyyyy - throw new TypeError("Constructor PseudoMap requires 'new'") +function type(fn, fn2, fp) { + if (typeof fp !== 'string') { + return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`)); + } - this.clear() + return pify(fs[fn])(fp) + .then(stats => stats[fn2]()) + .catch(err => { + if (err.code === 'ENOENT') { + return false; + } - if (set) { - if ((set instanceof PseudoMap) || - (typeof Map === 'function' && set instanceof Map)) - set.forEach(function (value, key) { - this.set(key, value) - }, this) - else if (Array.isArray(set)) - set.forEach(function (kv) { - this.set(kv[0], kv[1]) - }, this) - else - throw new TypeError('invalid argument') - } + throw err; + }); } -PseudoMap.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - Object.keys(this._data).forEach(function (k) { - if (k !== 'size') - fn.call(thisp, this._data[k].value, this._data[k].key) - }, this) -} +function typeSync(fn, fn2, fp) { + if (typeof fp !== 'string') { + throw new TypeError(`Expected a string, got ${typeof fp}`); + } -PseudoMap.prototype.has = function (k) { - return !!find(this._data, k) -} + try { + return fs[fn](fp)[fn2](); + } catch (err) { + if (err.code === 'ENOENT') { + return false; + } -PseudoMap.prototype.get = function (k) { - var res = find(this._data, k) - return res && res.value + throw err; + } } -PseudoMap.prototype.set = function (k, v) { - set(this._data, k, v) -} +exports.file = type.bind(null, 'stat', 'isFile'); +exports.dir = type.bind(null, 'stat', 'isDirectory'); +exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink'); +exports.fileSync = typeSync.bind(null, 'statSync', 'isFile'); +exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory'); +exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); -PseudoMap.prototype.delete = function (k) { - var res = find(this._data, k) - if (res) { - delete this._data[res._index] - this._data.size-- - } -} -PseudoMap.prototype.clear = function () { - var data = Object.create(null) - data.size = 0 +/***/ }), +/* 360 */ +/***/ (function(module, exports, __webpack_require__) { - Object.defineProperty(this, '_data', { - value: data, - enumerable: false, - configurable: true, - writable: false - }) -} +var semver = __webpack_require__(361) +var validateLicense = __webpack_require__(362); +var hostedGitInfo = __webpack_require__(367) +var isBuiltinModule = __webpack_require__(369) +var depTypes = ["dependencies","devDependencies","optionalDependencies"] +var extractDescription = __webpack_require__(371) +var url = __webpack_require__(88) +var typos = __webpack_require__(372) -Object.defineProperty(PseudoMap.prototype, 'size', { - get: function () { - return this._data.size - }, - set: function (n) {}, - enumerable: true, - configurable: true -}) +var fixer = module.exports = { + // default warning function + warn: function() {}, -PseudoMap.prototype.values = -PseudoMap.prototype.keys = -PseudoMap.prototype.entries = function () { - throw new Error('iterators are not implemented in this version') -} + fixRepositoryField: function(data) { + if (data.repositories) { + this.warn("repositories"); + data.repository = data.repositories[0] + } + if (!data.repository) return this.warn("missingRepository") + if (typeof data.repository === "string") { + data.repository = { + type: "git", + url: data.repository + } + } + var r = data.repository.url || "" + if (r) { + var hosted = hostedGitInfo.fromUrl(r) + if (hosted) { + r = data.repository.url + = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString() + } + } -// Either identical, or both NaN -function same (a, b) { - return a === b || a !== a && b !== b -} + if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) { + this.warn("brokenGitUrl", r) + } + } -function Entry (k, v, i) { - this.key = k - this.value = v - this._index = i -} +, fixTypos: function(data) { + Object.keys(typos.topLevel).forEach(function (d) { + if (data.hasOwnProperty(d)) { + this.warn("typo", d, typos.topLevel[d]) + } + }, this) + } -function find (data, k) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) - return data[key] - } -} - -function set (data, k, v) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) { - data[key].value = v +, fixScriptsField: function(data) { + if (!data.scripts) return + if (typeof data.scripts !== "object") { + this.warn("nonObjectScripts") + delete data.scripts return } + Object.keys(data.scripts).forEach(function (k) { + if (typeof data.scripts[k] !== "string") { + this.warn("nonStringScript") + delete data.scripts[k] + } else if (typos.script[k] && !data.scripts[typos.script[k]]) { + this.warn("typo", k, typos.script[k], "scripts") + } + }, this) } - data.size++ - data[key] = new Entry(k, v, key) -} - -/***/ }), -/* 357 */ -/***/ (function(module, exports) { - -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() +, fixFilesField: function(data) { + var files = data.files + if (files && !Array.isArray(files)) { + this.warn("nonArrayFiles") + delete data.files + } else if (data.files) { + data.files = data.files.filter(function(file) { + if (!file || typeof file !== "string") { + this.warn("invalidFilename", file) + return false + } else { + return true + } + }, this) + } } - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) +, fixBinField: function(data) { + if (!data.bin) return; + if (typeof data.bin === "string") { + var b = {} + var match + if (match = data.name.match(/^@[^/]+[/](.*)$/)) { + b[match[1]] = data.bin + } else { + b[data.name] = data.bin + } + data.bin = b } } - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') +, fixManField: function(data) { + if (!data.man) return; + if (typeof data.man === "string") { + data.man = [ data.man ] + } + } +, fixBundleDependenciesField: function(data) { + var bdd = "bundledDependencies" + var bd = "bundleDependencies" + if (data[bdd] && !data[bd]) { + data[bd] = data[bdd] + delete data[bdd] + } + if (data[bd] && !Array.isArray(data[bd])) { + this.warn("nonArrayBundleDependencies") + delete data[bd] + } else if (data[bd]) { + data[bd] = data[bd].filter(function(bd) { + if (!bd || typeof bd !== 'string') { + this.warn("nonStringBundleDependency", bd) + return false + } else { + if (!data.dependencies) { + data.dependencies = {} + } + if (!data.dependencies.hasOwnProperty(bd)) { + this.warn("nonDependencyBundleDependency", bd) + data.dependencies[bd] = "*" + } + return true + } + }, this) + } } - var next = node.next - var prev = node.prev +, fixDependencies: function(data, strict) { + var loose = !strict + objectifyDeps(data, this.warn) + addOptionalDepsToDeps(data, this.warn) + this.fixBundleDependenciesField(data) - if (next) { - next.prev = prev + ;['dependencies','devDependencies'].forEach(function(deps) { + if (!(deps in data)) return + if (!data[deps] || typeof data[deps] !== "object") { + this.warn("nonObjectDependencies", deps) + delete data[deps] + return + } + Object.keys(data[deps]).forEach(function (d) { + var r = data[deps][d] + if (typeof r !== 'string') { + this.warn("nonStringDependency", d, JSON.stringify(r)) + delete data[deps][d] + } + var hosted = hostedGitInfo.fromUrl(data[deps][d]) + if (hosted) data[deps][d] = hosted.toString() + }, this) + }, this) } - if (prev) { - prev.next = next +, fixModulesField: function (data) { + if (data.modules) { + this.warn("deprecatedModules") + delete data.modules + } } - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev +, fixKeywordsField: function (data) { + if (typeof data.keywords === "string") { + data.keywords = data.keywords.split(/,\s+/) + } + if (data.keywords && !Array.isArray(data.keywords)) { + delete data.keywords + this.warn("nonArrayKeywords") + } else if (data.keywords) { + data.keywords = data.keywords.filter(function(kw) { + if (typeof kw !== "string" || !kw) { + this.warn("nonStringKeyword"); + return false + } else { + return true + } + }, this) + } } - node.list.length-- - node.next = null - node.prev = null - node.list = null -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return +, fixVersionField: function(data, strict) { + // allow "loose" semver 1.0 versions in non-strict mode + // enforce strict semver 2.0 compliance in strict mode + var loose = !strict + if (!data.version) { + data.version = "" + return true + } + if (!semver.valid(data.version, loose)) { + throw new Error('Invalid version: "'+ data.version + '"') + } + data.version = semver.clean(data.version, loose) + return true } - if (node.list) { - node.list.removeNode(node) +, fixPeople: function(data) { + modifyPeople(data, unParsePerson) + modifyPeople(data, parsePerson) } - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node +, fixNameField: function(data, options) { + if (typeof options === "boolean") options = {strict: options} + else if (typeof options === "undefined") options = {} + var strict = options.strict + if (!data.name && !strict) { + data.name = "" + return + } + if (typeof data.name !== "string") { + throw new Error("name field must be a string.") + } + if (!strict) + data.name = data.name.trim() + ensureValidName(data.name, strict, options.allowLegacyCase) + if (isBuiltinModule(data.name)) + this.warn("conflictingName", data.name) } - this.head = node - if (!this.tail) { - this.tail = node - } - this.length++ -} -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return +, fixDescriptionField: function (data) { + if (data.description && typeof data.description !== 'string') { + this.warn("nonStringDescription") + delete data.description + } + if (data.readme && !data.description) + data.description = extractDescription(data.readme) + if(data.description === undefined) delete data.description; + if (!data.description) this.warn("missingDescription") } - if (node.list) { - node.list.removeNode(node) +, fixReadmeField: function (data) { + if (!data.readme) { + this.warn("missingReadme") + data.readme = "ERROR: No README data found!" + } } - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node +, fixBugsField: function(data) { + if (!data.bugs && data.repository && data.repository.url) { + var hosted = hostedGitInfo.fromUrl(data.repository.url) + if(hosted && hosted.bugs()) { + data.bugs = {url: hosted.bugs()} + } + } + else if(data.bugs) { + var emailRe = /^.+@.*\..+$/ + if(typeof data.bugs == "string") { + if(emailRe.test(data.bugs)) + data.bugs = {email:data.bugs} + else if(url.parse(data.bugs).protocol) + data.bugs = {url: data.bugs} + else + this.warn("nonEmailUrlBugsString") + } + else { + bugsTypos(data.bugs, this.warn) + var oldBugs = data.bugs + data.bugs = {} + if(oldBugs.url) { + if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol) + data.bugs.url = oldBugs.url + else + this.warn("nonUrlBugsUrlField") + } + if(oldBugs.email) { + if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email)) + data.bugs.email = oldBugs.email + else + this.warn("nonEmailBugsEmailField") + } + } + if(!data.bugs.email && !data.bugs.url) { + delete data.bugs + this.warn("emptyNormalizedBugs") + } + } } - this.tail = node - if (!this.head) { - this.head = node - } - this.length++ -} +, fixHomepageField: function(data) { + if (!data.homepage && data.repository && data.repository.url) { + var hosted = hostedGitInfo.fromUrl(data.repository.url) + if (hosted && hosted.docs()) data.homepage = hosted.docs() + } + if (!data.homepage) return -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) + if(typeof data.homepage !== "string") { + this.warn("nonUrlHomepage") + return delete data.homepage + } + if(!url.parse(data.homepage).protocol) { + data.homepage = "http://" + data.homepage + } } - return this.length -} -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) +, fixLicenseField: function(data) { + if (!data.license) { + return this.warn("missingLicense") + } else{ + if ( + typeof(data.license) !== 'string' || + data.license.length < 1 + ) { + this.warn("invalidLicense") + } else { + if (!validateLicense(data.license).validForNewPackages) + this.warn("invalidLicense") + } + } } - return this.length } -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined - } +function isValidScopedPackageName(spec) { + if (spec.charAt(0) !== '@') return false - var res = this.tail.value - this.tail = this.tail.prev - if (this.tail) { - this.tail.next = null - } else { - this.head = null - } - this.length-- - return res + var rest = spec.slice(1).split('/') + if (rest.length !== 2) return false + + return rest[0] && rest[1] && + rest[0] === encodeURIComponent(rest[0]) && + rest[1] === encodeURIComponent(rest[1]) } -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined - } +function isCorrectlyEncodedName(spec) { + return !spec.match(/[\/@\s\+%:]/) && + spec === encodeURIComponent(spec) +} - var res = this.head.value - this.head = this.head.next - if (this.head) { - this.head.prev = null - } else { - this.tail = null +function ensureValidName (name, strict, allowLegacyCase) { + if (name.charAt(0) === "." || + !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) || + (strict && (!allowLegacyCase) && name !== name.toLowerCase()) || + name.toLowerCase() === "node_modules" || + name.toLowerCase() === "favicon.ico") { + throw new Error("Invalid name: " + JSON.stringify(name)) } - this.length-- - return res } -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } +function modifyPeople (data, fn) { + if (data.author) data.author = fn(data.author) + ;["maintainers", "contributors"].forEach(function (set) { + if (!Array.isArray(data[set])) return; + data[set] = data[set].map(fn) + }) + return data } -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } +function unParsePerson (person) { + if (typeof person === "string") return person + var name = person.name || "" + var u = person.url || person.web + var url = u ? (" ("+u+")") : "" + var e = person.email || person.mail + var email = e ? (" <"+e+">") : "" + return name+email+url } -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } +function parsePerson (person) { + if (typeof person !== "string") return person + var name = person.match(/^([^\(<]+)/) + var url = person.match(/\(([^\)]+)\)/) + var email = person.match(/<([^>]+)>/) + var obj = {} + if (name && name[0].trim()) obj.name = name[0].trim() + if (email) obj.email = email[1]; + if (url) obj.url = url[1]; + return obj } -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } +function addOptionalDepsToDeps (data, warn) { + var o = data.optionalDependencies + if (!o) return; + var d = data.dependencies || {} + Object.keys(o).forEach(function (k) { + d[k] = o[k] + }) + data.dependencies = d } -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next +function depObjectify (deps, type, warn) { + if (!deps) return {} + if (typeof deps === "string") { + deps = deps.trim().split(/[\n\r\s\t ,]+/) } - return res + if (!Array.isArray(deps)) return deps + warn("deprecatedArrayDependencies", type) + var o = {} + deps.filter(function (d) { + return typeof d === "string" + }).forEach(function(d) { + d = d.trim().split(/(:?[@\s><=])/) + var dn = d.shift() + var dv = d.join("") + dv = dv.trim() + dv = dv.replace(/^@/, "") + o[dn] = dv + }) + return o } -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res +function objectifyDeps (data, warn) { + depTypes.forEach(function (type) { + if (!data[type]) return; + data[type] = depObjectify(data[type], type, warn) + }) } -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } +function bugsTypos(bugs, warn) { + if (!bugs) return + Object.keys(bugs).forEach(function (k) { + if (typos.bugs[k]) { + warn("typo", k, typos.bugs[k], "bugs") + bugs[typos.bugs[k]] = bugs[k] + delete bugs[k] + } + }) +} - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - return acc -} +/***/ }), +/* 361 */ +/***/ (function(module, exports) { -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} +exports = module.exports = SemVer; -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} +// The debug function is excluded entirely from the minified version. +/* nomin */ var debug; +/* nomin */ if (typeof process === 'object' && + /* nomin */ process.env && + /* nomin */ process.env.NODE_DEBUG && + /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) + /* nomin */ debug = function() { + /* nomin */ var args = Array.prototype.slice.call(arguments, 0); + /* nomin */ args.unshift('SEMVER'); + /* nomin */ console.log.apply(console, args); + /* nomin */ }; +/* nomin */ else + /* nomin */ debug = function() {}; -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} +var MAX_LENGTH = 256; +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length++ -} +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16; -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length++ -} +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. - this.list = list - this.value = value +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. -/***/ }), -/* 358 */ -/***/ (function(module, exports, __webpack_require__) { +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; -"use strict"; +// ## Main Version +// Three dot-separated numeric identifiers. -// See: https://github.com/IndigoUnited/node-cross-spawn/pull/34#issuecomment-221623455 -function hasEmptyArgumentBug() { - var nodeVer; +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; - if (process.platform !== 'win32') { - return false; - } +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - nodeVer = process.version.substr(1).split('.').map(function (num) { - return parseInt(num, 10); - }); +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. - return (nodeVer[0] === 0 && nodeVer[1] < 12); -} +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; -module.exports = hasEmptyArgumentBug(); +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; -/***/ }), -/* 359 */ -/***/ (function(module, exports, __webpack_require__) { +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. -"use strict"; +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; -var escapeArgument = __webpack_require__(86); +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. -function escapeCommand(command) { - // Do not escape if this command is not dangerous.. - // We do this so that commands like "echo" or "ifconfig" work - // Quoting them, will make them unaccessible - return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true); -} +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; -module.exports = escapeCommand; +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; -/***/ }), -/* 360 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. -var fs = __webpack_require__(7); -var LRU = __webpack_require__(85); -var shebangCommand = __webpack_require__(361); +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; -var shebangCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec +src[FULL] = '^' + FULLPLAIN + '$'; -function readShebang(command) { - var buffer; - var fd; - var shebang; +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; - // Check if it is in the cache first - if (shebangCache.has(command)) { - return shebangCache.get(command); - } +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; - // Read the first 150 bytes from the file - buffer = new Buffer(150); +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, 150, 0); - fs.closeSync(fd); - } catch (e) { /* empty */ } +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - // Attempt to extract shebang (null is returned if not a shebang) - shebang = shebangCommand(buffer.toString()); +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; - // Store the shebang in the cache - shebangCache.set(command, shebang); +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; - return shebang; -} +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; -module.exports = readShebang; +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +var COERCE = R++; +src[COERCE] = '(?:^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])'; +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; -/***/ }), -/* 361 */ -/***/ (function(module, exports, __webpack_require__) { +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; -"use strict"; +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; -var shebangRegex = __webpack_require__(362); +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; -module.exports = function (str) { - var match = str.match(shebangRegex); +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; - if (!match) { - return null; - } +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - var arr = match[0].replace(/#! ?/, '').split(' '); - var bin = arr[0].split('/').pop(); - var arg = arr[1]; +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - return (bin === 'env' ? - arg : - bin + (arg ? ' ' + arg : '') - ); -}; +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; -/***/ }), -/* 362 */ -/***/ (function(module, exports, __webpack_require__) { +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; -"use strict"; -module.exports = /^#!.*/; +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; -/***/ }), -/* 363 */ -/***/ (function(module, exports, __webpack_require__) { +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; -"use strict"; +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) + re[i] = new RegExp(src[i]); +} +exports.parse = parse; +function parse(version, loose) { + if (version instanceof SemVer) + return version; -var isWin = process.platform === 'win32'; -var resolveCommand = __webpack_require__(84); + if (typeof version !== 'string') + return null; -var isNode10 = process.version.indexOf('v0.10.') === 0; + if (version.length > MAX_LENGTH) + return null; -function notFoundError(command, syscall) { - var err; + var r = loose ? re[LOOSE] : re[FULL]; + if (!r.test(version)) + return null; - err = new Error(syscall + ' ' + command + ' ENOENT'); - err.code = err.errno = 'ENOENT'; - err.syscall = syscall + ' ' + command; + try { + return new SemVer(version, loose); + } catch (er) { + return null; + } +} - return err; +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; } -function hookChildProcess(cp, parsed) { - var originalEmit; - if (!isWin) { - return; - } +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); + return s ? s.version : null; +} - originalEmit = cp.emit; - cp.emit = function (name, arg1) { - var err; +exports.SemVer = SemVer; - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === 'exit') { - err = verifyENOENT(arg1, parsed, 'spawn'); +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } - if (err) { - return originalEmit.call(cp, 'error', err); - } - } + if (version.length > MAX_LENGTH) + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - return originalEmit.apply(cp, arguments); - }; -} + if (!(this instanceof SemVer)) + return new SemVer(version, loose); -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); - } + debug('SemVer', version, loose); + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - return null; -} + if (!m) + throw new TypeError('Invalid Version: ' + version); -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } + this.raw = version; - // If we are in node 10, then we are using spawn-sync; if it exited - // with -1 it probably means that the command does not exist - if (isNode10 && status === -1) { - parsed.file = isWin ? parsed.file : resolveCommand(parsed.original); + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; - if (!parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } - } + if (this.major > MAX_SAFE_INTEGER || this.major < 0) + throw new TypeError('Invalid major version') - return null; -} + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) + throw new TypeError('Invalid minor version') -module.exports.hookChildProcess = hookChildProcess; -module.exports.verifyENOENT = verifyENOENT; -module.exports.verifyENOENTSync = verifyENOENTSync; -module.exports.notFoundError = notFoundError; + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) + throw new TypeError('Invalid patch version') + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + if (/^[0-9]+$/.test(id)) { + var num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) + return num; + } + return id; + }); -/***/ }), -/* 364 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(56).spawnSync; - + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} -/***/ }), -/* 365 */ -/***/ (function(module, exports, __webpack_require__) { +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; -"use strict"; +SemVer.prototype.toString = function() { + return this.version; +}; -module.exports = function (x) { - var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); - var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); +SemVer.prototype.compare = function(other) { + debug('SemVer.compare', this.version, this.loose, other); + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); - if (x[x.length - 1] === lf) { - x = x.slice(0, x.length - 1); - } + return this.compareMain(other) || this.comparePre(other); +}; - if (x[x.length - 1] === cr) { - x = x.slice(0, x.length - 1); - } +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); - return x; + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); }; +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); -/***/ }), -/* 366 */ -/***/ (function(module, exports, __webpack_require__) { + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; -"use strict"; + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; -const path = __webpack_require__(3); -const pathKey = __webpack_require__(367); +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break; + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch', identifier); + this.inc('pre', identifier); + break; -module.exports = opts => { - opts = Object.assign({ - cwd: process.cwd(), - path: process.env[pathKey()] - }, opts); + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) + this.prerelease = [identifier, 0]; + } else + this.prerelease = [identifier, 0]; + } + break; - let prev; - let pth = path.resolve(opts.cwd); - const ret = []; + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + this.raw = this.version; + return this; +}; - while (prev !== pth) { - ret.push(path.join(pth, 'node_modules/.bin')); - prev = pth; - pth = path.resolve(pth, '..'); - } +exports.inc = inc; +function inc(version, release, loose, identifier) { + if (typeof(loose) === 'string') { + identifier = loose; + loose = undefined; + } - // ensure the running `node` binary is used - ret.push(path.dirname(process.execPath)); + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } +} - return ret.concat(opts.path).join(path.delimiter); -}; +exports.diff = diff; +function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + if (v1.prerelease.length || v2.prerelease.length) { + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return 'pre'+key; + } + } + } + return 'prerelease'; + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return key; + } + } + } + } +} -module.exports.env = opts => { - opts = Object.assign({ - env: process.env - }, opts); +exports.compareIdentifiers = compareIdentifiers; - const env = Object.assign({}, opts.env); - const path = pathKey({env}); +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); - opts.path = env[path]; - env[path] = module.exports(opts); + if (anum && bnum) { + a = +a; + b = +b; + } - return env; -}; + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} -/***/ }), -/* 367 */ -/***/ (function(module, exports, __webpack_require__) { +exports.major = major; +function major(a, loose) { + return new SemVer(a, loose).major; +} -"use strict"; +exports.minor = minor; +function minor(a, loose) { + return new SemVer(a, loose).minor; +} -module.exports = opts => { - opts = opts || {}; +exports.patch = patch; +function patch(a, loose) { + return new SemVer(a, loose).patch; +} - const env = opts.env || process.env; - const platform = opts.platform || process.platform; +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); +} - if (platform !== 'win32') { - return 'PATH'; - } +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} - return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; -}; +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} -/***/ }), -/* 368 */ -/***/ (function(module, exports, __webpack_require__) { +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} -"use strict"; +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} -var isStream = module.exports = function (stream) { - return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; -}; +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} -isStream.writable = function (stream) { - return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; -}; +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} -isStream.readable = function (stream) { - return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; -}; +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} -isStream.duplex = function (stream) { - return isStream.writable(stream) && isStream.readable(stream); -}; +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} -isStream.transform = function (stream) { - return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; -}; +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } -/***/ }), -/* 369 */ -/***/ (function(module, exports, __webpack_require__) { + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); -"use strict"; + debug('comparator', comp, loose); + this.loose = loose; + this.parse(comp); -const bufferStream = __webpack_require__(370); + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; -function getStream(inputStream, opts) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } + debug('comp', this); +} - opts = Object.assign({maxBuffer: Infinity}, opts); +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); - const maxBuffer = opts.maxBuffer; - let stream; - let clean; + if (!m) + throw new TypeError('Invalid comparator: ' + comp); - const p = new Promise((resolve, reject) => { - const error = err => { - if (err) { // null check - err.bufferedData = stream.getBufferedValue(); - } + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; - reject(err); - }; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else + this.semver = new SemVer(m[2], this.loose); +}; - stream = bufferStream(opts); - inputStream.once('error', error); - inputStream.pipe(stream); +Comparator.prototype.toString = function() { + return this.value; +}; - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - reject(new Error('maxBuffer exceeded')); - } - }); - stream.once('error', error); - stream.on('end', resolve); +Comparator.prototype.test = function(version) { + debug('Comparator.test', version, this.loose); - clean = () => { - // some streams doesn't implement the `stream.Readable` interface correctly - if (inputStream.unpipe) { - inputStream.unpipe(stream); - } - }; - }); + if (this.semver === ANY) + return true; - p.then(clean, clean); + if (typeof version === 'string') + version = new SemVer(version, this.loose); - return p.then(() => stream.getBufferedValue()); -} + return cmp(version, this.operator, this.semver, this.loose); +}; -module.exports = getStream; -module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); -module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); +Comparator.prototype.intersects = function(comp, loose) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required'); + } + var rangeTmp; -/***/ }), -/* 370 */ -/***/ (function(module, exports, __webpack_require__) { + if (this.operator === '') { + rangeTmp = new Range(comp.value, loose); + return satisfies(this.value, rangeTmp, loose); + } else if (comp.operator === '') { + rangeTmp = new Range(this.value, loose); + return satisfies(comp.semver, rangeTmp, loose); + } -"use strict"; + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>'); + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<'); + var sameSemVer = this.semver.version === comp.semver.version; + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<='); + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, loose) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')); + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, loose) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')); -const PassThrough = __webpack_require__(20).PassThrough; + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; +}; -module.exports = opts => { - opts = Object.assign({}, opts); - const array = opts.array; - let encoding = opts.encoding; - const buffer = encoding === 'buffer'; - let objectMode = false; +exports.Range = Range; +function Range(range, loose) { + if (range instanceof Range) { + if (range.loose === loose) { + return range; + } else { + return new Range(range.raw, loose); + } + } - if (array) { - objectMode = !(encoding || buffer); - } else { - encoding = encoding || 'utf8'; - } + if (range instanceof Comparator) { + return new Range(range.value, loose); + } - if (buffer) { - encoding = null; - } + if (!(this instanceof Range)) + return new Range(range, loose); - let len = 0; - const ret = []; - const stream = new PassThrough({objectMode}); + this.loose = loose; - if (encoding) { - stream.setEncoding(encoding); - } + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); - stream.on('data', chunk => { - ret.push(chunk); + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } - if (objectMode) { - len = ret.length; - } else { - len += chunk.length; - } - }); + this.format(); +} - stream.getBufferedValue = () => { - if (array) { - return ret; - } +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; - return buffer ? Buffer.concat(ret, len) : ret.join(''); - }; +Range.prototype.toString = function() { + return this.range; +}; - stream.getBufferedLength = () => len; +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + debug('range', range, loose); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range, re[COMPARATORTRIM]); - return stream; -}; + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); -/***/ }), -/* 371 */ -/***/ (function(module, exports, __webpack_require__) { + // normalize spaces + range = range.split(/\s+/).join(' '); -"use strict"; + // At this point, the range is completely trimmed and + // ready to be split into comparators. -module.exports = (promise, onFinally) => { - onFinally = onFinally || (() => {}); + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); - return promise.then( - val => new Promise(resolve => { - resolve(onFinally()); - }).then(() => val), - err => new Promise(resolve => { - resolve(onFinally()); - }).then(() => { - throw err; - }) - ); + return set; }; +Range.prototype.intersects = function(range, loose) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required'); + } -/***/ }), -/* 372 */ -/***/ (function(module, exports) { - -// This is not the set of all possible signals. -// -// It IS, however, the set of all signals that trigger -// an exit on either Linux or BSD systems. Linux is a -// superset of the signal names supported on BSD, and -// the unknown signals just fail to register, so we can -// catch that easily enough. -// -// Don't bother with SIGKILL. It's uncatchable, which -// means that we can't fire any callbacks anyway. -// -// If a user does happen to register a handler on a non- -// fatal signal like SIGWINCH or something, and then -// exit, it'll end up firing `process.emit('exit')`, so -// the handler will be fired anyway. -// -// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised -// artificially, inherently leave the process in a -// state from which it is not safe to try and enter JS -// listeners. -module.exports = [ - 'SIGABRT', - 'SIGALRM', - 'SIGHUP', - 'SIGINT', - 'SIGTERM' -] + return this.set.some(function(thisComparators) { + return thisComparators.every(function(thisComparator) { + return range.set.some(function(rangeComparators) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, loose); + }); + }); + }); + }); +}; -if (process.platform !== 'win32') { - module.exports.push( - 'SIGVTALRM', - 'SIGXCPU', - 'SIGXFSZ', - 'SIGUSR2', - 'SIGTRAP', - 'SIGSYS', - 'SIGQUIT', - 'SIGIOT' - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ) +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); } -if (process.platform === 'linux') { - module.exports.push( - 'SIGIO', - 'SIGPOLL', - 'SIGPWR', - 'SIGSTKFLT', - 'SIGUNUSED' - ) +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + debug('comp', comp); + comp = replaceCarets(comp, loose); + debug('caret', comp); + comp = replaceTildes(comp, loose); + debug('tildes', comp); + comp = replaceXRanges(comp, loose); + debug('xrange', comp); + comp = replaceStars(comp, loose); + debug('stars', comp); + return comp; } +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} -/***/ }), -/* 373 */ -/***/ (function(module, exports, __webpack_require__) { +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} -"use strict"; +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; -// The Node team wants to deprecate `process.bind(...)`. -// https://github.com/nodejs/node/pull/2768 -// -// However, we need the 'uv' binding for errname support. -// This is a defensive wrapper around it so `execa` will not fail entirely if it stops working someday. -// -// If this ever stops working. See: https://github.com/sindresorhus/execa/issues/31#issuecomment-215939939 for another possible solution. -let uv; + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else if (pr) { + debug('replaceTilde pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; -try { - uv = process.binding('uv'); + debug('tilde return', ret); + return ret; + }); +} - if (typeof uv.errname !== 'function') { - throw new TypeError('uv.errname is not a function'); - } -} catch (err) { - console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); - uv = null; +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); } -function errname(uv, code) { - if (uv) { - return uv.errname(code); - } +function replaceCaret(comp, loose) { + debug('caret', comp, loose); + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr); + var ret; - if (!(code < 0)) { - throw new Error('err >= 0'); - } + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + } else if (pr) { + debug('replaceCaret pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0'; + } else { + debug('no pr'); + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; + } - return `Unknown system error ${code}`; + debug('caret return', ret); + return ret; + }); } -module.exports = code => errname(uv, code); +function replaceXRanges(comp, loose) { + debug('replaceXRanges', comp, loose); + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} -// Used for testing the fallback behavior -module.exports.__test__ = errname; +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + if (gtlt === '=' && anyX) + gtlt = ''; -/***/ }), -/* 374 */ -/***/ (function(module, exports, __webpack_require__) { + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0'; + } else { + // nothing is forbidden + ret = '*'; + } + } else if (gtlt && anyX) { + // replace X with 0 + if (xm) + m = 0; + if (xp) + p = 0; -"use strict"; + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<'; + if (xm) + M = +M + 1; + else + m = +m + 1; + } -const alias = ['stdin', 'stdout', 'stderr']; + ret = gtlt + M + '.' + m + '.' + p; + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } -const hasAlias = opts => alias.some(x => Boolean(opts[x])); + debug('xRange return', ret); -module.exports = opts => { - if (!opts) { - return null; - } + return ret; + }); +} - if (opts.stdio && hasAlias(opts)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); - } +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + debug('replaceStars', comp, loose); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} - if (typeof opts.stdio === 'string') { - return opts.stdio; - } +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { - const stdio = opts.stdio || []; + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0'; + else + from = '>=' + from; - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; - const result = []; - const len = Math.max(stdio.length, alias.length); + return (from + ' ' + to).trim(); +} - for (let i = 0; i < len; i++) { - let value = null; - if (stdio[i] !== undefined) { - value = stdio[i]; - } else if (opts[alias[i]] !== undefined) { - value = opts[alias[i]]; - } +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; - result[i] = value; - } + if (typeof version === 'string') + version = new SemVer(version, this.loose); - return result; + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; }; +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } -/***/ }), -/* 375 */ -/***/ (function(module, exports, __webpack_require__) { + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === ANY) + continue; -// Copyright IBM Corp. 2014. All Rights Reserved. -// Node module: strong-log-transformer -// This file is licensed under the Artistic License 2.0. -// License text available at https://opensource.org/licenses/Artistic-2.0 + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } -module.exports = __webpack_require__(87); -module.exports.cli = __webpack_require__(381); + // Version has a -pre, but it's not one of the ones we like. + return false; + } + return true; +} -/***/ }), -/* 376 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright (C) 2011-2015 John Hewson -// -// 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. - -var stream = __webpack_require__(20), - util = __webpack_require__(13), - timers = __webpack_require__(377); - -// convinience API -module.exports = function(readStream, options) { - return module.exports.createStream(readStream, options); -}; - -// basic API -module.exports.createStream = function(readStream, options) { - if (readStream) { - return createLineStream(readStream, options); - } else { - return new LineStream(options); - } -}; - -// deprecated API -module.exports.createLineStream = function(readStream) { - console.log('WARNING: byline#createLineStream is deprecated and will be removed soon'); - return createLineStream(readStream); -}; - -function createLineStream(readStream, options) { - if (!readStream) { - throw new Error('expected readStream'); - } - if (!readStream.readable) { - throw new Error('readStream must be readable'); +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; } - var ls = new LineStream(options); - readStream.pipe(ls); - return ls; + return range.test(version); } -// -// using the new node v0.10 "streams2" API -// - -module.exports.LineStream = LineStream; - -function LineStream(options) { - stream.Transform.call(this, options); - options = options || {}; - - // use objectMode to stop the output from being buffered - // which re-concatanates the lines, just without newlines. - this._readableState.objectMode = true; - this._lineBuffer = []; - this._keepEmptyLines = options.keepEmptyLines || false; - this._lastChunkEndedWithCR = false; - - // take the source's encoding if we don't have one - var self = this; - this.on('pipe', function(src) { - if (!self.encoding) { - // but we can't do this for old-style streams - if (src instanceof stream.Readable) { - self.encoding = src._readableState.encoding; +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range(range, loose); + } catch (er) { + return null; + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { // satisfies(v, range, loose) + if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) + max = v; + maxSV = new SemVer(max, loose); } } - }); + }) + return max; } -util.inherits(LineStream, stream.Transform); -LineStream.prototype._transform = function(chunk, encoding, done) { - // decode binary chunks as UTF-8 - encoding = encoding || 'utf8'; - - if (Buffer.isBuffer(chunk)) { - if (encoding == 'buffer') { - chunk = chunk.toString(); // utf8 - encoding = 'utf8'; - } - else { - chunk = chunk.toString(encoding); - } - } - this._chunkEncoding = encoding; - - // see: http://www.unicode.org/reports/tr18/#Line_Boundaries - var lines = chunk.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g); - - // don't split CRLF which spans chunks - if (this._lastChunkEndedWithCR && chunk[0] == '\n') { - lines.shift(); - } - - if (this._lineBuffer.length > 0) { - this._lineBuffer[this._lineBuffer.length - 1] += lines[0]; - lines.shift(); +exports.minSatisfying = minSatisfying; +function minSatisfying(versions, range, loose) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range(range, loose); + } catch (er) { + return null; } - - this._lastChunkEndedWithCR = chunk[chunk.length - 1] == '\r'; - this._lineBuffer = this._lineBuffer.concat(lines); - this._pushBuffer(encoding, 1, done); -}; - -LineStream.prototype._pushBuffer = function(encoding, keep, done) { - // always buffer the last (possibly partial) line - while (this._lineBuffer.length > keep) { - var line = this._lineBuffer.shift(); - // skip empty lines - if (this._keepEmptyLines || line.length > 0 ) { - if (!this.push(this._reencode(line, encoding))) { - // when the high-water mark is reached, defer pushes until the next tick - var self = this; - timers.setImmediate(function() { - self._pushBuffer(encoding, keep, done); - }); - return; + versions.forEach(function (v) { + if (rangeObj.test(v)) { // satisfies(v, range, loose) + if (!min || minSV.compare(v) === 1) { // compare(min, v, true) + min = v; + minSV = new SemVer(min, loose); } } - } - done(); -}; - -LineStream.prototype._flush = function(done) { - this._pushBuffer(this._chunkEncoding, 0, done); -}; + }) + return min; +} -// see Readable::push -LineStream.prototype._reencode = function(line, chunkEncoding) { - if (this.encoding && this.encoding != chunkEncoding) { - return new Buffer(line, chunkEncoding).toString(this.encoding); - } - else if (this.encoding) { - // this should be the most common case, i.e. we're using an encoded source stream - return line; - } - else { - return new Buffer(line, chunkEncoding); +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; } -}; - - -/***/ }), -/* 377 */ -/***/ (function(module, exports) { - -module.exports = require("timers"); +} -/***/ }), -/* 378 */ -/***/ (function(module, exports, __webpack_require__) { +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} -var Stream = __webpack_require__(20) +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} -// through -// -// a stream that does nothing but re-emit the input. -// useful for aggregating a series of changing but not ending streams into one stream) +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); -exports = module.exports = through -through.through = through + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } -//create a readable writable stream. + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } -function through (write, end, opts) { - write = write || function (data) { this.queue(data) } - end = end || function () { this.queue(null) } + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. - var ended = false, destroyed = false, buffer = [], _ended = false - var stream = new Stream() - stream.readable = stream.writable = true - stream.paused = false + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; -// stream.autoPause = !(opts && opts.autoPause === false) - stream.autoDestroy = !(opts && opts.autoDestroy === false) + var high = null; + var low = null; - stream.write = function (data) { - write.call(this, data) - return !stream.paused - } + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); - function drain() { - while(buffer.length && !stream.paused) { - var data = buffer.shift() - if(null === data) - return stream.emit('end') - else - stream.emit('data', data) + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; } - } - stream.queue = stream.push = function (data) { -// console.error(ended) - if(_ended) return stream - if(data === null) _ended = true - buffer.push(data) - drain() - return stream + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } } + return true; +} - //this will be registered as the first 'end' listener - //must call destroy next tick, to make sure we're after any - //stream piped from here. - //this is only a problem if end is not emitted synchronously. - //a nicer way to do this is to make sure this is the last listener for 'end' +exports.prerelease = prerelease; +function prerelease(version, loose) { + var parsed = parse(version, loose); + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; +} - stream.on('end', function () { - stream.readable = false - if(!stream.writable && stream.autoDestroy) - process.nextTick(function () { - stream.destroy() - }) - }) +exports.intersects = intersects; +function intersects(r1, r2, loose) { + r1 = new Range(r1, loose) + r2 = new Range(r2, loose) + return r1.intersects(r2) +} - function _end () { - stream.writable = false - end.call(stream) - if(!stream.readable && stream.autoDestroy) - stream.destroy() - } +exports.coerce = coerce; +function coerce(version) { + if (version instanceof SemVer) + return version; - stream.end = function (data) { - if(ended) return - ended = true - if(arguments.length) stream.write(data) - _end() // will emit or queue - return stream - } + if (typeof version !== 'string') + return null; - stream.destroy = function () { - if(destroyed) return - destroyed = true - ended = true - buffer.length = 0 - stream.writable = stream.readable = false - stream.emit('close') - return stream - } + var match = version.match(re[COERCE]); - stream.pause = function () { - if(stream.paused) return - stream.paused = true - return stream - } + if (match == null) + return null; - stream.resume = function () { - if(stream.paused) { - stream.paused = false - stream.emit('resume') - } - drain() - //may have become paused again, - //as drain emits 'data'. - if(!stream.paused) - stream.emit('drain') - return stream - } - return stream + return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); } - /***/ }), -/* 379 */ +/* 362 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(20) -var writeMethods = ["write", "end", "destroy"] -var readMethods = ["resume", "pause"] -var readEvents = ["data", "close"] -var slice = Array.prototype.slice +var parse = __webpack_require__(363); +var correct = __webpack_require__(365); -module.exports = duplex +var genericWarning = ( + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "' +); -function forEach (arr, fn) { - if (arr.forEach) { - return arr.forEach(fn) - } +var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/; - for (var i = 0; i < arr.length; i++) { - fn(arr[i], i) - } +function startsWith(prefix, string) { + return string.slice(0, prefix.length) === prefix; } -function duplex(writer, reader) { - var stream = new Stream() - var ended = false +function usesLicenseRef(ast) { + if (ast.hasOwnProperty('license')) { + var license = ast.license; + return ( + startsWith('LicenseRef', license) || + startsWith('DocumentRef', license) + ); + } else { + return ( + usesLicenseRef(ast.left) || + usesLicenseRef(ast.right) + ); + } +} - forEach(writeMethods, proxyWriter) +module.exports = function(argument) { + var ast; - forEach(readMethods, proxyReader) + try { + ast = parse(argument); + } catch (e) { + var match + if ( + argument === 'UNLICENSED' || + argument === 'UNLICENCED' + ) { + return { + validForOldPackages: true, + validForNewPackages: true, + unlicensed: true + }; + } else if (match = fileReferenceRE.exec(argument)) { + return { + validForOldPackages: true, + validForNewPackages: true, + inFile: match[1] + }; + } else { + var result = { + validForOldPackages: false, + validForNewPackages: false, + warnings: [genericWarning] + }; + var corrected = correct(argument); + if (corrected) { + result.warnings.push( + 'license is similar to the valid expression "' + corrected + '"' + ); + } + return result; + } + } - forEach(readEvents, proxyStream) + if (usesLicenseRef(ast)) { + return { + validForNewPackages: false, + validForOldPackages: false, + spdx: true, + warnings: [genericWarning] + }; + } else { + return { + validForNewPackages: true, + validForOldPackages: true, + spdx: true + }; + } +}; - reader.on("end", handleEnd) - writer.on("drain", function() { - stream.emit("drain") - }) +/***/ }), +/* 363 */ +/***/ (function(module, exports, __webpack_require__) { - writer.on("error", reemit) - reader.on("error", reemit) +var parser = __webpack_require__(364).parser - stream.writable = writer.writable - stream.readable = reader.readable +module.exports = function (argument) { + return parser.parse(argument) +} - return stream - function proxyWriter(methodName) { - stream[methodName] = method +/***/ }), +/* 364 */ +/***/ (function(module, exports, __webpack_require__) { - function method() { - return writer[methodName].apply(writer, arguments) - } - } +/* WEBPACK VAR INJECTION */(function(module) {/* parser generated by jison 0.4.17 */ +/* + Returns a Parser object of the following structure: - function proxyReader(methodName) { - stream[methodName] = method + Parser: { + yy: {} + } - function method() { - stream.emit(methodName) - var func = reader[methodName] - if (func) { - return func.apply(reader, arguments) - } - reader.emit(methodName) - } - } - - function proxyStream(methodName) { - reader.on(methodName, reemit) + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), - function reemit() { - var args = slice.call(arguments) - args.unshift(methodName) - stream.emit.apply(stream, args) - } - } + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), - function handleEnd() { - if (ended) { - return - } - ended = true - var args = slice.call(arguments) - args.unshift("end") - stream.emit.apply(stream, args) - } + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, - function reemit(err) { - stream.emit("error", err) + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, } -} - - -/***/ }), -/* 380 */ -/***/ (function(module, exports, __webpack_require__) { - -var map = { - "./af": 88, - "./af.js": 88, - "./ar": 89, - "./ar-dz": 90, - "./ar-dz.js": 90, - "./ar-kw": 91, - "./ar-kw.js": 91, - "./ar-ly": 92, - "./ar-ly.js": 92, - "./ar-ma": 93, - "./ar-ma.js": 93, - "./ar-sa": 94, - "./ar-sa.js": 94, - "./ar-tn": 95, - "./ar-tn.js": 95, - "./ar.js": 89, - "./az": 96, - "./az.js": 96, - "./be": 97, - "./be.js": 97, - "./bg": 98, - "./bg.js": 98, - "./bm": 99, - "./bm.js": 99, - "./bn": 100, - "./bn.js": 100, - "./bo": 101, - "./bo.js": 101, - "./br": 102, - "./br.js": 102, - "./bs": 103, - "./bs.js": 103, - "./ca": 104, - "./ca.js": 104, - "./cs": 105, - "./cs.js": 105, - "./cv": 106, - "./cv.js": 106, - "./cy": 107, - "./cy.js": 107, - "./da": 108, - "./da.js": 108, - "./de": 109, - "./de-at": 110, - "./de-at.js": 110, - "./de-ch": 111, - "./de-ch.js": 111, - "./de.js": 109, - "./dv": 112, - "./dv.js": 112, - "./el": 113, - "./el.js": 113, - "./en-au": 114, - "./en-au.js": 114, - "./en-ca": 115, - "./en-ca.js": 115, - "./en-gb": 116, - "./en-gb.js": 116, - "./en-ie": 117, - "./en-ie.js": 117, - "./en-nz": 118, - "./en-nz.js": 118, - "./eo": 119, - "./eo.js": 119, - "./es": 120, - "./es-do": 121, - "./es-do.js": 121, - "./es-us": 122, - "./es-us.js": 122, - "./es.js": 120, - "./et": 123, - "./et.js": 123, - "./eu": 124, - "./eu.js": 124, - "./fa": 125, - "./fa.js": 125, - "./fi": 126, - "./fi.js": 126, - "./fo": 127, - "./fo.js": 127, - "./fr": 128, - "./fr-ca": 129, - "./fr-ca.js": 129, - "./fr-ch": 130, - "./fr-ch.js": 130, - "./fr.js": 128, - "./fy": 131, - "./fy.js": 131, - "./gd": 132, - "./gd.js": 132, - "./gl": 133, - "./gl.js": 133, - "./gom-latn": 134, - "./gom-latn.js": 134, - "./gu": 135, - "./gu.js": 135, - "./he": 136, - "./he.js": 136, - "./hi": 137, - "./hi.js": 137, - "./hr": 138, - "./hr.js": 138, - "./hu": 139, - "./hu.js": 139, - "./hy-am": 140, - "./hy-am.js": 140, - "./id": 141, - "./id.js": 141, - "./is": 142, - "./is.js": 142, - "./it": 143, - "./it.js": 143, - "./ja": 144, - "./ja.js": 144, - "./jv": 145, - "./jv.js": 145, - "./ka": 146, - "./ka.js": 146, - "./kk": 147, - "./kk.js": 147, - "./km": 148, - "./km.js": 148, - "./kn": 149, - "./kn.js": 149, - "./ko": 150, - "./ko.js": 150, - "./ky": 151, - "./ky.js": 151, - "./lb": 152, - "./lb.js": 152, - "./lo": 153, - "./lo.js": 153, - "./lt": 154, - "./lt.js": 154, - "./lv": 155, - "./lv.js": 155, - "./me": 156, - "./me.js": 156, - "./mi": 157, - "./mi.js": 157, - "./mk": 158, - "./mk.js": 158, - "./ml": 159, - "./ml.js": 159, - "./mr": 160, - "./mr.js": 160, - "./ms": 161, - "./ms-my": 162, - "./ms-my.js": 162, - "./ms.js": 161, - "./mt": 163, - "./mt.js": 163, - "./my": 164, - "./my.js": 164, - "./nb": 165, - "./nb.js": 165, - "./ne": 166, - "./ne.js": 166, - "./nl": 167, - "./nl-be": 168, - "./nl-be.js": 168, - "./nl.js": 167, - "./nn": 169, - "./nn.js": 169, - "./pa-in": 170, - "./pa-in.js": 170, - "./pl": 171, - "./pl.js": 171, - "./pt": 172, - "./pt-br": 173, - "./pt-br.js": 173, - "./pt.js": 172, - "./ro": 174, - "./ro.js": 174, - "./ru": 175, - "./ru.js": 175, - "./sd": 176, - "./sd.js": 176, - "./se": 177, - "./se.js": 177, - "./si": 178, - "./si.js": 178, - "./sk": 179, - "./sk.js": 179, - "./sl": 180, - "./sl.js": 180, - "./sq": 181, - "./sq.js": 181, - "./sr": 182, - "./sr-cyrl": 183, - "./sr-cyrl.js": 183, - "./sr.js": 182, - "./ss": 184, - "./ss.js": 184, - "./sv": 185, - "./sv.js": 185, - "./sw": 186, - "./sw.js": 186, - "./ta": 187, - "./ta.js": 187, - "./te": 188, - "./te.js": 188, - "./tet": 189, - "./tet.js": 189, - "./th": 190, - "./th.js": 190, - "./tl-ph": 191, - "./tl-ph.js": 191, - "./tlh": 192, - "./tlh.js": 192, - "./tr": 193, - "./tr.js": 193, - "./tzl": 194, - "./tzl.js": 194, - "./tzm": 195, - "./tzm-latn": 196, - "./tzm-latn.js": 196, - "./tzm.js": 195, - "./uk": 197, - "./uk.js": 197, - "./ur": 198, - "./ur.js": 198, - "./uz": 199, - "./uz-latn": 200, - "./uz-latn.js": 200, - "./uz.js": 199, - "./vi": 201, - "./vi.js": 201, - "./x-pseudo": 202, - "./x-pseudo.js": 202, - "./yo": 203, - "./yo.js": 203, - "./zh-cn": 204, - "./zh-cn.js": 204, - "./zh-hk": 205, - "./zh-hk.js": 205, - "./zh-tw": 206, - "./zh-tw.js": 206 -}; -function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); -}; -function webpackContextResolve(req) { - var id = map[req]; - if(!(id + 1)) // check for number or string - throw new Error("Cannot find module '" + req + "'."); - return id; -}; -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -module.exports = webpackContext; -webpackContext.id = 380; - -/***/ }), -/* 381 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright IBM Corp. 2014. All Rights Reserved. -// Node module: strong-log-transformer -// This file is licensed under the Artistic License 2.0. -// License text available at https://opensource.org/licenses/Artistic-2.0 - - - -var minimist = __webpack_require__(382); -var path = __webpack_require__(3); - -var Logger = __webpack_require__(87); -var pkg = __webpack_require__(383); + } -module.exports = cli; -function cli(args) { - var opts = minimist(args.slice(2)); - var $0 = path.basename(args[1]); - var p = console.log.bind(console); - if (opts.v || opts.version) { - version($0, p); - } else if (opts.h || opts.help) { - usage($0, p); - } else { - process.stdin.pipe(Logger(opts)).pipe(process.stdout); + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } -} -function version($0, p) { - p('%s v%s', pkg.name, pkg.version); -} -function usage($0, p) { - var PADDING = ' '; - var opt, def; - p('Usage: %s [options]', $0); - p(''); - p('%s', pkg.description); - p(''); - p('OPTIONS:'); - for (opt in Logger.DEFAULTS) { - def = Logger.DEFAULTS[opt]; - if (typeof def === 'boolean') - boolOpt(opt, Logger.DEFAULTS[opt]); - else - stdOpt(opt, Logger.DEFAULTS[opt]); + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) } - p(''); - - function boolOpt(name, def) { - name = def ? 'no-' + name : name; - name = name + PADDING.slice(0, 20-name.length); - p(' --%s default: %s', name, def ? 'on' : 'off'); + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } +*/ +var spdxparse = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,6],$V2=[1,7],$V3=[1,4],$V4=[1,9],$V5=[1,10],$V6=[5,14,15,17],$V7=[5,12,14,15,17]; +var parser = {trace: function trace() { }, +yy: {}, +symbols_: {"error":2,"start":3,"expression":4,"EOS":5,"simpleExpression":6,"LICENSE":7,"PLUS":8,"LICENSEREF":9,"DOCUMENTREF":10,"COLON":11,"WITH":12,"EXCEPTION":13,"AND":14,"OR":15,"OPEN":16,"CLOSE":17,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"EOS",7:"LICENSE",8:"PLUS",9:"LICENSEREF",10:"DOCUMENTREF",11:"COLON",12:"WITH",13:"EXCEPTION",14:"AND",15:"OR",16:"OPEN",17:"CLOSE"}, +productions_: [0,[3,2],[6,1],[6,2],[6,1],[6,3],[4,1],[4,3],[4,3],[4,3],[4,3]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ - function stdOpt(name, def) { - var value = name.toUpperCase() + - PADDING.slice(0, 19 - name.length*2); - p(' --%s %s default: %j', name, value, def); - } +var $0 = $$.length - 1; +switch (yystate) { +case 1: +return this.$ = $$[$0-1] +break; +case 2: case 4: case 5: +this.$ = {license: yytext} +break; +case 3: +this.$ = {license: $$[$0-1], plus: true} +break; +case 6: +this.$ = $$[$0] +break; +case 7: +this.$ = {exception: $$[$0]} +this.$.license = $$[$0-2].license +if ($$[$0-2].hasOwnProperty('plus')) { + this.$.plus = $$[$0-2].plus } - - -/***/ }), -/* 382 */ -/***/ (function(module, exports) { - -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {} }; - - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - flags.strings[aliases[key]] = true; +break; +case 8: +this.$ = {conjunction: 'and', left: $$[$0-2], right: $$[$0]} +break; +case 9: +this.$ = {conjunction: 'or', left: $$[$0-2], right: $$[$0]} +break; +case 10: +this.$ = $$[$0-1] +break; +} +}, +table: [{3:1,4:2,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{1:[3]},{5:[1,8],14:$V4,15:$V5},o($V6,[2,6],{12:[1,11]}),{4:12,6:3,7:$V0,9:$V1,10:$V2,16:$V3},o($V7,[2,2],{8:[1,13]}),o($V7,[2,4]),{11:[1,14]},{1:[2,1]},{4:15,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{4:16,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{13:[1,17]},{14:$V4,15:$V5,17:[1,18]},o($V7,[2,3]),{9:[1,19]},o($V6,[2,8]),o([5,15,17],[2,9],{14:$V4}),o($V6,[2,7]),o($V6,[2,10]),o($V7,[2,5])], +defaultActions: {8:[2,1]}, +parseError: function parseError(str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + function _parseError (msg, hash) { + this.message = msg; + this.hash = hash; } - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } + _parseError.prototype = Error; - function setArg (key, val) { - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); + throw new _parseError(str, hash); } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + _token_stack: + var lex = function () { + var token; + token = lexer.lex() || EOF; + if (typeof token !== 'number') { + token = self.symbols_[token] || token; } - else { - setArg(key, flags.strings[key] ? '' : true); + return token; + }; + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); } + action = table[state] && table[state][symbol]; } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true); + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; } - else { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - if (opts['--']) { - argv['--'] = new Array(); - notFlags.forEach(function(key) { - argv['--'].push(key); - }); - } - else { - notFlags.forEach(function(key) { - argv._.push(key); - }); } + return true; +}}; +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); +EOF:1, - var key = keys[keys.length - 1]; - return key in o; -} +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - - - -/***/ }), -/* 383 */ -/***/ (function(module, exports) { - -module.exports = {"name":"strong-log-transformer","version":"1.0.6","description":"Stream transformer that prefixes lines with timestamps and other things.","author":"Ryan Graham ","license":"Artistic-2.0","repository":{"type":"git","url":"git://github.com/strongloop/strong-log-transformer"},"keywords":["logging","streams"],"bugs":{"url":"https://github.com/strongloop/strong-log-transformer/issues"},"homepage":"https://github.com/strongloop/strong-log-transformer","directories":{"test":"test"},"bin":{"sl-log-transformer":"bin/sl-log-transformer.js"},"main":"index.js","scripts":{"test":"tap --coverage --coverage-report=cobertura test/test-*"},"dependencies":{"byline":"^5.0.0","duplexer":"^0.1.1","minimist":"^0.1.0","moment":"^2.6.0","through":"^2.3.4"},"devDependencies":{"tap":"^1.3.2"}} - -/***/ }), -/* 384 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const path = __webpack_require__(3); -const loadJsonFile = __webpack_require__(385); -const pathType = __webpack_require__(394); - -module.exports = (fp, opts) => { - if (typeof fp !== 'string') { - opts = fp; - fp = '.'; - } - - opts = opts || {}; - - return pathType.dir(fp) - .then(isDir => { - if (isDir) { - fp = path.join(fp, 'package.json'); - } - - return loadJsonFile(fp); - }) - .then(x => { - if (opts.normalize !== false) { - __webpack_require__(209)(x); - } - - return x; - }); -}; - -module.exports.sync = (fp, opts) => { - if (typeof fp !== 'string') { - opts = fp; - fp = '.'; - } - - opts = opts || {}; - fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp; - - const x = loadJsonFile.sync(fp); - - if (opts.normalize !== false) { - __webpack_require__(209)(x); - } - - return x; -}; - - -/***/ }), -/* 385 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const path = __webpack_require__(3); -const fs = __webpack_require__(25); -const stripBom = __webpack_require__(389); -const parseJson = __webpack_require__(390); -const pify = __webpack_require__(21); - -const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp)); +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, -module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp)); -module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp); +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, -/***/ }), -/* 386 */ -/***/ (function(module, exports, __webpack_require__) { +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); -var fs = __webpack_require__(208) -var constants = __webpack_require__(387) + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); -var origCwd = process.cwd -var cwd = null + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; -var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -try { - process.cwd() -} catch (er) {} + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, -module.exports = patch +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); -function patch (fs) { - // (re-)implement some things that are known busted or missing. + } + return this; + }, - // lchmod, broken prior to 0.6.2 - // back-port the fix here. - if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs) - } +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, - // lutimes implementation, or no-op - if (!fs.lutimes) { - patchLutimes(fs) - } +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, - // https://github.com/isaacs/node-graceful-fs/issues/4 - // Chown should not fail on einval or eperm if non-root. - // It should not fail on enosys ever, as this just indicates - // that a fs doesn't support the intended operation. +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, - fs.chown = chownFix(fs.chown) - fs.fchown = chownFix(fs.fchown) - fs.lchown = chownFix(fs.lchown) +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, - fs.chmod = chmodFix(fs.chmod) - fs.fchmod = chmodFix(fs.fchmod) - fs.lchmod = chmodFix(fs.lchmod) +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function (match, indexed_rule) { + var token, + lines, + backup; - fs.chownSync = chownFixSync(fs.chownSync) - fs.fchownSync = chownFixSync(fs.fchownSync) - fs.lchownSync = chownFixSync(fs.lchownSync) + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } - fs.chmodSync = chmodFixSync(fs.chmodSync) - fs.fchmodSync = chmodFixSync(fs.fchmodSync) - fs.lchmodSync = chmodFixSync(fs.lchmodSync) + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, - fs.stat = statFix(fs.stat) - fs.fstat = statFix(fs.fstat) - fs.lstat = statFix(fs.lstat) +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } - fs.statSync = statFixSync(fs.statSync) - fs.fstatSync = statFixSync(fs.fstatSync) - fs.lstatSync = statFixSync(fs.lstatSync) + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, - // if lchmod/lchown do not exist, then make them no-ops - if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - if (cb) process.nextTick(cb) - } - fs.lchmodSync = function () {} - } - if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - if (cb) process.nextTick(cb) - } - fs.lchownSync = function () {} - } +// return next match that has a token +lex:function lex() { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, - // on Windows, A/V software can lock the directory, causing this - // to fail with an EACCES or EPERM if the directory contains newly - // created files. Try again on failure, for up to 60 seconds. +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin(condition) { + this.conditionStack.push(condition); + }, - // Set the timeout this long because some Windows Anti-Virus, such as Parity - // bit9, may lock files for up to a minute, causing npm package install - // failures. Also, take care to yield the scheduler. Windows scheduling gives - // CPU to a busy looping process, which can cause the program causing the lock - // contention to be starved of CPU by node, so the contention doesn't resolve. - if (platform === "win32") { - fs.rename = (function (fs$rename) { return function (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; +// pop the previously active lexer condition state off the condition stack +popState:function popState() { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; } - if (cb) cb(er) - }) - }})(fs.rename) - } + }, - // if read() returns EAGAIN, then just try it again. - fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return fs$read.call(fs, fd, buffer, offset, length, position, callback) +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; } - callback_.apply(this, arguments) - } - } - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - }})(fs.read) + }, - fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return fs$readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState(n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; } - throw er - } - } - }})(fs.readSync) -} - -function patchLchmod (fs) { - fs.lchmod = function (path, mode, callback) { - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - if (callback) callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - if (callback) callback(err || err2) - }) - }) - }) - } + }, - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var threw = true - var ret - try { - ret = fs.fchmodSync(fd, mode) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } -} - -function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - if (er) { - if (cb) cb(er) - return - } - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - if (cb) cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - var ret - var threw = true - try { - ret = fs.futimesSync(fd, at, mt) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - -function chmodFix (orig) { - if (!orig) return orig - return function (target, mode, cb) { - return orig.call(fs, target, mode, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } -} - -function chmodFixSync (orig) { - if (!orig) return orig - return function (target, mode) { - try { - return orig.call(fs, target, mode) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - - -function statFix (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, cb) { - return orig.call(fs, target, function (er, stats) { - if (!stats) return cb.apply(this, arguments) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - if (cb) cb.apply(this, arguments) - }) - } -} - -function statFixSync (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target) { - var stats = orig.call(fs, target) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - return stats; - } -} - -// ENOSYS means that the fs doesn't support the op. Just ignore -// that, because it doesn't matter. -// -// if there's no getuid, or if getuid() is something other -// than 0, and the error is EINVAL or EPERM, then just ignore -// it. -// -// This specific case is a silent failure in cp, install, tar, -// and most other unix tools that manage permissions. -// -// When running as root, or if other types of errors are -// encountered, then it's strict. -function chownErOk (er) { - if (!er) - return true - - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - - return false -} - - -/***/ }), -/* 387 */ -/***/ (function(module, exports) { - -module.exports = require("constants"); - -/***/ }), -/* 388 */ -/***/ (function(module, exports, __webpack_require__) { - -var Stream = __webpack_require__(20).Stream - -module.exports = legacy - -function legacy (fs) { - return { - ReadStream: ReadStream, - WriteStream: WriteStream - } - - function ReadStream (path, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path, options); - - Stream.call(this); - - var self = this; - - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; - - this.flags = 'r'; - this.mode = 438; /*=0666*/ - this.bufferSize = 64 * 1024; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.encoding) this.setEncoding(this.encoding); - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } - - fs.open(this.path, this.flags, this.mode, function (err, fd) { - if (err) { - self.emit('error', err); - self.readable = false; - return; - } - - self.fd = fd; - self.emit('open', fd); - self._read(); - }) - } - - function WriteStream (path, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path, options); - - Stream.call(this); - - this.path = path; - this.fd = null; - this.writable = true; - - this.flags = 'w'; - this.encoding = 'binary'; - this.mode = 438; /*=0666*/ - this.bytesWritten = 0; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - this.busy = false; - this._queue = []; - - if (this.fd === null) { - this._open = fs.open; - this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); - this.flush(); - } - } -} - - -/***/ }), -/* 389 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = x => { - if (typeof x !== 'string') { - throw new TypeError('Expected a string, got ' + typeof x); - } - - // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string - // conversion translates it to FEFF (UTF-16 BOM) - if (x.charCodeAt(0) === 0xFEFF) { - return x.slice(1); - } - - return x; -}; - - -/***/ }), -/* 390 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const errorEx = __webpack_require__(391); -const fallback = __webpack_require__(393); - -const JSONError = errorEx('JSONError', { - fileName: errorEx.append('in %s') -}); - -module.exports = (input, reviver, filename) => { - if (typeof reviver === 'string') { - filename = reviver; - reviver = null; - } - - try { - try { - return JSON.parse(input, reviver); - } catch (err) { - fallback(input, reviver); - - throw err; - } - } catch (err) { - err.message = err.message.replace(/\n/g, ''); - - const jsonErr = new JSONError(err); - if (filename) { - jsonErr.fileName = filename; - } - - throw jsonErr; - } -}; - - -/***/ }), -/* 391 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(13); -var isArrayish = __webpack_require__(392); - -var errorEx = function errorEx(name, properties) { - if (!name || name.constructor !== String) { - properties = name || {}; - name = Error.name; - } - - var errorExError = function ErrorEXError(message) { - if (!this) { - return new ErrorEXError(message); - } - - message = message instanceof Error - ? message.message - : (message || this.message); - - Error.call(this, message); - Error.captureStackTrace(this, errorExError); - - this.name = name; - - Object.defineProperty(this, 'message', { - configurable: true, - enumerable: false, - get: function () { - var newMessage = message.split(/\r?\n/g); - - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - - var modifier = properties[key]; - - if ('message' in modifier) { - newMessage = modifier.message(this[key], newMessage) || newMessage; - if (!isArrayish(newMessage)) { - newMessage = [newMessage]; - } - } - } - - return newMessage.join('\n'); - }, - set: function (v) { - message = v; - } - }); - - var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); - var stackGetter = stackDescriptor.get; - var stackValue = stackDescriptor.value; - delete stackDescriptor.value; - delete stackDescriptor.writable; - - stackDescriptor.get = function () { - var stack = (stackGetter) - ? stackGetter.call(this).split(/\r?\n+/g) - : stackValue.split(/\r?\n+/g); - - // starting in Node 7, the stack builder caches the message. - // just replace it. - stack[0] = this.name + ': ' + this.message; - - var lineCount = 1; - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - - var modifier = properties[key]; - - if ('line' in modifier) { - var line = modifier.line(this[key]); - if (line) { - stack.splice(lineCount++, 0, ' ' + line); - } - } - - if ('stack' in modifier) { - modifier.stack(this[key], stack); - } - } - - return stack.join('\n'); - }; - - Object.defineProperty(this, 'stack', stackDescriptor); - }; - - if (Object.setPrototypeOf) { - Object.setPrototypeOf(errorExError.prototype, Error.prototype); - Object.setPrototypeOf(errorExError, Error); - } else { - util.inherits(errorExError, Error); - } - - return errorExError; -}; - -errorEx.append = function (str, def) { - return { - message: function (v, message) { - v = v || def; - - if (v) { - message[0] += ' ' + str.replace('%s', v.toString()); - } - - return message; - } - }; -}; - -errorEx.line = function (str, def) { - return { - line: function (v) { - v = v || def; - - if (v) { - return str.replace('%s', v.toString()); - } - - return null; - } - }; -}; - -module.exports = errorEx; - - -/***/ }), -/* 392 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function isArrayish(obj) { - if (!obj) { - return false; - } - - return obj instanceof Array || Array.isArray(obj) || - (obj.length >= 0 && obj.splice instanceof Function); -}; - - -/***/ }), -/* 393 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = parseJson -function parseJson (txt, reviver, context) { - context = context || 20 - try { - return JSON.parse(txt, reviver) - } catch (e) { - const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i) - const errIdx = syntaxErr - ? +syntaxErr[1] - : e.message.match(/^Unexpected end of JSON.*/i) - ? txt.length - 1 - : null - if (errIdx != null) { - const start = errIdx <= context - ? 0 - : errIdx - context - const end = errIdx + context >= txt.length - ? txt.length - : errIdx + context - e.message += ` while parsing near '${ - start === 0 ? '' : '...' - }${txt.slice(start, end)}${ - end === txt.length ? '' : '...' - }'` - } else { - e.message += ` while parsing '${txt.slice(0, context * 2)}'` - } - throw e - } -} - - -/***/ }), -/* 394 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const fs = __webpack_require__(7); -const pify = __webpack_require__(21); - -function type(fn, fn2, fp) { - if (typeof fp !== 'string') { - return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`)); - } - - return pify(fs[fn])(fp) - .then(stats => stats[fn2]()) - .catch(err => { - if (err.code === 'ENOENT') { - return false; - } - - throw err; - }); -} - -function typeSync(fn, fn2, fp) { - if (typeof fp !== 'string') { - throw new TypeError(`Expected a string, got ${typeof fp}`); - } - - try { - return fs[fn](fp)[fn2](); - } catch (err) { - if (err.code === 'ENOENT') { - return false; - } - - throw err; - } -} - -exports.file = type.bind(null, 'stat', 'isFile'); -exports.dir = type.bind(null, 'stat', 'isDirectory'); -exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink'); -exports.fileSync = typeSync.bind(null, 'statSync', 'isFile'); -exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory'); -exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); - - -/***/ }), -/* 395 */ -/***/ (function(module, exports, __webpack_require__) { - -var semver = __webpack_require__(396) -var validateLicense = __webpack_require__(397); -var hostedGitInfo = __webpack_require__(402) -var isBuiltinModule = __webpack_require__(404) -var depTypes = ["dependencies","devDependencies","optionalDependencies"] -var extractDescription = __webpack_require__(406) -var url = __webpack_require__(210) -var typos = __webpack_require__(407) - -var fixer = module.exports = { - // default warning function - warn: function() {}, - - fixRepositoryField: function(data) { - if (data.repositories) { - this.warn("repositories"); - data.repository = data.repositories[0] - } - if (!data.repository) return this.warn("missingRepository") - if (typeof data.repository === "string") { - data.repository = { - type: "git", - url: data.repository - } - } - var r = data.repository.url || "" - if (r) { - var hosted = hostedGitInfo.fromUrl(r) - if (hosted) { - r = data.repository.url - = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString() - } - } - - if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) { - this.warn("brokenGitUrl", r) - } - } - -, fixTypos: function(data) { - Object.keys(typos.topLevel).forEach(function (d) { - if (data.hasOwnProperty(d)) { - this.warn("typo", d, typos.topLevel[d]) - } - }, this) - } - -, fixScriptsField: function(data) { - if (!data.scripts) return - if (typeof data.scripts !== "object") { - this.warn("nonObjectScripts") - delete data.scripts - return - } - Object.keys(data.scripts).forEach(function (k) { - if (typeof data.scripts[k] !== "string") { - this.warn("nonStringScript") - delete data.scripts[k] - } else if (typos.script[k] && !data.scripts[typos.script[k]]) { - this.warn("typo", k, typos.script[k], "scripts") - } - }, this) - } - -, fixFilesField: function(data) { - var files = data.files - if (files && !Array.isArray(files)) { - this.warn("nonArrayFiles") - delete data.files - } else if (data.files) { - data.files = data.files.filter(function(file) { - if (!file || typeof file !== "string") { - this.warn("invalidFilename", file) - return false - } else { - return true - } - }, this) - } - } - -, fixBinField: function(data) { - if (!data.bin) return; - if (typeof data.bin === "string") { - var b = {} - var match - if (match = data.name.match(/^@[^/]+[/](.*)$/)) { - b[match[1]] = data.bin - } else { - b[data.name] = data.bin - } - data.bin = b - } - } - -, fixManField: function(data) { - if (!data.man) return; - if (typeof data.man === "string") { - data.man = [ data.man ] - } - } -, fixBundleDependenciesField: function(data) { - var bdd = "bundledDependencies" - var bd = "bundleDependencies" - if (data[bdd] && !data[bd]) { - data[bd] = data[bdd] - delete data[bdd] - } - if (data[bd] && !Array.isArray(data[bd])) { - this.warn("nonArrayBundleDependencies") - delete data[bd] - } else if (data[bd]) { - data[bd] = data[bd].filter(function(bd) { - if (!bd || typeof bd !== 'string') { - this.warn("nonStringBundleDependency", bd) - return false - } else { - if (!data.dependencies) { - data.dependencies = {} - } - if (!data.dependencies.hasOwnProperty(bd)) { - this.warn("nonDependencyBundleDependency", bd) - data.dependencies[bd] = "*" - } - return true - } - }, this) - } - } - -, fixDependencies: function(data, strict) { - var loose = !strict - objectifyDeps(data, this.warn) - addOptionalDepsToDeps(data, this.warn) - this.fixBundleDependenciesField(data) - - ;['dependencies','devDependencies'].forEach(function(deps) { - if (!(deps in data)) return - if (!data[deps] || typeof data[deps] !== "object") { - this.warn("nonObjectDependencies", deps) - delete data[deps] - return - } - Object.keys(data[deps]).forEach(function (d) { - var r = data[deps][d] - if (typeof r !== 'string') { - this.warn("nonStringDependency", d, JSON.stringify(r)) - delete data[deps][d] - } - var hosted = hostedGitInfo.fromUrl(data[deps][d]) - if (hosted) data[deps][d] = hosted.toString() - }, this) - }, this) - } - -, fixModulesField: function (data) { - if (data.modules) { - this.warn("deprecatedModules") - delete data.modules - } - } - -, fixKeywordsField: function (data) { - if (typeof data.keywords === "string") { - data.keywords = data.keywords.split(/,\s+/) - } - if (data.keywords && !Array.isArray(data.keywords)) { - delete data.keywords - this.warn("nonArrayKeywords") - } else if (data.keywords) { - data.keywords = data.keywords.filter(function(kw) { - if (typeof kw !== "string" || !kw) { - this.warn("nonStringKeyword"); - return false - } else { - return true - } - }, this) - } - } - -, fixVersionField: function(data, strict) { - // allow "loose" semver 1.0 versions in non-strict mode - // enforce strict semver 2.0 compliance in strict mode - var loose = !strict - if (!data.version) { - data.version = "" - return true - } - if (!semver.valid(data.version, loose)) { - throw new Error('Invalid version: "'+ data.version + '"') - } - data.version = semver.clean(data.version, loose) - return true - } - -, fixPeople: function(data) { - modifyPeople(data, unParsePerson) - modifyPeople(data, parsePerson) - } - -, fixNameField: function(data, options) { - if (typeof options === "boolean") options = {strict: options} - else if (typeof options === "undefined") options = {} - var strict = options.strict - if (!data.name && !strict) { - data.name = "" - return - } - if (typeof data.name !== "string") { - throw new Error("name field must be a string.") - } - if (!strict) - data.name = data.name.trim() - ensureValidName(data.name, strict, options.allowLegacyCase) - if (isBuiltinModule(data.name)) - this.warn("conflictingName", data.name) - } - - -, fixDescriptionField: function (data) { - if (data.description && typeof data.description !== 'string') { - this.warn("nonStringDescription") - delete data.description - } - if (data.readme && !data.description) - data.description = extractDescription(data.readme) - if(data.description === undefined) delete data.description; - if (!data.description) this.warn("missingDescription") - } - -, fixReadmeField: function (data) { - if (!data.readme) { - this.warn("missingReadme") - data.readme = "ERROR: No README data found!" - } - } - -, fixBugsField: function(data) { - if (!data.bugs && data.repository && data.repository.url) { - var hosted = hostedGitInfo.fromUrl(data.repository.url) - if(hosted && hosted.bugs()) { - data.bugs = {url: hosted.bugs()} - } - } - else if(data.bugs) { - var emailRe = /^.+@.*\..+$/ - if(typeof data.bugs == "string") { - if(emailRe.test(data.bugs)) - data.bugs = {email:data.bugs} - else if(url.parse(data.bugs).protocol) - data.bugs = {url: data.bugs} - else - this.warn("nonEmailUrlBugsString") - } - else { - bugsTypos(data.bugs, this.warn) - var oldBugs = data.bugs - data.bugs = {} - if(oldBugs.url) { - if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol) - data.bugs.url = oldBugs.url - else - this.warn("nonUrlBugsUrlField") - } - if(oldBugs.email) { - if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email)) - data.bugs.email = oldBugs.email - else - this.warn("nonEmailBugsEmailField") - } - } - if(!data.bugs.email && !data.bugs.url) { - delete data.bugs - this.warn("emptyNormalizedBugs") - } - } - } - -, fixHomepageField: function(data) { - if (!data.homepage && data.repository && data.repository.url) { - var hosted = hostedGitInfo.fromUrl(data.repository.url) - if (hosted && hosted.docs()) data.homepage = hosted.docs() - } - if (!data.homepage) return - - if(typeof data.homepage !== "string") { - this.warn("nonUrlHomepage") - return delete data.homepage - } - if(!url.parse(data.homepage).protocol) { - data.homepage = "http://" + data.homepage - } - } - -, fixLicenseField: function(data) { - if (!data.license) { - return this.warn("missingLicense") - } else{ - if ( - typeof(data.license) !== 'string' || - data.license.length < 1 - ) { - this.warn("invalidLicense") - } else { - if (!validateLicense(data.license).validForNewPackages) - this.warn("invalidLicense") - } - } - } -} - -function isValidScopedPackageName(spec) { - if (spec.charAt(0) !== '@') return false - - var rest = spec.slice(1).split('/') - if (rest.length !== 2) return false - - return rest[0] && rest[1] && - rest[0] === encodeURIComponent(rest[0]) && - rest[1] === encodeURIComponent(rest[1]) -} - -function isCorrectlyEncodedName(spec) { - return !spec.match(/[\/@\s\+%:]/) && - spec === encodeURIComponent(spec) -} - -function ensureValidName (name, strict, allowLegacyCase) { - if (name.charAt(0) === "." || - !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) || - (strict && (!allowLegacyCase) && name !== name.toLowerCase()) || - name.toLowerCase() === "node_modules" || - name.toLowerCase() === "favicon.ico") { - throw new Error("Invalid name: " + JSON.stringify(name)) - } -} - -function modifyPeople (data, fn) { - if (data.author) data.author = fn(data.author) - ;["maintainers", "contributors"].forEach(function (set) { - if (!Array.isArray(data[set])) return; - data[set] = data[set].map(fn) - }) - return data -} - -function unParsePerson (person) { - if (typeof person === "string") return person - var name = person.name || "" - var u = person.url || person.web - var url = u ? (" ("+u+")") : "" - var e = person.email || person.mail - var email = e ? (" <"+e+">") : "" - return name+email+url -} - -function parsePerson (person) { - if (typeof person !== "string") return person - var name = person.match(/^([^\(<]+)/) - var url = person.match(/\(([^\)]+)\)/) - var email = person.match(/<([^>]+)>/) - var obj = {} - if (name && name[0].trim()) obj.name = name[0].trim() - if (email) obj.email = email[1]; - if (url) obj.url = url[1]; - return obj -} - -function addOptionalDepsToDeps (data, warn) { - var o = data.optionalDependencies - if (!o) return; - var d = data.dependencies || {} - Object.keys(o).forEach(function (k) { - d[k] = o[k] - }) - data.dependencies = d -} - -function depObjectify (deps, type, warn) { - if (!deps) return {} - if (typeof deps === "string") { - deps = deps.trim().split(/[\n\r\s\t ,]+/) - } - if (!Array.isArray(deps)) return deps - warn("deprecatedArrayDependencies", type) - var o = {} - deps.filter(function (d) { - return typeof d === "string" - }).forEach(function(d) { - d = d.trim().split(/(:?[@\s><=])/) - var dn = d.shift() - var dv = d.join("") - dv = dv.trim() - dv = dv.replace(/^@/, "") - o[dn] = dv - }) - return o -} - -function objectifyDeps (data, warn) { - depTypes.forEach(function (type) { - if (!data[type]) return; - data[type] = depObjectify(data[type], type, warn) - }) -} - -function bugsTypos(bugs, warn) { - if (!bugs) return - Object.keys(bugs).forEach(function (k) { - if (typos.bugs[k]) { - warn("typo", k, typos.bugs[k], "bugs") - bugs[typos.bugs[k]] = bugs[k] - delete bugs[k] - } - }) -} - - -/***/ }), -/* 396 */ -/***/ (function(module, exports) { - -exports = module.exports = SemVer; - -// The debug function is excluded entirely from the minified version. -/* nomin */ var debug; -/* nomin */ if (typeof process === 'object' && - /* nomin */ process.env && - /* nomin */ process.env.NODE_DEBUG && - /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) - /* nomin */ debug = function() { - /* nomin */ var args = Array.prototype.slice.call(arguments, 0); - /* nomin */ args.unshift('SEMVER'); - /* nomin */ console.log.apply(console, args); - /* nomin */ }; -/* nomin */ else - /* nomin */ debug = function() {}; - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; - -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; - -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16; - -// The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++; -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; - -var MAINVERSIONLOOSE = R++; -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++; -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - -var PRERELEASEIDENTIFIERLOOSE = R++; -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++; -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; - -var PRERELEASELOOSE = R++; -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++; -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++; -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?'; - -src[FULL] = '^' + FULLPLAIN + '$'; - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; - -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; - -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - -var XRANGEPLAIN = R++; -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGEPLAINLOOSE = R++; -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -var COERCE = R++; -src[COERCE] = '(?:^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])'; - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; - -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; - -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; - -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; - -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++; -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; - -var HYPHENRANGELOOSE = R++; -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; - -// Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]); - if (!re[i]) - re[i] = new RegExp(src[i]); -} - -exports.parse = parse; -function parse(version, loose) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - if (version.length > MAX_LENGTH) - return null; - - var r = loose ? re[LOOSE] : re[FULL]; - if (!r.test(version)) - return null; - - try { - return new SemVer(version, loose); - } catch (er) { - return null; - } -} - -exports.valid = valid; -function valid(version, loose) { - var v = parse(version, loose); - return v ? v.version : null; -} - - -exports.clean = clean; -function clean(version, loose) { - var s = parse(version.trim().replace(/^[=v]+/, ''), loose); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, loose) { - if (version instanceof SemVer) { - if (version.loose === loose) - return version; - else - version = version.version; - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - if (version.length > MAX_LENGTH) - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - - if (!(this instanceof SemVer)) - return new SemVer(version, loose); - - debug('SemVer', version, loose); - this.loose = loose; - var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - - if (!m) - throw new TypeError('Invalid Version: ' + version); - - this.raw = version; - - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) - throw new TypeError('Invalid major version') - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) - throw new TypeError('Invalid minor version') - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) - throw new TypeError('Invalid patch version') - - // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) - return num; - } - return id; - }); - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; - -SemVer.prototype.toString = function() { - return this.version; -}; - -SemVer.prototype.compare = function(other) { - debug('SemVer.compare', this.version, this.loose, other); - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.length && !other.prerelease.length) - return 0; - - var i = 0; - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) - this.major++; - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) - this.minor++; - this.patch = 0; - this.prerelease = []; - break; - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) - this.patch++; - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) // didn't increment anything - this.prerelease.push(0); - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) - this.prerelease = [identifier, 0]; - } else - this.prerelease = [identifier, 0]; - } - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - this.format(); - this.raw = this.version; - return this; -}; - -exports.inc = inc; -function inc(version, release, loose, identifier) { - if (typeof(loose) === 'string') { - identifier = loose; - loose = undefined; - } - - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } -} - -exports.diff = diff; -function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - if (v1.prerelease.length || v2.prerelease.length) { - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return 'pre'+key; - } - } - } - return 'prerelease'; - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return key; - } - } - } - } -} - -exports.compareIdentifiers = compareIdentifiers; - -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.major = major; -function major(a, loose) { - return new SemVer(a, loose).major; -} - -exports.minor = minor; -function minor(a, loose) { - return new SemVer(a, loose).minor; -} - -exports.patch = patch; -function patch(a, loose) { - return new SemVer(a, loose).patch; -} - -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); -} - -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); -} - -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); -} - -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; - switch (op) { - case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a === b; - break; - case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a !== b; - break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); - } - return ret; -} - -exports.Comparator = Comparator; -function Comparator(comp, loose) { - if (comp instanceof Comparator) { - if (comp.loose === loose) - return comp; - else - comp = comp.value; - } - - if (!(this instanceof Comparator)) - return new Comparator(comp, loose); - - debug('comparator', comp, loose); - this.loose = loose; - this.parse(comp); - - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; - - debug('comp', this); -} - -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); - - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - if (this.operator === '=') - this.operator = ''; - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else - this.semver = new SemVer(m[2], this.loose); -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - debug('Comparator.test', version, this.loose); - - if (this.semver === ANY) - return true; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - return cmp(version, this.operator, this.semver, this.loose); -}; - -Comparator.prototype.intersects = function(comp, loose) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required'); - } - - var rangeTmp; - - if (this.operator === '') { - rangeTmp = new Range(comp.value, loose); - return satisfies(this.value, rangeTmp, loose); - } else if (comp.operator === '') { - rangeTmp = new Range(this.value, loose); - return satisfies(comp.semver, rangeTmp, loose); - } - - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>'); - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<'); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<='); - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, loose) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')); - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, loose) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')); - - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; -}; - - -exports.Range = Range; -function Range(range, loose) { - if (range instanceof Range) { - if (range.loose === loose) { - return range; - } else { - return new Range(range.raw, loose); - } - } - - if (range instanceof Comparator) { - return new Range(range.value, loose); - } - - if (!(this instanceof Range)) - return new Range(range, loose); - - this.loose = loose; - - // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function() { - return this.range; -}; - -Range.prototype.parseRange = function(range) { - var loose = this.loose; - range = range.trim(); - debug('range', range, loose); - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug('hyphen replace', range); - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - debug('comparator trim', range, re[COMPARATORTRIM]); - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); - - // normalize spaces - range = range.split(/\s+/).join(' '); - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, loose); - }).join(' ').split(/\s+/); - if (this.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, loose); - }); - - return set; -}; - -Range.prototype.intersects = function(range, loose) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required'); - } - - return this.set.some(function(thisComparators) { - return thisComparators.every(function(thisComparator) { - return range.set.some(function(rangeComparators) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, loose); - }); - }); - }); - }); -}; - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, loose) { - return new Range(range, loose).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator(comp, loose) { - debug('comp', comp); - comp = replaceCarets(comp, loose); - debug('caret', comp); - comp = replaceTildes(comp, loose); - debug('tildes', comp); - comp = replaceXRanges(comp, loose); - debug('xrange', comp); - comp = replaceStars(comp, loose); - debug('stars', comp); - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); - }).join(' '); -} - -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else if (pr) { - debug('replaceTilde pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - - debug('tilde return', ret); - return ret; - }); -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); - }).join(' '); -} - -function replaceCaret(comp, loose) { - debug('caret', comp, loose); - var r = loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) { - if (M === '0') - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; - } else if (pr) { - debug('replaceCaret pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0'; - } else { - debug('no pr'); - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0'; - } - - debug('caret return', ret); - return ret; - }); -} - -function replaceXRanges(comp, loose) { - debug('replaceXRanges', comp, loose); - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); - }).join(' '); -} - -function replaceXRange(comp, loose) { - comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) - gtlt = ''; - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0'; - } else { - // nothing is forbidden - ret = '*'; - } - } else if (gtlt && anyX) { - // replace X with 0 - if (xm) - m = 0; - if (xp) - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>='; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<'; - if (xm) - M = +M + 1; - else - m = +m + 1; - } - - ret = gtlt + M + '.' + m + '.' + p; - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } - - debug('xRange return', ret); - - return ret; - }); -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - debug('replaceStars', comp, loose); - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0'; - else - from = '>=' + from; - - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); -} - - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) - return true; - } - return false; -}; - -function testSet(set, version) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; - } - - if (version.prerelease.length) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (var i = 0; i < set.length; i++) { - debug(set[i].semver); - if (set[i].semver === ANY) - continue; - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) - return true; - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false; - } - - return true; -} - -exports.satisfies = satisfies; -function satisfies(version, range, loose) { - try { - range = new Range(range, loose); - } catch (er) { - return false; - } - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range(range, loose); - } catch (er) { - return null; - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, loose) - if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) - max = v; - maxSV = new SemVer(max, loose); - } - } - }) - return max; -} - -exports.minSatisfying = minSatisfying; -function minSatisfying(versions, range, loose) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range(range, loose); - } catch (er) { - return null; - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, loose) - if (!min || minSV.compare(v) === 1) { // compare(min, v, true) - min = v; - minSV = new SemVer(min, loose); - } - } - }) - return min; -} - -exports.validRange = validRange; -function validRange(range, loose) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; - } catch (er) { - return null; - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr; -function ltr(version, range, loose) { - return outside(version, range, '<', loose); -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr; -function gtr(version, range, loose) { - return outside(version, range, '>', loose); -} - -exports.outside = outside; -function outside(version, range, hilo, loose) { - version = new SemVer(version, loose); - range = new Range(range, loose); - - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; - case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, loose)) { - return false; - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - - var high = null; - var low = null; - - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, loose)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, loose)) { - low = comparator; - } - }); - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false; - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; -} - -exports.prerelease = prerelease; -function prerelease(version, loose) { - var parsed = parse(version, loose); - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; -} - -exports.intersects = intersects; -function intersects(r1, r2, loose) { - r1 = new Range(r1, loose) - r2 = new Range(r2, loose) - return r1.intersects(r2) -} - -exports.coerce = coerce; -function coerce(version) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - var match = version.match(re[COERCE]); - - if (match == null) - return null; - - return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); -} - - -/***/ }), -/* 397 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(398); -var correct = __webpack_require__(400); - -var genericWarning = ( - 'license should be ' + - 'a valid SPDX license expression (without "LicenseRef"), ' + - '"UNLICENSED", or ' + - '"SEE LICENSE IN "' -); - -var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/; - -function startsWith(prefix, string) { - return string.slice(0, prefix.length) === prefix; -} - -function usesLicenseRef(ast) { - if (ast.hasOwnProperty('license')) { - var license = ast.license; - return ( - startsWith('LicenseRef', license) || - startsWith('DocumentRef', license) - ); - } else { - return ( - usesLicenseRef(ast.left) || - usesLicenseRef(ast.right) - ); - } -} - -module.exports = function(argument) { - var ast; - - try { - ast = parse(argument); - } catch (e) { - var match - if ( - argument === 'UNLICENSED' || - argument === 'UNLICENCED' - ) { - return { - validForOldPackages: true, - validForNewPackages: true, - unlicensed: true - }; - } else if (match = fileReferenceRE.exec(argument)) { - return { - validForOldPackages: true, - validForNewPackages: true, - inFile: match[1] - }; - } else { - var result = { - validForOldPackages: false, - validForNewPackages: false, - warnings: [genericWarning] - }; - var corrected = correct(argument); - if (corrected) { - result.warnings.push( - 'license is similar to the valid expression "' + corrected + '"' - ); - } - return result; - } - } - - if (usesLicenseRef(ast)) { - return { - validForNewPackages: false, - validForOldPackages: false, - spdx: true, - warnings: [genericWarning] - }; - } else { - return { - validForNewPackages: true, - validForOldPackages: true, - spdx: true - }; - } -}; - - -/***/ }), -/* 398 */ -/***/ (function(module, exports, __webpack_require__) { - -var parser = __webpack_require__(399).parser - -module.exports = function (argument) { - return parser.parse(argument) -} - - -/***/ }), -/* 399 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {/* parser generated by jison 0.4.17 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var spdxparse = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,6],$V2=[1,7],$V3=[1,4],$V4=[1,9],$V5=[1,10],$V6=[5,14,15,17],$V7=[5,12,14,15,17]; -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"start":3,"expression":4,"EOS":5,"simpleExpression":6,"LICENSE":7,"PLUS":8,"LICENSEREF":9,"DOCUMENTREF":10,"COLON":11,"WITH":12,"EXCEPTION":13,"AND":14,"OR":15,"OPEN":16,"CLOSE":17,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"EOS",7:"LICENSE",8:"PLUS",9:"LICENSEREF",10:"DOCUMENTREF",11:"COLON",12:"WITH",13:"EXCEPTION",14:"AND",15:"OR",16:"OPEN",17:"CLOSE"}, -productions_: [0,[3,2],[6,1],[6,2],[6,1],[6,3],[4,1],[4,3],[4,3],[4,3],[4,3]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: -return this.$ = $$[$0-1] -break; -case 2: case 4: case 5: -this.$ = {license: yytext} -break; -case 3: -this.$ = {license: $$[$0-1], plus: true} -break; -case 6: -this.$ = $$[$0] -break; -case 7: -this.$ = {exception: $$[$0]} -this.$.license = $$[$0-2].license -if ($$[$0-2].hasOwnProperty('plus')) { - this.$.plus = $$[$0-2].plus -} -break; -case 8: -this.$ = {conjunction: 'and', left: $$[$0-2], right: $$[$0]} -break; -case 9: -this.$ = {conjunction: 'or', left: $$[$0-2], right: $$[$0]} -break; -case 10: -this.$ = $$[$0-1] -break; -} -}, -table: [{3:1,4:2,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{1:[3]},{5:[1,8],14:$V4,15:$V5},o($V6,[2,6],{12:[1,11]}),{4:12,6:3,7:$V0,9:$V1,10:$V2,16:$V3},o($V7,[2,2],{8:[1,13]}),o($V7,[2,4]),{11:[1,14]},{1:[2,1]},{4:15,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{4:16,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{13:[1,17]},{14:$V4,15:$V5,17:[1,18]},o($V7,[2,3]),{9:[1,19]},o($V6,[2,8]),o([5,15,17],[2,9],{14:$V4}),o($V6,[2,7]),o($V6,[2,10]),o($V7,[2,5])], -defaultActions: {8:[2,1]}, -parseError: function parseError(str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - function _parseError (msg, hash) { - this.message = msg; - this.hash = hash; - } - _parseError.prototype = Error; - - throw new _parseError(str, hash); - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - _token_stack: - var lex = function () { - var token; - token = lexer.lex() || EOF; - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - }; - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function (match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin(condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState(condition) { - this.begin(condition); - }, +// alias for begin(condition) +pushState:function pushState(condition) { + this.begin(condition); + }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { @@ -45760,1517 +43219,4336 @@ break; case 364:return 7 break; } -}, -rules: [/^(?:$)/,/^(?:\s+)/,/^(?:\+)/,/^(?:\()/,/^(?:\))/,/^(?::)/,/^(?:DocumentRef-([0-9A-Za-z-+.]+))/,/^(?:LicenseRef-([0-9A-Za-z-+.]+))/,/^(?:AND)/,/^(?:OR)/,/^(?:WITH)/,/^(?:BSD-3-Clause-No-Nuclear-License-2014)/,/^(?:BSD-3-Clause-No-Nuclear-Warranty)/,/^(?:GPL-2\.0-with-classpath-exception)/,/^(?:GPL-3\.0-with-autoconf-exception)/,/^(?:GPL-2\.0-with-autoconf-exception)/,/^(?:BSD-3-Clause-No-Nuclear-License)/,/^(?:MPL-2\.0-no-copyleft-exception)/,/^(?:GPL-2\.0-with-bison-exception)/,/^(?:GPL-2\.0-with-font-exception)/,/^(?:GPL-2\.0-with-GCC-exception)/,/^(?:CNRI-Python-GPL-Compatible)/,/^(?:GPL-3\.0-with-GCC-exception)/,/^(?:BSD-3-Clause-Attribution)/,/^(?:Classpath-exception-2\.0)/,/^(?:WxWindows-exception-3\.1)/,/^(?:freertos-exception-2\.0)/,/^(?:Autoconf-exception-3\.0)/,/^(?:i2p-gpl-java-exception)/,/^(?:gnu-javamail-exception)/,/^(?:Nokia-Qt-exception-1\.1)/,/^(?:Autoconf-exception-2\.0)/,/^(?:BSD-2-Clause-FreeBSD)/,/^(?:u-boot-exception-2\.0)/,/^(?:zlib-acknowledgement)/,/^(?:Bison-exception-2\.2)/,/^(?:BSD-2-Clause-NetBSD)/,/^(?:CLISP-exception-2\.0)/,/^(?:eCos-exception-2\.0)/,/^(?:BSD-3-Clause-Clear)/,/^(?:Font-exception-2\.0)/,/^(?:FLTK-exception-2\.0)/,/^(?:GCC-exception-2\.0)/,/^(?:Qwt-exception-1\.0)/,/^(?:Libtool-exception)/,/^(?:BSD-3-Clause-LBNL)/,/^(?:GCC-exception-3\.1)/,/^(?:Artistic-1\.0-Perl)/,/^(?:Artistic-1\.0-cl8)/,/^(?:CC-BY-NC-SA-2\.5)/,/^(?:MIT-advertising)/,/^(?:BSD-Source-Code)/,/^(?:CC-BY-NC-SA-4\.0)/,/^(?:LiLiQ-Rplus-1\.1)/,/^(?:CC-BY-NC-SA-3\.0)/,/^(?:BSD-4-Clause-UC)/,/^(?:CC-BY-NC-SA-2\.0)/,/^(?:CC-BY-NC-SA-1\.0)/,/^(?:CC-BY-NC-ND-4\.0)/,/^(?:CC-BY-NC-ND-3\.0)/,/^(?:CC-BY-NC-ND-2\.5)/,/^(?:CC-BY-NC-ND-2\.0)/,/^(?:CC-BY-NC-ND-1\.0)/,/^(?:LZMA-exception)/,/^(?:BitTorrent-1\.1)/,/^(?:CrystalStacker)/,/^(?:FLTK-exception)/,/^(?:SugarCRM-1\.1\.3)/,/^(?:BSD-Protection)/,/^(?:BitTorrent-1\.0)/,/^(?:HaskellReport)/,/^(?:Interbase-1\.0)/,/^(?:StandardML-NJ)/,/^(?:mif-exception)/,/^(?:Frameworx-1\.0)/,/^(?:389-exception)/,/^(?:CC-BY-NC-2\.0)/,/^(?:CC-BY-NC-2\.5)/,/^(?:CC-BY-NC-3\.0)/,/^(?:CC-BY-NC-4\.0)/,/^(?:W3C-19980720)/,/^(?:CC-BY-SA-1\.0)/,/^(?:CC-BY-SA-2\.0)/,/^(?:CC-BY-SA-2\.5)/,/^(?:CC-BY-ND-2\.0)/,/^(?:CC-BY-SA-4\.0)/,/^(?:CC-BY-SA-3\.0)/,/^(?:Artistic-1\.0)/,/^(?:Artistic-2\.0)/,/^(?:CC-BY-ND-2\.5)/,/^(?:CC-BY-ND-3\.0)/,/^(?:CC-BY-ND-4\.0)/,/^(?:CC-BY-ND-1\.0)/,/^(?:BSD-4-Clause)/,/^(?:BSD-3-Clause)/,/^(?:BSD-2-Clause)/,/^(?:CC-BY-NC-1\.0)/,/^(?:bzip2-1\.0\.6)/,/^(?:Unicode-TOU)/,/^(?:CNRI-Jython)/,/^(?:ImageMagick)/,/^(?:Adobe-Glyph)/,/^(?:CUA-OPL-1\.0)/,/^(?:OLDAP-2\.2\.2)/,/^(?:LiLiQ-R-1\.1)/,/^(?:bzip2-1\.0\.5)/,/^(?:LiLiQ-P-1\.1)/,/^(?:OLDAP-2\.0\.1)/,/^(?:OLDAP-2\.2\.1)/,/^(?:CNRI-Python)/,/^(?:XFree86-1\.1)/,/^(?:OSET-PL-2\.1)/,/^(?:Apache-2\.0)/,/^(?:Watcom-1\.0)/,/^(?:PostgreSQL)/,/^(?:Python-2\.0)/,/^(?:RHeCos-1\.1)/,/^(?:EUDatagrid)/,/^(?:Spencer-99)/,/^(?:Intel-ACPI)/,/^(?:CECILL-1\.0)/,/^(?:CECILL-1\.1)/,/^(?:JasPer-2\.0)/,/^(?:CECILL-2\.0)/,/^(?:CECILL-2\.1)/,/^(?:gSOAP-1\.3b)/,/^(?:Spencer-94)/,/^(?:Apache-1\.1)/,/^(?:Spencer-86)/,/^(?:Apache-1\.0)/,/^(?:ClArtistic)/,/^(?:TORQUE-1\.1)/,/^(?:CATOSL-1\.1)/,/^(?:Adobe-2006)/,/^(?:Zimbra-1\.4)/,/^(?:Zimbra-1\.3)/,/^(?:Condor-1\.1)/,/^(?:CC-BY-3\.0)/,/^(?:CC-BY-2\.5)/,/^(?:OLDAP-2\.4)/,/^(?:SGI-B-1\.1)/,/^(?:SISSL-1\.2)/,/^(?:SGI-B-1\.0)/,/^(?:OLDAP-2\.3)/,/^(?:CC-BY-4\.0)/,/^(?:Crossword)/,/^(?:SimPL-2\.0)/,/^(?:OLDAP-2\.2)/,/^(?:OLDAP-2\.1)/,/^(?:ErlPL-1\.1)/,/^(?:LPPL-1\.3a)/,/^(?:LPPL-1\.3c)/,/^(?:OLDAP-2\.0)/,/^(?:Leptonica)/,/^(?:CPOL-1\.02)/,/^(?:OLDAP-1\.4)/,/^(?:OLDAP-1\.3)/,/^(?:CC-BY-2\.0)/,/^(?:Unlicense)/,/^(?:OLDAP-2\.8)/,/^(?:OLDAP-1\.2)/,/^(?:MakeIndex)/,/^(?:OLDAP-2\.7)/,/^(?:OLDAP-1\.1)/,/^(?:Sleepycat)/,/^(?:D-FSL-1\.0)/,/^(?:CC-BY-1\.0)/,/^(?:OLDAP-2\.6)/,/^(?:WXwindows)/,/^(?:NPOSL-3\.0)/,/^(?:FreeImage)/,/^(?:SGI-B-2\.0)/,/^(?:OLDAP-2\.5)/,/^(?:Beerware)/,/^(?:Newsletr)/,/^(?:NBPL-1\.0)/,/^(?:NASA-1\.3)/,/^(?:NLOD-1\.0)/,/^(?:AGPL-1\.0)/,/^(?:OCLC-2\.0)/,/^(?:ODbL-1\.0)/,/^(?:PDDL-1\.0)/,/^(?:Motosoto)/,/^(?:Afmparse)/,/^(?:ANTLR-PD)/,/^(?:LPL-1\.02)/,/^(?:Abstyles)/,/^(?:eCos-2\.0)/,/^(?:APSL-1\.0)/,/^(?:LPPL-1\.2)/,/^(?:LPPL-1\.1)/,/^(?:LPPL-1\.0)/,/^(?:APSL-1\.1)/,/^(?:APSL-2\.0)/,/^(?:Info-ZIP)/,/^(?:Zend-2\.0)/,/^(?:IBM-pibs)/,/^(?:LGPL-2\.0)/,/^(?:LGPL-3\.0)/,/^(?:LGPL-2\.1)/,/^(?:GFDL-1\.3)/,/^(?:PHP-3\.01)/,/^(?:GFDL-1\.2)/,/^(?:GFDL-1\.1)/,/^(?:AGPL-3\.0)/,/^(?:Giftware)/,/^(?:EUPL-1\.1)/,/^(?:RPSL-1\.0)/,/^(?:EUPL-1\.0)/,/^(?:MIT-enna)/,/^(?:CECILL-B)/,/^(?:diffmark)/,/^(?:CECILL-C)/,/^(?:CDDL-1\.0)/,/^(?:Sendmail)/,/^(?:CDDL-1\.1)/,/^(?:CPAL-1\.0)/,/^(?:APSL-1\.2)/,/^(?:NPL-1\.1)/,/^(?:AFL-1\.2)/,/^(?:Caldera)/,/^(?:AFL-2\.0)/,/^(?:FSFULLR)/,/^(?:AFL-2\.1)/,/^(?:VSL-1\.0)/,/^(?:VOSTROM)/,/^(?:UPL-1\.0)/,/^(?:Dotseqn)/,/^(?:CPL-1\.0)/,/^(?:dvipdfm)/,/^(?:EPL-1\.0)/,/^(?:OCCT-PL)/,/^(?:ECL-1\.0)/,/^(?:Latex2e)/,/^(?:ECL-2\.0)/,/^(?:GPL-1\.0)/,/^(?:GPL-2\.0)/,/^(?:GPL-3\.0)/,/^(?:AFL-3\.0)/,/^(?:LAL-1\.2)/,/^(?:LAL-1\.3)/,/^(?:EFL-1\.0)/,/^(?:EFL-2\.0)/,/^(?:gnuplot)/,/^(?:Aladdin)/,/^(?:LPL-1\.0)/,/^(?:libtiff)/,/^(?:Entessa)/,/^(?:AMDPLPA)/,/^(?:IPL-1\.0)/,/^(?:OPL-1\.0)/,/^(?:OSL-1\.0)/,/^(?:OSL-1\.1)/,/^(?:OSL-2\.0)/,/^(?:OSL-2\.1)/,/^(?:OSL-3\.0)/,/^(?:OpenSSL)/,/^(?:ZPL-2\.1)/,/^(?:PHP-3\.0)/,/^(?:ZPL-2\.0)/,/^(?:ZPL-1\.1)/,/^(?:CC0-1\.0)/,/^(?:SPL-1\.0)/,/^(?:psutils)/,/^(?:MPL-1\.0)/,/^(?:QPL-1\.0)/,/^(?:MPL-1\.1)/,/^(?:MPL-2\.0)/,/^(?:APL-1\.0)/,/^(?:RPL-1\.1)/,/^(?:RPL-1\.5)/,/^(?:MIT-CMU)/,/^(?:Multics)/,/^(?:Eurosym)/,/^(?:BSL-1\.0)/,/^(?:MIT-feh)/,/^(?:Saxpath)/,/^(?:Borceux)/,/^(?:OFL-1\.1)/,/^(?:OFL-1\.0)/,/^(?:AFL-1\.1)/,/^(?:YPL-1\.1)/,/^(?:YPL-1\.0)/,/^(?:NPL-1\.0)/,/^(?:iMatix)/,/^(?:mpich2)/,/^(?:APAFML)/,/^(?:Bahyph)/,/^(?:RSA-MD)/,/^(?:psfrag)/,/^(?:Plexus)/,/^(?:eGenix)/,/^(?:Glulxe)/,/^(?:SAX-PD)/,/^(?:Imlib2)/,/^(?:Wsuipa)/,/^(?:LGPLLR)/,/^(?:Libpng)/,/^(?:xinetd)/,/^(?:MITNFA)/,/^(?:NetCDF)/,/^(?:Naumen)/,/^(?:SMPPL)/,/^(?:Nunit)/,/^(?:FSFUL)/,/^(?:GL2PS)/,/^(?:SMLNJ)/,/^(?:Rdisc)/,/^(?:Noweb)/,/^(?:Nokia)/,/^(?:SISSL)/,/^(?:Qhull)/,/^(?:Intel)/,/^(?:Glide)/,/^(?:Xerox)/,/^(?:AMPAS)/,/^(?:WTFPL)/,/^(?:MS-PL)/,/^(?:XSkat)/,/^(?:MS-RL)/,/^(?:MirOS)/,/^(?:RSCPL)/,/^(?:TMate)/,/^(?:OGTSL)/,/^(?:FSFAP)/,/^(?:NCSA)/,/^(?:Zlib)/,/^(?:SCEA)/,/^(?:SNIA)/,/^(?:NGPL)/,/^(?:NOSL)/,/^(?:ADSL)/,/^(?:MTLL)/,/^(?:NLPL)/,/^(?:Ruby)/,/^(?:JSON)/,/^(?:Barr)/,/^(?:0BSD)/,/^(?:Xnet)/,/^(?:Cube)/,/^(?:curl)/,/^(?:DSDP)/,/^(?:Fair)/,/^(?:HPND)/,/^(?:TOSL)/,/^(?:IJG)/,/^(?:SWL)/,/^(?:Vim)/,/^(?:FTL)/,/^(?:ICU)/,/^(?:OML)/,/^(?:NRL)/,/^(?:DOC)/,/^(?:TCL)/,/^(?:W3C)/,/^(?:NTP)/,/^(?:IPA)/,/^(?:ISC)/,/^(?:X11)/,/^(?:AAL)/,/^(?:AML)/,/^(?:xpp)/,/^(?:Zed)/,/^(?:MIT)/,/^(?:Mup)/], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; +}, +rules: [/^(?:$)/,/^(?:\s+)/,/^(?:\+)/,/^(?:\()/,/^(?:\))/,/^(?::)/,/^(?:DocumentRef-([0-9A-Za-z-+.]+))/,/^(?:LicenseRef-([0-9A-Za-z-+.]+))/,/^(?:AND)/,/^(?:OR)/,/^(?:WITH)/,/^(?:BSD-3-Clause-No-Nuclear-License-2014)/,/^(?:BSD-3-Clause-No-Nuclear-Warranty)/,/^(?:GPL-2\.0-with-classpath-exception)/,/^(?:GPL-3\.0-with-autoconf-exception)/,/^(?:GPL-2\.0-with-autoconf-exception)/,/^(?:BSD-3-Clause-No-Nuclear-License)/,/^(?:MPL-2\.0-no-copyleft-exception)/,/^(?:GPL-2\.0-with-bison-exception)/,/^(?:GPL-2\.0-with-font-exception)/,/^(?:GPL-2\.0-with-GCC-exception)/,/^(?:CNRI-Python-GPL-Compatible)/,/^(?:GPL-3\.0-with-GCC-exception)/,/^(?:BSD-3-Clause-Attribution)/,/^(?:Classpath-exception-2\.0)/,/^(?:WxWindows-exception-3\.1)/,/^(?:freertos-exception-2\.0)/,/^(?:Autoconf-exception-3\.0)/,/^(?:i2p-gpl-java-exception)/,/^(?:gnu-javamail-exception)/,/^(?:Nokia-Qt-exception-1\.1)/,/^(?:Autoconf-exception-2\.0)/,/^(?:BSD-2-Clause-FreeBSD)/,/^(?:u-boot-exception-2\.0)/,/^(?:zlib-acknowledgement)/,/^(?:Bison-exception-2\.2)/,/^(?:BSD-2-Clause-NetBSD)/,/^(?:CLISP-exception-2\.0)/,/^(?:eCos-exception-2\.0)/,/^(?:BSD-3-Clause-Clear)/,/^(?:Font-exception-2\.0)/,/^(?:FLTK-exception-2\.0)/,/^(?:GCC-exception-2\.0)/,/^(?:Qwt-exception-1\.0)/,/^(?:Libtool-exception)/,/^(?:BSD-3-Clause-LBNL)/,/^(?:GCC-exception-3\.1)/,/^(?:Artistic-1\.0-Perl)/,/^(?:Artistic-1\.0-cl8)/,/^(?:CC-BY-NC-SA-2\.5)/,/^(?:MIT-advertising)/,/^(?:BSD-Source-Code)/,/^(?:CC-BY-NC-SA-4\.0)/,/^(?:LiLiQ-Rplus-1\.1)/,/^(?:CC-BY-NC-SA-3\.0)/,/^(?:BSD-4-Clause-UC)/,/^(?:CC-BY-NC-SA-2\.0)/,/^(?:CC-BY-NC-SA-1\.0)/,/^(?:CC-BY-NC-ND-4\.0)/,/^(?:CC-BY-NC-ND-3\.0)/,/^(?:CC-BY-NC-ND-2\.5)/,/^(?:CC-BY-NC-ND-2\.0)/,/^(?:CC-BY-NC-ND-1\.0)/,/^(?:LZMA-exception)/,/^(?:BitTorrent-1\.1)/,/^(?:CrystalStacker)/,/^(?:FLTK-exception)/,/^(?:SugarCRM-1\.1\.3)/,/^(?:BSD-Protection)/,/^(?:BitTorrent-1\.0)/,/^(?:HaskellReport)/,/^(?:Interbase-1\.0)/,/^(?:StandardML-NJ)/,/^(?:mif-exception)/,/^(?:Frameworx-1\.0)/,/^(?:389-exception)/,/^(?:CC-BY-NC-2\.0)/,/^(?:CC-BY-NC-2\.5)/,/^(?:CC-BY-NC-3\.0)/,/^(?:CC-BY-NC-4\.0)/,/^(?:W3C-19980720)/,/^(?:CC-BY-SA-1\.0)/,/^(?:CC-BY-SA-2\.0)/,/^(?:CC-BY-SA-2\.5)/,/^(?:CC-BY-ND-2\.0)/,/^(?:CC-BY-SA-4\.0)/,/^(?:CC-BY-SA-3\.0)/,/^(?:Artistic-1\.0)/,/^(?:Artistic-2\.0)/,/^(?:CC-BY-ND-2\.5)/,/^(?:CC-BY-ND-3\.0)/,/^(?:CC-BY-ND-4\.0)/,/^(?:CC-BY-ND-1\.0)/,/^(?:BSD-4-Clause)/,/^(?:BSD-3-Clause)/,/^(?:BSD-2-Clause)/,/^(?:CC-BY-NC-1\.0)/,/^(?:bzip2-1\.0\.6)/,/^(?:Unicode-TOU)/,/^(?:CNRI-Jython)/,/^(?:ImageMagick)/,/^(?:Adobe-Glyph)/,/^(?:CUA-OPL-1\.0)/,/^(?:OLDAP-2\.2\.2)/,/^(?:LiLiQ-R-1\.1)/,/^(?:bzip2-1\.0\.5)/,/^(?:LiLiQ-P-1\.1)/,/^(?:OLDAP-2\.0\.1)/,/^(?:OLDAP-2\.2\.1)/,/^(?:CNRI-Python)/,/^(?:XFree86-1\.1)/,/^(?:OSET-PL-2\.1)/,/^(?:Apache-2\.0)/,/^(?:Watcom-1\.0)/,/^(?:PostgreSQL)/,/^(?:Python-2\.0)/,/^(?:RHeCos-1\.1)/,/^(?:EUDatagrid)/,/^(?:Spencer-99)/,/^(?:Intel-ACPI)/,/^(?:CECILL-1\.0)/,/^(?:CECILL-1\.1)/,/^(?:JasPer-2\.0)/,/^(?:CECILL-2\.0)/,/^(?:CECILL-2\.1)/,/^(?:gSOAP-1\.3b)/,/^(?:Spencer-94)/,/^(?:Apache-1\.1)/,/^(?:Spencer-86)/,/^(?:Apache-1\.0)/,/^(?:ClArtistic)/,/^(?:TORQUE-1\.1)/,/^(?:CATOSL-1\.1)/,/^(?:Adobe-2006)/,/^(?:Zimbra-1\.4)/,/^(?:Zimbra-1\.3)/,/^(?:Condor-1\.1)/,/^(?:CC-BY-3\.0)/,/^(?:CC-BY-2\.5)/,/^(?:OLDAP-2\.4)/,/^(?:SGI-B-1\.1)/,/^(?:SISSL-1\.2)/,/^(?:SGI-B-1\.0)/,/^(?:OLDAP-2\.3)/,/^(?:CC-BY-4\.0)/,/^(?:Crossword)/,/^(?:SimPL-2\.0)/,/^(?:OLDAP-2\.2)/,/^(?:OLDAP-2\.1)/,/^(?:ErlPL-1\.1)/,/^(?:LPPL-1\.3a)/,/^(?:LPPL-1\.3c)/,/^(?:OLDAP-2\.0)/,/^(?:Leptonica)/,/^(?:CPOL-1\.02)/,/^(?:OLDAP-1\.4)/,/^(?:OLDAP-1\.3)/,/^(?:CC-BY-2\.0)/,/^(?:Unlicense)/,/^(?:OLDAP-2\.8)/,/^(?:OLDAP-1\.2)/,/^(?:MakeIndex)/,/^(?:OLDAP-2\.7)/,/^(?:OLDAP-1\.1)/,/^(?:Sleepycat)/,/^(?:D-FSL-1\.0)/,/^(?:CC-BY-1\.0)/,/^(?:OLDAP-2\.6)/,/^(?:WXwindows)/,/^(?:NPOSL-3\.0)/,/^(?:FreeImage)/,/^(?:SGI-B-2\.0)/,/^(?:OLDAP-2\.5)/,/^(?:Beerware)/,/^(?:Newsletr)/,/^(?:NBPL-1\.0)/,/^(?:NASA-1\.3)/,/^(?:NLOD-1\.0)/,/^(?:AGPL-1\.0)/,/^(?:OCLC-2\.0)/,/^(?:ODbL-1\.0)/,/^(?:PDDL-1\.0)/,/^(?:Motosoto)/,/^(?:Afmparse)/,/^(?:ANTLR-PD)/,/^(?:LPL-1\.02)/,/^(?:Abstyles)/,/^(?:eCos-2\.0)/,/^(?:APSL-1\.0)/,/^(?:LPPL-1\.2)/,/^(?:LPPL-1\.1)/,/^(?:LPPL-1\.0)/,/^(?:APSL-1\.1)/,/^(?:APSL-2\.0)/,/^(?:Info-ZIP)/,/^(?:Zend-2\.0)/,/^(?:IBM-pibs)/,/^(?:LGPL-2\.0)/,/^(?:LGPL-3\.0)/,/^(?:LGPL-2\.1)/,/^(?:GFDL-1\.3)/,/^(?:PHP-3\.01)/,/^(?:GFDL-1\.2)/,/^(?:GFDL-1\.1)/,/^(?:AGPL-3\.0)/,/^(?:Giftware)/,/^(?:EUPL-1\.1)/,/^(?:RPSL-1\.0)/,/^(?:EUPL-1\.0)/,/^(?:MIT-enna)/,/^(?:CECILL-B)/,/^(?:diffmark)/,/^(?:CECILL-C)/,/^(?:CDDL-1\.0)/,/^(?:Sendmail)/,/^(?:CDDL-1\.1)/,/^(?:CPAL-1\.0)/,/^(?:APSL-1\.2)/,/^(?:NPL-1\.1)/,/^(?:AFL-1\.2)/,/^(?:Caldera)/,/^(?:AFL-2\.0)/,/^(?:FSFULLR)/,/^(?:AFL-2\.1)/,/^(?:VSL-1\.0)/,/^(?:VOSTROM)/,/^(?:UPL-1\.0)/,/^(?:Dotseqn)/,/^(?:CPL-1\.0)/,/^(?:dvipdfm)/,/^(?:EPL-1\.0)/,/^(?:OCCT-PL)/,/^(?:ECL-1\.0)/,/^(?:Latex2e)/,/^(?:ECL-2\.0)/,/^(?:GPL-1\.0)/,/^(?:GPL-2\.0)/,/^(?:GPL-3\.0)/,/^(?:AFL-3\.0)/,/^(?:LAL-1\.2)/,/^(?:LAL-1\.3)/,/^(?:EFL-1\.0)/,/^(?:EFL-2\.0)/,/^(?:gnuplot)/,/^(?:Aladdin)/,/^(?:LPL-1\.0)/,/^(?:libtiff)/,/^(?:Entessa)/,/^(?:AMDPLPA)/,/^(?:IPL-1\.0)/,/^(?:OPL-1\.0)/,/^(?:OSL-1\.0)/,/^(?:OSL-1\.1)/,/^(?:OSL-2\.0)/,/^(?:OSL-2\.1)/,/^(?:OSL-3\.0)/,/^(?:OpenSSL)/,/^(?:ZPL-2\.1)/,/^(?:PHP-3\.0)/,/^(?:ZPL-2\.0)/,/^(?:ZPL-1\.1)/,/^(?:CC0-1\.0)/,/^(?:SPL-1\.0)/,/^(?:psutils)/,/^(?:MPL-1\.0)/,/^(?:QPL-1\.0)/,/^(?:MPL-1\.1)/,/^(?:MPL-2\.0)/,/^(?:APL-1\.0)/,/^(?:RPL-1\.1)/,/^(?:RPL-1\.5)/,/^(?:MIT-CMU)/,/^(?:Multics)/,/^(?:Eurosym)/,/^(?:BSL-1\.0)/,/^(?:MIT-feh)/,/^(?:Saxpath)/,/^(?:Borceux)/,/^(?:OFL-1\.1)/,/^(?:OFL-1\.0)/,/^(?:AFL-1\.1)/,/^(?:YPL-1\.1)/,/^(?:YPL-1\.0)/,/^(?:NPL-1\.0)/,/^(?:iMatix)/,/^(?:mpich2)/,/^(?:APAFML)/,/^(?:Bahyph)/,/^(?:RSA-MD)/,/^(?:psfrag)/,/^(?:Plexus)/,/^(?:eGenix)/,/^(?:Glulxe)/,/^(?:SAX-PD)/,/^(?:Imlib2)/,/^(?:Wsuipa)/,/^(?:LGPLLR)/,/^(?:Libpng)/,/^(?:xinetd)/,/^(?:MITNFA)/,/^(?:NetCDF)/,/^(?:Naumen)/,/^(?:SMPPL)/,/^(?:Nunit)/,/^(?:FSFUL)/,/^(?:GL2PS)/,/^(?:SMLNJ)/,/^(?:Rdisc)/,/^(?:Noweb)/,/^(?:Nokia)/,/^(?:SISSL)/,/^(?:Qhull)/,/^(?:Intel)/,/^(?:Glide)/,/^(?:Xerox)/,/^(?:AMPAS)/,/^(?:WTFPL)/,/^(?:MS-PL)/,/^(?:XSkat)/,/^(?:MS-RL)/,/^(?:MirOS)/,/^(?:RSCPL)/,/^(?:TMate)/,/^(?:OGTSL)/,/^(?:FSFAP)/,/^(?:NCSA)/,/^(?:Zlib)/,/^(?:SCEA)/,/^(?:SNIA)/,/^(?:NGPL)/,/^(?:NOSL)/,/^(?:ADSL)/,/^(?:MTLL)/,/^(?:NLPL)/,/^(?:Ruby)/,/^(?:JSON)/,/^(?:Barr)/,/^(?:0BSD)/,/^(?:Xnet)/,/^(?:Cube)/,/^(?:curl)/,/^(?:DSDP)/,/^(?:Fair)/,/^(?:HPND)/,/^(?:TOSL)/,/^(?:IJG)/,/^(?:SWL)/,/^(?:Vim)/,/^(?:FTL)/,/^(?:ICU)/,/^(?:OML)/,/^(?:NRL)/,/^(?:DOC)/,/^(?:TCL)/,/^(?:W3C)/,/^(?:NTP)/,/^(?:IPA)/,/^(?:ISC)/,/^(?:X11)/,/^(?:AAL)/,/^(?:AML)/,/^(?:xpp)/,/^(?:Zed)/,/^(?:MIT)/,/^(?:Mup)/], +conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = spdxparse; +exports.Parser = spdxparse.Parser; +exports.parse = function () { return spdxparse.parse.apply(spdxparse, arguments); }; +exports.main = function commonjsMain(args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = __webpack_require__(7).readFileSync(__webpack_require__(3).normalize(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(53)(module))) + +/***/ }), +/* 365 */ +/***/ (function(module, exports, __webpack_require__) { + +var licenseIDs = __webpack_require__(366); + +function valid(string) { + return licenseIDs.indexOf(string) > -1; +} + +// Common transpositions of license identifier acronyms +var transpositions = [ + ['APGL', 'AGPL'], + ['Gpl', 'GPL'], + ['GLP', 'GPL'], + ['APL', 'Apache'], + ['ISD', 'ISC'], + ['GLP', 'GPL'], + ['IST', 'ISC'], + ['Claude', 'Clause'], + [' or later', '+'], + [' International', ''], + ['GNU', 'GPL'], + ['GUN', 'GPL'], + ['+', ''], + ['GNU GPL', 'GPL'], + ['GNU/GPL', 'GPL'], + ['GNU GLP', 'GPL'], + ['GNU General Public License', 'GPL'], + ['Gnu public license', 'GPL'], + ['GNU Public License', 'GPL'], + ['GNU GENERAL PUBLIC LICENSE', 'GPL'], + ['MTI', 'MIT'], + ['Mozilla Public License', 'MPL'], + ['WTH', 'WTF'], + ['-License', ''] +]; + +var TRANSPOSED = 0; +var CORRECT = 1; + +// Simple corrections to nearly valid identifiers. +var transforms = [ + // e.g. 'mit' + function(argument) { + return argument.toUpperCase(); + }, + // e.g. 'MIT ' + function(argument) { + return argument.trim(); + }, + // e.g. 'M.I.T.' + function(argument) { + return argument.replace(/\./g, ''); + }, + // e.g. 'Apache- 2.0' + function(argument) { + return argument.replace(/\s+/g, ''); + }, + // e.g. 'CC BY 4.0'' + function(argument) { + return argument.replace(/\s+/g, '-'); + }, + // e.g. 'LGPLv2.1' + function(argument) { + return argument.replace('v', '-'); + }, + // e.g. 'Apache 2.0' + function(argument) { + return argument.replace(/,?\s*(\d)/, '-$1'); + }, + // e.g. 'GPL 2' + function(argument) { + return argument.replace(/,?\s*(\d)/, '-$1.0'); + }, + // e.g. 'Apache Version 2.0' + function(argument) { + return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2'); + }, + // e.g. 'Apache Version 2' + function(argument) { + return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0'); + }, + // e.g. 'ZLIB' + function(argument) { + return argument[0].toUpperCase() + argument.slice(1); + }, + // e.g. 'MPL/2.0' + function(argument) { + return argument.replace('/', '-'); + }, + // e.g. 'Apache 2' + function(argument) { + return argument + .replace(/\s*V\s*(\d)/, '-$1') + .replace(/(\d)$/, '$1.0'); + }, + // e.g. 'GPL-2.0-' + function(argument) { + return argument.slice(0, argument.length - 1); + }, + // e.g. 'GPL2' + function(argument) { + return argument.replace(/(\d)$/, '-$1.0'); + }, + // e.g. 'BSD 3' + function(argument) { + return argument.replace(/(-| )?(\d)$/, '-$2-Clause'); + }, + // e.g. 'BSD clause 3' + function(argument) { + return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause'); + }, + // e.g. 'BY-NC-4.0' + function(argument) { + return 'CC-' + argument; + }, + // e.g. 'BY-NC' + function(argument) { + return 'CC-' + argument + '-4.0'; + }, + // e.g. 'Attribution-NonCommercial' + function(argument) { + return argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, ''); + }, + // e.g. 'Attribution-NonCommercial' + function(argument) { + return 'CC-' + + argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, '') + + '-4.0'; + } +]; + +// If all else fails, guess that strings containing certain substrings +// meant to identify certain licenses. +var lastResorts = [ + ['UNLI', 'Unlicense'], + ['WTF', 'WTFPL'], + ['2 CLAUSE', 'BSD-2-Clause'], + ['2-CLAUSE', 'BSD-2-Clause'], + ['3 CLAUSE', 'BSD-3-Clause'], + ['3-CLAUSE', 'BSD-3-Clause'], + ['AFFERO', 'AGPL-3.0'], + ['AGPL', 'AGPL-3.0'], + ['APACHE', 'Apache-2.0'], + ['ARTISTIC', 'Artistic-2.0'], + ['Affero', 'AGPL-3.0'], + ['BEER', 'Beerware'], + ['BOOST', 'BSL-1.0'], + ['BSD', 'BSD-2-Clause'], + ['ECLIPSE', 'EPL-1.0'], + ['FUCK', 'WTFPL'], + ['GNU', 'GPL-3.0'], + ['LGPL', 'LGPL-3.0'], + ['GPL', 'GPL-3.0'], + ['MIT', 'MIT'], + ['MPL', 'MPL-2.0'], + ['X11', 'X11'], + ['ZLIB', 'Zlib'] +]; + +var SUBSTRING = 0; +var IDENTIFIER = 1; + +var validTransformation = function(identifier) { + for (var i = 0; i < transforms.length; i++) { + var transformed = transforms[i](identifier); + if (transformed !== identifier && valid(transformed)) { + return transformed; + } + } + return null; +}; + +var validLastResort = function(identifier) { + var upperCased = identifier.toUpperCase(); + for (var i = 0; i < lastResorts.length; i++) { + var lastResort = lastResorts[i]; + if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { + return lastResort[IDENTIFIER]; + } + } + return null; +}; + +var anyCorrection = function(identifier, check) { + for (var i = 0; i < transpositions.length; i++) { + var transposition = transpositions[i]; + var transposed = transposition[TRANSPOSED]; + if (identifier.indexOf(transposed) > -1) { + var corrected = identifier.replace( + transposed, + transposition[CORRECT] + ); + var checked = check(corrected); + if (checked !== null) { + return checked; + } + } + } + return null; +}; + +module.exports = function(identifier) { + identifier = identifier.replace(/\+$/, ''); + if (valid(identifier)) { + return identifier; + } + var transformed = validTransformation(identifier); + if (transformed !== null) { + return transformed; + } + transformed = anyCorrection(identifier, function(argument) { + if (valid(argument)) { + return argument; + } + return validTransformation(argument); + }); + if (transformed !== null) { + return transformed; + } + transformed = validLastResort(identifier); + if (transformed !== null) { + return transformed; + } + transformed = anyCorrection(identifier, validLastResort); + if (transformed !== null) { + return transformed; + } + return null; +}; + + +/***/ }), +/* 366 */ +/***/ (function(module, exports) { + +module.exports = ["Glide","Abstyles","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AMPAS","APL-1.0","Adobe-Glyph","APAFML","Adobe-2006","AGPL-1.0","Afmparse","Aladdin","ADSL","AMDPLPA","ANTLR-PD","Apache-1.0","Apache-1.1","Apache-2.0","AML","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","AAL","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","BSL-1.0","Borceux","BSD-2-Clause","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","BSD-3-Clause","BSD-3-Clause-Clear","BSD-4-Clause","BSD-Protection","BSD-Source-Code","BSD-3-Clause-Attribution","0BSD","BSD-4-Clause-UC","bzip2-1.0.5","bzip2-1.0.6","Caldera","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","ClArtistic","MIT-CMU","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","CPOL-1.02","CDDL-1.0","CDDL-1.1","CPAL-1.0","CPL-1.0","CATOSL-1.1","Condor-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-3.0","CC-BY-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-4.0","CC0-1.0","Crossword","CrystalStacker","CUA-OPL-1.0","Cube","curl","D-FSL-1.0","diffmark","WTFPL","DOC","Dotseqn","DSDP","dvipdfm","EPL-1.0","ECL-1.0","ECL-2.0","eGenix","EFL-1.0","EFL-2.0","MIT-advertising","MIT-enna","Entessa","ErlPL-1.1","EUDatagrid","EUPL-1.0","EUPL-1.1","Eurosym","Fair","MIT-feh","Frameworx-1.0","FreeImage","FTL","FSFAP","FSFUL","FSFULLR","Giftware","GL2PS","Glulxe","AGPL-3.0","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-3.0","LGPL-2.1","LGPL-3.0","LGPL-2.0","gnuplot","gSOAP-1.3b","HaskellReport","HPND","IBM-pibs","IPL-1.0","ICU","ImageMagick","iMatix","Imlib2","IJG","Info-ZIP","Intel-ACPI","Intel","Interbase-1.0","IPA","ISC","JasPer-2.0","JSON","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","Latex2e","BSD-3-Clause-LBNL","Leptonica","LGPLLR","Libpng","libtiff","LAL-1.2","LAL-1.3","LiLiQ-P-1.1","LiLiQ-Rplus-1.1","LiLiQ-R-1.1","LPL-1.02","LPL-1.0","MakeIndex","MTLL","MS-PL","MS-RL","MirOS","MITNFA","MIT","Motosoto","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","mpich2","Multics","Mup","NASA-1.3","Naumen","NBPL-1.0","NetCDF","NGPL","NOSL","NPL-1.0","NPL-1.1","Newsletr","NLPL","Nokia","NPOSL-3.0","NLOD-1.0","Noweb","NRL","NTP","Nunit","OCLC-2.0","ODbL-1.0","PDDL-1.0","OCCT-PL","OGTSL","OLDAP-2.2.2","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OML","OPL-1.0","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenSSL","OSET-PL-2.1","PHP-3.0","PHP-3.01","Plexus","PostgreSQL","psfrag","psutils","Python-2.0","QPL-1.0","Qhull","Rdisc","RPSL-1.0","RPL-1.1","RPL-1.5","RHeCos-1.1","RSCPL","RSA-MD","Ruby","SAX-PD","Saxpath","SCEA","SWL","SMPPL","Sendmail","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","OFL-1.0","OFL-1.1","SimPL-2.0","Sleepycat","SNIA","Spencer-86","Spencer-94","Spencer-99","SMLNJ","SugarCRM-1.1.3","SISSL","SISSL-1.2","SPL-1.0","Watcom-1.0","TCL","Unlicense","TMate","TORQUE-1.1","TOSL","Unicode-TOU","UPL-1.0","NCSA","Vim","VOSTROM","VSL-1.0","W3C-19980720","W3C","Wsuipa","Xnet","X11","Xerox","XFree86-1.1","xinetd","xpp","XSkat","YPL-1.0","YPL-1.1","Zed","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","zlib-acknowledgement","ZPL-1.1","ZPL-2.0","ZPL-2.1","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-No-Nuclear-License-2014","eCos-2.0","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-2.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","StandardML-NJ","WXwindows"] + +/***/ }), +/* 367 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var url = __webpack_require__(88) +var gitHosts = __webpack_require__(89) +var GitHost = module.exports = __webpack_require__(368) + +var protocolToRepresentationMap = { + 'git+ssh': 'sshurl', + 'git+https': 'https', + 'ssh': 'sshurl', + 'git': 'git' +} + +function protocolToRepresentation (protocol) { + if (protocol.substr(-1) === ':') protocol = protocol.slice(0, -1) + return protocolToRepresentationMap[protocol] || protocol +} + +var authProtocols = { + 'git:': true, + 'https:': true, + 'git+https:': true, + 'http:': true, + 'git+http:': true +} + +var cache = {} + +module.exports.fromUrl = function (giturl, opts) { + var key = giturl + JSON.stringify(opts || {}) + + if (!(key in cache)) { + cache[key] = fromUrl(giturl, opts) + } + + return cache[key] +} + +function fromUrl (giturl, opts) { + if (giturl == null || giturl === '') return + var url = fixupUnqualifiedGist( + isGitHubShorthand(giturl) ? 'github:' + giturl : giturl + ) + var parsed = parseGitUrl(url) + var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)')) + var matches = Object.keys(gitHosts).map(function (gitHostName) { + try { + var gitHostInfo = gitHosts[gitHostName] + var auth = null + if (parsed.auth && authProtocols[parsed.protocol]) { + auth = decodeURIComponent(parsed.auth) + } + var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null + var user = null + var project = null + var defaultRepresentation = null + if (shortcutMatch && shortcutMatch[1] === gitHostName) { + user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]) + project = decodeURIComponent(shortcutMatch[3]) + defaultRepresentation = 'shortcut' + } else { + if (parsed.host !== gitHostInfo.domain) return + if (!gitHostInfo.protocols_re.test(parsed.protocol)) return + if (!parsed.path) return + var pathmatch = gitHostInfo.pathmatch + var matched = parsed.path.match(pathmatch) + if (!matched) return + if (matched[1] != null) user = decodeURIComponent(matched[1].replace(/^:/, '')) + if (matched[2] != null) project = decodeURIComponent(matched[2]) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) + } catch (ex) { + if (!(ex instanceof URIError)) throw ex + } + }).filter(function (gitHostInfo) { return gitHostInfo }) + if (matches.length !== 1) return + return matches[0] +} + +function isGitHubShorthand (arg) { + // Note: This does not fully test the git ref format. + // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg) +} + +function fixupUnqualifiedGist (giturl) { + // necessary for round-tripping gists + var parsed = url.parse(giturl) + if (parsed.protocol === 'gist:' && parsed.host && !parsed.path) { + return parsed.protocol + '/' + parsed.host + } else { + return giturl + } +} + +function parseGitUrl (giturl) { + if (typeof giturl !== 'string') giturl = '' + giturl + var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) + if (!matched) return url.parse(giturl) + return { + protocol: 'git+ssh:', + slashes: true, + auth: matched[1], + host: matched[2], + port: null, + hostname: matched[2], + hash: matched[4], + search: null, + query: null, + pathname: '/' + matched[3], + path: '/' + matched[3], + href: 'git+ssh://' + matched[1] + '@' + matched[2] + + '/' + matched[3] + (matched[4] || '') + } +} + + +/***/ }), +/* 368 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var gitHosts = __webpack_require__(89) +var extend = Object.assign || __webpack_require__(13)._extend + +var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) { + var gitHostInfo = this + gitHostInfo.type = type + Object.keys(gitHosts[type]).forEach(function (key) { + gitHostInfo[key] = gitHosts[type][key] + }) + gitHostInfo.user = user + gitHostInfo.auth = auth + gitHostInfo.project = project + gitHostInfo.committish = committish + gitHostInfo.default = defaultRepresentation + gitHostInfo.opts = opts || {} +} +GitHost.prototype = {} + +GitHost.prototype.hash = function () { + return this.committish ? '#' + this.committish : '' +} + +GitHost.prototype._fill = function (template, opts) { + if (!template) return + var vars = extend({}, opts) + opts = extend(extend({}, this.opts), opts) + var self = this + Object.keys(this).forEach(function (key) { + if (self[key] != null && vars[key] == null) vars[key] = self[key] + }) + var rawAuth = vars.auth + var rawComittish = vars.committish + Object.keys(vars).forEach(function (key) { + vars[key] = encodeURIComponent(vars[key]) + }) + vars['auth@'] = rawAuth ? rawAuth + '@' : '' + if (opts.noCommittish) { + vars['#committish'] = '' + vars['/tree/committish'] = '' + vars['/comittish'] = '' + vars.comittish = '' + } else { + vars['#committish'] = rawComittish ? '#' + rawComittish : '' + vars['/tree/committish'] = vars.committish + ? '/' + vars.treepath + '/' + vars.committish + : '' + vars['/committish'] = vars.committish ? '/' + vars.committish : '' + vars.committish = vars.committish || 'master' + } + var res = template + Object.keys(vars).forEach(function (key) { + res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key]) + }) + if (opts.noGitPlus) { + return res.replace(/^git[+]/, '') + } else { + return res + } +} + +GitHost.prototype.ssh = function (opts) { + return this._fill(this.sshtemplate, opts) +} + +GitHost.prototype.sshurl = function (opts) { + return this._fill(this.sshurltemplate, opts) +} + +GitHost.prototype.browse = function (opts) { + return this._fill(this.browsetemplate, opts) +} + +GitHost.prototype.docs = function (opts) { + return this._fill(this.docstemplate, opts) +} + +GitHost.prototype.bugs = function (opts) { + return this._fill(this.bugstemplate, opts) +} + +GitHost.prototype.https = function (opts) { + return this._fill(this.httpstemplate, opts) +} + +GitHost.prototype.git = function (opts) { + return this._fill(this.gittemplate, opts) +} + +GitHost.prototype.shortcut = function (opts) { + return this._fill(this.shortcuttemplate, opts) +} + +GitHost.prototype.path = function (opts) { + return this._fill(this.pathtemplate, opts) +} + +GitHost.prototype.tarball = function (opts) { + return this._fill(this.tarballtemplate, opts) +} + +GitHost.prototype.file = function (P, opts) { + return this._fill(this.filetemplate, extend({ + path: P.replace(/^[/]+/g, '') + }, opts)) +} + +GitHost.prototype.getDefaultRepresentation = function () { + return this.default +} + +GitHost.prototype.toString = function (opts) { + return (this[this.default] || this.sshurl).call(this, opts) +} + + +/***/ }), +/* 369 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var builtinModules = __webpack_require__(370); + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return builtinModules.indexOf(str) !== -1; +}; + + +/***/ }), +/* 370 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var blacklist = [ + 'freelist', + 'sys' +]; + +module.exports = Object.keys(process.binding('natives')).filter(function (el) { + return !/^_|^internal|\//.test(el) && blacklist.indexOf(el) === -1; +}).sort(); + + +/***/ }), +/* 371 */ +/***/ (function(module, exports) { + +module.exports = extractDescription + +// Extracts description from contents of a readme file in markdown format +function extractDescription (d) { + if (!d) return; + if (d === "ERROR: No README data found!") return; + // the first block of text before the first heading + // that isn't the first line heading + d = d.trim().split('\n') + for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++); + var l = d.length + for (var e = s + 1; e < l && d[e].trim(); e ++); + return d.slice(s, e).join(' ').trim() +} + + +/***/ }), +/* 372 */ +/***/ (function(module, exports) { + +module.exports = {"topLevel":{"dependancies":"dependencies","dependecies":"dependencies","depdenencies":"dependencies","devEependencies":"devDependencies","depends":"dependencies","dev-dependencies":"devDependencies","devDependences":"devDependencies","devDepenencies":"devDependencies","devdependencies":"devDependencies","repostitory":"repository","repo":"repository","prefereGlobal":"preferGlobal","hompage":"homepage","hampage":"homepage","autohr":"author","autor":"author","contributers":"contributors","publicationConfig":"publishConfig","script":"scripts"},"bugs":{"web":"url","name":"url"},"script":{"server":"start","tests":"test"}} + +/***/ }), +/* 373 */ +/***/ (function(module, exports, __webpack_require__) { + +var util = __webpack_require__(13) +var messages = __webpack_require__(374) + +module.exports = function() { + var args = Array.prototype.slice.call(arguments, 0) + var warningName = args.shift() + if (warningName == "typo") { + return makeTypoWarning.apply(null,args) + } + else { + var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'" + args.unshift(msgTemplate) + return util.format.apply(null, args) + } +} + +function makeTypoWarning (providedName, probableName, field) { + if (field) { + providedName = field + "['" + providedName + "']" + probableName = field + "['" + probableName + "']" + } + return util.format(messages.typo, providedName, probableName) +} + + +/***/ }), +/* 374 */ +/***/ (function(module, exports) { + +module.exports = {"repositories":"'repositories' (plural) Not supported. Please pick one as the 'repository' field","missingRepository":"No repository field.","brokenGitUrl":"Probably broken git url: %s","nonObjectScripts":"scripts must be an object","nonStringScript":"script values must be string commands","nonArrayFiles":"Invalid 'files' member","invalidFilename":"Invalid filename in 'files' list: %s","nonArrayBundleDependencies":"Invalid 'bundleDependencies' list. Must be array of package names","nonStringBundleDependency":"Invalid bundleDependencies member: %s","nonDependencyBundleDependency":"Non-dependency in bundleDependencies: %s","nonObjectDependencies":"%s field must be an object","nonStringDependency":"Invalid dependency: %s %s","deprecatedArrayDependencies":"specifying %s as array is deprecated","deprecatedModules":"modules field is deprecated","nonArrayKeywords":"keywords should be an array of strings","nonStringKeyword":"keywords should be an array of strings","conflictingName":"%s is also the name of a node core module.","nonStringDescription":"'description' field should be a string","missingDescription":"No description","missingReadme":"No README data","missingLicense":"No license field.","nonEmailUrlBugsString":"Bug string field must be url, email, or {email,url}","nonUrlBugsUrlField":"bugs.url field must be a string url. Deleted.","nonEmailBugsEmailField":"bugs.email field must be a string email. Deleted.","emptyNormalizedBugs":"Normalized value of bugs field is an empty object. Deleted.","nonUrlHomepage":"homepage field must be a string url. Deleted.","invalidLicense":"license should be a valid SPDX license expression","typo":"%s should probably be %s."} + +/***/ }), +/* 375 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const path = __webpack_require__(3); +const writeJsonFile = __webpack_require__(376); +const sortKeys = __webpack_require__(90); + +const opts = {detectIndent: true}; + +const dependencyKeys = new Set([ + 'dependencies', + 'devDependencies', + 'optionalDependencies', + 'peerDependencies' +]); + +function normalize(pkg) { + const ret = {}; + + for (const key of Object.keys(pkg)) { + if (!dependencyKeys.has(key)) { + ret[key] = pkg[key]; + } else if (Object.keys(pkg[key]).length !== 0) { + ret[key] = sortKeys(pkg[key]); + } + } + + return ret; +} + +module.exports = (fp, data) => { + if (typeof fp !== 'string') { + data = fp; + fp = '.'; + } + + fp = path.basename(fp) === 'package.json' ? fp : path.join(fp, 'package.json'); + + data = normalize(data); + + return writeJsonFile(fp, data, opts); +}; + +module.exports.sync = (fp, data) => { + if (typeof fp !== 'string') { + data = fp; + fp = '.'; + } + + fp = path.basename(fp) === 'package.json' ? fp : path.join(fp, 'package.json'); + + data = normalize(data); + + writeJsonFile.sync(fp, data, opts); +}; + + +/***/ }), +/* 376 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const path = __webpack_require__(3); +const fs = __webpack_require__(23); +const writeFileAtomic = __webpack_require__(377); +const sortKeys = __webpack_require__(90); +const makeDir = __webpack_require__(91); +const pify = __webpack_require__(22); +const detectIndent = __webpack_require__(381); + +const init = (fn, fp, data, opts) => { + if (!fp) { + throw new TypeError('Expected a filepath'); + } + + if (data === undefined) { + throw new TypeError('Expected data to stringify'); + } + + opts = Object.assign({ + indent: '\t', + sortKeys: false + }, opts); + + if (opts.sortKeys) { + data = sortKeys(data, { + deep: true, + compare: typeof opts.sortKeys === 'function' && opts.sortKeys + }); + } + + return fn(fp, data, opts); +}; + +const readFile = fp => pify(fs.readFile)(fp, 'utf8').catch(() => {}); + +const main = (fp, data, opts) => { + return (opts.detectIndent ? readFile(fp) : Promise.resolve()) + .then(str => { + const indent = str ? detectIndent(str).indent : opts.indent; + const json = JSON.stringify(data, opts.replacer, indent); + + return pify(writeFileAtomic)(fp, `${json}\n`, {mode: opts.mode}); + }); +}; + +const mainSync = (fp, data, opts) => { + let indent = opts.indent; + + if (opts.detectIndent) { + try { + const file = fs.readFileSync(fp, 'utf8'); + indent = detectIndent(file).indent; + } catch (err) { + if (err.code !== 'ENOENT') { + throw err; + } + } + } + + const json = JSON.stringify(data, opts.replacer, indent); + + return writeFileAtomic.sync(fp, `${json}\n`, {mode: opts.mode}); +}; + +module.exports = (fp, data, opts) => { + return makeDir(path.dirname(fp), {fs}) + .then(() => init(main, fp, data, opts)); +}; + +module.exports.sync = (fp, data, opts) => { + makeDir.sync(path.dirname(fp), {fs}); + init(mainSync, fp, data, opts); +}; + + +/***/ }), +/* 377 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = writeFile +module.exports.sync = writeFileSync +module.exports._getTmpname = getTmpname // for testing +module.exports._cleanupOnExit = cleanupOnExit + +var fs = __webpack_require__(23) +var MurmurHash3 = __webpack_require__(378) +var onExit = __webpack_require__(59) +var path = __webpack_require__(3) +var activeFiles = {} + +var invocations = 0 +function getTmpname (filename) { + return filename + '.' + + MurmurHash3(__filename) + .hash(String(process.pid)) + .hash(String(++invocations)) + .result() +} + +function cleanupOnExit (tmpfile) { + return function () { + try { + fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) + } catch (_) {} + } +} + +function writeFile (filename, data, options, callback) { + if (options instanceof Function) { + callback = options + options = null + } + if (!options) options = {} + + var Promise = options.Promise || global.Promise + var truename + var fd + var tmpfile + var removeOnExit = cleanupOnExit(() => tmpfile) + var absoluteName = path.resolve(filename) + + new Promise(function serializeSameFile (resolve) { + // make a queue if it doesn't already exist + if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] + + activeFiles[absoluteName].push(resolve) // add this job to the queue + if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one + }).then(function getRealPath () { + return new Promise(function (resolve) { + fs.realpath(filename, function (_, realname) { + truename = realname || filename + tmpfile = getTmpname(truename) + resolve() + }) + }) + }).then(function stat () { + return new Promise(function stat (resolve) { + if (options.mode && options.chown) resolve() + else { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + fs.stat(truename, function (err, stats) { + if (err || !stats) resolve() + else { + options = Object.assign({}, options) + + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + resolve() + } + }) + } + }) + }).then(function thenWriteFile () { + return new Promise(function (resolve, reject) { + fs.open(tmpfile, 'w', options.mode, function (err, _fd) { + fd = _fd + if (err) reject(err) + else resolve() + }) + }) + }).then(function write () { + return new Promise(function (resolve, reject) { + if (Buffer.isBuffer(data)) { + fs.write(fd, data, 0, data.length, 0, function (err) { + if (err) reject(err) + else resolve() + }) + } else if (data != null) { + fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { + if (err) reject(err) + else resolve() + }) + } else resolve() + }) + }).then(function syncAndClose () { + if (options.fsync !== false) { + return new Promise(function (resolve, reject) { + fs.fsync(fd, function (err) { + if (err) reject(err) + else fs.close(fd, resolve) + }) + }) + } + }).then(function chown () { + if (options.chown) { + return new Promise(function (resolve, reject) { + fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { + if (err) reject(err) + else resolve() + }) + }) + } + }).then(function chmod () { + if (options.mode) { + return new Promise(function (resolve, reject) { + fs.chmod(tmpfile, options.mode, function (err) { + if (err) reject(err) + else resolve() + }) + }) + } + }).then(function rename () { + return new Promise(function (resolve, reject) { + fs.rename(tmpfile, truename, function (err) { + if (err) reject(err) + else resolve() + }) + }) + }).then(function success () { + removeOnExit() + callback() + }).catch(function fail (err) { + removeOnExit() + fs.unlink(tmpfile, function () { + callback(err) + }) + }).then(function checkQueue () { + activeFiles[absoluteName].shift() // remove the element added by serializeSameFile + if (activeFiles[absoluteName].length > 0) { + activeFiles[absoluteName][0]() // start next job if one is pending + } else delete activeFiles[absoluteName] + }) +} + +function writeFileSync (filename, data, options) { + if (!options) options = {} + try { + filename = fs.realpathSync(filename) + } catch (ex) { + // it's ok, it'll happen on a not yet existing file + } + var tmpfile = getTmpname(filename) + + try { + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + var stats = fs.statSync(filename) + options = Object.assign({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + var removeOnExit = onExit(cleanupOnExit(tmpfile)) + var fd = fs.openSync(tmpfile, 'w', options.mode) + if (Buffer.isBuffer(data)) { + fs.writeSync(fd, data, 0, data.length, 0) + } else if (data != null) { + fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) + } + if (options.fsync !== false) { + fs.fsyncSync(fd) + } + fs.closeSync(fd) + if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + if (options.mode) fs.chmodSync(tmpfile, options.mode) + fs.renameSync(tmpfile, filename) + removeOnExit() + } catch (err) { + removeOnExit() + try { fs.unlinkSync(tmpfile) } catch (e) {} + throw err + } +} + + +/***/ }), +/* 378 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (true) { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); + + +/***/ }), +/* 379 */ +/***/ (function(module, exports) { + +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} + + +/***/ }), +/* 380 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toString = Object.prototype.toString; + +module.exports = function (x) { + var prototype; + return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); +}; + + +/***/ }), +/* 381 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// detect either spaces or tabs but not both to properly handle tabs +// for indentation and spaces for alignment +const INDENT_RE = /^(?:( )+|\t+)/; + +function getMostUsed(indents) { + let result = 0; + let maxUsed = 0; + let maxWeight = 0; + + for (const entry of indents) { + // TODO: use destructuring when targeting Node.js 6 + const key = entry[0]; + const val = entry[1]; + + const u = val[0]; + const w = val[1]; + + if (u > maxUsed || (u === maxUsed && w > maxWeight)) { + maxUsed = u; + maxWeight = w; + result = Number(key); + } + } + + return result; +} + +module.exports = str => { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + // used to see if tabs or spaces are the most used + let tabs = 0; + let spaces = 0; + + // remember the size of previous line's indentation + let prev = 0; + + // remember how many indents/unindents as occurred for a given size + // and how much lines follow a given indentation + // + // indents = { + // 3: [1, 0], + // 4: [1, 5], + // 5: [1, 0], + // 12: [1, 0], + // } + const indents = new Map(); + + // pointer to the array of last used indent + let current; + + // whether the last action was an indent (opposed to an unindent) + let isIndent; + + for (const line of str.split(/\n/g)) { + if (!line) { + // ignore empty lines + continue; + } + + let indent; + const matches = line.match(INDENT_RE); + + if (matches) { + indent = matches[0].length; + + if (matches[1]) { + spaces++; + } else { + tabs++; + } + } else { + indent = 0; + } + + const diff = indent - prev; + prev = indent; + + if (diff) { + // an indent or unindent has been detected + + isIndent = diff > 0; + + current = indents.get(isIndent ? diff : -diff); + + if (current) { + current[0]++; + } else { + current = [1, 0]; + indents.set(diff, current); + } + } else if (current) { + // if the last action was an indent, increment the weight + current[1] += Number(isIndent); + } + } + + const amount = getMostUsed(indents); + + let type; + let indent; + if (!amount) { + type = null; + indent = ''; + } else if (spaces >= tabs) { + type = 'space'; + indent = ' '.repeat(amount); + } else { + type = 'tab'; + indent = '\t'.repeat(amount); + } + + return { + amount, + type, + indent + }; +}; + + +/***/ }), +/* 382 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.runScriptInPackage = exports.installInDir = undefined; + +/** + * Install all dependencies in the given directory + */ +let installInDir = exports.installInDir = (() => { + var _ref = _asyncToGenerator(function* (directory, extraArgs = []) { + const options = ['install', '--non-interactive', '--mutex file', ...extraArgs]; + // We pass the mutex flag to ensure only one instance of yarn runs at any + // given time (e.g. to avoid conflicts). + yield (0, _child_process.spawn)('yarn', options, { + cwd: directory + }); + }); + + return function installInDir(_x) { + return _ref.apply(this, arguments); + }; +})(); +/** + * Run script in the given directory + */ + + +let runScriptInPackage = exports.runScriptInPackage = (() => { + var _ref2 = _asyncToGenerator(function* (script, args, pkg) { + const execOpts = { + cwd: pkg.path + }; + yield (0, _child_process.spawn)('yarn', ['run', script, ...args], execOpts); + }); + + return function runScriptInPackage(_x2, _x3, _x4) { + return _ref2.apply(this, arguments); + }; +})(); +/** + * Run script in the given directory + */ + + +exports.runScriptInPackageStreaming = runScriptInPackageStreaming; + +var _child_process = __webpack_require__(383); + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +function runScriptInPackageStreaming(script, args, pkg) { + const execOpts = { + cwd: pkg.path + }; + return (0, _child_process.spawnStreaming)('yarn', ['run', script, ...args], execOpts, { + prefix: pkg.name + }); +} + +/***/ }), +/* 383 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +exports.spawn = spawn; +exports.spawnStreaming = spawnStreaming; + +var _chalk = __webpack_require__(14); + +var _chalk2 = _interopRequireDefault(_chalk); + +var _execa = __webpack_require__(384); + +var _execa2 = _interopRequireDefault(_execa); + +var _logSymbols = __webpack_require__(95); + +var _logSymbols2 = _interopRequireDefault(_logSymbols); + +var _strongLogTransformer = __webpack_require__(410); + +var _strongLogTransformer2 = _interopRequireDefault(_strongLogTransformer); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function generateColors() { + const colorWheel = [_chalk2.default.cyan, _chalk2.default.magenta, _chalk2.default.blue, _chalk2.default.yellow, _chalk2.default.green, _chalk2.default.red]; + const count = colorWheel.length; + let children = 0; + return () => colorWheel[children++ % count]; +} +function spawn(command, args, opts) { + return (0, _execa2.default)(command, args, _extends({}, opts, { + stdio: 'inherit' + })); +} +const nextColor = generateColors(); +function spawnStreaming(command, args, opts, { prefix }) { + const spawned = (0, _execa2.default)(command, args, _extends({}, opts, { + stdio: ['ignore', 'pipe', 'pipe'] + })); + const color = nextColor(); + const prefixedStdout = (0, _strongLogTransformer2.default)({ tag: `${color.bold(prefix)}:` }); + const prefixedStderr = (0, _strongLogTransformer2.default)({ + mergeMultiline: true, + tag: `${_logSymbols2.default.error} ${color.bold(prefix)}:` + }); + spawned.stdout.pipe(prefixedStdout).pipe(process.stdout); + spawned.stderr.pipe(prefixedStderr).pipe(process.stderr); + return spawned; +} + +/***/ }), +/* 384 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const path = __webpack_require__(3); +const childProcess = __webpack_require__(60); +const util = __webpack_require__(13); +const crossSpawn = __webpack_require__(385); +const stripEof = __webpack_require__(401); +const npmRunPath = __webpack_require__(402); +const isStream = __webpack_require__(404); +const _getStream = __webpack_require__(405); +const pFinally = __webpack_require__(407); +const onExit = __webpack_require__(59); +const errname = __webpack_require__(408); +const stdio = __webpack_require__(409); + +const TEN_MEGABYTES = 1000 * 1000 * 10; + +function handleArgs(cmd, args, opts) { + let parsed; + + opts = Object.assign({ + extendEnv: true, + env: {} + }, opts); + + if (opts.extendEnv) { + opts.env = Object.assign({}, process.env, opts.env); + } + + if (opts.__winShell === true) { + delete opts.__winShell; + parsed = { + command: cmd, + args, + options: opts, + file: cmd, + original: cmd + }; + } else { + parsed = crossSpawn._parse(cmd, args, opts); + } + + opts = Object.assign({ + maxBuffer: TEN_MEGABYTES, + stripEof: true, + preferLocal: true, + localDir: parsed.options.cwd || process.cwd(), + encoding: 'utf8', + reject: true, + cleanup: true + }, parsed.options); + + opts.stdio = stdio(opts); + + if (opts.preferLocal) { + opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); + } + + if (opts.detached) { + // #115 + opts.cleanup = false; + } + + if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { + // #116 + parsed.args.unshift('/q'); + } + + return { + cmd: parsed.command, + args: parsed.args, + opts, + parsed + }; +} + +function handleInput(spawned, opts) { + const input = opts.input; + + if (input === null || input === undefined) { + return; + } + + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +} + +function handleOutput(opts, val) { + if (val && opts.stripEof) { + val = stripEof(val); + } + + return val; +} + +function handleShell(fn, cmd, opts) { + let file = '/bin/sh'; + let args = ['-c', cmd]; + + opts = Object.assign({}, opts); + + if (process.platform === 'win32') { + opts.__winShell = true; + file = process.env.comspec || 'cmd.exe'; + args = ['/s', '/c', `"${cmd}"`]; + opts.windowsVerbatimArguments = true; + } + + if (opts.shell) { + file = opts.shell; + delete opts.shell; + } + + return fn(file, args, opts); +} + +function getStream(process, stream, encoding, maxBuffer) { + if (!process[stream]) { + return null; + } + + let ret; + + if (encoding) { + ret = _getStream(process[stream], { + encoding, + maxBuffer + }); + } else { + ret = _getStream.buffer(process[stream], {maxBuffer}); + } + + return ret.catch(err => { + err.stream = stream; + err.message = `${stream} ${err.message}`; + throw err; + }); +} + +function makeError(result, options) { + const stdout = result.stdout; + const stderr = result.stderr; + + let err = result.error; + const code = result.code; + const signal = result.signal; + + const parsed = options.parsed; + const joinedCmd = options.joinedCmd; + const timedOut = options.timedOut || false; + + if (!err) { + let output = ''; + + if (Array.isArray(parsed.opts.stdio)) { + if (parsed.opts.stdio[2] !== 'inherit') { + output += output.length > 0 ? stderr : `\n${stderr}`; + } + + if (parsed.opts.stdio[1] !== 'inherit') { + output += `\n${stdout}`; + } + } else if (parsed.opts.stdio !== 'inherit') { + output = `\n${stderr}${stdout}`; + } + + err = new Error(`Command failed: ${joinedCmd}${output}`); + err.code = code < 0 ? errname(code) : code; + } + + err.stdout = stdout; + err.stderr = stderr; + err.failed = true; + err.signal = signal || null; + err.cmd = joinedCmd; + err.timedOut = timedOut; + + return err; +} + +function joinCmd(cmd, args) { + let joinedCmd = cmd; + + if (Array.isArray(args) && args.length > 0) { + joinedCmd += ' ' + args.join(' '); + } + + return joinedCmd; +} + +module.exports = (cmd, args, opts) => { + const parsed = handleArgs(cmd, args, opts); + const encoding = parsed.opts.encoding; + const maxBuffer = parsed.opts.maxBuffer; + const joinedCmd = joinCmd(cmd, args); + + let spawned; + try { + spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); + } catch (err) { + return Promise.reject(err); + } + + let removeExitHandler; + if (parsed.opts.cleanup) { + removeExitHandler = onExit(() => { + spawned.kill(); + }); + } + + let timeoutId = null; + let timedOut = false; + + const cleanupTimeout = () => { + if (timeoutId) { + clearTimeout(timeoutId); + timeoutId = null; + } + }; + + if (parsed.opts.timeout > 0) { + timeoutId = setTimeout(() => { + timeoutId = null; + timedOut = true; + spawned.kill(parsed.opts.killSignal); + }, parsed.opts.timeout); + } + + const processDone = new Promise(resolve => { + spawned.on('exit', (code, signal) => { + cleanupTimeout(); + resolve({code, signal}); + }); + + spawned.on('error', err => { + cleanupTimeout(); + resolve({error: err}); + }); + + if (spawned.stdin) { + spawned.stdin.on('error', err => { + cleanupTimeout(); + resolve({error: err}); + }); + } + }); + + function destroy() { + if (spawned.stdout) { + spawned.stdout.destroy(); + } + + if (spawned.stderr) { + spawned.stderr.destroy(); + } + } + + const handlePromise = () => pFinally(Promise.all([ + processDone, + getStream(spawned, 'stdout', encoding, maxBuffer), + getStream(spawned, 'stderr', encoding, maxBuffer) + ]).then(arr => { + const result = arr[0]; + result.stdout = arr[1]; + result.stderr = arr[2]; + + if (removeExitHandler) { + removeExitHandler(); + } + + if (result.error || result.code !== 0 || result.signal !== null) { + const err = makeError(result, { + joinedCmd, + parsed, + timedOut + }); + + // TODO: missing some timeout logic for killed + // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 + // err.killed = spawned.killed || killed; + err.killed = err.killed || spawned.killed; + + if (!parsed.opts.reject) { + return err; + } + + throw err; + } + + return { + stdout: handleOutput(parsed.opts, result.stdout), + stderr: handleOutput(parsed.opts, result.stderr), + code: 0, + failed: false, + killed: false, + signal: null, + cmd: joinedCmd, + timedOut: false + }; + }), destroy); + + crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); + + handleInput(spawned, parsed.opts); + + spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); + spawned.catch = onrejected => handlePromise().catch(onrejected); + + return spawned; +}; + +module.exports.stdout = function () { + // TODO: set `stderr: 'ignore'` when that option is implemented + return module.exports.apply(null, arguments).then(x => x.stdout); +}; + +module.exports.stderr = function () { + // TODO: set `stdout: 'ignore'` when that option is implemented + return module.exports.apply(null, arguments).then(x => x.stderr); +}; + +module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); + +module.exports.sync = (cmd, args, opts) => { + const parsed = handleArgs(cmd, args, opts); + const joinedCmd = joinCmd(cmd, args); + + if (isStream(parsed.opts.input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } + + const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); + result.code = result.status; + + if (result.error || result.status !== 0 || result.signal !== null) { + const err = makeError(result, { + joinedCmd, + parsed + }); + + if (!parsed.opts.reject) { + return err; + } + + throw err; + } + + return { + stdout: handleOutput(parsed.opts, result.stdout), + stderr: handleOutput(parsed.opts, result.stderr), + code: 0, + failed: false, + signal: null, + cmd: joinedCmd, + timedOut: false + }; +}; + +module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); + +module.exports.spawn = util.deprecate(module.exports, 'execa.spawn() is deprecated. Use execa() instead.'); + + +/***/ }), +/* 385 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var cp = __webpack_require__(60); +var parse = __webpack_require__(386); +var enoent = __webpack_require__(399); + +var cpSpawnSync = cp.spawnSync; + +function spawn(command, args, options) { + var parsed; + var spawned; + + // Parse the arguments + parsed = parse(command, args, options); + + // Spawn the child process + spawned = cp.spawn(parsed.command, parsed.args, parsed.options); + + // Hook into child process "exit" event to emit an error if the command + // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + enoent.hookChildProcess(spawned, parsed); + + return spawned; +} + +function spawnSync(command, args, options) { + var parsed; + var result; + + if (!cpSpawnSync) { + try { + cpSpawnSync = __webpack_require__(400); // eslint-disable-line global-require + } catch (ex) { + throw new Error( + 'In order to use spawnSync on node 0.10 or older, you must ' + + 'install spawn-sync:\n\n' + + ' npm install spawn-sync --save' + ); + } + } + + // Parse the arguments + parsed = parse(command, args, options); + + // Spawn the child process + result = cpSpawnSync(parsed.command, parsed.args, parsed.options); + + // Analyze if the command does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); + + return result; +} + +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; + +module.exports._parse = parse; +module.exports._enoent = enoent; + + +/***/ }), +/* 386 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var resolveCommand = __webpack_require__(92); +var hasEmptyArgumentBug = __webpack_require__(394); +var escapeArgument = __webpack_require__(94); +var escapeCommand = __webpack_require__(395); +var readShebang = __webpack_require__(396); + +var isWin = process.platform === 'win32'; +var skipShellRegExp = /\.(?:com|exe)$/i; + +// Supported in Node >= 6 and >= 4.8 +var supportsShellOption = parseInt(process.version.substr(1).split('.')[0], 10) >= 6 || + parseInt(process.version.substr(1).split('.')[0], 10) === 4 && parseInt(process.version.substr(1).split('.')[1], 10) >= 8; + +function parseNonShell(parsed) { + var shebang; + var needsShell; + var applyQuotes; + + if (!isWin) { + return parsed; + } + + // Detect & add support for shebangs + parsed.file = resolveCommand(parsed.command); + parsed.file = parsed.file || resolveCommand(parsed.command, true); + shebang = parsed.file && readShebang(parsed.file); + + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; + needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(resolveCommand(shebang) || resolveCommand(shebang, true)); + } else { + needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(parsed.file); + } + + // If a shell is required, use cmd.exe and take care of escaping everything correctly + if (needsShell) { + // Escape command & arguments + applyQuotes = (parsed.command !== 'echo'); // Do not quote arguments for the special "echo" command + parsed.command = escapeCommand(parsed.command); + parsed.args = parsed.args.map(function (arg) { + return escapeArgument(arg, applyQuotes); + }); + + // Make use of cmd.exe + parsed.args = ['/d', '/s', '/c', '"' + parsed.command + (parsed.args.length ? ' ' + parsed.args.join(' ') : '') + '"']; + parsed.command = process.env.comspec || 'cmd.exe'; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } + + return parsed; +} + +function parseShell(parsed) { + var shellCommand; + + // If node supports the shell option, there's no need to mimic its behavior + if (supportsShellOption) { + return parsed; + } + + // Mimic node shell option, see: https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 + shellCommand = [parsed.command].concat(parsed.args).join(' '); + + if (isWin) { + parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; + parsed.args = ['/d', '/s', '/c', '"' + shellCommand + '"']; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } else { + if (typeof parsed.options.shell === 'string') { + parsed.command = parsed.options.shell; + } else if (process.platform === 'android') { + parsed.command = '/system/bin/sh'; + } else { + parsed.command = '/bin/sh'; + } + + parsed.args = ['-c', shellCommand]; + } + + return parsed; +} + +// ------------------------------------------------ + +function parse(command, args, options) { + var parsed; + + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; + } + + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = options || {}; + + // Build our parsed object + parsed = { + command: command, + args: args, + options: options, + file: undefined, + original: command, + }; + + // Delegate further parsing to shell or non-shell + return options.shell ? parseShell(parsed) : parseNonShell(parsed); +} + +module.exports = parse; + + +/***/ }), +/* 387 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = which +which.sync = whichSync + +var isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' + +var path = __webpack_require__(3) +var COLON = isWindows ? ';' : ':' +var isexe = __webpack_require__(388) + +function getNotFoundError (cmd) { + var er = new Error('not found: ' + cmd) + er.code = 'ENOENT' + + return er +} + +function getPathInfo (cmd, opt) { + var colon = opt.colon || COLON + var pathEnv = opt.path || process.env.PATH || '' + var pathExt = [''] + + pathEnv = pathEnv.split(colon) + + var pathExtExe = '' + if (isWindows) { + pathEnv.unshift(process.cwd()) + pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') + pathExt = pathExtExe.split(colon) + + + // Always test the cmd itself first. isexe will check to make sure + // it's found in the pathExt set. + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } + + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) + pathEnv = [''] + + return { + env: pathEnv, + ext: pathExt, + extExe: pathExtExe + } +} + +function which (cmd, opt, cb) { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] + + ;(function F (i, l) { + if (i === l) { + if (opt.all && found.length) + return cb(null, found) + else + return cb(getNotFoundError(cmd)) + } + + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) + if (!pathPart && (/^\.[\\\/]/).test(cmd)) { + p = cmd.slice(0, 2) + p + } + ;(function E (ii, ll) { + if (ii === ll) return F(i + 1, l) + var ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return cb(null, p + ext) + } + return E(ii + 1, ll) + }) + })(0, pathExt.length) + })(0, pathEnv.length) +} + +function whichSync (cmd, opt) { + opt = opt || {} + + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] + + for (var i = 0, l = pathEnv.length; i < l; i ++) { + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) + if (!pathPart && /^\.[\\\/]/.test(cmd)) { + p = cmd.slice(0, 2) + p + } + for (var j = 0, ll = pathExt.length; j < ll; j ++) { + var cur = p + pathExt[j] + var is + try { + is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } + } + + if (opt.all && found.length) + return found + + if (opt.nothrow) + return null + + throw getNotFoundError(cmd) +} + + +/***/ }), +/* 388 */ +/***/ (function(module, exports, __webpack_require__) { + +var fs = __webpack_require__(7) +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = __webpack_require__(389) +} else { + core = __webpack_require__(390) +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } + + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } + + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false + } + } + cb(er, is) + }) +} + +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} + + +/***/ }), +/* 389 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = isexe +isexe.sync = sync + +var fs = __webpack_require__(7) + +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT + + if (!pathext) { + return true + } + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } + } + return false +} + +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) +} + + +/***/ }), +/* 390 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = isexe +isexe.sync = sync + +var fs = __webpack_require__(7) + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), options) +} + +function checkStat (stat, options) { + return stat.isFile() && checkMode(stat, options) +} + +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid + + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() + + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g + + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 + + return ret +} + + +/***/ }), +/* 391 */ +/***/ (function(module, exports, __webpack_require__) { + +if (process.env.npm_package_name === 'pseudomap' && + process.env.npm_lifecycle_script === 'test') + process.env.TEST_PSEUDOMAP = 'true' + +if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { + module.exports = Map +} else { + module.exports = __webpack_require__(392) +} + + +/***/ }), +/* 392 */ +/***/ (function(module, exports) { + +var hasOwnProperty = Object.prototype.hasOwnProperty + +module.exports = PseudoMap + +function PseudoMap (set) { + if (!(this instanceof PseudoMap)) // whyyyyyyy + throw new TypeError("Constructor PseudoMap requires 'new'") + + this.clear() + + if (set) { + if ((set instanceof PseudoMap) || + (typeof Map === 'function' && set instanceof Map)) + set.forEach(function (value, key) { + this.set(key, value) + }, this) + else if (Array.isArray(set)) + set.forEach(function (kv) { + this.set(kv[0], kv[1]) + }, this) + else + throw new TypeError('invalid argument') + } +} + +PseudoMap.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + Object.keys(this._data).forEach(function (k) { + if (k !== 'size') + fn.call(thisp, this._data[k].value, this._data[k].key) + }, this) +} + +PseudoMap.prototype.has = function (k) { + return !!find(this._data, k) +} + +PseudoMap.prototype.get = function (k) { + var res = find(this._data, k) + return res && res.value +} + +PseudoMap.prototype.set = function (k, v) { + set(this._data, k, v) +} + +PseudoMap.prototype.delete = function (k) { + var res = find(this._data, k) + if (res) { + delete this._data[res._index] + this._data.size-- + } +} + +PseudoMap.prototype.clear = function () { + var data = Object.create(null) + data.size = 0 + + Object.defineProperty(this, '_data', { + value: data, + enumerable: false, + configurable: true, + writable: false + }) +} + +Object.defineProperty(PseudoMap.prototype, 'size', { + get: function () { + return this._data.size + }, + set: function (n) {}, + enumerable: true, + configurable: true +}) + +PseudoMap.prototype.values = +PseudoMap.prototype.keys = +PseudoMap.prototype.entries = function () { + throw new Error('iterators are not implemented in this version') +} + +// Either identical, or both NaN +function same (a, b) { + return a === b || a !== a && b !== b +} + +function Entry (k, v, i) { + this.key = k + this.value = v + this._index = i +} + +function find (data, k) { + for (var i = 0, s = '_' + k, key = s; + hasOwnProperty.call(data, key); + key = s + i++) { + if (same(data[key].key, k)) + return data[key] + } +} + +function set (data, k, v) { + for (var i = 0, s = '_' + k, key = s; + hasOwnProperty.call(data, key); + key = s + i++) { + if (same(data[key].key, k)) { + data[key].value = v + return + } + } + data.size++ + data[key] = new Entry(k, v, key) } -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); -if (true) { -exports.parser = spdxparse; -exports.Parser = spdxparse.Parser; -exports.parse = function () { return spdxparse.parse.apply(spdxparse, arguments); }; -exports.main = function commonjsMain(args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); +/***/ }), +/* 393 */ +/***/ (function(module, exports) { + +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) } - var source = __webpack_require__(7).readFileSync(__webpack_require__(3).normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); + } + + return self } + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(52)(module))) +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } -/***/ }), -/* 400 */ -/***/ (function(module, exports, __webpack_require__) { + if (node.list) { + node.list.removeNode(node) + } -var licenseIDs = __webpack_require__(401); + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } -function valid(string) { - return licenseIDs.indexOf(string) > -1; + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ } -// Common transpositions of license identifier acronyms -var transpositions = [ - ['APGL', 'AGPL'], - ['Gpl', 'GPL'], - ['GLP', 'GPL'], - ['APL', 'Apache'], - ['ISD', 'ISC'], - ['GLP', 'GPL'], - ['IST', 'ISC'], - ['Claude', 'Clause'], - [' or later', '+'], - [' International', ''], - ['GNU', 'GPL'], - ['GUN', 'GPL'], - ['+', ''], - ['GNU GPL', 'GPL'], - ['GNU/GPL', 'GPL'], - ['GNU GLP', 'GPL'], - ['GNU General Public License', 'GPL'], - ['Gnu public license', 'GPL'], - ['GNU Public License', 'GPL'], - ['GNU GENERAL PUBLIC LICENSE', 'GPL'], - ['MTI', 'MIT'], - ['Mozilla Public License', 'MPL'], - ['WTH', 'WTF'], - ['-License', ''] -]; +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } -var TRANSPOSED = 0; -var CORRECT = 1; + if (node.list) { + node.list.removeNode(node) + } -// Simple corrections to nearly valid identifiers. -var transforms = [ - // e.g. 'mit' - function(argument) { - return argument.toUpperCase(); - }, - // e.g. 'MIT ' - function(argument) { - return argument.trim(); - }, - // e.g. 'M.I.T.' - function(argument) { - return argument.replace(/\./g, ''); - }, - // e.g. 'Apache- 2.0' - function(argument) { - return argument.replace(/\s+/g, ''); - }, - // e.g. 'CC BY 4.0'' - function(argument) { - return argument.replace(/\s+/g, '-'); - }, - // e.g. 'LGPLv2.1' - function(argument) { - return argument.replace('v', '-'); - }, - // e.g. 'Apache 2.0' - function(argument) { - return argument.replace(/,?\s*(\d)/, '-$1'); - }, - // e.g. 'GPL 2' - function(argument) { - return argument.replace(/,?\s*(\d)/, '-$1.0'); - }, - // e.g. 'Apache Version 2.0' - function(argument) { - return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2'); - }, - // e.g. 'Apache Version 2' - function(argument) { - return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0'); - }, - // e.g. 'ZLIB' - function(argument) { - return argument[0].toUpperCase() + argument.slice(1); - }, - // e.g. 'MPL/2.0' - function(argument) { - return argument.replace('/', '-'); - }, - // e.g. 'Apache 2' - function(argument) { - return argument - .replace(/\s*V\s*(\d)/, '-$1') - .replace(/(\d)$/, '$1.0'); - }, - // e.g. 'GPL-2.0-' - function(argument) { - return argument.slice(0, argument.length - 1); - }, - // e.g. 'GPL2' - function(argument) { - return argument.replace(/(\d)$/, '-$1.0'); - }, - // e.g. 'BSD 3' - function(argument) { - return argument.replace(/(-| )?(\d)$/, '-$2-Clause'); - }, - // e.g. 'BSD clause 3' - function(argument) { - return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause'); - }, - // e.g. 'BY-NC-4.0' - function(argument) { - return 'CC-' + argument; - }, - // e.g. 'BY-NC' - function(argument) { - return 'CC-' + argument + '-4.0'; - }, - // e.g. 'Attribution-NonCommercial' - function(argument) { - return argument - .replace('Attribution', 'BY') - .replace('NonCommercial', 'NC') - .replace('NoDerivatives', 'ND') - .replace(/ (\d)/, '-$1') - .replace(/ ?International/, ''); - }, - // e.g. 'Attribution-NonCommercial' - function(argument) { - return 'CC-' + - argument - .replace('Attribution', 'BY') - .replace('NonCommercial', 'NC') - .replace('NoDerivatives', 'ND') - .replace(/ (\d)/, '-$1') - .replace(/ ?International/, '') + - '-4.0'; + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node } -]; -// If all else fails, guess that strings containing certain substrings -// meant to identify certain licenses. -var lastResorts = [ - ['UNLI', 'Unlicense'], - ['WTF', 'WTFPL'], - ['2 CLAUSE', 'BSD-2-Clause'], - ['2-CLAUSE', 'BSD-2-Clause'], - ['3 CLAUSE', 'BSD-3-Clause'], - ['3-CLAUSE', 'BSD-3-Clause'], - ['AFFERO', 'AGPL-3.0'], - ['AGPL', 'AGPL-3.0'], - ['APACHE', 'Apache-2.0'], - ['ARTISTIC', 'Artistic-2.0'], - ['Affero', 'AGPL-3.0'], - ['BEER', 'Beerware'], - ['BOOST', 'BSL-1.0'], - ['BSD', 'BSD-2-Clause'], - ['ECLIPSE', 'EPL-1.0'], - ['FUCK', 'WTFPL'], - ['GNU', 'GPL-3.0'], - ['LGPL', 'LGPL-3.0'], - ['GPL', 'GPL-3.0'], - ['MIT', 'MIT'], - ['MPL', 'MPL-2.0'], - ['X11', 'X11'], - ['ZLIB', 'Zlib'] -]; + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} -var SUBSTRING = 0; -var IDENTIFIER = 1; +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} -var validTransformation = function(identifier) { - for (var i = 0; i < transforms.length; i++) { - var transformed = transforms[i](identifier); - if (transformed !== identifier && valid(transformed)) { - return transformed; - } +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) } - return null; -}; + return this.length +} -var validLastResort = function(identifier) { - var upperCased = identifier.toUpperCase(); - for (var i = 0; i < lastResorts.length; i++) { - var lastResort = lastResorts[i]; - if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { - return lastResort[IDENTIFIER]; - } +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev } - return null; -}; + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} -var anyCorrection = function(identifier, check) { - for (var i = 0; i < transpositions.length; i++) { - var transposition = transpositions[i]; - var transposed = transposition[TRANSPOSED]; - if (identifier.indexOf(transposed) > -1) { - var corrected = identifier.replace( - transposed, - transposition[CORRECT] - ); - var checked = check(corrected); - if (checked !== null) { - return checked; - } - } +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p } - return null; -}; + this.head = tail + this.tail = head + return this +} -module.exports = function(identifier) { - identifier = identifier.replace(/\+$/, ''); - if (valid(identifier)) { - return identifier; +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail } - var transformed = validTransformation(identifier); - if (transformed !== null) { - return transformed; + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head } - transformed = anyCorrection(identifier, function(argument) { - if (valid(argument)) { - return argument; - } - return validTransformation(argument); - }); - if (transformed !== null) { - return transformed; + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) } - transformed = validLastResort(identifier); - if (transformed !== null) { - return transformed; + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null } - transformed = anyCorrection(identifier, validLastResort); - if (transformed !== null) { - return transformed; + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null } - return null; -}; +} /***/ }), -/* 401 */ -/***/ (function(module, exports) { +/* 394 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// See: https://github.com/IndigoUnited/node-cross-spawn/pull/34#issuecomment-221623455 +function hasEmptyArgumentBug() { + var nodeVer; + + if (process.platform !== 'win32') { + return false; + } + + nodeVer = process.version.substr(1).split('.').map(function (num) { + return parseInt(num, 10); + }); + + return (nodeVer[0] === 0 && nodeVer[1] < 12); +} + +module.exports = hasEmptyArgumentBug(); -module.exports = ["Glide","Abstyles","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AMPAS","APL-1.0","Adobe-Glyph","APAFML","Adobe-2006","AGPL-1.0","Afmparse","Aladdin","ADSL","AMDPLPA","ANTLR-PD","Apache-1.0","Apache-1.1","Apache-2.0","AML","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","AAL","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","BSL-1.0","Borceux","BSD-2-Clause","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","BSD-3-Clause","BSD-3-Clause-Clear","BSD-4-Clause","BSD-Protection","BSD-Source-Code","BSD-3-Clause-Attribution","0BSD","BSD-4-Clause-UC","bzip2-1.0.5","bzip2-1.0.6","Caldera","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","ClArtistic","MIT-CMU","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","CPOL-1.02","CDDL-1.0","CDDL-1.1","CPAL-1.0","CPL-1.0","CATOSL-1.1","Condor-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-3.0","CC-BY-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-4.0","CC0-1.0","Crossword","CrystalStacker","CUA-OPL-1.0","Cube","curl","D-FSL-1.0","diffmark","WTFPL","DOC","Dotseqn","DSDP","dvipdfm","EPL-1.0","ECL-1.0","ECL-2.0","eGenix","EFL-1.0","EFL-2.0","MIT-advertising","MIT-enna","Entessa","ErlPL-1.1","EUDatagrid","EUPL-1.0","EUPL-1.1","Eurosym","Fair","MIT-feh","Frameworx-1.0","FreeImage","FTL","FSFAP","FSFUL","FSFULLR","Giftware","GL2PS","Glulxe","AGPL-3.0","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-3.0","LGPL-2.1","LGPL-3.0","LGPL-2.0","gnuplot","gSOAP-1.3b","HaskellReport","HPND","IBM-pibs","IPL-1.0","ICU","ImageMagick","iMatix","Imlib2","IJG","Info-ZIP","Intel-ACPI","Intel","Interbase-1.0","IPA","ISC","JasPer-2.0","JSON","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","Latex2e","BSD-3-Clause-LBNL","Leptonica","LGPLLR","Libpng","libtiff","LAL-1.2","LAL-1.3","LiLiQ-P-1.1","LiLiQ-Rplus-1.1","LiLiQ-R-1.1","LPL-1.02","LPL-1.0","MakeIndex","MTLL","MS-PL","MS-RL","MirOS","MITNFA","MIT","Motosoto","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","mpich2","Multics","Mup","NASA-1.3","Naumen","NBPL-1.0","NetCDF","NGPL","NOSL","NPL-1.0","NPL-1.1","Newsletr","NLPL","Nokia","NPOSL-3.0","NLOD-1.0","Noweb","NRL","NTP","Nunit","OCLC-2.0","ODbL-1.0","PDDL-1.0","OCCT-PL","OGTSL","OLDAP-2.2.2","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OML","OPL-1.0","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenSSL","OSET-PL-2.1","PHP-3.0","PHP-3.01","Plexus","PostgreSQL","psfrag","psutils","Python-2.0","QPL-1.0","Qhull","Rdisc","RPSL-1.0","RPL-1.1","RPL-1.5","RHeCos-1.1","RSCPL","RSA-MD","Ruby","SAX-PD","Saxpath","SCEA","SWL","SMPPL","Sendmail","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","OFL-1.0","OFL-1.1","SimPL-2.0","Sleepycat","SNIA","Spencer-86","Spencer-94","Spencer-99","SMLNJ","SugarCRM-1.1.3","SISSL","SISSL-1.2","SPL-1.0","Watcom-1.0","TCL","Unlicense","TMate","TORQUE-1.1","TOSL","Unicode-TOU","UPL-1.0","NCSA","Vim","VOSTROM","VSL-1.0","W3C-19980720","W3C","Wsuipa","Xnet","X11","Xerox","XFree86-1.1","xinetd","xpp","XSkat","YPL-1.0","YPL-1.1","Zed","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","zlib-acknowledgement","ZPL-1.1","ZPL-2.0","ZPL-2.1","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-No-Nuclear-License-2014","eCos-2.0","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-2.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","StandardML-NJ","WXwindows"] /***/ }), -/* 402 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var url = __webpack_require__(210) -var gitHosts = __webpack_require__(211) -var GitHost = module.exports = __webpack_require__(403) -var protocolToRepresentationMap = { - 'git+ssh': 'sshurl', - 'git+https': 'https', - 'ssh': 'sshurl', - 'git': 'git' -} +var escapeArgument = __webpack_require__(94); -function protocolToRepresentation (protocol) { - if (protocol.substr(-1) === ':') protocol = protocol.slice(0, -1) - return protocolToRepresentationMap[protocol] || protocol +function escapeCommand(command) { + // Do not escape if this command is not dangerous.. + // We do this so that commands like "echo" or "ifconfig" work + // Quoting them, will make them unaccessible + return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true); } -var authProtocols = { - 'git:': true, - 'https:': true, - 'git+https:': true, - 'http:': true, - 'git+http:': true -} +module.exports = escapeCommand; -var cache = {} -module.exports.fromUrl = function (giturl, opts) { - var key = giturl + JSON.stringify(opts || {}) +/***/ }), +/* 396 */ +/***/ (function(module, exports, __webpack_require__) { - if (!(key in cache)) { - cache[key] = fromUrl(giturl, opts) - } +"use strict"; - return cache[key] -} -function fromUrl (giturl, opts) { - if (giturl == null || giturl === '') return - var url = fixupUnqualifiedGist( - isGitHubShorthand(giturl) ? 'github:' + giturl : giturl - ) - var parsed = parseGitUrl(url) - var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)')) - var matches = Object.keys(gitHosts).map(function (gitHostName) { - try { - var gitHostInfo = gitHosts[gitHostName] - var auth = null - if (parsed.auth && authProtocols[parsed.protocol]) { - auth = decodeURIComponent(parsed.auth) - } - var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null - var user = null - var project = null - var defaultRepresentation = null - if (shortcutMatch && shortcutMatch[1] === gitHostName) { - user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]) - project = decodeURIComponent(shortcutMatch[3]) - defaultRepresentation = 'shortcut' - } else { - if (parsed.host !== gitHostInfo.domain) return - if (!gitHostInfo.protocols_re.test(parsed.protocol)) return - if (!parsed.path) return - var pathmatch = gitHostInfo.pathmatch - var matched = parsed.path.match(pathmatch) - if (!matched) return - if (matched[1] != null) user = decodeURIComponent(matched[1].replace(/^:/, '')) - if (matched[2] != null) project = decodeURIComponent(matched[2]) - defaultRepresentation = protocolToRepresentation(parsed.protocol) - } - return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) - } catch (ex) { - if (!(ex instanceof URIError)) throw ex +var fs = __webpack_require__(7); +var LRU = __webpack_require__(93); +var shebangCommand = __webpack_require__(397); + +var shebangCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec + +function readShebang(command) { + var buffer; + var fd; + var shebang; + + // Check if it is in the cache first + if (shebangCache.has(command)) { + return shebangCache.get(command); } - }).filter(function (gitHostInfo) { return gitHostInfo }) - if (matches.length !== 1) return - return matches[0] -} -function isGitHubShorthand (arg) { - // Note: This does not fully test the git ref format. - // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html - // - // The only way to do this properly would be to shell out to - // git-check-ref-format, and as this is a fast sync function, - // we don't want to do that. Just let git fail if it turns - // out that the commit-ish is invalid. - // GH usernames cannot start with . or - - return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg) -} + // Read the first 150 bytes from the file + buffer = new Buffer(150); -function fixupUnqualifiedGist (giturl) { - // necessary for round-tripping gists - var parsed = url.parse(giturl) - if (parsed.protocol === 'gist:' && parsed.host && !parsed.path) { - return parsed.protocol + '/' + parsed.host - } else { - return giturl - } -} + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, 150, 0); + fs.closeSync(fd); + } catch (e) { /* empty */ } -function parseGitUrl (giturl) { - if (typeof giturl !== 'string') giturl = '' + giturl - var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) - if (!matched) return url.parse(giturl) - return { - protocol: 'git+ssh:', - slashes: true, - auth: matched[1], - host: matched[2], - port: null, - hostname: matched[2], - hash: matched[4], - search: null, - query: null, - pathname: '/' + matched[3], - path: '/' + matched[3], - href: 'git+ssh://' + matched[1] + '@' + matched[2] + - '/' + matched[3] + (matched[4] || '') - } + // Attempt to extract shebang (null is returned if not a shebang) + shebang = shebangCommand(buffer.toString()); + + // Store the shebang in the cache + shebangCache.set(command, shebang); + + return shebang; } +module.exports = readShebang; + /***/ }), -/* 403 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var gitHosts = __webpack_require__(211) -var extend = Object.assign || __webpack_require__(13)._extend +var shebangRegex = __webpack_require__(398); -var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) { - var gitHostInfo = this - gitHostInfo.type = type - Object.keys(gitHosts[type]).forEach(function (key) { - gitHostInfo[key] = gitHosts[type][key] - }) - gitHostInfo.user = user - gitHostInfo.auth = auth - gitHostInfo.project = project - gitHostInfo.committish = committish - gitHostInfo.default = defaultRepresentation - gitHostInfo.opts = opts || {} -} -GitHost.prototype = {} +module.exports = function (str) { + var match = str.match(shebangRegex); -GitHost.prototype.hash = function () { - return this.committish ? '#' + this.committish : '' -} + if (!match) { + return null; + } -GitHost.prototype._fill = function (template, opts) { - if (!template) return - var vars = extend({}, opts) - opts = extend(extend({}, this.opts), opts) - var self = this - Object.keys(this).forEach(function (key) { - if (self[key] != null && vars[key] == null) vars[key] = self[key] - }) - var rawAuth = vars.auth - var rawComittish = vars.committish - Object.keys(vars).forEach(function (key) { - vars[key] = encodeURIComponent(vars[key]) - }) - vars['auth@'] = rawAuth ? rawAuth + '@' : '' - if (opts.noCommittish) { - vars['#committish'] = '' - vars['/tree/committish'] = '' - vars['/comittish'] = '' - vars.comittish = '' - } else { - vars['#committish'] = rawComittish ? '#' + rawComittish : '' - vars['/tree/committish'] = vars.committish - ? '/' + vars.treepath + '/' + vars.committish - : '' - vars['/committish'] = vars.committish ? '/' + vars.committish : '' - vars.committish = vars.committish || 'master' - } - var res = template - Object.keys(vars).forEach(function (key) { - res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key]) - }) - if (opts.noGitPlus) { - return res.replace(/^git[+]/, '') - } else { - return res - } -} + var arr = match[0].replace(/#! ?/, '').split(' '); + var bin = arr[0].split('/').pop(); + var arg = arr[1]; -GitHost.prototype.ssh = function (opts) { - return this._fill(this.sshtemplate, opts) -} + return (bin === 'env' ? + arg : + bin + (arg ? ' ' + arg : '') + ); +}; -GitHost.prototype.sshurl = function (opts) { - return this._fill(this.sshurltemplate, opts) -} -GitHost.prototype.browse = function (opts) { - return this._fill(this.browsetemplate, opts) -} +/***/ }), +/* 398 */ +/***/ (function(module, exports, __webpack_require__) { -GitHost.prototype.docs = function (opts) { - return this._fill(this.docstemplate, opts) -} +"use strict"; -GitHost.prototype.bugs = function (opts) { - return this._fill(this.bugstemplate, opts) -} +module.exports = /^#!.*/; -GitHost.prototype.https = function (opts) { - return this._fill(this.httpstemplate, opts) -} -GitHost.prototype.git = function (opts) { - return this._fill(this.gittemplate, opts) -} +/***/ }), +/* 399 */ +/***/ (function(module, exports, __webpack_require__) { -GitHost.prototype.shortcut = function (opts) { - return this._fill(this.shortcuttemplate, opts) -} +"use strict"; -GitHost.prototype.path = function (opts) { - return this._fill(this.pathtemplate, opts) -} -GitHost.prototype.tarball = function (opts) { - return this._fill(this.tarballtemplate, opts) +var isWin = process.platform === 'win32'; +var resolveCommand = __webpack_require__(92); + +var isNode10 = process.version.indexOf('v0.10.') === 0; + +function notFoundError(command, syscall) { + var err; + + err = new Error(syscall + ' ' + command + ' ENOENT'); + err.code = err.errno = 'ENOENT'; + err.syscall = syscall + ' ' + command; + + return err; } -GitHost.prototype.file = function (P, opts) { - return this._fill(this.filetemplate, extend({ - path: P.replace(/^[/]+/g, '') - }, opts)) +function hookChildProcess(cp, parsed) { + var originalEmit; + + if (!isWin) { + return; + } + + originalEmit = cp.emit; + cp.emit = function (name, arg1) { + var err; + + // If emitting "exit" event and exit code is 1, we need to check if + // the command exists and emit an "error" instead + // See: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + if (name === 'exit') { + err = verifyENOENT(arg1, parsed, 'spawn'); + + if (err) { + return originalEmit.call(cp, 'error', err); + } + } + + return originalEmit.apply(cp, arguments); + }; } -GitHost.prototype.getDefaultRepresentation = function () { - return this.default +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); + } + + return null; } -GitHost.prototype.toString = function (opts) { - return (this[this.default] || this.sshurl).call(this, opts) +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } + + // If we are in node 10, then we are using spawn-sync; if it exited + // with -1 it probably means that the command does not exist + if (isNode10 && status === -1) { + parsed.file = isWin ? parsed.file : resolveCommand(parsed.original); + + if (!parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } + } + + return null; } +module.exports.hookChildProcess = hookChildProcess; +module.exports.verifyENOENT = verifyENOENT; +module.exports.verifyENOENTSync = verifyENOENTSync; +module.exports.notFoundError = notFoundError; + + +/***/ }), +/* 400 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(60).spawnSync; + + +/***/ }), +/* 401 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function (x) { + var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); + var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); + + if (x[x.length - 1] === lf) { + x = x.slice(0, x.length - 1); + } + + if (x[x.length - 1] === cr) { + x = x.slice(0, x.length - 1); + } + + return x; +}; + + +/***/ }), +/* 402 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const path = __webpack_require__(3); +const pathKey = __webpack_require__(403); + +module.exports = opts => { + opts = Object.assign({ + cwd: process.cwd(), + path: process.env[pathKey()] + }, opts); + + let prev; + let pth = path.resolve(opts.cwd); + const ret = []; + + while (prev !== pth) { + ret.push(path.join(pth, 'node_modules/.bin')); + prev = pth; + pth = path.resolve(pth, '..'); + } + + // ensure the running `node` binary is used + ret.push(path.dirname(process.execPath)); + + return ret.concat(opts.path).join(path.delimiter); +}; + +module.exports.env = opts => { + opts = Object.assign({ + env: process.env + }, opts); + + const env = Object.assign({}, opts.env); + const path = pathKey({env}); + + opts.path = env[path]; + env[path] = module.exports(opts); + + return env; +}; + /***/ }), -/* 404 */ +/* 403 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var builtinModules = __webpack_require__(405); +module.exports = opts => { + opts = opts || {}; -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); + const env = opts.env || process.env; + const platform = opts.platform || process.platform; + + if (platform !== 'win32') { + return 'PATH'; } - return builtinModules.indexOf(str) !== -1; + return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; }; /***/ }), -/* 405 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var blacklist = [ - 'freelist', - 'sys' -]; +var isStream = module.exports = function (stream) { + return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; +}; -module.exports = Object.keys(process.binding('natives')).filter(function (el) { - return !/^_|^internal|\//.test(el) && blacklist.indexOf(el) === -1; -}).sort(); +isStream.writable = function (stream) { + return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; +}; + +isStream.readable = function (stream) { + return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; +}; + +isStream.duplex = function (stream) { + return isStream.writable(stream) && isStream.readable(stream); +}; + +isStream.transform = function (stream) { + return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; +}; /***/ }), -/* 406 */ -/***/ (function(module, exports) { +/* 405 */ +/***/ (function(module, exports, __webpack_require__) { -module.exports = extractDescription +"use strict"; -// Extracts description from contents of a readme file in markdown format -function extractDescription (d) { - if (!d) return; - if (d === "ERROR: No README data found!") return; - // the first block of text before the first heading - // that isn't the first line heading - d = d.trim().split('\n') - for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++); - var l = d.length - for (var e = s + 1; e < l && d[e].trim(); e ++); - return d.slice(s, e).join(' ').trim() -} +const bufferStream = __webpack_require__(406); + +function getStream(inputStream, opts) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + opts = Object.assign({maxBuffer: Infinity}, opts); -/***/ }), -/* 407 */ -/***/ (function(module, exports) { + const maxBuffer = opts.maxBuffer; + let stream; + let clean; -module.exports = {"topLevel":{"dependancies":"dependencies","dependecies":"dependencies","depdenencies":"dependencies","devEependencies":"devDependencies","depends":"dependencies","dev-dependencies":"devDependencies","devDependences":"devDependencies","devDepenencies":"devDependencies","devdependencies":"devDependencies","repostitory":"repository","repo":"repository","prefereGlobal":"preferGlobal","hompage":"homepage","hampage":"homepage","autohr":"author","autor":"author","contributers":"contributors","publicationConfig":"publishConfig","script":"scripts"},"bugs":{"web":"url","name":"url"},"script":{"server":"start","tests":"test"}} + const p = new Promise((resolve, reject) => { + const error = err => { + if (err) { // null check + err.bufferedData = stream.getBufferedValue(); + } -/***/ }), -/* 408 */ -/***/ (function(module, exports, __webpack_require__) { + reject(err); + }; -var util = __webpack_require__(13) -var messages = __webpack_require__(409) + stream = bufferStream(opts); + inputStream.once('error', error); + inputStream.pipe(stream); -module.exports = function() { - var args = Array.prototype.slice.call(arguments, 0) - var warningName = args.shift() - if (warningName == "typo") { - return makeTypoWarning.apply(null,args) - } - else { - var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'" - args.unshift(msgTemplate) - return util.format.apply(null, args) - } -} + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + reject(new Error('maxBuffer exceeded')); + } + }); + stream.once('error', error); + stream.on('end', resolve); -function makeTypoWarning (providedName, probableName, field) { - if (field) { - providedName = field + "['" + providedName + "']" - probableName = field + "['" + probableName + "']" - } - return util.format(messages.typo, providedName, probableName) -} + clean = () => { + // some streams doesn't implement the `stream.Readable` interface correctly + if (inputStream.unpipe) { + inputStream.unpipe(stream); + } + }; + }); + p.then(clean, clean); -/***/ }), -/* 409 */ -/***/ (function(module, exports) { + return p.then(() => stream.getBufferedValue()); +} + +module.exports = getStream; +module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); +module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); -module.exports = {"repositories":"'repositories' (plural) Not supported. Please pick one as the 'repository' field","missingRepository":"No repository field.","brokenGitUrl":"Probably broken git url: %s","nonObjectScripts":"scripts must be an object","nonStringScript":"script values must be string commands","nonArrayFiles":"Invalid 'files' member","invalidFilename":"Invalid filename in 'files' list: %s","nonArrayBundleDependencies":"Invalid 'bundleDependencies' list. Must be array of package names","nonStringBundleDependency":"Invalid bundleDependencies member: %s","nonDependencyBundleDependency":"Non-dependency in bundleDependencies: %s","nonObjectDependencies":"%s field must be an object","nonStringDependency":"Invalid dependency: %s %s","deprecatedArrayDependencies":"specifying %s as array is deprecated","deprecatedModules":"modules field is deprecated","nonArrayKeywords":"keywords should be an array of strings","nonStringKeyword":"keywords should be an array of strings","conflictingName":"%s is also the name of a node core module.","nonStringDescription":"'description' field should be a string","missingDescription":"No description","missingReadme":"No README data","missingLicense":"No license field.","nonEmailUrlBugsString":"Bug string field must be url, email, or {email,url}","nonUrlBugsUrlField":"bugs.url field must be a string url. Deleted.","nonEmailBugsEmailField":"bugs.email field must be a string email. Deleted.","emptyNormalizedBugs":"Normalized value of bugs field is an empty object. Deleted.","nonUrlHomepage":"homepage field must be a string url. Deleted.","invalidLicense":"license should be a valid SPDX license expression","typo":"%s should probably be %s."} /***/ }), -/* 410 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const path = __webpack_require__(3); -const writeJsonFile = __webpack_require__(411); -const sortKeys = __webpack_require__(212); +const PassThrough = __webpack_require__(21).PassThrough; -const opts = {detectIndent: true}; +module.exports = opts => { + opts = Object.assign({}, opts); -const dependencyKeys = new Set([ - 'dependencies', - 'devDependencies', - 'optionalDependencies', - 'peerDependencies' -]); + const array = opts.array; + let encoding = opts.encoding; + const buffer = encoding === 'buffer'; + let objectMode = false; -function normalize(pkg) { - const ret = {}; + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } - for (const key of Object.keys(pkg)) { - if (!dependencyKeys.has(key)) { - ret[key] = pkg[key]; - } else if (Object.keys(pkg[key]).length !== 0) { - ret[key] = sortKeys(pkg[key]); - } + if (buffer) { + encoding = null; } - return ret; -} + let len = 0; + const ret = []; + const stream = new PassThrough({objectMode}); -module.exports = (fp, data) => { - if (typeof fp !== 'string') { - data = fp; - fp = '.'; + if (encoding) { + stream.setEncoding(encoding); } - fp = path.basename(fp) === 'package.json' ? fp : path.join(fp, 'package.json'); - - data = normalize(data); + stream.on('data', chunk => { + ret.push(chunk); - return writeJsonFile(fp, data, opts); -}; + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); -module.exports.sync = (fp, data) => { - if (typeof fp !== 'string') { - data = fp; - fp = '.'; - } + stream.getBufferedValue = () => { + if (array) { + return ret; + } - fp = path.basename(fp) === 'package.json' ? fp : path.join(fp, 'package.json'); + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; - data = normalize(data); + stream.getBufferedLength = () => len; - writeJsonFile.sync(fp, data, opts); + return stream; }; /***/ }), -/* 411 */ +/* 407 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const path = __webpack_require__(3); -const fs = __webpack_require__(25); -const writeFileAtomic = __webpack_require__(412); -const sortKeys = __webpack_require__(212); -const makeDir = __webpack_require__(213); -const pify = __webpack_require__(21); -const detectIndent = __webpack_require__(415); - -const init = (fn, fp, data, opts) => { - if (!fp) { - throw new TypeError('Expected a filepath'); - } - - if (data === undefined) { - throw new TypeError('Expected data to stringify'); - } +module.exports = (promise, onFinally) => { + onFinally = onFinally || (() => {}); - opts = Object.assign({ - indent: '\t', - sortKeys: false - }, opts); + return promise.then( + val => new Promise(resolve => { + resolve(onFinally()); + }).then(() => val), + err => new Promise(resolve => { + resolve(onFinally()); + }).then(() => { + throw err; + }) + ); +}; - if (opts.sortKeys) { - data = sortKeys(data, { - deep: true, - compare: typeof opts.sortKeys === 'function' && opts.sortKeys - }); - } - return fn(fp, data, opts); -}; +/***/ }), +/* 408 */ +/***/ (function(module, exports, __webpack_require__) { -const readFile = fp => pify(fs.readFile)(fp, 'utf8').catch(() => {}); +"use strict"; -const main = (fp, data, opts) => { - return (opts.detectIndent ? readFile(fp) : Promise.resolve()) - .then(str => { - const indent = str ? detectIndent(str).indent : opts.indent; - const json = JSON.stringify(data, opts.replacer, indent); +// The Node team wants to deprecate `process.bind(...)`. +// https://github.com/nodejs/node/pull/2768 +// +// However, we need the 'uv' binding for errname support. +// This is a defensive wrapper around it so `execa` will not fail entirely if it stops working someday. +// +// If this ever stops working. See: https://github.com/sindresorhus/execa/issues/31#issuecomment-215939939 for another possible solution. +let uv; - return pify(writeFileAtomic)(fp, `${json}\n`, {mode: opts.mode}); - }); -}; +try { + uv = process.binding('uv'); -const mainSync = (fp, data, opts) => { - let indent = opts.indent; + if (typeof uv.errname !== 'function') { + throw new TypeError('uv.errname is not a function'); + } +} catch (err) { + console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); + uv = null; +} - if (opts.detectIndent) { - try { - const file = fs.readFileSync(fp, 'utf8'); - indent = detectIndent(file).indent; - } catch (err) { - if (err.code !== 'ENOENT') { - throw err; - } - } +function errname(uv, code) { + if (uv) { + return uv.errname(code); } - const json = JSON.stringify(data, opts.replacer, indent); + if (!(code < 0)) { + throw new Error('err >= 0'); + } - return writeFileAtomic.sync(fp, `${json}\n`, {mode: opts.mode}); -}; + return `Unknown system error ${code}`; +} -module.exports = (fp, data, opts) => { - return makeDir(path.dirname(fp), {fs}) - .then(() => init(main, fp, data, opts)); -}; +module.exports = code => errname(uv, code); -module.exports.sync = (fp, data, opts) => { - makeDir.sync(path.dirname(fp), {fs}); - init(mainSync, fp, data, opts); -}; +// Used for testing the fallback behavior +module.exports.__test__ = errname; /***/ }), -/* 412 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = writeFile -module.exports.sync = writeFileSync -module.exports._getTmpname = getTmpname // for testing -module.exports._cleanupOnExit = cleanupOnExit - -var fs = __webpack_require__(25) -var MurmurHash3 = __webpack_require__(413) -var onExit = __webpack_require__(57) -var path = __webpack_require__(3) -var activeFiles = {} - -var invocations = 0 -function getTmpname (filename) { - return filename + '.' + - MurmurHash3(__filename) - .hash(String(process.pid)) - .hash(String(++invocations)) - .result() -} +const alias = ['stdin', 'stdout', 'stderr']; -function cleanupOnExit (tmpfile) { - return function () { - try { - fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} - } -} +const hasAlias = opts => alias.some(x => Boolean(opts[x])); -function writeFile (filename, data, options, callback) { - if (options instanceof Function) { - callback = options - options = null - } - if (!options) options = {} +module.exports = opts => { + if (!opts) { + return null; + } - var Promise = options.Promise || global.Promise - var truename - var fd - var tmpfile - var removeOnExit = cleanupOnExit(() => tmpfile) - var absoluteName = path.resolve(filename) + if (opts.stdio && hasAlias(opts)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); + } - new Promise(function serializeSameFile (resolve) { - // make a queue if it doesn't already exist - if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] + if (typeof opts.stdio === 'string') { + return opts.stdio; + } - activeFiles[absoluteName].push(resolve) // add this job to the queue - if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one - }).then(function getRealPath () { - return new Promise(function (resolve) { - fs.realpath(filename, function (_, realname) { - truename = realname || filename - tmpfile = getTmpname(truename) - resolve() - }) - }) - }).then(function stat () { - return new Promise(function stat (resolve) { - if (options.mode && options.chown) resolve() - else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - fs.stat(truename, function (err, stats) { - if (err || !stats) resolve() - else { - options = Object.assign({}, options) + const stdio = opts.stdio || []; - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - resolve() - } - }) - } - }) - }).then(function thenWriteFile () { - return new Promise(function (resolve, reject) { - fs.open(tmpfile, 'w', options.mode, function (err, _fd) { - fd = _fd - if (err) reject(err) - else resolve() - }) - }) - }).then(function write () { - return new Promise(function (resolve, reject) { - if (Buffer.isBuffer(data)) { - fs.write(fd, data, 0, data.length, 0, function (err) { - if (err) reject(err) - else resolve() - }) - } else if (data != null) { - fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { - if (err) reject(err) - else resolve() - }) - } else resolve() - }) - }).then(function syncAndClose () { - if (options.fsync !== false) { - return new Promise(function (resolve, reject) { - fs.fsync(fd, function (err) { - if (err) reject(err) - else fs.close(fd, resolve) - }) - }) - } - }).then(function chown () { - if (options.chown) { - return new Promise(function (resolve, reject) { - fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function chmod () { - if (options.mode) { - return new Promise(function (resolve, reject) { - fs.chmod(tmpfile, options.mode, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function rename () { - return new Promise(function (resolve, reject) { - fs.rename(tmpfile, truename, function (err) { - if (err) reject(err) - else resolve() - }) - }) - }).then(function success () { - removeOnExit() - callback() - }).catch(function fail (err) { - removeOnExit() - fs.unlink(tmpfile, function () { - callback(err) - }) - }).then(function checkQueue () { - activeFiles[absoluteName].shift() // remove the element added by serializeSameFile - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0]() // start next job if one is pending - } else delete activeFiles[absoluteName] - }) -} + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } -function writeFileSync (filename, data, options) { - if (!options) options = {} - try { - filename = fs.realpathSync(filename) - } catch (ex) { - // it's ok, it'll happen on a not yet existing file - } - var tmpfile = getTmpname(filename) + const result = []; + const len = Math.max(stdio.length, alias.length); - try { - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - try { - var stats = fs.statSync(filename) - options = Object.assign({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } catch (ex) { - // ignore stat errors - } - } + for (let i = 0; i < len; i++) { + let value = null; - var removeOnExit = onExit(cleanupOnExit(tmpfile)) - var fd = fs.openSync(tmpfile, 'w', options.mode) - if (Buffer.isBuffer(data)) { - fs.writeSync(fd, data, 0, data.length, 0) - } else if (data != null) { - fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) - } - if (options.fsync !== false) { - fs.fsyncSync(fd) - } - fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) - fs.renameSync(tmpfile, filename) - removeOnExit() - } catch (err) { - removeOnExit() - try { fs.unlinkSync(tmpfile) } catch (e) {} - throw err - } -} + if (stdio[i] !== undefined) { + value = stdio[i]; + } else if (opts[alias[i]] !== undefined) { + value = opts[alias[i]]; + } + + result[i] = value; + } + + return result; +}; /***/ }), -/* 413 */ +/* 410 */ /***/ (function(module, exports, __webpack_require__) { -/** - * @preserve - * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) - * - * @author Jens Taylor - * @see http://github.com/homebrewing/brauhaus-diff - * @author Gary Court - * @see http://github.com/garycourt/murmurhash-js - * @author Austin Appleby - * @see http://sites.google.com/site/murmurhash/ - */ -(function(){ - var cache; +// Copyright IBM Corp. 2014. All Rights Reserved. +// Node module: strong-log-transformer +// This file is licensed under the Artistic License 2.0. +// License text available at https://opensource.org/licenses/Artistic-2.0 - // Call this function without `new` to use the cached object (good for - // single-threaded environments), or with `new` to create a new object. - // - // @param {string} key A UTF-16 or ASCII string - // @param {number} seed An optional positive integer - // @return {object} A MurmurHash3 object for incremental hashing - function MurmurHash3(key, seed) { - var m = this instanceof MurmurHash3 ? this : cache; - m.reset(seed) - if (typeof key === 'string' && key.length > 0) { - m.hash(key); - } +module.exports = __webpack_require__(96); +module.exports.cli = __webpack_require__(416); - if (m !== this) { - return m; - } - }; - // Incrementally add a string to this hash - // - // @param {string} key A UTF-16 or ASCII string - // @return {object} this - MurmurHash3.prototype.hash = function(key) { - var h1, k1, i, top, len; +/***/ }), +/* 411 */ +/***/ (function(module, exports, __webpack_require__) { - len = key.length; - this.len += len; +// Copyright (C) 2011-2015 John Hewson +// +// 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. - k1 = this.k1; - i = 0; - switch (this.rem) { - case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; - case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; - case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; - case 3: - k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; - k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; - } +var stream = __webpack_require__(21), + util = __webpack_require__(13), + timers = __webpack_require__(412); - this.rem = (len + this.rem) & 3; // & 3 is same as % 4 - len -= this.rem; - if (len > 0) { - h1 = this.h1; - while (1) { - k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; - k1 = (k1 << 15) | (k1 >>> 17); - k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; +// convinience API +module.exports = function(readStream, options) { + return module.exports.createStream(readStream, options); +}; - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); - h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; +// basic API +module.exports.createStream = function(readStream, options) { + if (readStream) { + return createLineStream(readStream, options); + } else { + return new LineStream(options); + } +}; - if (i >= len) { - break; - } +// deprecated API +module.exports.createLineStream = function(readStream) { + console.log('WARNING: byline#createLineStream is deprecated and will be removed soon'); + return createLineStream(readStream); +}; - k1 = ((key.charCodeAt(i++) & 0xffff)) ^ - ((key.charCodeAt(i++) & 0xffff) << 8) ^ - ((key.charCodeAt(i++) & 0xffff) << 16); - top = key.charCodeAt(i++); - k1 ^= ((top & 0xff) << 24) ^ - ((top & 0xff00) >> 8); - } +function createLineStream(readStream, options) { + if (!readStream) { + throw new Error('expected readStream'); + } + if (!readStream.readable) { + throw new Error('readStream must be readable'); + } + var ls = new LineStream(options); + readStream.pipe(ls); + return ls; +} - k1 = 0; - switch (this.rem) { - case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; - case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; - case 1: k1 ^= (key.charCodeAt(i) & 0xffff); - } +// +// using the new node v0.10 "streams2" API +// - this.h1 = h1; - } +module.exports.LineStream = LineStream; - this.k1 = k1; - return this; - }; +function LineStream(options) { + stream.Transform.call(this, options); + options = options || {}; - // Get the result of this hash - // - // @return {number} The 32-bit hash - MurmurHash3.prototype.result = function() { - var k1, h1; - - k1 = this.k1; - h1 = this.h1; + // use objectMode to stop the output from being buffered + // which re-concatanates the lines, just without newlines. + this._readableState.objectMode = true; + this._lineBuffer = []; + this._keepEmptyLines = options.keepEmptyLines || false; + this._lastChunkEndedWithCR = false; - if (k1 > 0) { - k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; - k1 = (k1 << 15) | (k1 >>> 17); - k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; - h1 ^= k1; - } + // take the source's encoding if we don't have one + var self = this; + this.on('pipe', function(src) { + if (!self.encoding) { + // but we can't do this for old-style streams + if (src instanceof stream.Readable) { + self.encoding = src._readableState.encoding; + } + } + }); +} +util.inherits(LineStream, stream.Transform); - h1 ^= this.len; +LineStream.prototype._transform = function(chunk, encoding, done) { + // decode binary chunks as UTF-8 + encoding = encoding || 'utf8'; + + if (Buffer.isBuffer(chunk)) { + if (encoding == 'buffer') { + chunk = chunk.toString(); // utf8 + encoding = 'utf8'; + } + else { + chunk = chunk.toString(encoding); + } + } + this._chunkEncoding = encoding; + + // see: http://www.unicode.org/reports/tr18/#Line_Boundaries + var lines = chunk.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g); + + // don't split CRLF which spans chunks + if (this._lastChunkEndedWithCR && chunk[0] == '\n') { + lines.shift(); + } + + if (this._lineBuffer.length > 0) { + this._lineBuffer[this._lineBuffer.length - 1] += lines[0]; + lines.shift(); + } - h1 ^= h1 >>> 16; - h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; - h1 ^= h1 >>> 13; - h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; - h1 ^= h1 >>> 16; + this._lastChunkEndedWithCR = chunk[chunk.length - 1] == '\r'; + this._lineBuffer = this._lineBuffer.concat(lines); + this._pushBuffer(encoding, 1, done); +}; - return h1 >>> 0; - }; +LineStream.prototype._pushBuffer = function(encoding, keep, done) { + // always buffer the last (possibly partial) line + while (this._lineBuffer.length > keep) { + var line = this._lineBuffer.shift(); + // skip empty lines + if (this._keepEmptyLines || line.length > 0 ) { + if (!this.push(this._reencode(line, encoding))) { + // when the high-water mark is reached, defer pushes until the next tick + var self = this; + timers.setImmediate(function() { + self._pushBuffer(encoding, keep, done); + }); + return; + } + } + } + done(); +}; - // Reset the hash object for reuse - // - // @param {number} seed An optional positive integer - MurmurHash3.prototype.reset = function(seed) { - this.h1 = typeof seed === 'number' ? seed : 0; - this.rem = this.k1 = this.len = 0; - return this; - }; +LineStream.prototype._flush = function(done) { + this._pushBuffer(this._chunkEncoding, 0, done); +}; - // A cached object to use. This can be safely used if you're in a single- - // threaded environment, otherwise you need to create new hashes to use. - cache = new MurmurHash3(); +// see Readable::push +LineStream.prototype._reencode = function(line, chunkEncoding) { + if (this.encoding && this.encoding != chunkEncoding) { + return new Buffer(line, chunkEncoding).toString(this.encoding); + } + else if (this.encoding) { + // this should be the most common case, i.e. we're using an encoded source stream + return line; + } + else { + return new Buffer(line, chunkEncoding); + } +}; - if (true) { - module.exports = MurmurHash3; - } else { - this.MurmurHash3 = MurmurHash3; - } -}()); +/***/ }), +/* 412 */ +/***/ (function(module, exports) { + +module.exports = require("timers"); /***/ }), -/* 414 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var Stream = __webpack_require__(21) -var toString = Object.prototype.toString; +// through +// +// a stream that does nothing but re-emit the input. +// useful for aggregating a series of changing but not ending streams into one stream) -module.exports = function (x) { - var prototype; - return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); -}; +exports = module.exports = through +through.through = through +//create a readable writable stream. -/***/ }), -/* 415 */ -/***/ (function(module, exports, __webpack_require__) { +function through (write, end, opts) { + write = write || function (data) { this.queue(data) } + end = end || function () { this.queue(null) } -"use strict"; + var ended = false, destroyed = false, buffer = [], _ended = false + var stream = new Stream() + stream.readable = stream.writable = true + stream.paused = false +// stream.autoPause = !(opts && opts.autoPause === false) + stream.autoDestroy = !(opts && opts.autoDestroy === false) -// detect either spaces or tabs but not both to properly handle tabs -// for indentation and spaces for alignment -const INDENT_RE = /^(?:( )+|\t+)/; + stream.write = function (data) { + write.call(this, data) + return !stream.paused + } -function getMostUsed(indents) { - let result = 0; - let maxUsed = 0; - let maxWeight = 0; + function drain() { + while(buffer.length && !stream.paused) { + var data = buffer.shift() + if(null === data) + return stream.emit('end') + else + stream.emit('data', data) + } + } - for (const entry of indents) { - // TODO: use destructuring when targeting Node.js 6 - const key = entry[0]; - const val = entry[1]; + stream.queue = stream.push = function (data) { +// console.error(ended) + if(_ended) return stream + if(data === null) _ended = true + buffer.push(data) + drain() + return stream + } - const u = val[0]; - const w = val[1]; + //this will be registered as the first 'end' listener + //must call destroy next tick, to make sure we're after any + //stream piped from here. + //this is only a problem if end is not emitted synchronously. + //a nicer way to do this is to make sure this is the last listener for 'end' - if (u > maxUsed || (u === maxUsed && w > maxWeight)) { - maxUsed = u; - maxWeight = w; - result = Number(key); - } - } + stream.on('end', function () { + stream.readable = false + if(!stream.writable && stream.autoDestroy) + process.nextTick(function () { + stream.destroy() + }) + }) - return result; -} + function _end () { + stream.writable = false + end.call(stream) + if(!stream.readable && stream.autoDestroy) + stream.destroy() + } -module.exports = str => { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } + stream.end = function (data) { + if(ended) return + ended = true + if(arguments.length) stream.write(data) + _end() // will emit or queue + return stream + } - // used to see if tabs or spaces are the most used - let tabs = 0; - let spaces = 0; + stream.destroy = function () { + if(destroyed) return + destroyed = true + ended = true + buffer.length = 0 + stream.writable = stream.readable = false + stream.emit('close') + return stream + } - // remember the size of previous line's indentation - let prev = 0; + stream.pause = function () { + if(stream.paused) return + stream.paused = true + return stream + } - // remember how many indents/unindents as occurred for a given size - // and how much lines follow a given indentation - // - // indents = { - // 3: [1, 0], - // 4: [1, 5], - // 5: [1, 0], - // 12: [1, 0], - // } - const indents = new Map(); + stream.resume = function () { + if(stream.paused) { + stream.paused = false + stream.emit('resume') + } + drain() + //may have become paused again, + //as drain emits 'data'. + if(!stream.paused) + stream.emit('drain') + return stream + } + return stream +} - // pointer to the array of last used indent - let current; - // whether the last action was an indent (opposed to an unindent) - let isIndent; - for (const line of str.split(/\n/g)) { - if (!line) { - // ignore empty lines - continue; - } +/***/ }), +/* 414 */ +/***/ (function(module, exports, __webpack_require__) { - let indent; - const matches = line.match(INDENT_RE); +var Stream = __webpack_require__(21) +var writeMethods = ["write", "end", "destroy"] +var readMethods = ["resume", "pause"] +var readEvents = ["data", "close"] +var slice = Array.prototype.slice - if (matches) { - indent = matches[0].length; +module.exports = duplex - if (matches[1]) { - spaces++; - } else { - tabs++; - } - } else { - indent = 0; - } +function forEach (arr, fn) { + if (arr.forEach) { + return arr.forEach(fn) + } - const diff = indent - prev; - prev = indent; + for (var i = 0; i < arr.length; i++) { + fn(arr[i], i) + } +} - if (diff) { - // an indent or unindent has been detected +function duplex(writer, reader) { + var stream = new Stream() + var ended = false - isIndent = diff > 0; + forEach(writeMethods, proxyWriter) - current = indents.get(isIndent ? diff : -diff); + forEach(readMethods, proxyReader) - if (current) { - current[0]++; - } else { - current = [1, 0]; - indents.set(diff, current); - } - } else if (current) { - // if the last action was an indent, increment the weight - current[1] += Number(isIndent); - } - } + forEach(readEvents, proxyStream) - const amount = getMostUsed(indents); + reader.on("end", handleEnd) - let type; - let indent; - if (!amount) { - type = null; - indent = ''; - } else if (spaces >= tabs) { - type = 'space'; - indent = ' '.repeat(amount); - } else { - type = 'tab'; - indent = '\t'.repeat(amount); - } + writer.on("drain", function() { + stream.emit("drain") + }) - return { - amount, - type, - indent - }; -}; + writer.on("error", reemit) + reader.on("error", reemit) + stream.writable = writer.writable + stream.readable = reader.readable -/***/ }), -/* 416 */ -/***/ (function(module, exports, __webpack_require__) { + return stream -"use strict"; + function proxyWriter(methodName) { + stream[methodName] = method + function method() { + return writer[methodName].apply(writer, arguments) + } + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.linkProjectExecutables = undefined; + function proxyReader(methodName) { + stream[methodName] = method -/** - * Yarn does not link the executables from dependencies that are installed - * using `link:` https://github.com/yarnpkg/yarn/pull/5046 - * - * We simulate this functionality by walking through each project's project - * dependencies, and manually linking their executables if defined. The logic - * for linking was mostly adapted from lerna: https://github.com/lerna/lerna/blob/1d7eb9eeff65d5a7de64dea73613b1bf6bfa8d57/src/PackageUtilities.js#L348 - */ -let linkProjectExecutables = exports.linkProjectExecutables = (() => { - var _ref = _asyncToGenerator(function* (projectsByName, projectGraph) { - for (const [projectName, projectDeps] of projectGraph) { - const project = projectsByName.get(projectName); - const binsDir = (0, _path.resolve)(project.nodeModulesLocation, '.bin'); - for (const projectDep of projectDeps) { - const executables = projectDep.getExecutables(); - for (const name of Object.keys(executables)) { - const srcPath = executables[name]; - // existing logic from lerna -- ensure that the bin we are going to - // point to exists or ignore it - if (!(yield (0, _fs.isFile)(srcPath))) { - continue; - } - const dest = (0, _path.resolve)(binsDir, name); - // Get relative project path with normalized path separators. - const projectRelativePath = (0, _path.relative)(project.path, srcPath).split(_path.sep).join('/'); - console.log(_chalk2.default`{dim [${project.name}]} ${name} -> {dim ${projectRelativePath}}`); - yield (0, _fs.mkdirp)((0, _path.dirname)(dest)); - yield (0, _fs.createSymlink)(srcPath, dest, 'exec'); - yield (0, _fs.chmod)(dest, '755'); - } + function method() { + stream.emit(methodName) + var func = reader[methodName] + if (func) { + return func.apply(reader, arguments) } + reader.emit(methodName) } - }); + } - return function linkProjectExecutables(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + function proxyStream(methodName) { + reader.on(methodName, reemit) -var _path = __webpack_require__(3); + function reemit() { + var args = slice.call(arguments) + args.unshift(methodName) + stream.emit.apply(stream, args) + } + } -var _chalk = __webpack_require__(14); + function handleEnd() { + if (ended) { + return + } + ended = true + var args = slice.call(arguments) + args.unshift("end") + stream.emit.apply(stream, args) + } -var _chalk2 = _interopRequireDefault(_chalk); + function reemit(err) { + stream.emit("error", err) + } +} -var _fs = __webpack_require__(58); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 415 */ +/***/ (function(module, exports, __webpack_require__) { -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +var map = { + "./af": 97, + "./af.js": 97, + "./ar": 98, + "./ar-dz": 99, + "./ar-dz.js": 99, + "./ar-kw": 100, + "./ar-kw.js": 100, + "./ar-ly": 101, + "./ar-ly.js": 101, + "./ar-ma": 102, + "./ar-ma.js": 102, + "./ar-sa": 103, + "./ar-sa.js": 103, + "./ar-tn": 104, + "./ar-tn.js": 104, + "./ar.js": 98, + "./az": 105, + "./az.js": 105, + "./be": 106, + "./be.js": 106, + "./bg": 107, + "./bg.js": 107, + "./bm": 108, + "./bm.js": 108, + "./bn": 109, + "./bn.js": 109, + "./bo": 110, + "./bo.js": 110, + "./br": 111, + "./br.js": 111, + "./bs": 112, + "./bs.js": 112, + "./ca": 113, + "./ca.js": 113, + "./cs": 114, + "./cs.js": 114, + "./cv": 115, + "./cv.js": 115, + "./cy": 116, + "./cy.js": 116, + "./da": 117, + "./da.js": 117, + "./de": 118, + "./de-at": 119, + "./de-at.js": 119, + "./de-ch": 120, + "./de-ch.js": 120, + "./de.js": 118, + "./dv": 121, + "./dv.js": 121, + "./el": 122, + "./el.js": 122, + "./en-au": 123, + "./en-au.js": 123, + "./en-ca": 124, + "./en-ca.js": 124, + "./en-gb": 125, + "./en-gb.js": 125, + "./en-ie": 126, + "./en-ie.js": 126, + "./en-nz": 127, + "./en-nz.js": 127, + "./eo": 128, + "./eo.js": 128, + "./es": 129, + "./es-do": 130, + "./es-do.js": 130, + "./es-us": 131, + "./es-us.js": 131, + "./es.js": 129, + "./et": 132, + "./et.js": 132, + "./eu": 133, + "./eu.js": 133, + "./fa": 134, + "./fa.js": 134, + "./fi": 135, + "./fi.js": 135, + "./fo": 136, + "./fo.js": 136, + "./fr": 137, + "./fr-ca": 138, + "./fr-ca.js": 138, + "./fr-ch": 139, + "./fr-ch.js": 139, + "./fr.js": 137, + "./fy": 140, + "./fy.js": 140, + "./gd": 141, + "./gd.js": 141, + "./gl": 142, + "./gl.js": 142, + "./gom-latn": 143, + "./gom-latn.js": 143, + "./gu": 144, + "./gu.js": 144, + "./he": 145, + "./he.js": 145, + "./hi": 146, + "./hi.js": 146, + "./hr": 147, + "./hr.js": 147, + "./hu": 148, + "./hu.js": 148, + "./hy-am": 149, + "./hy-am.js": 149, + "./id": 150, + "./id.js": 150, + "./is": 151, + "./is.js": 151, + "./it": 152, + "./it.js": 152, + "./ja": 153, + "./ja.js": 153, + "./jv": 154, + "./jv.js": 154, + "./ka": 155, + "./ka.js": 155, + "./kk": 156, + "./kk.js": 156, + "./km": 157, + "./km.js": 157, + "./kn": 158, + "./kn.js": 158, + "./ko": 159, + "./ko.js": 159, + "./ky": 160, + "./ky.js": 160, + "./lb": 161, + "./lb.js": 161, + "./lo": 162, + "./lo.js": 162, + "./lt": 163, + "./lt.js": 163, + "./lv": 164, + "./lv.js": 164, + "./me": 165, + "./me.js": 165, + "./mi": 166, + "./mi.js": 166, + "./mk": 167, + "./mk.js": 167, + "./ml": 168, + "./ml.js": 168, + "./mr": 169, + "./mr.js": 169, + "./ms": 170, + "./ms-my": 171, + "./ms-my.js": 171, + "./ms.js": 170, + "./mt": 172, + "./mt.js": 172, + "./my": 173, + "./my.js": 173, + "./nb": 174, + "./nb.js": 174, + "./ne": 175, + "./ne.js": 175, + "./nl": 176, + "./nl-be": 177, + "./nl-be.js": 177, + "./nl.js": 176, + "./nn": 178, + "./nn.js": 178, + "./pa-in": 179, + "./pa-in.js": 179, + "./pl": 180, + "./pl.js": 180, + "./pt": 181, + "./pt-br": 182, + "./pt-br.js": 182, + "./pt.js": 181, + "./ro": 183, + "./ro.js": 183, + "./ru": 184, + "./ru.js": 184, + "./sd": 185, + "./sd.js": 185, + "./se": 186, + "./se.js": 186, + "./si": 187, + "./si.js": 187, + "./sk": 188, + "./sk.js": 188, + "./sl": 189, + "./sl.js": 189, + "./sq": 190, + "./sq.js": 190, + "./sr": 191, + "./sr-cyrl": 192, + "./sr-cyrl.js": 192, + "./sr.js": 191, + "./ss": 193, + "./ss.js": 193, + "./sv": 194, + "./sv.js": 194, + "./sw": 195, + "./sw.js": 195, + "./ta": 196, + "./ta.js": 196, + "./te": 197, + "./te.js": 197, + "./tet": 198, + "./tet.js": 198, + "./th": 199, + "./th.js": 199, + "./tl-ph": 200, + "./tl-ph.js": 200, + "./tlh": 201, + "./tlh.js": 201, + "./tr": 202, + "./tr.js": 202, + "./tzl": 203, + "./tzl.js": 203, + "./tzm": 204, + "./tzm-latn": 205, + "./tzm-latn.js": 205, + "./tzm.js": 204, + "./uk": 206, + "./uk.js": 206, + "./ur": 207, + "./ur.js": 207, + "./uz": 208, + "./uz-latn": 209, + "./uz-latn.js": 209, + "./uz.js": 208, + "./vi": 210, + "./vi.js": 210, + "./x-pseudo": 211, + "./x-pseudo.js": 211, + "./yo": 212, + "./yo.js": 212, + "./zh-cn": 213, + "./zh-cn.js": 213, + "./zh-hk": 214, + "./zh-hk.js": 214, + "./zh-tw": 215, + "./zh-tw.js": 215 +}; +function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); +}; +function webpackContextResolve(req) { + var id = map[req]; + if(!(id + 1)) // check for number or string + throw new Error("Cannot find module '" + req + "'."); + return id; +}; +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = 415; /***/ }), -/* 417 */ +/* 416 */ /***/ (function(module, exports, __webpack_require__) { -// On windows, create a .cmd file. -// Read the #! in the file to see what it uses. The vast majority -// of the time, this will be either: -// "#!/usr/bin/env " -// or: -// "#! " -// -// Write a binroot/pkg.bin + ".cmd" file that has this line in it: -// @ %~dp0 %* +"use strict"; +// Copyright IBM Corp. 2014. All Rights Reserved. +// Node module: strong-log-transformer +// This file is licensed under the Artistic License 2.0. +// License text available at https://opensource.org/licenses/Artistic-2.0 -module.exports = cmdShim -cmdShim.ifExists = cmdShimIfExists -var fs = __webpack_require__(25) -var mkdir = __webpack_require__(214) - , path = __webpack_require__(3) - , shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/ +var minimist = __webpack_require__(417); +var path = __webpack_require__(3); -function cmdShimIfExists (from, to, cb) { - fs.stat(from, function (er) { - if (er) return cb() - cmdShim(from, to, cb) - }) -} +var Logger = __webpack_require__(96); +var pkg = __webpack_require__(418); -// Try to unlink, but ignore errors. -// Any problems will surface later. -function rm (path, cb) { - fs.unlink(path, function(er) { - cb() - }) -} +module.exports = cli; -function cmdShim (from, to, cb) { - fs.stat(from, function (er, stat) { - if (er) - return cb(er) +function cli(args) { + var opts = minimist(args.slice(2)); + var $0 = path.basename(args[1]); + var p = console.log.bind(console); + if (opts.v || opts.version) { + version($0, p); + } else if (opts.h || opts.help) { + usage($0, p); + } else { + process.stdin.pipe(Logger(opts)).pipe(process.stdout); + } +} - cmdShim_(from, to, cb) - }) +function version($0, p) { + p('%s v%s', pkg.name, pkg.version); } -function cmdShim_ (from, to, cb) { - var then = times(2, next, cb) - rm(to, then) - rm(to + ".cmd", then) +function usage($0, p) { + var PADDING = ' '; + var opt, def; + p('Usage: %s [options]', $0); + p(''); + p('%s', pkg.description); + p(''); + p('OPTIONS:'); + for (opt in Logger.DEFAULTS) { + def = Logger.DEFAULTS[opt]; + if (typeof def === 'boolean') + boolOpt(opt, Logger.DEFAULTS[opt]); + else + stdOpt(opt, Logger.DEFAULTS[opt]); + } + p(''); - function next(er) { - writeShim(from, to, cb) + function boolOpt(name, def) { + name = def ? 'no-' + name : name; + name = name + PADDING.slice(0, 20-name.length); + p(' --%s default: %s', name, def ? 'on' : 'off'); } -} -function writeShim (from, to, cb) { - // make a cmd file and a sh script - // First, check if the bin is a #! of some sort. - // If not, then assume it's something that'll be compiled, or some other - // sort of script, and just call it directly. - mkdir(path.dirname(to), function (er) { - if (er) - return cb(er) - fs.readFile(from, "utf8", function (er, data) { - if (er) return writeShim_(from, to, null, null, cb) - var firstLine = data.trim().split(/\r*\n/)[0] - , shebang = firstLine.match(shebangExpr) - if (!shebang) return writeShim_(from, to, null, null, cb) - var prog = shebang[1] - , args = shebang[2] || "" - return writeShim_(from, to, prog, args, cb) - }) - }) + function stdOpt(name, def) { + var value = name.toUpperCase() + + PADDING.slice(0, 19 - name.length*2); + p(' --%s %s default: %j', name, value, def); + } } -function writeShim_ (from, to, prog, args, cb) { - var shTarget = path.relative(path.dirname(to), from) - , target = shTarget.split("/").join("\\") - , longProg - , shProg = prog && prog.split("\\").join("/") - , shLongProg - shTarget = shTarget.split("\\").join("/") - args = args || "" - if (!prog) { - prog = "\"%~dp0\\" + target + "\"" - shProg = "\"$basedir/" + shTarget + "\"" - args = "" - target = "" - shTarget = "" - } else { - longProg = "\"%~dp0\\" + prog + ".exe\"" - shLongProg = "\"$basedir/" + prog + "\"" - target = "\"%~dp0\\" + target + "\"" - shTarget = "\"$basedir/" + shTarget + "\"" - } - // @IF EXIST "%~dp0\node.exe" ( - // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* - // ) ELSE ( - // SETLOCAL - // SET PATHEXT=%PATHEXT:;.JS;=;% - // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* - // ) - var cmd - if (longProg) { - cmd = "@IF EXIST " + longProg + " (\r\n" - + " " + longProg + " " + args + " " + target + " %*\r\n" - + ") ELSE (\r\n" - + " @SETLOCAL\r\n" - + " @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n" - + " " + prog + " " + args + " " + target + " %*\r\n" - + ")" - } else { - cmd = "@" + prog + " " + args + " " + target + " %*\r\n" - } +/***/ }), +/* 417 */ +/***/ (function(module, exports) { - // #!/bin/sh - // basedir=`dirname "$0"` - // - // case `uname` in - // *CYGWIN*) basedir=`cygpath -w "$basedir"`;; - // esac - // - // if [ -x "$basedir/node.exe" ]; then - // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@" - // ret=$? - // else - // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" - // ret=$? - // fi - // exit $ret +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {} }; + + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); - var sh = "#!/bin/sh\n" + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + flags.strings[aliases[key]] = true; + } + }); - if (shLongProg) { - sh = sh - + "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n" - + "\n" - + "case `uname` in\n" - + " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n" - + "esac\n" - + "\n" + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; - sh = sh - + "if [ -x "+shLongProg+" ]; then\n" - + " " + shLongProg + " " + args + " " + shTarget + " \"$@\"\n" - + " ret=$?\n" - + "else \n" - + " " + shProg + " " + args + " " + shTarget + " \"$@\"\n" - + " ret=$?\n" - + "fi\n" - + "exit $ret\n" - } else { - sh = shProg + " " + args + " " + shTarget + " \"$@\"\n" - + "exit $?\n" - } + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } - var then = times(2, next, cb) - fs.writeFile(to + ".cmd", cmd, "utf8", then) - fs.writeFile(to, sh, "utf8", then) - function next () { - chmodShim(to, cb) - } -} + function setArg (key, val) { + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + setArg(m[1], m[2]); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + } + else { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + if (opts['--']) { + argv['--'] = new Array(); + notFlags.forEach(function(key) { + argv['--'].push(key); + }); + } + else { + notFlags.forEach(function(key) { + argv._.push(key); + }); + } -function chmodShim (to, cb) { - var then = times(2, cb, cb) - fs.chmod(to, 0755, then) - fs.chmod(to + ".cmd", 0755, then) + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; } -function times(n, ok, cb) { - var errState = null - return function(er) { - if (!errState) { - if (er) - cb(errState = er) - else if (--n === 0) - ok() +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; } - } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); } + /***/ }), /* 418 */ +/***/ (function(module, exports) { + +module.exports = {"name":"strong-log-transformer","version":"1.0.6","description":"Stream transformer that prefixes lines with timestamps and other things.","author":"Ryan Graham ","license":"Artistic-2.0","repository":{"type":"git","url":"git://github.com/strongloop/strong-log-transformer"},"keywords":["logging","streams"],"bugs":{"url":"https://github.com/strongloop/strong-log-transformer/issues"},"homepage":"https://github.com/strongloop/strong-log-transformer","directories":{"test":"test"},"bin":{"sl-log-transformer":"bin/sl-log-transformer.js"},"main":"index.js","scripts":{"test":"tap --coverage --coverage-report=cobertura test/test-*"},"dependencies":{"byline":"^5.0.0","duplexer":"^0.1.1","minimist":"^0.1.0","moment":"^2.6.0","through":"^2.3.4"},"devDependencies":{"tap":"^1.3.2"}} + +/***/ }), +/* 419 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47281,29 +47559,49 @@ Object.defineProperty(exports, "__esModule", { }); exports.CleanCommand = undefined; -var _del = __webpack_require__(215); - -var _del2 = _interopRequireDefault(_del); - var _chalk = __webpack_require__(14); var _chalk2 = _interopRequireDefault(_chalk); -var _path = __webpack_require__(3); +var _del = __webpack_require__(216); + +var _del2 = _interopRequireDefault(_del); -var _ora = __webpack_require__(429); +var _ora = __webpack_require__(430); var _ora2 = _interopRequireDefault(_ora); -var _fs = __webpack_require__(58); +var _path = __webpack_require__(3); + +var _fs = __webpack_require__(54); + +var _log = __webpack_require__(17); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + const CleanCommand = exports.CleanCommand = { - name: 'clean', description: 'Remove the node_modules and target directories from all projects.', + name: 'clean', run(projects, projectGraph, { rootPath }) { return _asyncToGenerator(function* () { const directoriesToDelete = []; @@ -47316,9 +47614,9 @@ const CleanCommand = exports.CleanCommand = { } } if (directoriesToDelete.length === 0) { - console.log(_chalk2.default.bold.green('\n\nNo directories to delete')); + _log.log.write(_chalk2.default.bold.green('\n\nNo directories to delete')); } else { - console.log(_chalk2.default.bold.red('\n\nDeleting directories:\n')); + _log.log.write(_chalk2.default.bold.red('\n\nDeleting directories:\n')); for (const dir of directoriesToDelete) { const deleting = (0, _del2.default)(dir, { force: true }); _ora2.default.promise(deleting, (0, _path.relative)(rootPath, dir)); @@ -47330,16 +47628,16 @@ const CleanCommand = exports.CleanCommand = { }; /***/ }), -/* 419 */ +/* 420 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Promise = __webpack_require__(216); -var arrayUnion = __webpack_require__(217); -var objectAssign = __webpack_require__(218); -var glob = __webpack_require__(23); -var pify = __webpack_require__(422); +var Promise = __webpack_require__(217); +var arrayUnion = __webpack_require__(218); +var objectAssign = __webpack_require__(219); +var glob = __webpack_require__(26); +var pify = __webpack_require__(423); var globP = pify(glob, Promise).bind(glob); @@ -47425,7 +47723,7 @@ module.exports.hasMagic = function (patterns, opts) { /***/ }), -/* 420 */ +/* 421 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47724,7 +48022,7 @@ module.exports = Promise; /***/ }), -/* 421 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47793,7 +48091,7 @@ if ('Set' in global) { /***/ }), -/* 422 */ +/* 423 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47868,7 +48166,7 @@ pify.all = pify; /***/ }), -/* 423 */ +/* 424 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47881,12 +48179,12 @@ module.exports = function (str) { /***/ }), -/* 424 */ +/* 425 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isPathInside = __webpack_require__(425); +var isPathInside = __webpack_require__(426); module.exports = function (str) { return isPathInside(str, process.cwd()); @@ -47894,13 +48192,13 @@ module.exports = function (str) { /***/ }), -/* 425 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var path = __webpack_require__(3); -var pathIsInside = __webpack_require__(426); +var pathIsInside = __webpack_require__(427); module.exports = function (a, b) { a = path.resolve(a); @@ -47915,7 +48213,7 @@ module.exports = function (a, b) { /***/ }), -/* 426 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47950,7 +48248,7 @@ function stripTrailingSep(thePath) { /***/ }), -/* 427 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { module.exports = rimraf @@ -47959,7 +48257,7 @@ rimraf.sync = rimrafSync var assert = __webpack_require__(24) var path = __webpack_require__(3) var fs = __webpack_require__(7) -var glob = __webpack_require__(23) +var glob = __webpack_require__(26) var _0666 = parseInt('666', 8) var defaultGlobOpts = { @@ -48320,7 +48618,7 @@ function rmkidsSync (p, options) { /***/ }), -/* 428 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48394,15 +48692,15 @@ module.exports = (iterable, mapper, opts) => new Promise((resolve, reject) => { /***/ }), -/* 429 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const chalk = __webpack_require__(14); -const cliCursor = __webpack_require__(430); -const cliSpinners = __webpack_require__(434); -const logSymbols = __webpack_require__(207); +const cliCursor = __webpack_require__(431); +const cliSpinners = __webpack_require__(435); +const logSymbols = __webpack_require__(95); class Ora { constructor(options) { @@ -48549,12 +48847,12 @@ module.exports.promise = (action, options) => { /***/ }), -/* 430 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const restoreCursor = __webpack_require__(431); +const restoreCursor = __webpack_require__(432); let hidden = false; @@ -48595,13 +48893,13 @@ exports.toggle = (force, stream) => { /***/ }), -/* 431 */ +/* 432 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const onetime = __webpack_require__(432); -const signalExit = __webpack_require__(57); +const onetime = __webpack_require__(433); +const signalExit = __webpack_require__(59); module.exports = onetime(() => { signalExit(() => { @@ -48611,12 +48909,12 @@ module.exports = onetime(() => { /***/ }), -/* 432 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const mimicFn = __webpack_require__(433); +const mimicFn = __webpack_require__(434); module.exports = (fn, opts) => { // TODO: Remove this in v3 @@ -48657,7 +48955,7 @@ module.exports = (fn, opts) => { /***/ }), -/* 433 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48673,22 +48971,22 @@ module.exports = (to, from) => { /***/ }), -/* 434 */ +/* 435 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = __webpack_require__(435); +module.exports = __webpack_require__(436); /***/ }), -/* 435 */ +/* 436 */ /***/ (function(module, exports) { module.exports = {"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"line":{"interval":130,"frames":["-","\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]}} /***/ }), -/* 436 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48703,27 +49001,47 @@ var _chalk = __webpack_require__(14); var _chalk2 = _interopRequireDefault(_chalk); -var _projects = __webpack_require__(22); +var _log = __webpack_require__(17); + +var _parallelize = __webpack_require__(55); -var _parallelize = __webpack_require__(59); +var _projects = __webpack_require__(25); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + const RunCommand = exports.RunCommand = { - name: 'run', description: 'Run script defined in package.json in each package that contains that script.', + name: 'run', run(projects, projectGraph, { extraArgs }) { return _asyncToGenerator(function* () { const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); if (extraArgs.length === 0) { - console.log(_chalk2.default.red.bold('\nNo script specified')); + _log.log.write(_chalk2.default.red.bold('\nNo script specified')); process.exit(1); } const scriptName = extraArgs[0]; const scriptArgs = extraArgs.slice(1); - console.log(_chalk2.default.bold(`\nRunning script [${_chalk2.default.green(scriptName)}] in batched topological order\n`)); + _log.log.write(_chalk2.default.bold(`\nRunning script [${_chalk2.default.green(scriptName)}] in batched topological order\n`)); yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { var _ref = _asyncToGenerator(function* (pkg) { if (pkg.hasScript(scriptName)) { @@ -48740,7 +49058,7 @@ const RunCommand = exports.RunCommand = { }; /***/ }), -/* 437 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48755,15 +49073,35 @@ var _chalk = __webpack_require__(14); var _chalk2 = _interopRequireDefault(_chalk); -var _projects = __webpack_require__(22); +var _log = __webpack_require__(17); -var _parallelize = __webpack_require__(59); +var _parallelize = __webpack_require__(55); -var _watch = __webpack_require__(438); +var _projects = __webpack_require__(25); + +var _watch = __webpack_require__(439); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /** * Name of the script in the package/project package.json file to run during `kbn watch`. @@ -48784,8 +49122,8 @@ const kibanaProjectName = 'kibana'; * `webpack` and `tsc` only, for the rest we rely on predefined timeouts. */ const WatchCommand = exports.WatchCommand = { - name: 'watch', description: 'Runs `kbn:watch` script for every project.', + name: 'watch', run(projects, projectGraph) { return _asyncToGenerator(function* () { const projectsToWatch = new Map(); @@ -48796,11 +49134,11 @@ const WatchCommand = exports.WatchCommand = { } } if (projectsToWatch.size === 0) { - console.log(_chalk2.default.red(`\nThere are no projects to watch found. Make sure that projects define 'kbn:watch' script in 'package.json'.\n`)); + _log.log.write(_chalk2.default.red(`\nThere are no projects to watch found. Make sure that projects define 'kbn:watch' script in 'package.json'.\n`)); return; } const projectNames = Array.from(projectsToWatch.keys()); - console.log(_chalk2.default.bold(_chalk2.default.green(`Running ${watchScriptName} scripts for [${projectNames.join(', ')}].`))); + _log.log.write(_chalk2.default.bold(_chalk2.default.green(`Running ${watchScriptName} scripts for [${projectNames.join(', ')}].`))); // Kibana should always be run the last, so we don't rely on automatic // topological batching and push it to the last one-entry batch manually. const shouldWatchKibanaProject = projectsToWatch.delete(kibanaProjectName); @@ -48811,7 +49149,7 @@ const WatchCommand = exports.WatchCommand = { yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { var _ref = _asyncToGenerator(function* (pkg) { const completionHint = yield (0, _watch.waitUntilWatchIsReady)(pkg.runScriptStreaming(watchScriptName).stdout); - console.log(_chalk2.default.bold(`[${_chalk2.default.green(pkg.name)}] Initial build completed (${completionHint}).`)); + _log.log.write(_chalk2.default.bold(`[${_chalk2.default.green(pkg.name)}] Initial build completed (${completionHint}).`)); }); return function (_x) { @@ -48823,7 +49161,7 @@ const WatchCommand = exports.WatchCommand = { }; /***/ }), -/* 438 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48834,7 +49172,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.waitUntilWatchIsReady = waitUntilWatchIsReady; -var _rxjs = __webpack_require__(439); +var _rxjs = __webpack_require__(440); /** * Number of milliseconds we wait before we fall back to the default watch handler. @@ -48844,6 +49182,24 @@ const defaultHandlerDelay = 3000; * If default watch handler is used, then it's the number of milliseconds we wait for * any build output before we consider watch task ready. */ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ const defaultHandlerReadinessTimeout = 2000; function getWatchHandlers(buildOutput$, { handlerDelay = defaultHandlerDelay, handlerReadinessTimeout = defaultHandlerReadinessTimeout }) { const typescriptHandler = buildOutput$.first(data => data.includes('$ tsc')).map(() => buildOutput$.first(data => data.includes('Compilation complete.')).mapTo('tsc')); @@ -48868,7 +49224,7 @@ function waitUntilWatchIsReady(stream, opts = {}) { } /***/ }), -/* 439 */ +/* 440 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48885,184 +49241,184 @@ var Observable_1 = __webpack_require__(0); exports.Observable = Observable_1.Observable; // statics /* tslint:disable:no-use-before-declare */ -__webpack_require__(441); -__webpack_require__(444); -__webpack_require__(447); -__webpack_require__(450); -__webpack_require__(453); -__webpack_require__(456); -__webpack_require__(458); -__webpack_require__(461); +__webpack_require__(442); +__webpack_require__(445); +__webpack_require__(448); +__webpack_require__(451); +__webpack_require__(454); +__webpack_require__(457); +__webpack_require__(459); __webpack_require__(462); -__webpack_require__(465); -__webpack_require__(468); -__webpack_require__(470); -__webpack_require__(473); -__webpack_require__(476); -__webpack_require__(481); +__webpack_require__(463); +__webpack_require__(466); +__webpack_require__(469); +__webpack_require__(471); +__webpack_require__(474); +__webpack_require__(477); __webpack_require__(482); __webpack_require__(483); -__webpack_require__(486); +__webpack_require__(484); __webpack_require__(487); -__webpack_require__(489); -__webpack_require__(492); -__webpack_require__(495); -__webpack_require__(498); -__webpack_require__(501); -__webpack_require__(503); +__webpack_require__(488); +__webpack_require__(490); +__webpack_require__(493); +__webpack_require__(496); +__webpack_require__(499); +__webpack_require__(502); +__webpack_require__(504); //dom -__webpack_require__(505); -__webpack_require__(507); +__webpack_require__(506); +__webpack_require__(508); //operators -__webpack_require__(513); -__webpack_require__(515); -__webpack_require__(517); -__webpack_require__(519); -__webpack_require__(521); -__webpack_require__(523); -__webpack_require__(525); -__webpack_require__(527); -__webpack_require__(529); -__webpack_require__(531); -__webpack_require__(533); -__webpack_require__(535); -__webpack_require__(537); -__webpack_require__(539); -__webpack_require__(541); -__webpack_require__(543); -__webpack_require__(545); -__webpack_require__(547); -__webpack_require__(549); -__webpack_require__(551); -__webpack_require__(554); -__webpack_require__(556); -__webpack_require__(558); -__webpack_require__(560); -__webpack_require__(562); -__webpack_require__(564); -__webpack_require__(566); -__webpack_require__(568); -__webpack_require__(570); -__webpack_require__(572); -__webpack_require__(574); -__webpack_require__(576); -__webpack_require__(578); -__webpack_require__(583); -__webpack_require__(585); -__webpack_require__(587); -__webpack_require__(589); -__webpack_require__(591); -__webpack_require__(593); -__webpack_require__(595); -__webpack_require__(597); -__webpack_require__(599); -__webpack_require__(601); -__webpack_require__(603); -__webpack_require__(605); -__webpack_require__(607); -__webpack_require__(609); -__webpack_require__(611); -__webpack_require__(613); -__webpack_require__(615); -__webpack_require__(617); -__webpack_require__(619); -__webpack_require__(621); -__webpack_require__(623); -__webpack_require__(625); -__webpack_require__(628); -__webpack_require__(630); -__webpack_require__(632); -__webpack_require__(634); -__webpack_require__(636); -__webpack_require__(638); -__webpack_require__(640); -__webpack_require__(642); -__webpack_require__(644); -__webpack_require__(646); -__webpack_require__(648); -__webpack_require__(650); -__webpack_require__(652); -__webpack_require__(654); -__webpack_require__(656); -__webpack_require__(658); -__webpack_require__(660); -__webpack_require__(662); -__webpack_require__(664); -__webpack_require__(666); -__webpack_require__(668); -__webpack_require__(670); -__webpack_require__(672); -__webpack_require__(674); -__webpack_require__(681); -__webpack_require__(683); -__webpack_require__(685); -__webpack_require__(687); -__webpack_require__(689); -__webpack_require__(691); -__webpack_require__(693); -__webpack_require__(695); -__webpack_require__(697); -__webpack_require__(699); +__webpack_require__(514); +__webpack_require__(516); +__webpack_require__(518); +__webpack_require__(520); +__webpack_require__(522); +__webpack_require__(524); +__webpack_require__(526); +__webpack_require__(528); +__webpack_require__(530); +__webpack_require__(532); +__webpack_require__(534); +__webpack_require__(536); +__webpack_require__(538); +__webpack_require__(540); +__webpack_require__(542); +__webpack_require__(544); +__webpack_require__(546); +__webpack_require__(548); +__webpack_require__(550); +__webpack_require__(552); +__webpack_require__(555); +__webpack_require__(557); +__webpack_require__(559); +__webpack_require__(561); +__webpack_require__(563); +__webpack_require__(565); +__webpack_require__(567); +__webpack_require__(569); +__webpack_require__(571); +__webpack_require__(573); +__webpack_require__(575); +__webpack_require__(577); +__webpack_require__(579); +__webpack_require__(584); +__webpack_require__(586); +__webpack_require__(588); +__webpack_require__(590); +__webpack_require__(592); +__webpack_require__(594); +__webpack_require__(596); +__webpack_require__(598); +__webpack_require__(600); +__webpack_require__(602); +__webpack_require__(604); +__webpack_require__(606); +__webpack_require__(608); +__webpack_require__(610); +__webpack_require__(612); +__webpack_require__(614); +__webpack_require__(616); +__webpack_require__(618); +__webpack_require__(620); +__webpack_require__(622); +__webpack_require__(624); +__webpack_require__(626); +__webpack_require__(629); +__webpack_require__(631); +__webpack_require__(633); +__webpack_require__(635); +__webpack_require__(637); +__webpack_require__(639); +__webpack_require__(641); +__webpack_require__(643); +__webpack_require__(645); +__webpack_require__(647); +__webpack_require__(649); +__webpack_require__(651); +__webpack_require__(653); +__webpack_require__(655); +__webpack_require__(657); +__webpack_require__(659); +__webpack_require__(661); +__webpack_require__(663); +__webpack_require__(665); +__webpack_require__(667); +__webpack_require__(669); +__webpack_require__(671); +__webpack_require__(673); +__webpack_require__(675); +__webpack_require__(682); +__webpack_require__(684); +__webpack_require__(686); +__webpack_require__(688); +__webpack_require__(690); +__webpack_require__(692); +__webpack_require__(694); +__webpack_require__(696); +__webpack_require__(698); __webpack_require__(700); -__webpack_require__(702); -__webpack_require__(704); -__webpack_require__(706); -__webpack_require__(708); +__webpack_require__(701); +__webpack_require__(703); +__webpack_require__(705); +__webpack_require__(707); __webpack_require__(709); -__webpack_require__(711); -__webpack_require__(713); -__webpack_require__(715); -__webpack_require__(717); -__webpack_require__(719); -__webpack_require__(721); -__webpack_require__(723); +__webpack_require__(710); +__webpack_require__(712); +__webpack_require__(714); +__webpack_require__(716); +__webpack_require__(718); +__webpack_require__(720); +__webpack_require__(722); +__webpack_require__(724); /* tslint:disable:no-unused-variable */ var Subscription_1 = __webpack_require__(8); exports.Subscription = Subscription_1.Subscription; var Subscriber_1 = __webpack_require__(2); exports.Subscriber = Subscriber_1.Subscriber; -var AsyncSubject_1 = __webpack_require__(42); +var AsyncSubject_1 = __webpack_require__(43); exports.AsyncSubject = AsyncSubject_1.AsyncSubject; -var ReplaySubject_1 = __webpack_require__(49); +var ReplaySubject_1 = __webpack_require__(50); exports.ReplaySubject = ReplaySubject_1.ReplaySubject; -var BehaviorSubject_1 = __webpack_require__(277); +var BehaviorSubject_1 = __webpack_require__(278); exports.BehaviorSubject = BehaviorSubject_1.BehaviorSubject; -var ConnectableObservable_1 = __webpack_require__(271); +var ConnectableObservable_1 = __webpack_require__(272); exports.ConnectableObservable = ConnectableObservable_1.ConnectableObservable; -var Notification_1 = __webpack_require__(28); +var Notification_1 = __webpack_require__(29); exports.Notification = Notification_1.Notification; -var EmptyError_1 = __webpack_require__(50); +var EmptyError_1 = __webpack_require__(51); exports.EmptyError = EmptyError_1.EmptyError; -var ArgumentOutOfRangeError_1 = __webpack_require__(34); +var ArgumentOutOfRangeError_1 = __webpack_require__(35); exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; -var ObjectUnsubscribedError_1 = __webpack_require__(41); +var ObjectUnsubscribedError_1 = __webpack_require__(42); exports.ObjectUnsubscribedError = ObjectUnsubscribedError_1.ObjectUnsubscribedError; -var TimeoutError_1 = __webpack_require__(306); +var TimeoutError_1 = __webpack_require__(307); exports.TimeoutError = TimeoutError_1.TimeoutError; -var UnsubscriptionError_1 = __webpack_require__(220); +var UnsubscriptionError_1 = __webpack_require__(221); exports.UnsubscriptionError = UnsubscriptionError_1.UnsubscriptionError; -var timeInterval_1 = __webpack_require__(303); +var timeInterval_1 = __webpack_require__(304); exports.TimeInterval = timeInterval_1.TimeInterval; -var timestamp_1 = __webpack_require__(76); +var timestamp_1 = __webpack_require__(77); exports.Timestamp = timestamp_1.Timestamp; -var TestScheduler_1 = __webpack_require__(725); +var TestScheduler_1 = __webpack_require__(726); exports.TestScheduler = TestScheduler_1.TestScheduler; -var VirtualTimeScheduler_1 = __webpack_require__(319); +var VirtualTimeScheduler_1 = __webpack_require__(320); exports.VirtualTimeScheduler = VirtualTimeScheduler_1.VirtualTimeScheduler; -var AjaxObservable_1 = __webpack_require__(231); +var AjaxObservable_1 = __webpack_require__(232); exports.AjaxResponse = AjaxObservable_1.AjaxResponse; exports.AjaxError = AjaxObservable_1.AjaxError; exports.AjaxTimeoutError = AjaxObservable_1.AjaxTimeoutError; -var pipe_1 = __webpack_require__(60); +var pipe_1 = __webpack_require__(61); exports.pipe = pipe_1.pipe; -var asap_1 = __webpack_require__(296); +var asap_1 = __webpack_require__(297); var async_1 = __webpack_require__(6); -var queue_1 = __webpack_require__(232); -var animationFrame_1 = __webpack_require__(728); -var rxSubscriber_1 = __webpack_require__(39); -var iterator_1 = __webpack_require__(26); -var observable_1 = __webpack_require__(40); -var _operators = __webpack_require__(732); +var queue_1 = __webpack_require__(233); +var animationFrame_1 = __webpack_require__(729); +var rxSubscriber_1 = __webpack_require__(40); +var iterator_1 = __webpack_require__(27); +var observable_1 = __webpack_require__(41); +var _operators = __webpack_require__(733); exports.operators = _operators; /* tslint:enable:no-unused-variable */ /** @@ -49107,14 +49463,14 @@ exports.Symbol = Symbol; //# sourceMappingURL=Rx.js.map /***/ }), -/* 440 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Subscriber_1 = __webpack_require__(2); -var rxSubscriber_1 = __webpack_require__(39); -var Observer_1 = __webpack_require__(221); +var rxSubscriber_1 = __webpack_require__(40); +var Observer_1 = __webpack_require__(222); function toSubscriber(nextOrObserver, error, complete) { if (nextOrObserver) { if (nextOrObserver instanceof Subscriber_1.Subscriber) { @@ -49133,28 +49489,28 @@ exports.toSubscriber = toSubscriber; //# sourceMappingURL=toSubscriber.js.map /***/ }), -/* 441 */ +/* 442 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var bindCallback_1 = __webpack_require__(442); +var bindCallback_1 = __webpack_require__(443); Observable_1.Observable.bindCallback = bindCallback_1.bindCallback; //# sourceMappingURL=bindCallback.js.map /***/ }), -/* 442 */ +/* 443 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var BoundCallbackObservable_1 = __webpack_require__(443); +var BoundCallbackObservable_1 = __webpack_require__(444); exports.bindCallback = BoundCallbackObservable_1.BoundCallbackObservable.create; //# sourceMappingURL=bindCallback.js.map /***/ }), -/* 443 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49167,7 +49523,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Observable_1 = __webpack_require__(0); var tryCatch_1 = __webpack_require__(11); var errorObject_1 = __webpack_require__(10); -var AsyncSubject_1 = __webpack_require__(42); +var AsyncSubject_1 = __webpack_require__(43); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -49424,28 +49780,28 @@ function dispatchError(arg) { //# sourceMappingURL=BoundCallbackObservable.js.map /***/ }), -/* 444 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var bindNodeCallback_1 = __webpack_require__(445); +var bindNodeCallback_1 = __webpack_require__(446); Observable_1.Observable.bindNodeCallback = bindNodeCallback_1.bindNodeCallback; //# sourceMappingURL=bindNodeCallback.js.map /***/ }), -/* 445 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var BoundNodeCallbackObservable_1 = __webpack_require__(446); +var BoundNodeCallbackObservable_1 = __webpack_require__(447); exports.bindNodeCallback = BoundNodeCallbackObservable_1.BoundNodeCallbackObservable.create; //# sourceMappingURL=bindNodeCallback.js.map /***/ }), -/* 446 */ +/* 447 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49458,7 +49814,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Observable_1 = __webpack_require__(0); var tryCatch_1 = __webpack_require__(11); var errorObject_1 = __webpack_require__(10); -var AsyncSubject_1 = __webpack_require__(42); +var AsyncSubject_1 = __webpack_require__(43); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -49714,26 +50070,26 @@ function dispatchError(arg) { //# sourceMappingURL=BoundNodeCallbackObservable.js.map /***/ }), -/* 447 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var combineLatest_1 = __webpack_require__(448); +var combineLatest_1 = __webpack_require__(449); Observable_1.Observable.combineLatest = combineLatest_1.combineLatest; //# sourceMappingURL=combineLatest.js.map /***/ }), -/* 448 */ +/* 449 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isScheduler_1 = __webpack_require__(15); var isArray_1 = __webpack_require__(16); -var ArrayObservable_1 = __webpack_require__(17); -var combineLatest_1 = __webpack_require__(43); +var ArrayObservable_1 = __webpack_require__(18); +var combineLatest_1 = __webpack_require__(44); /* tslint:enable:max-line-length */ /** * Combines multiple Observables to create an Observable whose values are @@ -49867,7 +50223,7 @@ exports.combineLatest = combineLatest; //# sourceMappingURL=combineLatest.js.map /***/ }), -/* 449 */ +/* 450 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49909,18 +50265,18 @@ exports.InnerSubscriber = InnerSubscriber; //# sourceMappingURL=InnerSubscriber.js.map /***/ }), -/* 450 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var concat_1 = __webpack_require__(27); +var concat_1 = __webpack_require__(28); Observable_1.Observable.concat = concat_1.concat; //# sourceMappingURL=concat.js.map /***/ }), -/* 451 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49932,7 +50288,7 @@ var __extends = (this && this.__extends) || function (d, b) { }; var root_1 = __webpack_require__(12); var Observable_1 = __webpack_require__(0); -var iterator_1 = __webpack_require__(26); +var iterator_1 = __webpack_require__(27); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -50089,7 +50445,7 @@ function sign(value) { //# sourceMappingURL=IteratorObservable.js.map /***/ }), -/* 452 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50100,8 +50456,8 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Observable_1 = __webpack_require__(0); -var ScalarObservable_1 = __webpack_require__(62); -var EmptyObservable_1 = __webpack_require__(18); +var ScalarObservable_1 = __webpack_require__(63); +var EmptyObservable_1 = __webpack_require__(19); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -50165,28 +50521,28 @@ exports.ArrayLikeObservable = ArrayLikeObservable; //# sourceMappingURL=ArrayLikeObservable.js.map /***/ }), -/* 453 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var defer_1 = __webpack_require__(454); +var defer_1 = __webpack_require__(455); Observable_1.Observable.defer = defer_1.defer; //# sourceMappingURL=defer.js.map /***/ }), -/* 454 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var DeferObservable_1 = __webpack_require__(455); +var DeferObservable_1 = __webpack_require__(456); exports.defer = DeferObservable_1.DeferObservable.create; //# sourceMappingURL=defer.js.map /***/ }), -/* 455 */ +/* 456 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50291,49 +50647,49 @@ var DeferSubscriber = (function (_super) { //# sourceMappingURL=DeferObservable.js.map /***/ }), -/* 456 */ +/* 457 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var empty_1 = __webpack_require__(457); +var empty_1 = __webpack_require__(458); Observable_1.Observable.empty = empty_1.empty; //# sourceMappingURL=empty.js.map /***/ }), -/* 457 */ +/* 458 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var EmptyObservable_1 = __webpack_require__(18); +var EmptyObservable_1 = __webpack_require__(19); exports.empty = EmptyObservable_1.EmptyObservable.create; //# sourceMappingURL=empty.js.map /***/ }), -/* 458 */ +/* 459 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var forkJoin_1 = __webpack_require__(459); +var forkJoin_1 = __webpack_require__(460); Observable_1.Observable.forkJoin = forkJoin_1.forkJoin; //# sourceMappingURL=forkJoin.js.map /***/ }), -/* 459 */ +/* 460 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ForkJoinObservable_1 = __webpack_require__(460); +var ForkJoinObservable_1 = __webpack_require__(461); exports.forkJoin = ForkJoinObservable_1.ForkJoinObservable.create; //# sourceMappingURL=forkJoin.js.map /***/ }), -/* 460 */ +/* 461 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50344,7 +50700,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Observable_1 = __webpack_require__(0); -var EmptyObservable_1 = __webpack_require__(18); +var EmptyObservable_1 = __webpack_require__(19); var isArray_1 = __webpack_require__(16); var subscribeToResult_1 = __webpack_require__(5); var OuterSubscriber_1 = __webpack_require__(4); @@ -50541,39 +50897,39 @@ var ForkJoinSubscriber = (function (_super) { //# sourceMappingURL=ForkJoinObservable.js.map /***/ }), -/* 461 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var from_1 = __webpack_require__(226); +var from_1 = __webpack_require__(227); Observable_1.Observable.from = from_1.from; //# sourceMappingURL=from.js.map /***/ }), -/* 462 */ +/* 463 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var fromEvent_1 = __webpack_require__(463); +var fromEvent_1 = __webpack_require__(464); Observable_1.Observable.fromEvent = fromEvent_1.fromEvent; //# sourceMappingURL=fromEvent.js.map /***/ }), -/* 463 */ +/* 464 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var FromEventObservable_1 = __webpack_require__(464); +var FromEventObservable_1 = __webpack_require__(465); exports.fromEvent = FromEventObservable_1.FromEventObservable.create; //# sourceMappingURL=fromEvent.js.map /***/ }), -/* 464 */ +/* 465 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50585,7 +50941,7 @@ var __extends = (this && this.__extends) || function (d, b) { }; var Observable_1 = __webpack_require__(0); var tryCatch_1 = __webpack_require__(11); -var isFunction_1 = __webpack_require__(38); +var isFunction_1 = __webpack_require__(39); var errorObject_1 = __webpack_require__(10); var Subscription_1 = __webpack_require__(8); var toString = Object.prototype.toString; @@ -50795,28 +51151,28 @@ exports.FromEventObservable = FromEventObservable; //# sourceMappingURL=FromEventObservable.js.map /***/ }), -/* 465 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var fromEventPattern_1 = __webpack_require__(466); +var fromEventPattern_1 = __webpack_require__(467); Observable_1.Observable.fromEventPattern = fromEventPattern_1.fromEventPattern; //# sourceMappingURL=fromEventPattern.js.map /***/ }), -/* 466 */ +/* 467 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var FromEventPatternObservable_1 = __webpack_require__(467); +var FromEventPatternObservable_1 = __webpack_require__(468); exports.fromEventPattern = FromEventPatternObservable_1.FromEventPatternObservable.create; //# sourceMappingURL=fromEventPattern.js.map /***/ }), -/* 467 */ +/* 468 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50826,7 +51182,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var isFunction_1 = __webpack_require__(38); +var isFunction_1 = __webpack_require__(39); var Observable_1 = __webpack_require__(0); var Subscription_1 = __webpack_require__(8); /** @@ -50935,49 +51291,49 @@ exports.FromEventPatternObservable = FromEventPatternObservable; //# sourceMappingURL=FromEventPatternObservable.js.map /***/ }), -/* 468 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var fromPromise_1 = __webpack_require__(469); +var fromPromise_1 = __webpack_require__(470); Observable_1.Observable.fromPromise = fromPromise_1.fromPromise; //# sourceMappingURL=fromPromise.js.map /***/ }), -/* 469 */ +/* 470 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var PromiseObservable_1 = __webpack_require__(228); +var PromiseObservable_1 = __webpack_require__(229); exports.fromPromise = PromiseObservable_1.PromiseObservable.create; //# sourceMappingURL=fromPromise.js.map /***/ }), -/* 470 */ +/* 471 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var generate_1 = __webpack_require__(471); +var generate_1 = __webpack_require__(472); Observable_1.Observable.generate = generate_1.generate; //# sourceMappingURL=generate.js.map /***/ }), -/* 471 */ +/* 472 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var GenerateObservable_1 = __webpack_require__(472); +var GenerateObservable_1 = __webpack_require__(473); exports.generate = GenerateObservable_1.GenerateObservable.create; //# sourceMappingURL=generate.js.map /***/ }), -/* 472 */ +/* 473 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51118,28 +51474,28 @@ exports.GenerateObservable = GenerateObservable; //# sourceMappingURL=GenerateObservable.js.map /***/ }), -/* 473 */ +/* 474 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var if_1 = __webpack_require__(474); +var if_1 = __webpack_require__(475); Observable_1.Observable.if = if_1._if; //# sourceMappingURL=if.js.map /***/ }), -/* 474 */ +/* 475 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var IfObservable_1 = __webpack_require__(475); +var IfObservable_1 = __webpack_require__(476); exports._if = IfObservable_1.IfObservable.create; //# sourceMappingURL=if.js.map /***/ }), -/* 475 */ +/* 476 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51206,28 +51562,28 @@ var IfSubscriber = (function (_super) { //# sourceMappingURL=IfObservable.js.map /***/ }), -/* 476 */ +/* 477 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var interval_1 = __webpack_require__(477); +var interval_1 = __webpack_require__(478); Observable_1.Observable.interval = interval_1.interval; //# sourceMappingURL=interval.js.map /***/ }), -/* 477 */ +/* 478 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var IntervalObservable_1 = __webpack_require__(478); +var IntervalObservable_1 = __webpack_require__(479); exports.interval = IntervalObservable_1.IntervalObservable.create; //# sourceMappingURL=interval.js.map /***/ }), -/* 478 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51237,7 +51593,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var isNumeric_1 = __webpack_require__(30); +var isNumeric_1 = __webpack_require__(31); var Observable_1 = __webpack_require__(0); var async_1 = __webpack_require__(6); /** @@ -51321,7 +51677,7 @@ exports.IntervalObservable = IntervalObservable; //# sourceMappingURL=IntervalObservable.js.map /***/ }), -/* 479 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51371,7 +51727,7 @@ exports.Action = Action; //# sourceMappingURL=Action.js.map /***/ }), -/* 480 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51426,50 +51782,50 @@ exports.Scheduler = Scheduler; //# sourceMappingURL=Scheduler.js.map /***/ }), -/* 481 */ +/* 482 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var merge_1 = __webpack_require__(46); +var merge_1 = __webpack_require__(47); Observable_1.Observable.merge = merge_1.merge; //# sourceMappingURL=merge.js.map /***/ }), -/* 482 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var race_1 = __webpack_require__(64); +var race_1 = __webpack_require__(65); Observable_1.Observable.race = race_1.race; //# sourceMappingURL=race.js.map /***/ }), -/* 483 */ +/* 484 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var never_1 = __webpack_require__(484); +var never_1 = __webpack_require__(485); Observable_1.Observable.never = never_1.never; //# sourceMappingURL=never.js.map /***/ }), -/* 484 */ +/* 485 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var NeverObservable_1 = __webpack_require__(485); +var NeverObservable_1 = __webpack_require__(486); exports.never = NeverObservable_1.NeverObservable.create; //# sourceMappingURL=never.js.map /***/ }), -/* 485 */ +/* 486 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51480,7 +51836,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Observable_1 = __webpack_require__(0); -var noop_1 = __webpack_require__(61); +var noop_1 = __webpack_require__(62); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -51534,60 +51890,60 @@ exports.NeverObservable = NeverObservable; //# sourceMappingURL=NeverObservable.js.map /***/ }), -/* 486 */ +/* 487 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var of_1 = __webpack_require__(225); +var of_1 = __webpack_require__(226); Observable_1.Observable.of = of_1.of; //# sourceMappingURL=of.js.map /***/ }), -/* 487 */ +/* 488 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var onErrorResumeNext_1 = __webpack_require__(488); +var onErrorResumeNext_1 = __webpack_require__(489); Observable_1.Observable.onErrorResumeNext = onErrorResumeNext_1.onErrorResumeNext; //# sourceMappingURL=onErrorResumeNext.js.map /***/ }), -/* 488 */ +/* 489 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var onErrorResumeNext_1 = __webpack_require__(65); +var onErrorResumeNext_1 = __webpack_require__(66); exports.onErrorResumeNext = onErrorResumeNext_1.onErrorResumeNextStatic; //# sourceMappingURL=onErrorResumeNext.js.map /***/ }), -/* 489 */ +/* 490 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var pairs_1 = __webpack_require__(490); +var pairs_1 = __webpack_require__(491); Observable_1.Observable.pairs = pairs_1.pairs; //# sourceMappingURL=pairs.js.map /***/ }), -/* 490 */ +/* 491 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var PairsObservable_1 = __webpack_require__(491); +var PairsObservable_1 = __webpack_require__(492); exports.pairs = PairsObservable_1.PairsObservable.create; //# sourceMappingURL=pairs.js.map /***/ }), -/* 491 */ +/* 492 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51678,28 +52034,28 @@ exports.PairsObservable = PairsObservable; //# sourceMappingURL=PairsObservable.js.map /***/ }), -/* 492 */ +/* 493 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var range_1 = __webpack_require__(493); +var range_1 = __webpack_require__(494); Observable_1.Observable.range = range_1.range; //# sourceMappingURL=range.js.map /***/ }), -/* 493 */ +/* 494 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var RangeObservable_1 = __webpack_require__(494); +var RangeObservable_1 = __webpack_require__(495); exports.range = RangeObservable_1.RangeObservable.create; //# sourceMappingURL=range.js.map /***/ }), -/* 494 */ +/* 495 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51801,28 +52157,28 @@ exports.RangeObservable = RangeObservable; //# sourceMappingURL=RangeObservable.js.map /***/ }), -/* 495 */ +/* 496 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var using_1 = __webpack_require__(496); +var using_1 = __webpack_require__(497); Observable_1.Observable.using = using_1.using; //# sourceMappingURL=using.js.map /***/ }), -/* 496 */ +/* 497 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var UsingObservable_1 = __webpack_require__(497); +var UsingObservable_1 = __webpack_require__(498); exports.using = UsingObservable_1.UsingObservable.create; //# sourceMappingURL=using.js.map /***/ }), -/* 497 */ +/* 498 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51889,28 +52245,28 @@ var UsingSubscriber = (function (_super) { //# sourceMappingURL=UsingObservable.js.map /***/ }), -/* 498 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var throw_1 = __webpack_require__(499); +var throw_1 = __webpack_require__(500); Observable_1.Observable.throw = throw_1._throw; //# sourceMappingURL=throw.js.map /***/ }), -/* 499 */ +/* 500 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ErrorObservable_1 = __webpack_require__(500); +var ErrorObservable_1 = __webpack_require__(501); exports._throw = ErrorObservable_1.ErrorObservable.create; //# sourceMappingURL=throw.js.map /***/ }), -/* 500 */ +/* 501 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51999,18 +52355,18 @@ exports.ErrorObservable = ErrorObservable; //# sourceMappingURL=ErrorObservable.js.map /***/ }), -/* 501 */ +/* 502 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var timer_1 = __webpack_require__(230); +var timer_1 = __webpack_require__(231); Observable_1.Observable.timer = timer_1.timer; //# sourceMappingURL=timer.js.map /***/ }), -/* 502 */ +/* 503 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52020,11 +52376,11 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var isNumeric_1 = __webpack_require__(30); +var isNumeric_1 = __webpack_require__(31); var Observable_1 = __webpack_require__(0); var async_1 = __webpack_require__(6); var isScheduler_1 = __webpack_require__(15); -var isDate_1 = __webpack_require__(47); +var isDate_1 = __webpack_require__(48); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -52123,70 +52479,70 @@ exports.TimerObservable = TimerObservable; //# sourceMappingURL=TimerObservable.js.map /***/ }), -/* 503 */ +/* 504 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var zip_1 = __webpack_require__(504); +var zip_1 = __webpack_require__(505); Observable_1.Observable.zip = zip_1.zip; //# sourceMappingURL=zip.js.map /***/ }), -/* 504 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var zip_1 = __webpack_require__(48); +var zip_1 = __webpack_require__(49); exports.zip = zip_1.zipStatic; //# sourceMappingURL=zip.js.map /***/ }), -/* 505 */ +/* 506 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var ajax_1 = __webpack_require__(506); +var ajax_1 = __webpack_require__(507); Observable_1.Observable.ajax = ajax_1.ajax; //# sourceMappingURL=ajax.js.map /***/ }), -/* 506 */ +/* 507 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var AjaxObservable_1 = __webpack_require__(231); +var AjaxObservable_1 = __webpack_require__(232); exports.ajax = AjaxObservable_1.AjaxObservable.create; //# sourceMappingURL=ajax.js.map /***/ }), -/* 507 */ +/* 508 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var webSocket_1 = __webpack_require__(508); +var webSocket_1 = __webpack_require__(509); Observable_1.Observable.webSocket = webSocket_1.webSocket; //# sourceMappingURL=webSocket.js.map /***/ }), -/* 508 */ +/* 509 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var WebSocketSubject_1 = __webpack_require__(509); +var WebSocketSubject_1 = __webpack_require__(510); exports.webSocket = WebSocketSubject_1.WebSocketSubject.create; //# sourceMappingURL=webSocket.js.map /***/ }), -/* 509 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52201,10 +52557,10 @@ var Subscriber_1 = __webpack_require__(2); var Observable_1 = __webpack_require__(0); var Subscription_1 = __webpack_require__(8); var root_1 = __webpack_require__(12); -var ReplaySubject_1 = __webpack_require__(49); +var ReplaySubject_1 = __webpack_require__(50); var tryCatch_1 = __webpack_require__(11); var errorObject_1 = __webpack_require__(10); -var assign_1 = __webpack_require__(512); +var assign_1 = __webpack_require__(513); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -52442,7 +52798,7 @@ exports.WebSocketSubject = WebSocketSubject; //# sourceMappingURL=WebSocketSubject.js.map /***/ }), -/* 510 */ +/* 511 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52452,7 +52808,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var AsyncAction_1 = __webpack_require__(31); +var AsyncAction_1 = __webpack_require__(32); /** * We need this JSDoc comment for affecting ESDoc. * @ignore @@ -52497,7 +52853,7 @@ exports.QueueAction = QueueAction; //# sourceMappingURL=QueueAction.js.map /***/ }), -/* 511 */ +/* 512 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52507,7 +52863,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var AsyncScheduler_1 = __webpack_require__(32); +var AsyncScheduler_1 = __webpack_require__(33); var QueueScheduler = (function (_super) { __extends(QueueScheduler, _super); function QueueScheduler() { @@ -52519,7 +52875,7 @@ exports.QueueScheduler = QueueScheduler; //# sourceMappingURL=QueueScheduler.js.map /***/ }), -/* 512 */ +/* 513 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52551,23 +52907,23 @@ exports.assign = getAssign(root_1.root); //# sourceMappingURL=assign.js.map /***/ }), -/* 513 */ +/* 514 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var buffer_1 = __webpack_require__(514); +var buffer_1 = __webpack_require__(515); Observable_1.Observable.prototype.buffer = buffer_1.buffer; //# sourceMappingURL=buffer.js.map /***/ }), -/* 514 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var buffer_1 = __webpack_require__(233); +var buffer_1 = __webpack_require__(234); /** * Buffers the source Observable values until `closingNotifier` emits. * @@ -52607,23 +52963,23 @@ exports.buffer = buffer; //# sourceMappingURL=buffer.js.map /***/ }), -/* 515 */ +/* 516 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var bufferCount_1 = __webpack_require__(516); +var bufferCount_1 = __webpack_require__(517); Observable_1.Observable.prototype.bufferCount = bufferCount_1.bufferCount; //# sourceMappingURL=bufferCount.js.map /***/ }), -/* 516 */ +/* 517 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var bufferCount_1 = __webpack_require__(234); +var bufferCount_1 = __webpack_require__(235); /** * Buffers the source Observable values until the size hits the maximum * `bufferSize` given. @@ -52673,25 +53029,25 @@ exports.bufferCount = bufferCount; //# sourceMappingURL=bufferCount.js.map /***/ }), -/* 517 */ +/* 518 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var bufferTime_1 = __webpack_require__(518); +var bufferTime_1 = __webpack_require__(519); Observable_1.Observable.prototype.bufferTime = bufferTime_1.bufferTime; //# sourceMappingURL=bufferTime.js.map /***/ }), -/* 518 */ +/* 519 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); var isScheduler_1 = __webpack_require__(15); -var bufferTime_1 = __webpack_require__(235); +var bufferTime_1 = __webpack_require__(236); /* tslint:enable:max-line-length */ /** * Buffers the source Observable values for a specific time period. @@ -52757,23 +53113,23 @@ exports.bufferTime = bufferTime; //# sourceMappingURL=bufferTime.js.map /***/ }), -/* 519 */ +/* 520 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var bufferToggle_1 = __webpack_require__(520); +var bufferToggle_1 = __webpack_require__(521); Observable_1.Observable.prototype.bufferToggle = bufferToggle_1.bufferToggle; //# sourceMappingURL=bufferToggle.js.map /***/ }), -/* 520 */ +/* 521 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var bufferToggle_1 = __webpack_require__(236); +var bufferToggle_1 = __webpack_require__(237); /** * Buffers the source Observable values starting from an emission from * `openings` and ending when the output of `closingSelector` emits. @@ -52819,23 +53175,23 @@ exports.bufferToggle = bufferToggle; //# sourceMappingURL=bufferToggle.js.map /***/ }), -/* 521 */ +/* 522 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var bufferWhen_1 = __webpack_require__(522); +var bufferWhen_1 = __webpack_require__(523); Observable_1.Observable.prototype.bufferWhen = bufferWhen_1.bufferWhen; //# sourceMappingURL=bufferWhen.js.map /***/ }), -/* 522 */ +/* 523 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var bufferWhen_1 = __webpack_require__(237); +var bufferWhen_1 = __webpack_require__(238); /** * Buffers the source Observable values, using a factory function of closing * Observables to determine when to close, emit, and reset the buffer. @@ -52876,24 +53232,24 @@ exports.bufferWhen = bufferWhen; //# sourceMappingURL=bufferWhen.js.map /***/ }), -/* 523 */ +/* 524 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var catch_1 = __webpack_require__(524); +var catch_1 = __webpack_require__(525); Observable_1.Observable.prototype.catch = catch_1._catch; Observable_1.Observable.prototype._catch = catch_1._catch; //# sourceMappingURL=catch.js.map /***/ }), -/* 524 */ +/* 525 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var catchError_1 = __webpack_require__(238); +var catchError_1 = __webpack_require__(239); /** * Catches errors on the observable to be handled by returning a new observable or throwing an error. * @@ -52960,23 +53316,23 @@ exports._catch = _catch; //# sourceMappingURL=catch.js.map /***/ }), -/* 525 */ +/* 526 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var combineAll_1 = __webpack_require__(526); +var combineAll_1 = __webpack_require__(527); Observable_1.Observable.prototype.combineAll = combineAll_1.combineAll; //# sourceMappingURL=combineAll.js.map /***/ }), -/* 526 */ +/* 527 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var combineAll_1 = __webpack_require__(239); +var combineAll_1 = __webpack_require__(240); /** * Converts a higher-order Observable into a first-order Observable by waiting * for the outer Observable to complete, then applying {@link combineLatest}. @@ -53024,23 +53380,23 @@ exports.combineAll = combineAll; //# sourceMappingURL=combineAll.js.map /***/ }), -/* 527 */ +/* 528 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var combineLatest_1 = __webpack_require__(528); +var combineLatest_1 = __webpack_require__(529); Observable_1.Observable.prototype.combineLatest = combineLatest_1.combineLatest; //# sourceMappingURL=combineLatest.js.map /***/ }), -/* 528 */ +/* 529 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var combineLatest_1 = __webpack_require__(43); +var combineLatest_1 = __webpack_require__(44); /* tslint:enable:max-line-length */ /** * Combines multiple Observables to create an Observable whose values are @@ -53096,24 +53452,24 @@ exports.combineLatest = combineLatest; //# sourceMappingURL=combineLatest.js.map /***/ }), -/* 529 */ +/* 530 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var concat_1 = __webpack_require__(530); +var concat_1 = __webpack_require__(531); Observable_1.Observable.prototype.concat = concat_1.concat; //# sourceMappingURL=concat.js.map /***/ }), -/* 530 */ +/* 531 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var concat_1 = __webpack_require__(240); -var concat_2 = __webpack_require__(27); +var concat_1 = __webpack_require__(241); +var concat_2 = __webpack_require__(28); exports.concatStatic = concat_2.concat; /* tslint:enable:max-line-length */ /** @@ -53176,23 +53532,23 @@ exports.concat = concat; //# sourceMappingURL=concat.js.map /***/ }), -/* 531 */ +/* 532 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var concatAll_1 = __webpack_require__(532); +var concatAll_1 = __webpack_require__(533); Observable_1.Observable.prototype.concatAll = concatAll_1.concatAll; //# sourceMappingURL=concatAll.js.map /***/ }), -/* 532 */ +/* 533 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var concatAll_1 = __webpack_require__(63); +var concatAll_1 = __webpack_require__(64); /* tslint:enable:max-line-length */ /** * Converts a higher-order Observable into a first-order Observable by @@ -53249,23 +53605,23 @@ exports.concatAll = concatAll; //# sourceMappingURL=concatAll.js.map /***/ }), -/* 533 */ +/* 534 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var concatMap_1 = __webpack_require__(534); +var concatMap_1 = __webpack_require__(535); Observable_1.Observable.prototype.concatMap = concatMap_1.concatMap; //# sourceMappingURL=concatMap.js.map /***/ }), -/* 534 */ +/* 535 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var concatMap_1 = __webpack_require__(66); +var concatMap_1 = __webpack_require__(67); /* tslint:enable:max-line-length */ /** * Projects each source value to an Observable which is merged in the output @@ -53333,23 +53689,23 @@ exports.concatMap = concatMap; //# sourceMappingURL=concatMap.js.map /***/ }), -/* 535 */ +/* 536 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var concatMapTo_1 = __webpack_require__(536); +var concatMapTo_1 = __webpack_require__(537); Observable_1.Observable.prototype.concatMapTo = concatMapTo_1.concatMapTo; //# sourceMappingURL=concatMapTo.js.map /***/ }), -/* 536 */ +/* 537 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var concatMapTo_1 = __webpack_require__(241); +var concatMapTo_1 = __webpack_require__(242); /* tslint:enable:max-line-length */ /** * Projects each source value to the same Observable which is merged multiple @@ -53414,23 +53770,23 @@ exports.concatMapTo = concatMapTo; //# sourceMappingURL=concatMapTo.js.map /***/ }), -/* 537 */ +/* 538 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var count_1 = __webpack_require__(538); +var count_1 = __webpack_require__(539); Observable_1.Observable.prototype.count = count_1.count; //# sourceMappingURL=count.js.map /***/ }), -/* 538 */ +/* 539 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var count_1 = __webpack_require__(242); +var count_1 = __webpack_require__(243); /** * Counts the number of emissions on the source and emits that number when the * source completes. @@ -53486,23 +53842,23 @@ exports.count = count; //# sourceMappingURL=count.js.map /***/ }), -/* 539 */ +/* 540 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var dematerialize_1 = __webpack_require__(540); +var dematerialize_1 = __webpack_require__(541); Observable_1.Observable.prototype.dematerialize = dematerialize_1.dematerialize; //# sourceMappingURL=dematerialize.js.map /***/ }), -/* 540 */ +/* 541 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var dematerialize_1 = __webpack_require__(243); +var dematerialize_1 = __webpack_require__(244); /** * Converts an Observable of {@link Notification} objects into the emissions * that they represent. @@ -53550,23 +53906,23 @@ exports.dematerialize = dematerialize; //# sourceMappingURL=dematerialize.js.map /***/ }), -/* 541 */ +/* 542 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var debounce_1 = __webpack_require__(542); +var debounce_1 = __webpack_require__(543); Observable_1.Observable.prototype.debounce = debounce_1.debounce; //# sourceMappingURL=debounce.js.map /***/ }), -/* 542 */ +/* 543 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var debounce_1 = __webpack_require__(244); +var debounce_1 = __webpack_require__(245); /** * Emits a value from the source Observable only after a particular time span * determined by another Observable has passed without another source emission. @@ -53616,24 +53972,24 @@ exports.debounce = debounce; //# sourceMappingURL=debounce.js.map /***/ }), -/* 543 */ +/* 544 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var debounceTime_1 = __webpack_require__(544); +var debounceTime_1 = __webpack_require__(545); Observable_1.Observable.prototype.debounceTime = debounceTime_1.debounceTime; //# sourceMappingURL=debounceTime.js.map /***/ }), -/* 544 */ +/* 545 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var debounceTime_1 = __webpack_require__(245); +var debounceTime_1 = __webpack_require__(246); /** * Emits a value from the source Observable only after a particular time span * has passed without another source emission. @@ -53688,23 +54044,23 @@ exports.debounceTime = debounceTime; //# sourceMappingURL=debounceTime.js.map /***/ }), -/* 545 */ +/* 546 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var defaultIfEmpty_1 = __webpack_require__(546); +var defaultIfEmpty_1 = __webpack_require__(547); Observable_1.Observable.prototype.defaultIfEmpty = defaultIfEmpty_1.defaultIfEmpty; //# sourceMappingURL=defaultIfEmpty.js.map /***/ }), -/* 546 */ +/* 547 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var defaultIfEmpty_1 = __webpack_require__(67); +var defaultIfEmpty_1 = __webpack_require__(68); /* tslint:enable:max-line-length */ /** * Emits a given value if the source Observable completes without emitting any @@ -53744,24 +54100,24 @@ exports.defaultIfEmpty = defaultIfEmpty; //# sourceMappingURL=defaultIfEmpty.js.map /***/ }), -/* 547 */ +/* 548 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var delay_1 = __webpack_require__(548); +var delay_1 = __webpack_require__(549); Observable_1.Observable.prototype.delay = delay_1.delay; //# sourceMappingURL=delay.js.map /***/ }), -/* 548 */ +/* 549 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var delay_1 = __webpack_require__(246); +var delay_1 = __webpack_require__(247); /** * Delays the emission of items from the source Observable by a given timeout or * until a given Date. @@ -53809,23 +54165,23 @@ exports.delay = delay; //# sourceMappingURL=delay.js.map /***/ }), -/* 549 */ +/* 550 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var delayWhen_1 = __webpack_require__(550); +var delayWhen_1 = __webpack_require__(551); Observable_1.Observable.prototype.delayWhen = delayWhen_1.delayWhen; //# sourceMappingURL=delayWhen.js.map /***/ }), -/* 550 */ +/* 551 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var delayWhen_1 = __webpack_require__(247); +var delayWhen_1 = __webpack_require__(248); /** * Delays the emission of items from the source Observable by a given time span * determined by the emissions of another Observable. @@ -53878,23 +54234,23 @@ exports.delayWhen = delayWhen; //# sourceMappingURL=delayWhen.js.map /***/ }), -/* 551 */ +/* 552 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var distinct_1 = __webpack_require__(552); +var distinct_1 = __webpack_require__(553); Observable_1.Observable.prototype.distinct = distinct_1.distinct; //# sourceMappingURL=distinct.js.map /***/ }), -/* 552 */ +/* 553 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var distinct_1 = __webpack_require__(248); +var distinct_1 = __webpack_require__(249); /** * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items. * @@ -53947,7 +54303,7 @@ exports.distinct = distinct; //# sourceMappingURL=distinct.js.map /***/ }), -/* 553 */ +/* 554 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -53986,23 +54342,23 @@ exports.Set = root_1.root.Set || minimalSetImpl(); //# sourceMappingURL=Set.js.map /***/ }), -/* 554 */ +/* 555 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var distinctUntilChanged_1 = __webpack_require__(555); +var distinctUntilChanged_1 = __webpack_require__(556); Observable_1.Observable.prototype.distinctUntilChanged = distinctUntilChanged_1.distinctUntilChanged; //# sourceMappingURL=distinctUntilChanged.js.map /***/ }), -/* 555 */ +/* 556 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var distinctUntilChanged_1 = __webpack_require__(68); +var distinctUntilChanged_1 = __webpack_require__(69); /* tslint:enable:max-line-length */ /** * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item. @@ -54050,23 +54406,23 @@ exports.distinctUntilChanged = distinctUntilChanged; //# sourceMappingURL=distinctUntilChanged.js.map /***/ }), -/* 556 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var distinctUntilKeyChanged_1 = __webpack_require__(557); +var distinctUntilKeyChanged_1 = __webpack_require__(558); Observable_1.Observable.prototype.distinctUntilKeyChanged = distinctUntilKeyChanged_1.distinctUntilKeyChanged; //# sourceMappingURL=distinctUntilKeyChanged.js.map /***/ }), -/* 557 */ +/* 558 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var distinctUntilKeyChanged_1 = __webpack_require__(249); +var distinctUntilKeyChanged_1 = __webpack_require__(250); /* tslint:enable:max-line-length */ /** * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item, @@ -54132,24 +54488,24 @@ exports.distinctUntilKeyChanged = distinctUntilKeyChanged; //# sourceMappingURL=distinctUntilKeyChanged.js.map /***/ }), -/* 558 */ +/* 559 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var do_1 = __webpack_require__(559); +var do_1 = __webpack_require__(560); Observable_1.Observable.prototype.do = do_1._do; Observable_1.Observable.prototype._do = do_1._do; //# sourceMappingURL=do.js.map /***/ }), -/* 559 */ +/* 560 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var tap_1 = __webpack_require__(250); +var tap_1 = __webpack_require__(251); /* tslint:enable:max-line-length */ /** * Perform a side effect for every emission on the source Observable, but return @@ -54201,23 +54557,23 @@ exports._do = _do; //# sourceMappingURL=do.js.map /***/ }), -/* 560 */ +/* 561 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var exhaust_1 = __webpack_require__(561); +var exhaust_1 = __webpack_require__(562); Observable_1.Observable.prototype.exhaust = exhaust_1.exhaust; //# sourceMappingURL=exhaust.js.map /***/ }), -/* 561 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var exhaust_1 = __webpack_require__(251); +var exhaust_1 = __webpack_require__(252); /** * Converts a higher-order Observable into a first-order Observable by dropping * inner Observables while the previous inner Observable has not yet completed. @@ -54260,23 +54616,23 @@ exports.exhaust = exhaust; //# sourceMappingURL=exhaust.js.map /***/ }), -/* 562 */ +/* 563 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var exhaustMap_1 = __webpack_require__(563); +var exhaustMap_1 = __webpack_require__(564); Observable_1.Observable.prototype.exhaustMap = exhaustMap_1.exhaustMap; //# sourceMappingURL=exhaustMap.js.map /***/ }), -/* 563 */ +/* 564 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var exhaustMap_1 = __webpack_require__(252); +var exhaustMap_1 = __webpack_require__(253); /* tslint:enable:max-line-length */ /** * Projects each source value to an Observable which is merged in the output @@ -54330,23 +54686,23 @@ exports.exhaustMap = exhaustMap; //# sourceMappingURL=exhaustMap.js.map /***/ }), -/* 564 */ +/* 565 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var expand_1 = __webpack_require__(565); +var expand_1 = __webpack_require__(566); Observable_1.Observable.prototype.expand = expand_1.expand; //# sourceMappingURL=expand.js.map /***/ }), -/* 565 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var expand_1 = __webpack_require__(253); +var expand_1 = __webpack_require__(254); /* tslint:enable:max-line-length */ /** * Recursively projects each source value to an Observable which is merged in @@ -54403,23 +54759,23 @@ exports.expand = expand; //# sourceMappingURL=expand.js.map /***/ }), -/* 566 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var elementAt_1 = __webpack_require__(567); +var elementAt_1 = __webpack_require__(568); Observable_1.Observable.prototype.elementAt = elementAt_1.elementAt; //# sourceMappingURL=elementAt.js.map /***/ }), -/* 567 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var elementAt_1 = __webpack_require__(254); +var elementAt_1 = __webpack_require__(255); /** * Emits the single value at the specified `index` in a sequence of emissions * from the source Observable. @@ -54469,23 +54825,23 @@ exports.elementAt = elementAt; //# sourceMappingURL=elementAt.js.map /***/ }), -/* 568 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var filter_1 = __webpack_require__(569); +var filter_1 = __webpack_require__(570); Observable_1.Observable.prototype.filter = filter_1.filter; //# sourceMappingURL=filter.js.map /***/ }), -/* 569 */ +/* 570 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var filter_1 = __webpack_require__(69); +var filter_1 = __webpack_require__(70); /* tslint:enable:max-line-length */ /** * Filter items emitted by the source Observable by only emitting those that @@ -54533,24 +54889,24 @@ exports.filter = filter; //# sourceMappingURL=filter.js.map /***/ }), -/* 570 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var finally_1 = __webpack_require__(571); +var finally_1 = __webpack_require__(572); Observable_1.Observable.prototype.finally = finally_1._finally; Observable_1.Observable.prototype._finally = finally_1._finally; //# sourceMappingURL=finally.js.map /***/ }), -/* 571 */ +/* 572 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var finalize_1 = __webpack_require__(255); +var finalize_1 = __webpack_require__(256); /** * Returns an Observable that mirrors the source Observable, but will call a specified function when * the source terminates on complete or error. @@ -54566,23 +54922,23 @@ exports._finally = _finally; //# sourceMappingURL=finally.js.map /***/ }), -/* 572 */ +/* 573 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var find_1 = __webpack_require__(573); +var find_1 = __webpack_require__(574); Observable_1.Observable.prototype.find = find_1.find; //# sourceMappingURL=find.js.map /***/ }), -/* 573 */ +/* 574 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var find_1 = __webpack_require__(70); +var find_1 = __webpack_require__(71); /* tslint:enable:max-line-length */ /** * Emits only the first value emitted by the source Observable that meets some @@ -54624,23 +54980,23 @@ exports.find = find; //# sourceMappingURL=find.js.map /***/ }), -/* 574 */ +/* 575 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var findIndex_1 = __webpack_require__(575); +var findIndex_1 = __webpack_require__(576); Observable_1.Observable.prototype.findIndex = findIndex_1.findIndex; //# sourceMappingURL=findIndex.js.map /***/ }), -/* 575 */ +/* 576 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var findIndex_1 = __webpack_require__(256); +var findIndex_1 = __webpack_require__(257); /** * Emits only the index of the first value emitted by the source Observable that * meets some condition. @@ -54682,23 +55038,23 @@ exports.findIndex = findIndex; //# sourceMappingURL=findIndex.js.map /***/ }), -/* 576 */ +/* 577 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var first_1 = __webpack_require__(577); +var first_1 = __webpack_require__(578); Observable_1.Observable.prototype.first = first_1.first; //# sourceMappingURL=first.js.map /***/ }), -/* 577 */ +/* 578 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var first_1 = __webpack_require__(257); +var first_1 = __webpack_require__(258); /** * Emits only the first value (or the first value that meets some condition) * emitted by the source Observable. @@ -54755,23 +55111,23 @@ exports.first = first; //# sourceMappingURL=first.js.map /***/ }), -/* 578 */ +/* 579 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var groupBy_1 = __webpack_require__(579); +var groupBy_1 = __webpack_require__(580); Observable_1.Observable.prototype.groupBy = groupBy_1.groupBy; //# sourceMappingURL=groupBy.js.map /***/ }), -/* 579 */ +/* 580 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var groupBy_1 = __webpack_require__(258); +var groupBy_1 = __webpack_require__(259); exports.GroupedObservable = groupBy_1.GroupedObservable; /* tslint:enable:max-line-length */ /** @@ -54848,18 +55204,18 @@ exports.groupBy = groupBy; //# sourceMappingURL=groupBy.js.map /***/ }), -/* 580 */ +/* 581 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var root_1 = __webpack_require__(12); -var MapPolyfill_1 = __webpack_require__(581); +var MapPolyfill_1 = __webpack_require__(582); exports.Map = root_1.root.Map || (function () { return MapPolyfill_1.MapPolyfill; })(); //# sourceMappingURL=Map.js.map /***/ }), -/* 581 */ +/* 582 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -54912,7 +55268,7 @@ exports.MapPolyfill = MapPolyfill; //# sourceMappingURL=MapPolyfill.js.map /***/ }), -/* 582 */ +/* 583 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -54949,23 +55305,23 @@ exports.FastMap = FastMap; //# sourceMappingURL=FastMap.js.map /***/ }), -/* 583 */ +/* 584 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var ignoreElements_1 = __webpack_require__(584); +var ignoreElements_1 = __webpack_require__(585); Observable_1.Observable.prototype.ignoreElements = ignoreElements_1.ignoreElements; //# sourceMappingURL=ignoreElements.js.map /***/ }), -/* 584 */ +/* 585 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ignoreElements_1 = __webpack_require__(259); +var ignoreElements_1 = __webpack_require__(260); /** * Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`. * @@ -54984,23 +55340,23 @@ exports.ignoreElements = ignoreElements; //# sourceMappingURL=ignoreElements.js.map /***/ }), -/* 585 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var isEmpty_1 = __webpack_require__(586); +var isEmpty_1 = __webpack_require__(587); Observable_1.Observable.prototype.isEmpty = isEmpty_1.isEmpty; //# sourceMappingURL=isEmpty.js.map /***/ }), -/* 586 */ +/* 587 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isEmpty_1 = __webpack_require__(260); +var isEmpty_1 = __webpack_require__(261); /** * If the source Observable is empty it returns an Observable that emits true, otherwise it emits false. * @@ -55017,23 +55373,23 @@ exports.isEmpty = isEmpty; //# sourceMappingURL=isEmpty.js.map /***/ }), -/* 587 */ +/* 588 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var audit_1 = __webpack_require__(588); +var audit_1 = __webpack_require__(589); Observable_1.Observable.prototype.audit = audit_1.audit; //# sourceMappingURL=audit.js.map /***/ }), -/* 588 */ +/* 589 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var audit_1 = __webpack_require__(71); +var audit_1 = __webpack_require__(72); /** * Ignores source values for a duration determined by another Observable, then * emits the most recent value from the source Observable, then repeats this @@ -55081,24 +55437,24 @@ exports.audit = audit; //# sourceMappingURL=audit.js.map /***/ }), -/* 589 */ +/* 590 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var auditTime_1 = __webpack_require__(590); +var auditTime_1 = __webpack_require__(591); Observable_1.Observable.prototype.auditTime = auditTime_1.auditTime; //# sourceMappingURL=auditTime.js.map /***/ }), -/* 590 */ +/* 591 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var auditTime_1 = __webpack_require__(261); +var auditTime_1 = __webpack_require__(262); /** * Ignores source values for `duration` milliseconds, then emits the most recent * value from the source Observable, then repeats this process. @@ -55149,23 +55505,23 @@ exports.auditTime = auditTime; //# sourceMappingURL=auditTime.js.map /***/ }), -/* 591 */ +/* 592 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var last_1 = __webpack_require__(592); +var last_1 = __webpack_require__(593); Observable_1.Observable.prototype.last = last_1.last; //# sourceMappingURL=last.js.map /***/ }), -/* 592 */ +/* 593 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var last_1 = __webpack_require__(262); +var last_1 = __webpack_require__(263); /* tslint:enable:max-line-length */ /** * Returns an Observable that emits only the last item emitted by the source Observable. @@ -55191,19 +55547,19 @@ exports.last = last; //# sourceMappingURL=last.js.map /***/ }), -/* 593 */ +/* 594 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var let_1 = __webpack_require__(594); +var let_1 = __webpack_require__(595); Observable_1.Observable.prototype.let = let_1.letProto; Observable_1.Observable.prototype.letBind = let_1.letProto; //# sourceMappingURL=let.js.map /***/ }), -/* 594 */ +/* 595 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55221,23 +55577,23 @@ exports.letProto = letProto; //# sourceMappingURL=let.js.map /***/ }), -/* 595 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var every_1 = __webpack_require__(596); +var every_1 = __webpack_require__(597); Observable_1.Observable.prototype.every = every_1.every; //# sourceMappingURL=every.js.map /***/ }), -/* 596 */ +/* 597 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var every_1 = __webpack_require__(263); +var every_1 = __webpack_require__(264); /** * Returns an Observable that emits whether or not every item of the source satisfies the condition specified. * @@ -55259,23 +55615,23 @@ exports.every = every; //# sourceMappingURL=every.js.map /***/ }), -/* 597 */ +/* 598 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var map_1 = __webpack_require__(598); +var map_1 = __webpack_require__(599); Observable_1.Observable.prototype.map = map_1.map; //# sourceMappingURL=map.js.map /***/ }), -/* 598 */ +/* 599 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var map_1 = __webpack_require__(33); +var map_1 = __webpack_require__(34); /** * Applies a given `project` function to each value emitted by the source * Observable, and emits the resulting values as an Observable. @@ -55316,23 +55672,23 @@ exports.map = map; //# sourceMappingURL=map.js.map /***/ }), -/* 599 */ +/* 600 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var mapTo_1 = __webpack_require__(600); +var mapTo_1 = __webpack_require__(601); Observable_1.Observable.prototype.mapTo = mapTo_1.mapTo; //# sourceMappingURL=mapTo.js.map /***/ }), -/* 600 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var mapTo_1 = __webpack_require__(264); +var mapTo_1 = __webpack_require__(265); /** * Emits the given constant value on the output Observable every time the source * Observable emits a value. @@ -55366,23 +55722,23 @@ exports.mapTo = mapTo; //# sourceMappingURL=mapTo.js.map /***/ }), -/* 601 */ +/* 602 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var materialize_1 = __webpack_require__(602); +var materialize_1 = __webpack_require__(603); Observable_1.Observable.prototype.materialize = materialize_1.materialize; //# sourceMappingURL=materialize.js.map /***/ }), -/* 602 */ +/* 603 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var materialize_1 = __webpack_require__(265); +var materialize_1 = __webpack_require__(266); /** * Represents all of the notifications from the source Observable as `next` * emissions marked with their original types within {@link Notification} @@ -55434,23 +55790,23 @@ exports.materialize = materialize; //# sourceMappingURL=materialize.js.map /***/ }), -/* 603 */ +/* 604 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var max_1 = __webpack_require__(604); +var max_1 = __webpack_require__(605); Observable_1.Observable.prototype.max = max_1.max; //# sourceMappingURL=max.js.map /***/ }), -/* 604 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var max_1 = __webpack_require__(266); +var max_1 = __webpack_require__(267); /** * The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function), * and when source Observable completes it emits a single item: the item with the largest value. @@ -55489,24 +55845,24 @@ exports.max = max; //# sourceMappingURL=max.js.map /***/ }), -/* 605 */ +/* 606 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var merge_1 = __webpack_require__(606); +var merge_1 = __webpack_require__(607); Observable_1.Observable.prototype.merge = merge_1.merge; //# sourceMappingURL=merge.js.map /***/ }), -/* 606 */ +/* 607 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var merge_1 = __webpack_require__(267); -var merge_2 = __webpack_require__(46); +var merge_1 = __webpack_require__(268); +var merge_2 = __webpack_require__(47); exports.mergeStatic = merge_2.merge; /* tslint:enable:max-line-length */ /** @@ -55566,23 +55922,23 @@ exports.merge = merge; //# sourceMappingURL=merge.js.map /***/ }), -/* 607 */ +/* 608 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var mergeAll_1 = __webpack_require__(608); +var mergeAll_1 = __webpack_require__(609); Observable_1.Observable.prototype.mergeAll = mergeAll_1.mergeAll; //# sourceMappingURL=mergeAll.js.map /***/ }), -/* 608 */ +/* 609 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var mergeAll_1 = __webpack_require__(45); +var mergeAll_1 = __webpack_require__(46); /** * Converts a higher-order Observable into a first-order Observable which * concurrently delivers all values that are emitted on the inner Observables. @@ -55635,24 +55991,24 @@ exports.mergeAll = mergeAll; //# sourceMappingURL=mergeAll.js.map /***/ }), -/* 609 */ +/* 610 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var mergeMap_1 = __webpack_require__(610); +var mergeMap_1 = __webpack_require__(611); Observable_1.Observable.prototype.mergeMap = mergeMap_1.mergeMap; Observable_1.Observable.prototype.flatMap = mergeMap_1.mergeMap; //# sourceMappingURL=mergeMap.js.map /***/ }), -/* 610 */ +/* 611 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var mergeMap_1 = __webpack_require__(29); +var mergeMap_1 = __webpack_require__(30); /* tslint:enable:max-line-length */ /** * Projects each source value to an Observable which is merged in the output @@ -55720,24 +56076,24 @@ exports.mergeMap = mergeMap; //# sourceMappingURL=mergeMap.js.map /***/ }), -/* 611 */ +/* 612 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var mergeMapTo_1 = __webpack_require__(612); +var mergeMapTo_1 = __webpack_require__(613); Observable_1.Observable.prototype.flatMapTo = mergeMapTo_1.mergeMapTo; Observable_1.Observable.prototype.mergeMapTo = mergeMapTo_1.mergeMapTo; //# sourceMappingURL=mergeMapTo.js.map /***/ }), -/* 612 */ +/* 613 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var mergeMapTo_1 = __webpack_require__(268); +var mergeMapTo_1 = __webpack_require__(269); /* tslint:enable:max-line-length */ /** * Projects each source value to the same Observable which is merged multiple @@ -55790,23 +56146,23 @@ exports.mergeMapTo = mergeMapTo; //# sourceMappingURL=mergeMapTo.js.map /***/ }), -/* 613 */ +/* 614 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var mergeScan_1 = __webpack_require__(614); +var mergeScan_1 = __webpack_require__(615); Observable_1.Observable.prototype.mergeScan = mergeScan_1.mergeScan; //# sourceMappingURL=mergeScan.js.map /***/ }), -/* 614 */ +/* 615 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var mergeScan_1 = __webpack_require__(269); +var mergeScan_1 = __webpack_require__(270); /** * Applies an accumulator function over the source Observable where the * accumulator function itself returns an Observable, then each intermediate @@ -55846,23 +56202,23 @@ exports.mergeScan = mergeScan; //# sourceMappingURL=mergeScan.js.map /***/ }), -/* 615 */ +/* 616 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var min_1 = __webpack_require__(616); +var min_1 = __webpack_require__(617); Observable_1.Observable.prototype.min = min_1.min; //# sourceMappingURL=min.js.map /***/ }), -/* 616 */ +/* 617 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var min_1 = __webpack_require__(270); +var min_1 = __webpack_require__(271); /** * The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function), * and when source Observable completes it emits a single item: the item with the smallest value. @@ -55901,23 +56257,23 @@ exports.min = min; //# sourceMappingURL=min.js.map /***/ }), -/* 617 */ +/* 618 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var multicast_1 = __webpack_require__(618); +var multicast_1 = __webpack_require__(619); Observable_1.Observable.prototype.multicast = multicast_1.multicast; //# sourceMappingURL=multicast.js.map /***/ }), -/* 618 */ +/* 619 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var multicast_1 = __webpack_require__(19); +var multicast_1 = __webpack_require__(20); /* tslint:enable:max-line-length */ /** * Allows source Observable to be subscribed only once with a Subject of choice, @@ -56020,23 +56376,23 @@ exports.multicast = multicast; //# sourceMappingURL=multicast.js.map /***/ }), -/* 619 */ +/* 620 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var observeOn_1 = __webpack_require__(620); +var observeOn_1 = __webpack_require__(621); Observable_1.Observable.prototype.observeOn = observeOn_1.observeOn; //# sourceMappingURL=observeOn.js.map /***/ }), -/* 620 */ +/* 621 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var observeOn_1 = __webpack_require__(44); +var observeOn_1 = __webpack_require__(45); /** * * Re-emits all notifications from source Observable with specified scheduler. @@ -56091,23 +56447,23 @@ exports.observeOn = observeOn; //# sourceMappingURL=observeOn.js.map /***/ }), -/* 621 */ +/* 622 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var onErrorResumeNext_1 = __webpack_require__(622); +var onErrorResumeNext_1 = __webpack_require__(623); Observable_1.Observable.prototype.onErrorResumeNext = onErrorResumeNext_1.onErrorResumeNext; //# sourceMappingURL=onErrorResumeNext.js.map /***/ }), -/* 622 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var onErrorResumeNext_1 = __webpack_require__(65); +var onErrorResumeNext_1 = __webpack_require__(66); /* tslint:enable:max-line-length */ /** * When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one @@ -56181,23 +56537,23 @@ exports.onErrorResumeNext = onErrorResumeNext; //# sourceMappingURL=onErrorResumeNext.js.map /***/ }), -/* 623 */ +/* 624 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var pairwise_1 = __webpack_require__(624); +var pairwise_1 = __webpack_require__(625); Observable_1.Observable.prototype.pairwise = pairwise_1.pairwise; //# sourceMappingURL=pairwise.js.map /***/ }), -/* 624 */ +/* 625 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var pairwise_1 = __webpack_require__(272); +var pairwise_1 = __webpack_require__(273); /** * Groups pairs of consecutive emissions together and emits them as an array of * two values. @@ -56240,23 +56596,23 @@ exports.pairwise = pairwise; //# sourceMappingURL=pairwise.js.map /***/ }), -/* 625 */ +/* 626 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var partition_1 = __webpack_require__(626); +var partition_1 = __webpack_require__(627); Observable_1.Observable.prototype.partition = partition_1.partition; //# sourceMappingURL=partition.js.map /***/ }), -/* 626 */ +/* 627 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var partition_1 = __webpack_require__(273); +var partition_1 = __webpack_require__(274); /** * Splits the source Observable into two, one with values that satisfy a * predicate, and another with values that don't satisfy the predicate. @@ -56305,7 +56661,7 @@ exports.partition = partition; //# sourceMappingURL=partition.js.map /***/ }), -/* 627 */ +/* 628 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56322,23 +56678,23 @@ exports.not = not; //# sourceMappingURL=not.js.map /***/ }), -/* 628 */ +/* 629 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var pluck_1 = __webpack_require__(629); +var pluck_1 = __webpack_require__(630); Observable_1.Observable.prototype.pluck = pluck_1.pluck; //# sourceMappingURL=pluck.js.map /***/ }), -/* 629 */ +/* 630 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var pluck_1 = __webpack_require__(274); +var pluck_1 = __webpack_require__(275); /** * Maps each source value (an object) to its specified nested property. * @@ -56376,23 +56732,23 @@ exports.pluck = pluck; //# sourceMappingURL=pluck.js.map /***/ }), -/* 630 */ +/* 631 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var publish_1 = __webpack_require__(631); +var publish_1 = __webpack_require__(632); Observable_1.Observable.prototype.publish = publish_1.publish; //# sourceMappingURL=publish.js.map /***/ }), -/* 631 */ +/* 632 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var publish_1 = __webpack_require__(275); +var publish_1 = __webpack_require__(276); /* tslint:enable:max-line-length */ /** * Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called @@ -56414,23 +56770,23 @@ exports.publish = publish; //# sourceMappingURL=publish.js.map /***/ }), -/* 632 */ +/* 633 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var publishBehavior_1 = __webpack_require__(633); +var publishBehavior_1 = __webpack_require__(634); Observable_1.Observable.prototype.publishBehavior = publishBehavior_1.publishBehavior; //# sourceMappingURL=publishBehavior.js.map /***/ }), -/* 633 */ +/* 634 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var publishBehavior_1 = __webpack_require__(276); +var publishBehavior_1 = __webpack_require__(277); /** * @param value * @return {ConnectableObservable} @@ -56444,23 +56800,23 @@ exports.publishBehavior = publishBehavior; //# sourceMappingURL=publishBehavior.js.map /***/ }), -/* 634 */ +/* 635 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var publishReplay_1 = __webpack_require__(635); +var publishReplay_1 = __webpack_require__(636); Observable_1.Observable.prototype.publishReplay = publishReplay_1.publishReplay; //# sourceMappingURL=publishReplay.js.map /***/ }), -/* 635 */ +/* 636 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var publishReplay_1 = __webpack_require__(278); +var publishReplay_1 = __webpack_require__(279); /* tslint:enable:max-line-length */ /** * @param bufferSize @@ -56478,23 +56834,23 @@ exports.publishReplay = publishReplay; //# sourceMappingURL=publishReplay.js.map /***/ }), -/* 636 */ +/* 637 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var publishLast_1 = __webpack_require__(637); +var publishLast_1 = __webpack_require__(638); Observable_1.Observable.prototype.publishLast = publishLast_1.publishLast; //# sourceMappingURL=publishLast.js.map /***/ }), -/* 637 */ +/* 638 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var publishLast_1 = __webpack_require__(279); +var publishLast_1 = __webpack_require__(280); /** * @return {ConnectableObservable} * @method publishLast @@ -56508,25 +56864,25 @@ exports.publishLast = publishLast; //# sourceMappingURL=publishLast.js.map /***/ }), -/* 638 */ +/* 639 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var race_1 = __webpack_require__(639); +var race_1 = __webpack_require__(640); Observable_1.Observable.prototype.race = race_1.race; //# sourceMappingURL=race.js.map /***/ }), -/* 639 */ +/* 640 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var race_1 = __webpack_require__(280); +var race_1 = __webpack_require__(281); // NOTE: to support backwards compatability with 5.4.* and lower -var race_2 = __webpack_require__(64); +var race_2 = __webpack_require__(65); exports.raceStatic = race_2.race; /* tslint:enable:max-line-length */ /** @@ -56548,23 +56904,23 @@ exports.race = race; //# sourceMappingURL=race.js.map /***/ }), -/* 640 */ +/* 641 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var reduce_1 = __webpack_require__(641); +var reduce_1 = __webpack_require__(642); Observable_1.Observable.prototype.reduce = reduce_1.reduce; //# sourceMappingURL=reduce.js.map /***/ }), -/* 641 */ +/* 642 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var reduce_1 = __webpack_require__(35); +var reduce_1 = __webpack_require__(36); /* tslint:enable:max-line-length */ /** * Applies an accumulator function over the source Observable, and returns the @@ -56625,23 +56981,23 @@ exports.reduce = reduce; //# sourceMappingURL=reduce.js.map /***/ }), -/* 642 */ +/* 643 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var repeat_1 = __webpack_require__(643); +var repeat_1 = __webpack_require__(644); Observable_1.Observable.prototype.repeat = repeat_1.repeat; //# sourceMappingURL=repeat.js.map /***/ }), -/* 643 */ +/* 644 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var repeat_1 = __webpack_require__(281); +var repeat_1 = __webpack_require__(282); /** * Returns an Observable that repeats the stream of items emitted by the source Observable at most count times. * @@ -56662,23 +57018,23 @@ exports.repeat = repeat; //# sourceMappingURL=repeat.js.map /***/ }), -/* 644 */ +/* 645 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var repeatWhen_1 = __webpack_require__(645); +var repeatWhen_1 = __webpack_require__(646); Observable_1.Observable.prototype.repeatWhen = repeatWhen_1.repeatWhen; //# sourceMappingURL=repeatWhen.js.map /***/ }), -/* 645 */ +/* 646 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var repeatWhen_1 = __webpack_require__(282); +var repeatWhen_1 = __webpack_require__(283); /** * Returns an Observable that mirrors the source Observable with the exception of a `complete`. If the source * Observable calls `complete`, this method will emit to the Observable returned from `notifier`. If that Observable @@ -56700,23 +57056,23 @@ exports.repeatWhen = repeatWhen; //# sourceMappingURL=repeatWhen.js.map /***/ }), -/* 646 */ +/* 647 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var retry_1 = __webpack_require__(647); +var retry_1 = __webpack_require__(648); Observable_1.Observable.prototype.retry = retry_1.retry; //# sourceMappingURL=retry.js.map /***/ }), -/* 647 */ +/* 648 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var retry_1 = __webpack_require__(283); +var retry_1 = __webpack_require__(284); /** * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable * calls `error`, this method will resubscribe to the source Observable for a maximum of `count` resubscriptions (given @@ -56741,23 +57097,23 @@ exports.retry = retry; //# sourceMappingURL=retry.js.map /***/ }), -/* 648 */ +/* 649 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var retryWhen_1 = __webpack_require__(649); +var retryWhen_1 = __webpack_require__(650); Observable_1.Observable.prototype.retryWhen = retryWhen_1.retryWhen; //# sourceMappingURL=retryWhen.js.map /***/ }), -/* 649 */ +/* 650 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var retryWhen_1 = __webpack_require__(284); +var retryWhen_1 = __webpack_require__(285); /** * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable * calls `error`, this method will emit the Throwable that caused the error to the Observable returned from `notifier`. @@ -56779,23 +57135,23 @@ exports.retryWhen = retryWhen; //# sourceMappingURL=retryWhen.js.map /***/ }), -/* 650 */ +/* 651 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var sample_1 = __webpack_require__(651); +var sample_1 = __webpack_require__(652); Observable_1.Observable.prototype.sample = sample_1.sample; //# sourceMappingURL=sample.js.map /***/ }), -/* 651 */ +/* 652 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var sample_1 = __webpack_require__(285); +var sample_1 = __webpack_require__(286); /** * Emits the most recently emitted value from the source Observable whenever * another Observable, the `notifier`, emits. @@ -56837,24 +57193,24 @@ exports.sample = sample; //# sourceMappingURL=sample.js.map /***/ }), -/* 652 */ +/* 653 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var sampleTime_1 = __webpack_require__(653); +var sampleTime_1 = __webpack_require__(654); Observable_1.Observable.prototype.sampleTime = sampleTime_1.sampleTime; //# sourceMappingURL=sampleTime.js.map /***/ }), -/* 653 */ +/* 654 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var sampleTime_1 = __webpack_require__(286); +var sampleTime_1 = __webpack_require__(287); /** * Emits the most recently emitted value from the source Observable within * periodic time intervals. @@ -56899,23 +57255,23 @@ exports.sampleTime = sampleTime; //# sourceMappingURL=sampleTime.js.map /***/ }), -/* 654 */ +/* 655 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var scan_1 = __webpack_require__(655); +var scan_1 = __webpack_require__(656); Observable_1.Observable.prototype.scan = scan_1.scan; //# sourceMappingURL=scan.js.map /***/ }), -/* 655 */ +/* 656 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var scan_1 = __webpack_require__(72); +var scan_1 = __webpack_require__(73); /* tslint:enable:max-line-length */ /** * Applies an accumulator function over the source Observable, and returns each @@ -56964,23 +57320,23 @@ exports.scan = scan; //# sourceMappingURL=scan.js.map /***/ }), -/* 656 */ +/* 657 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var sequenceEqual_1 = __webpack_require__(657); +var sequenceEqual_1 = __webpack_require__(658); Observable_1.Observable.prototype.sequenceEqual = sequenceEqual_1.sequenceEqual; //# sourceMappingURL=sequenceEqual.js.map /***/ }), -/* 657 */ +/* 658 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var sequenceEqual_1 = __webpack_require__(287); +var sequenceEqual_1 = __webpack_require__(288); /** * Compares all values of two observables in sequence using an optional comparor function * and returns an observable of a single boolean value representing whether or not the two sequences @@ -57040,23 +57396,23 @@ exports.sequenceEqual = sequenceEqual; //# sourceMappingURL=sequenceEqual.js.map /***/ }), -/* 658 */ +/* 659 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var share_1 = __webpack_require__(659); +var share_1 = __webpack_require__(660); Observable_1.Observable.prototype.share = share_1.share; //# sourceMappingURL=share.js.map /***/ }), -/* 659 */ +/* 660 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var share_1 = __webpack_require__(288); +var share_1 = __webpack_require__(289); /** * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will @@ -57081,23 +57437,23 @@ exports.share = share; //# sourceMappingURL=share.js.map /***/ }), -/* 660 */ +/* 661 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var shareReplay_1 = __webpack_require__(661); +var shareReplay_1 = __webpack_require__(662); Observable_1.Observable.prototype.shareReplay = shareReplay_1.shareReplay; //# sourceMappingURL=shareReplay.js.map /***/ }), -/* 661 */ +/* 662 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var shareReplay_1 = __webpack_require__(289); +var shareReplay_1 = __webpack_require__(290); /** * @method shareReplay * @owner Observable @@ -57110,23 +57466,23 @@ exports.shareReplay = shareReplay; //# sourceMappingURL=shareReplay.js.map /***/ }), -/* 662 */ +/* 663 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var single_1 = __webpack_require__(663); +var single_1 = __webpack_require__(664); Observable_1.Observable.prototype.single = single_1.single; //# sourceMappingURL=single.js.map /***/ }), -/* 663 */ +/* 664 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var single_1 = __webpack_require__(290); +var single_1 = __webpack_require__(291); /** * Returns an Observable that emits the single item emitted by the source Observable that matches a specified * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no @@ -57150,23 +57506,23 @@ exports.single = single; //# sourceMappingURL=single.js.map /***/ }), -/* 664 */ +/* 665 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var skip_1 = __webpack_require__(665); +var skip_1 = __webpack_require__(666); Observable_1.Observable.prototype.skip = skip_1.skip; //# sourceMappingURL=skip.js.map /***/ }), -/* 665 */ +/* 666 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var skip_1 = __webpack_require__(291); +var skip_1 = __webpack_require__(292); /** * Returns an Observable that skips the first `count` items emitted by the source Observable. * @@ -57185,23 +57541,23 @@ exports.skip = skip; //# sourceMappingURL=skip.js.map /***/ }), -/* 666 */ +/* 667 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var skipLast_1 = __webpack_require__(667); +var skipLast_1 = __webpack_require__(668); Observable_1.Observable.prototype.skipLast = skipLast_1.skipLast; //# sourceMappingURL=skipLast.js.map /***/ }), -/* 667 */ +/* 668 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var skipLast_1 = __webpack_require__(292); +var skipLast_1 = __webpack_require__(293); /** * Skip the last `count` values emitted by the source Observable. * @@ -57241,23 +57597,23 @@ exports.skipLast = skipLast; //# sourceMappingURL=skipLast.js.map /***/ }), -/* 668 */ +/* 669 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var skipUntil_1 = __webpack_require__(669); +var skipUntil_1 = __webpack_require__(670); Observable_1.Observable.prototype.skipUntil = skipUntil_1.skipUntil; //# sourceMappingURL=skipUntil.js.map /***/ }), -/* 669 */ +/* 670 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var skipUntil_1 = __webpack_require__(293); +var skipUntil_1 = __webpack_require__(294); /** * Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item. * @@ -57277,23 +57633,23 @@ exports.skipUntil = skipUntil; //# sourceMappingURL=skipUntil.js.map /***/ }), -/* 670 */ +/* 671 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var skipWhile_1 = __webpack_require__(671); +var skipWhile_1 = __webpack_require__(672); Observable_1.Observable.prototype.skipWhile = skipWhile_1.skipWhile; //# sourceMappingURL=skipWhile.js.map /***/ }), -/* 671 */ +/* 672 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var skipWhile_1 = __webpack_require__(294); +var skipWhile_1 = __webpack_require__(295); /** * Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds * true, but emits all further source items as soon as the condition becomes false. @@ -57313,23 +57669,23 @@ exports.skipWhile = skipWhile; //# sourceMappingURL=skipWhile.js.map /***/ }), -/* 672 */ +/* 673 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var startWith_1 = __webpack_require__(673); +var startWith_1 = __webpack_require__(674); Observable_1.Observable.prototype.startWith = startWith_1.startWith; //# sourceMappingURL=startWith.js.map /***/ }), -/* 673 */ +/* 674 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var startWith_1 = __webpack_require__(295); +var startWith_1 = __webpack_require__(296); /* tslint:enable:max-line-length */ /** * Returns an Observable that emits the items you specify as arguments before it begins to emit @@ -57356,23 +57712,23 @@ exports.startWith = startWith; //# sourceMappingURL=startWith.js.map /***/ }), -/* 674 */ +/* 675 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var subscribeOn_1 = __webpack_require__(675); +var subscribeOn_1 = __webpack_require__(676); Observable_1.Observable.prototype.subscribeOn = subscribeOn_1.subscribeOn; //# sourceMappingURL=subscribeOn.js.map /***/ }), -/* 675 */ +/* 676 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var subscribeOn_1 = __webpack_require__(676); +var subscribeOn_1 = __webpack_require__(677); /** * Asynchronously subscribes Observers to this Observable on the specified IScheduler. * @@ -57392,12 +57748,12 @@ exports.subscribeOn = subscribeOn; //# sourceMappingURL=subscribeOn.js.map /***/ }), -/* 676 */ +/* 677 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var SubscribeOnObservable_1 = __webpack_require__(677); +var SubscribeOnObservable_1 = __webpack_require__(678); /** * Asynchronously subscribes Observers to this Observable on the specified IScheduler. * @@ -57429,7 +57785,7 @@ var SubscribeOnOperator = (function () { //# sourceMappingURL=subscribeOn.js.map /***/ }), -/* 677 */ +/* 678 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57440,8 +57796,8 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Observable_1 = __webpack_require__(0); -var asap_1 = __webpack_require__(296); -var isNumeric_1 = __webpack_require__(30); +var asap_1 = __webpack_require__(297); +var isNumeric_1 = __webpack_require__(31); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} @@ -57486,7 +57842,7 @@ exports.SubscribeOnObservable = SubscribeOnObservable; //# sourceMappingURL=SubscribeOnObservable.js.map /***/ }), -/* 678 */ +/* 679 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57496,8 +57852,8 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var Immediate_1 = __webpack_require__(679); -var AsyncAction_1 = __webpack_require__(31); +var Immediate_1 = __webpack_require__(680); +var AsyncAction_1 = __webpack_require__(32); /** * We need this JSDoc comment for affecting ESDoc. * @ignore @@ -57547,7 +57903,7 @@ exports.AsapAction = AsapAction; //# sourceMappingURL=AsapAction.js.map /***/ }), -/* 679 */ +/* 680 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57762,7 +58118,7 @@ exports.Immediate = new ImmediateDefinition(root_1.root); //# sourceMappingURL=Immediate.js.map /***/ }), -/* 680 */ +/* 681 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57772,7 +58128,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var AsyncScheduler_1 = __webpack_require__(32); +var AsyncScheduler_1 = __webpack_require__(33); var AsapScheduler = (function (_super) { __extends(AsapScheduler, _super); function AsapScheduler() { @@ -57805,24 +58161,24 @@ exports.AsapScheduler = AsapScheduler; //# sourceMappingURL=AsapScheduler.js.map /***/ }), -/* 681 */ +/* 682 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var switch_1 = __webpack_require__(682); +var switch_1 = __webpack_require__(683); Observable_1.Observable.prototype.switch = switch_1._switch; Observable_1.Observable.prototype._switch = switch_1._switch; //# sourceMappingURL=switch.js.map /***/ }), -/* 682 */ +/* 683 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var switchAll_1 = __webpack_require__(297); +var switchAll_1 = __webpack_require__(298); /** * Converts a higher-order Observable into a first-order Observable by * subscribing to only the most recently emitted of those inner Observables. @@ -57872,23 +58228,23 @@ exports._switch = _switch; //# sourceMappingURL=switch.js.map /***/ }), -/* 683 */ +/* 684 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var switchMap_1 = __webpack_require__(684); +var switchMap_1 = __webpack_require__(685); Observable_1.Observable.prototype.switchMap = switchMap_1.switchMap; //# sourceMappingURL=switchMap.js.map /***/ }), -/* 684 */ +/* 685 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var switchMap_1 = __webpack_require__(75); +var switchMap_1 = __webpack_require__(76); /* tslint:enable:max-line-length */ /** * Projects each source value to an Observable which is merged in the output @@ -57944,23 +58300,23 @@ exports.switchMap = switchMap; //# sourceMappingURL=switchMap.js.map /***/ }), -/* 685 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var switchMapTo_1 = __webpack_require__(686); +var switchMapTo_1 = __webpack_require__(687); Observable_1.Observable.prototype.switchMapTo = switchMapTo_1.switchMapTo; //# sourceMappingURL=switchMapTo.js.map /***/ }), -/* 686 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var switchMapTo_1 = __webpack_require__(298); +var switchMapTo_1 = __webpack_require__(299); /* tslint:enable:max-line-length */ /** * Projects each source value to the same Observable which is flattened multiple @@ -58011,23 +58367,23 @@ exports.switchMapTo = switchMapTo; //# sourceMappingURL=switchMapTo.js.map /***/ }), -/* 687 */ +/* 688 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var take_1 = __webpack_require__(688); +var take_1 = __webpack_require__(689); Observable_1.Observable.prototype.take = take_1.take; //# sourceMappingURL=take.js.map /***/ }), -/* 688 */ +/* 689 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var take_1 = __webpack_require__(299); +var take_1 = __webpack_require__(300); /** * Emits only the first `count` values emitted by the source Observable. * @@ -58068,23 +58424,23 @@ exports.take = take; //# sourceMappingURL=take.js.map /***/ }), -/* 689 */ +/* 690 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var takeLast_1 = __webpack_require__(690); +var takeLast_1 = __webpack_require__(691); Observable_1.Observable.prototype.takeLast = takeLast_1.takeLast; //# sourceMappingURL=takeLast.js.map /***/ }), -/* 690 */ +/* 691 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var takeLast_1 = __webpack_require__(73); +var takeLast_1 = __webpack_require__(74); /** * Emits only the last `count` values emitted by the source Observable. * @@ -58128,23 +58484,23 @@ exports.takeLast = takeLast; //# sourceMappingURL=takeLast.js.map /***/ }), -/* 691 */ +/* 692 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var takeUntil_1 = __webpack_require__(692); +var takeUntil_1 = __webpack_require__(693); Observable_1.Observable.prototype.takeUntil = takeUntil_1.takeUntil; //# sourceMappingURL=takeUntil.js.map /***/ }), -/* 692 */ +/* 693 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var takeUntil_1 = __webpack_require__(300); +var takeUntil_1 = __webpack_require__(301); /** * Emits the values emitted by the source Observable until a `notifier` * Observable emits a value. @@ -58185,23 +58541,23 @@ exports.takeUntil = takeUntil; //# sourceMappingURL=takeUntil.js.map /***/ }), -/* 693 */ +/* 694 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var takeWhile_1 = __webpack_require__(694); +var takeWhile_1 = __webpack_require__(695); Observable_1.Observable.prototype.takeWhile = takeWhile_1.takeWhile; //# sourceMappingURL=takeWhile.js.map /***/ }), -/* 694 */ +/* 695 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var takeWhile_1 = __webpack_require__(301); +var takeWhile_1 = __webpack_require__(302); /** * Emits values emitted by the source Observable so long as each value satisfies * the given `predicate`, and then completes as soon as this `predicate` is not @@ -58245,23 +58601,23 @@ exports.takeWhile = takeWhile; //# sourceMappingURL=takeWhile.js.map /***/ }), -/* 695 */ +/* 696 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var throttle_1 = __webpack_require__(696); +var throttle_1 = __webpack_require__(697); Observable_1.Observable.prototype.throttle = throttle_1.throttle; //# sourceMappingURL=throttle.js.map /***/ }), -/* 696 */ +/* 697 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var throttle_1 = __webpack_require__(51); +var throttle_1 = __webpack_require__(52); /** * Emits a value from the source Observable, then ignores subsequent source * values for a duration determined by another Observable, then repeats this @@ -58310,25 +58666,25 @@ exports.throttle = throttle; //# sourceMappingURL=throttle.js.map /***/ }), -/* 697 */ +/* 698 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var throttleTime_1 = __webpack_require__(698); +var throttleTime_1 = __webpack_require__(699); Observable_1.Observable.prototype.throttleTime = throttleTime_1.throttleTime; //# sourceMappingURL=throttleTime.js.map /***/ }), -/* 698 */ +/* 699 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var throttle_1 = __webpack_require__(51); -var throttleTime_1 = __webpack_require__(302); +var throttle_1 = __webpack_require__(52); +var throttleTime_1 = __webpack_require__(303); /** * Emits a value from the source Observable, then ignores subsequent source * values for `duration` milliseconds, then repeats this process. @@ -58377,35 +58733,35 @@ exports.throttleTime = throttleTime; //# sourceMappingURL=throttleTime.js.map /***/ }), -/* 699 */ +/* 700 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var timeInterval_1 = __webpack_require__(303); +var timeInterval_1 = __webpack_require__(304); Observable_1.Observable.prototype.timeInterval = timeInterval_1.timeInterval; //# sourceMappingURL=timeInterval.js.map /***/ }), -/* 700 */ +/* 701 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var timeout_1 = __webpack_require__(701); +var timeout_1 = __webpack_require__(702); Observable_1.Observable.prototype.timeout = timeout_1.timeout; //# sourceMappingURL=timeout.js.map /***/ }), -/* 701 */ +/* 702 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var timeout_1 = __webpack_require__(305); +var timeout_1 = __webpack_require__(306); /** * * Errors if Observable does not emit a value in given time span. @@ -58479,24 +58835,24 @@ exports.timeout = timeout; //# sourceMappingURL=timeout.js.map /***/ }), -/* 702 */ +/* 703 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var timeoutWith_1 = __webpack_require__(703); +var timeoutWith_1 = __webpack_require__(704); Observable_1.Observable.prototype.timeoutWith = timeoutWith_1.timeoutWith; //# sourceMappingURL=timeoutWith.js.map /***/ }), -/* 703 */ +/* 704 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var timeoutWith_1 = __webpack_require__(307); +var timeoutWith_1 = __webpack_require__(308); /* tslint:enable:max-line-length */ /** * @@ -58553,24 +58909,24 @@ exports.timeoutWith = timeoutWith; //# sourceMappingURL=timeoutWith.js.map /***/ }), -/* 704 */ +/* 705 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var timestamp_1 = __webpack_require__(705); +var timestamp_1 = __webpack_require__(706); Observable_1.Observable.prototype.timestamp = timestamp_1.timestamp; //# sourceMappingURL=timestamp.js.map /***/ }), -/* 705 */ +/* 706 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var timestamp_1 = __webpack_require__(76); +var timestamp_1 = __webpack_require__(77); /** * @param scheduler * @return {Observable>|WebSocketSubject|Observable} @@ -58585,23 +58941,23 @@ exports.timestamp = timestamp; //# sourceMappingURL=timestamp.js.map /***/ }), -/* 706 */ +/* 707 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var toArray_1 = __webpack_require__(707); +var toArray_1 = __webpack_require__(708); Observable_1.Observable.prototype.toArray = toArray_1.toArray; //# sourceMappingURL=toArray.js.map /***/ }), -/* 707 */ +/* 708 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var toArray_1 = __webpack_require__(308); +var toArray_1 = __webpack_require__(309); /** * Collects all source emissions and emits them as an array when the source completes. * @@ -58632,7 +58988,7 @@ exports.toArray = toArray; //# sourceMappingURL=toArray.js.map /***/ }), -/* 708 */ +/* 709 */ /***/ (function(module, exports) { // HACK: does nothing, because `toPromise` now lives on the `Observable` itself. @@ -58640,23 +58996,23 @@ exports.toArray = toArray; //# sourceMappingURL=toPromise.js.map /***/ }), -/* 709 */ +/* 710 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var window_1 = __webpack_require__(710); +var window_1 = __webpack_require__(711); Observable_1.Observable.prototype.window = window_1.window; //# sourceMappingURL=window.js.map /***/ }), -/* 710 */ +/* 711 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var window_1 = __webpack_require__(309); +var window_1 = __webpack_require__(310); /** * Branch out the source Observable values as a nested Observable whenever * `windowBoundaries` emits. @@ -58700,23 +59056,23 @@ exports.window = window; //# sourceMappingURL=window.js.map /***/ }), -/* 711 */ +/* 712 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var windowCount_1 = __webpack_require__(712); +var windowCount_1 = __webpack_require__(713); Observable_1.Observable.prototype.windowCount = windowCount_1.windowCount; //# sourceMappingURL=windowCount.js.map /***/ }), -/* 712 */ +/* 713 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var windowCount_1 = __webpack_require__(310); +var windowCount_1 = __webpack_require__(311); /** * Branch out the source Observable values as a nested Observable with each * nested Observable emitting at most `windowSize` values. @@ -58773,26 +59129,26 @@ exports.windowCount = windowCount; //# sourceMappingURL=windowCount.js.map /***/ }), -/* 713 */ +/* 714 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var windowTime_1 = __webpack_require__(714); +var windowTime_1 = __webpack_require__(715); Observable_1.Observable.prototype.windowTime = windowTime_1.windowTime; //# sourceMappingURL=windowTime.js.map /***/ }), -/* 714 */ +/* 715 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var async_1 = __webpack_require__(6); -var isNumeric_1 = __webpack_require__(30); +var isNumeric_1 = __webpack_require__(31); var isScheduler_1 = __webpack_require__(15); -var windowTime_1 = __webpack_require__(311); +var windowTime_1 = __webpack_require__(312); function windowTime(windowTimeSpan) { var scheduler = async_1.async; var windowCreationInterval = null; @@ -58818,23 +59174,23 @@ exports.windowTime = windowTime; //# sourceMappingURL=windowTime.js.map /***/ }), -/* 715 */ +/* 716 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var windowToggle_1 = __webpack_require__(716); +var windowToggle_1 = __webpack_require__(717); Observable_1.Observable.prototype.windowToggle = windowToggle_1.windowToggle; //# sourceMappingURL=windowToggle.js.map /***/ }), -/* 716 */ +/* 717 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var windowToggle_1 = __webpack_require__(312); +var windowToggle_1 = __webpack_require__(313); /** * Branch out the source Observable values as a nested Observable starting from * an emission from `openings` and ending when the output of `closingSelector` @@ -58883,23 +59239,23 @@ exports.windowToggle = windowToggle; //# sourceMappingURL=windowToggle.js.map /***/ }), -/* 717 */ +/* 718 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var windowWhen_1 = __webpack_require__(718); +var windowWhen_1 = __webpack_require__(719); Observable_1.Observable.prototype.windowWhen = windowWhen_1.windowWhen; //# sourceMappingURL=windowWhen.js.map /***/ }), -/* 718 */ +/* 719 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var windowWhen_1 = __webpack_require__(313); +var windowWhen_1 = __webpack_require__(314); /** * Branch out the source Observable values as a nested Observable using a * factory function of closing Observables to determine when to start a new @@ -58945,23 +59301,23 @@ exports.windowWhen = windowWhen; //# sourceMappingURL=windowWhen.js.map /***/ }), -/* 719 */ +/* 720 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var withLatestFrom_1 = __webpack_require__(720); +var withLatestFrom_1 = __webpack_require__(721); Observable_1.Observable.prototype.withLatestFrom = withLatestFrom_1.withLatestFrom; //# sourceMappingURL=withLatestFrom.js.map /***/ }), -/* 720 */ +/* 721 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var withLatestFrom_1 = __webpack_require__(314); +var withLatestFrom_1 = __webpack_require__(315); /* tslint:enable:max-line-length */ /** * Combines the source Observable with other Observables to create an Observable @@ -59012,23 +59368,23 @@ exports.withLatestFrom = withLatestFrom; //# sourceMappingURL=withLatestFrom.js.map /***/ }), -/* 721 */ +/* 722 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var zip_1 = __webpack_require__(722); +var zip_1 = __webpack_require__(723); Observable_1.Observable.prototype.zip = zip_1.zipProto; //# sourceMappingURL=zip.js.map /***/ }), -/* 722 */ +/* 723 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var zip_1 = __webpack_require__(48); +var zip_1 = __webpack_require__(49); /* tslint:enable:max-line-length */ /** * @param observables @@ -59047,23 +59403,23 @@ exports.zipProto = zipProto; //# sourceMappingURL=zip.js.map /***/ }), -/* 723 */ +/* 724 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Observable_1 = __webpack_require__(0); -var zipAll_1 = __webpack_require__(724); +var zipAll_1 = __webpack_require__(725); Observable_1.Observable.prototype.zipAll = zipAll_1.zipAll; //# sourceMappingURL=zipAll.js.map /***/ }), -/* 724 */ +/* 725 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var zipAll_1 = __webpack_require__(315); +var zipAll_1 = __webpack_require__(316); /** * @param project * @return {Observable|WebSocketSubject|Observable} @@ -59077,7 +59433,7 @@ exports.zipAll = zipAll; //# sourceMappingURL=zipAll.js.map /***/ }), -/* 725 */ +/* 726 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59088,11 +59444,11 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Observable_1 = __webpack_require__(0); -var Notification_1 = __webpack_require__(28); -var ColdObservable_1 = __webpack_require__(726); -var HotObservable_1 = __webpack_require__(727); -var SubscriptionLog_1 = __webpack_require__(317); -var VirtualTimeScheduler_1 = __webpack_require__(319); +var Notification_1 = __webpack_require__(29); +var ColdObservable_1 = __webpack_require__(727); +var HotObservable_1 = __webpack_require__(728); +var SubscriptionLog_1 = __webpack_require__(318); +var VirtualTimeScheduler_1 = __webpack_require__(320); var defaultMaxFrame = 750; var TestScheduler = (function (_super) { __extends(TestScheduler, _super); @@ -59306,7 +59662,7 @@ exports.TestScheduler = TestScheduler; //# sourceMappingURL=TestScheduler.js.map /***/ }), -/* 726 */ +/* 727 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59318,8 +59674,8 @@ var __extends = (this && this.__extends) || function (d, b) { }; var Observable_1 = __webpack_require__(0); var Subscription_1 = __webpack_require__(8); -var SubscriptionLoggable_1 = __webpack_require__(316); -var applyMixins_1 = __webpack_require__(318); +var SubscriptionLoggable_1 = __webpack_require__(317); +var applyMixins_1 = __webpack_require__(319); /** * We need this JSDoc comment for affecting ESDoc. * @ignore @@ -59358,7 +59714,7 @@ applyMixins_1.applyMixins(ColdObservable, [SubscriptionLoggable_1.SubscriptionLo //# sourceMappingURL=ColdObservable.js.map /***/ }), -/* 727 */ +/* 728 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59370,8 +59726,8 @@ var __extends = (this && this.__extends) || function (d, b) { }; var Subject_1 = __webpack_require__(9); var Subscription_1 = __webpack_require__(8); -var SubscriptionLoggable_1 = __webpack_require__(316); -var applyMixins_1 = __webpack_require__(318); +var SubscriptionLoggable_1 = __webpack_require__(317); +var applyMixins_1 = __webpack_require__(319); /** * We need this JSDoc comment for affecting ESDoc. * @ignore @@ -59412,13 +59768,13 @@ applyMixins_1.applyMixins(HotObservable, [SubscriptionLoggable_1.SubscriptionLog //# sourceMappingURL=HotObservable.js.map /***/ }), -/* 728 */ +/* 729 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var AnimationFrameAction_1 = __webpack_require__(729); -var AnimationFrameScheduler_1 = __webpack_require__(731); +var AnimationFrameAction_1 = __webpack_require__(730); +var AnimationFrameScheduler_1 = __webpack_require__(732); /** * * Animation Frame Scheduler @@ -59453,7 +59809,7 @@ exports.animationFrame = new AnimationFrameScheduler_1.AnimationFrameScheduler(A //# sourceMappingURL=animationFrame.js.map /***/ }), -/* 729 */ +/* 730 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59463,8 +59819,8 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var AsyncAction_1 = __webpack_require__(31); -var AnimationFrame_1 = __webpack_require__(730); +var AsyncAction_1 = __webpack_require__(32); +var AnimationFrame_1 = __webpack_require__(731); /** * We need this JSDoc comment for affecting ESDoc. * @ignore @@ -59514,7 +59870,7 @@ exports.AnimationFrameAction = AnimationFrameAction; //# sourceMappingURL=AnimationFrameAction.js.map /***/ }), -/* 730 */ +/* 731 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59554,7 +59910,7 @@ exports.AnimationFrame = new RequestAnimationFrameDefinition(root_1.root); //# sourceMappingURL=AnimationFrame.js.map /***/ }), -/* 731 */ +/* 732 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59564,7 +59920,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var AsyncScheduler_1 = __webpack_require__(32); +var AsyncScheduler_1 = __webpack_require__(33); var AnimationFrameScheduler = (function (_super) { __extends(AnimationFrameScheduler, _super); function AnimationFrameScheduler() { @@ -59597,166 +59953,166 @@ exports.AnimationFrameScheduler = AnimationFrameScheduler; //# sourceMappingURL=AnimationFrameScheduler.js.map /***/ }), -/* 732 */ +/* 733 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var audit_1 = __webpack_require__(71); +var audit_1 = __webpack_require__(72); exports.audit = audit_1.audit; -var auditTime_1 = __webpack_require__(261); +var auditTime_1 = __webpack_require__(262); exports.auditTime = auditTime_1.auditTime; -var buffer_1 = __webpack_require__(233); +var buffer_1 = __webpack_require__(234); exports.buffer = buffer_1.buffer; -var bufferCount_1 = __webpack_require__(234); +var bufferCount_1 = __webpack_require__(235); exports.bufferCount = bufferCount_1.bufferCount; -var bufferTime_1 = __webpack_require__(235); +var bufferTime_1 = __webpack_require__(236); exports.bufferTime = bufferTime_1.bufferTime; -var bufferToggle_1 = __webpack_require__(236); +var bufferToggle_1 = __webpack_require__(237); exports.bufferToggle = bufferToggle_1.bufferToggle; -var bufferWhen_1 = __webpack_require__(237); +var bufferWhen_1 = __webpack_require__(238); exports.bufferWhen = bufferWhen_1.bufferWhen; -var catchError_1 = __webpack_require__(238); +var catchError_1 = __webpack_require__(239); exports.catchError = catchError_1.catchError; -var combineAll_1 = __webpack_require__(239); +var combineAll_1 = __webpack_require__(240); exports.combineAll = combineAll_1.combineAll; -var combineLatest_1 = __webpack_require__(43); +var combineLatest_1 = __webpack_require__(44); exports.combineLatest = combineLatest_1.combineLatest; -var concat_1 = __webpack_require__(240); +var concat_1 = __webpack_require__(241); exports.concat = concat_1.concat; -var concatAll_1 = __webpack_require__(63); +var concatAll_1 = __webpack_require__(64); exports.concatAll = concatAll_1.concatAll; -var concatMap_1 = __webpack_require__(66); +var concatMap_1 = __webpack_require__(67); exports.concatMap = concatMap_1.concatMap; -var concatMapTo_1 = __webpack_require__(241); +var concatMapTo_1 = __webpack_require__(242); exports.concatMapTo = concatMapTo_1.concatMapTo; -var count_1 = __webpack_require__(242); +var count_1 = __webpack_require__(243); exports.count = count_1.count; -var debounce_1 = __webpack_require__(244); +var debounce_1 = __webpack_require__(245); exports.debounce = debounce_1.debounce; -var debounceTime_1 = __webpack_require__(245); +var debounceTime_1 = __webpack_require__(246); exports.debounceTime = debounceTime_1.debounceTime; -var defaultIfEmpty_1 = __webpack_require__(67); +var defaultIfEmpty_1 = __webpack_require__(68); exports.defaultIfEmpty = defaultIfEmpty_1.defaultIfEmpty; -var delay_1 = __webpack_require__(246); +var delay_1 = __webpack_require__(247); exports.delay = delay_1.delay; -var delayWhen_1 = __webpack_require__(247); +var delayWhen_1 = __webpack_require__(248); exports.delayWhen = delayWhen_1.delayWhen; -var dematerialize_1 = __webpack_require__(243); +var dematerialize_1 = __webpack_require__(244); exports.dematerialize = dematerialize_1.dematerialize; -var distinct_1 = __webpack_require__(248); +var distinct_1 = __webpack_require__(249); exports.distinct = distinct_1.distinct; -var distinctUntilChanged_1 = __webpack_require__(68); +var distinctUntilChanged_1 = __webpack_require__(69); exports.distinctUntilChanged = distinctUntilChanged_1.distinctUntilChanged; -var distinctUntilKeyChanged_1 = __webpack_require__(249); +var distinctUntilKeyChanged_1 = __webpack_require__(250); exports.distinctUntilKeyChanged = distinctUntilKeyChanged_1.distinctUntilKeyChanged; -var elementAt_1 = __webpack_require__(254); +var elementAt_1 = __webpack_require__(255); exports.elementAt = elementAt_1.elementAt; -var every_1 = __webpack_require__(263); +var every_1 = __webpack_require__(264); exports.every = every_1.every; -var exhaust_1 = __webpack_require__(251); +var exhaust_1 = __webpack_require__(252); exports.exhaust = exhaust_1.exhaust; -var exhaustMap_1 = __webpack_require__(252); +var exhaustMap_1 = __webpack_require__(253); exports.exhaustMap = exhaustMap_1.exhaustMap; -var expand_1 = __webpack_require__(253); +var expand_1 = __webpack_require__(254); exports.expand = expand_1.expand; -var filter_1 = __webpack_require__(69); +var filter_1 = __webpack_require__(70); exports.filter = filter_1.filter; -var finalize_1 = __webpack_require__(255); +var finalize_1 = __webpack_require__(256); exports.finalize = finalize_1.finalize; -var find_1 = __webpack_require__(70); +var find_1 = __webpack_require__(71); exports.find = find_1.find; -var findIndex_1 = __webpack_require__(256); +var findIndex_1 = __webpack_require__(257); exports.findIndex = findIndex_1.findIndex; -var first_1 = __webpack_require__(257); +var first_1 = __webpack_require__(258); exports.first = first_1.first; -var groupBy_1 = __webpack_require__(258); +var groupBy_1 = __webpack_require__(259); exports.groupBy = groupBy_1.groupBy; -var ignoreElements_1 = __webpack_require__(259); +var ignoreElements_1 = __webpack_require__(260); exports.ignoreElements = ignoreElements_1.ignoreElements; -var isEmpty_1 = __webpack_require__(260); +var isEmpty_1 = __webpack_require__(261); exports.isEmpty = isEmpty_1.isEmpty; -var last_1 = __webpack_require__(262); +var last_1 = __webpack_require__(263); exports.last = last_1.last; -var map_1 = __webpack_require__(33); +var map_1 = __webpack_require__(34); exports.map = map_1.map; -var mapTo_1 = __webpack_require__(264); +var mapTo_1 = __webpack_require__(265); exports.mapTo = mapTo_1.mapTo; -var materialize_1 = __webpack_require__(265); +var materialize_1 = __webpack_require__(266); exports.materialize = materialize_1.materialize; -var max_1 = __webpack_require__(266); +var max_1 = __webpack_require__(267); exports.max = max_1.max; -var merge_1 = __webpack_require__(267); +var merge_1 = __webpack_require__(268); exports.merge = merge_1.merge; -var mergeAll_1 = __webpack_require__(45); +var mergeAll_1 = __webpack_require__(46); exports.mergeAll = mergeAll_1.mergeAll; -var mergeMap_1 = __webpack_require__(29); +var mergeMap_1 = __webpack_require__(30); exports.mergeMap = mergeMap_1.mergeMap; -var mergeMap_2 = __webpack_require__(29); +var mergeMap_2 = __webpack_require__(30); exports.flatMap = mergeMap_2.mergeMap; -var mergeMapTo_1 = __webpack_require__(268); +var mergeMapTo_1 = __webpack_require__(269); exports.mergeMapTo = mergeMapTo_1.mergeMapTo; -var mergeScan_1 = __webpack_require__(269); +var mergeScan_1 = __webpack_require__(270); exports.mergeScan = mergeScan_1.mergeScan; -var min_1 = __webpack_require__(270); +var min_1 = __webpack_require__(271); exports.min = min_1.min; -var multicast_1 = __webpack_require__(19); +var multicast_1 = __webpack_require__(20); exports.multicast = multicast_1.multicast; -var observeOn_1 = __webpack_require__(44); +var observeOn_1 = __webpack_require__(45); exports.observeOn = observeOn_1.observeOn; -var onErrorResumeNext_1 = __webpack_require__(65); +var onErrorResumeNext_1 = __webpack_require__(66); exports.onErrorResumeNext = onErrorResumeNext_1.onErrorResumeNext; -var pairwise_1 = __webpack_require__(272); +var pairwise_1 = __webpack_require__(273); exports.pairwise = pairwise_1.pairwise; -var partition_1 = __webpack_require__(273); +var partition_1 = __webpack_require__(274); exports.partition = partition_1.partition; -var pluck_1 = __webpack_require__(274); +var pluck_1 = __webpack_require__(275); exports.pluck = pluck_1.pluck; -var publish_1 = __webpack_require__(275); +var publish_1 = __webpack_require__(276); exports.publish = publish_1.publish; -var publishBehavior_1 = __webpack_require__(276); +var publishBehavior_1 = __webpack_require__(277); exports.publishBehavior = publishBehavior_1.publishBehavior; -var publishLast_1 = __webpack_require__(279); +var publishLast_1 = __webpack_require__(280); exports.publishLast = publishLast_1.publishLast; -var publishReplay_1 = __webpack_require__(278); +var publishReplay_1 = __webpack_require__(279); exports.publishReplay = publishReplay_1.publishReplay; -var race_1 = __webpack_require__(280); +var race_1 = __webpack_require__(281); exports.race = race_1.race; -var reduce_1 = __webpack_require__(35); +var reduce_1 = __webpack_require__(36); exports.reduce = reduce_1.reduce; -var repeat_1 = __webpack_require__(281); +var repeat_1 = __webpack_require__(282); exports.repeat = repeat_1.repeat; -var repeatWhen_1 = __webpack_require__(282); +var repeatWhen_1 = __webpack_require__(283); exports.repeatWhen = repeatWhen_1.repeatWhen; -var retry_1 = __webpack_require__(283); +var retry_1 = __webpack_require__(284); exports.retry = retry_1.retry; -var retryWhen_1 = __webpack_require__(284); +var retryWhen_1 = __webpack_require__(285); exports.retryWhen = retryWhen_1.retryWhen; -var refCount_1 = __webpack_require__(74); +var refCount_1 = __webpack_require__(75); exports.refCount = refCount_1.refCount; -var sample_1 = __webpack_require__(285); +var sample_1 = __webpack_require__(286); exports.sample = sample_1.sample; -var sampleTime_1 = __webpack_require__(286); +var sampleTime_1 = __webpack_require__(287); exports.sampleTime = sampleTime_1.sampleTime; -var scan_1 = __webpack_require__(72); +var scan_1 = __webpack_require__(73); exports.scan = scan_1.scan; -var sequenceEqual_1 = __webpack_require__(287); +var sequenceEqual_1 = __webpack_require__(288); exports.sequenceEqual = sequenceEqual_1.sequenceEqual; -var share_1 = __webpack_require__(288); +var share_1 = __webpack_require__(289); exports.share = share_1.share; -var shareReplay_1 = __webpack_require__(289); +var shareReplay_1 = __webpack_require__(290); exports.shareReplay = shareReplay_1.shareReplay; -var single_1 = __webpack_require__(290); +var single_1 = __webpack_require__(291); exports.single = single_1.single; -var skip_1 = __webpack_require__(291); +var skip_1 = __webpack_require__(292); exports.skip = skip_1.skip; -var skipLast_1 = __webpack_require__(292); +var skipLast_1 = __webpack_require__(293); exports.skipLast = skipLast_1.skipLast; -var skipUntil_1 = __webpack_require__(293); +var skipUntil_1 = __webpack_require__(294); exports.skipUntil = skipUntil_1.skipUntil; -var skipWhile_1 = __webpack_require__(294); +var skipWhile_1 = __webpack_require__(295); exports.skipWhile = skipWhile_1.skipWhile; -var startWith_1 = __webpack_require__(295); +var startWith_1 = __webpack_require__(296); exports.startWith = startWith_1.startWith; /** * TODO(https://github.com/ReactiveX/rxjs/issues/2900): Add back subscribeOn once it can be @@ -59765,56 +60121,56 @@ exports.startWith = startWith_1.startWith; * Immediate, root, and other supporting code. */ // export { subscribeOn } from './operators/subscribeOn'; -var switchAll_1 = __webpack_require__(297); +var switchAll_1 = __webpack_require__(298); exports.switchAll = switchAll_1.switchAll; -var switchMap_1 = __webpack_require__(75); +var switchMap_1 = __webpack_require__(76); exports.switchMap = switchMap_1.switchMap; -var switchMapTo_1 = __webpack_require__(298); +var switchMapTo_1 = __webpack_require__(299); exports.switchMapTo = switchMapTo_1.switchMapTo; -var take_1 = __webpack_require__(299); +var take_1 = __webpack_require__(300); exports.take = take_1.take; -var takeLast_1 = __webpack_require__(73); +var takeLast_1 = __webpack_require__(74); exports.takeLast = takeLast_1.takeLast; -var takeUntil_1 = __webpack_require__(300); +var takeUntil_1 = __webpack_require__(301); exports.takeUntil = takeUntil_1.takeUntil; -var takeWhile_1 = __webpack_require__(301); +var takeWhile_1 = __webpack_require__(302); exports.takeWhile = takeWhile_1.takeWhile; -var tap_1 = __webpack_require__(250); +var tap_1 = __webpack_require__(251); exports.tap = tap_1.tap; -var throttle_1 = __webpack_require__(51); +var throttle_1 = __webpack_require__(52); exports.throttle = throttle_1.throttle; -var throttleTime_1 = __webpack_require__(302); +var throttleTime_1 = __webpack_require__(303); exports.throttleTime = throttleTime_1.throttleTime; -var timeInterval_1 = __webpack_require__(304); +var timeInterval_1 = __webpack_require__(305); exports.timeInterval = timeInterval_1.timeInterval; -var timeout_1 = __webpack_require__(305); +var timeout_1 = __webpack_require__(306); exports.timeout = timeout_1.timeout; -var timeoutWith_1 = __webpack_require__(307); +var timeoutWith_1 = __webpack_require__(308); exports.timeoutWith = timeoutWith_1.timeoutWith; -var timestamp_1 = __webpack_require__(76); +var timestamp_1 = __webpack_require__(77); exports.timestamp = timestamp_1.timestamp; -var toArray_1 = __webpack_require__(308); +var toArray_1 = __webpack_require__(309); exports.toArray = toArray_1.toArray; -var window_1 = __webpack_require__(309); +var window_1 = __webpack_require__(310); exports.window = window_1.window; -var windowCount_1 = __webpack_require__(310); +var windowCount_1 = __webpack_require__(311); exports.windowCount = windowCount_1.windowCount; -var windowTime_1 = __webpack_require__(311); +var windowTime_1 = __webpack_require__(312); exports.windowTime = windowTime_1.windowTime; -var windowToggle_1 = __webpack_require__(312); +var windowToggle_1 = __webpack_require__(313); exports.windowToggle = windowToggle_1.windowToggle; -var windowWhen_1 = __webpack_require__(313); +var windowWhen_1 = __webpack_require__(314); exports.windowWhen = windowWhen_1.windowWhen; -var withLatestFrom_1 = __webpack_require__(314); +var withLatestFrom_1 = __webpack_require__(315); exports.withLatestFrom = withLatestFrom_1.withLatestFrom; -var zip_1 = __webpack_require__(48); +var zip_1 = __webpack_require__(49); exports.zip = zip_1.zip; -var zipAll_1 = __webpack_require__(315); +var zipAll_1 = __webpack_require__(316); exports.zipAll = zipAll_1.zipAll; //# sourceMappingURL=operators.js.map /***/ }), -/* 733 */ +/* 734 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59828,36 +60184,36 @@ exports.runCommand = undefined; let runCommand = exports.runCommand = (() => { var _ref = _asyncToGenerator(function* (command, config) { try { - console.log(_chalk2.default.bold(`Running [${_chalk2.default.green(command.name)}] command from [${_chalk2.default.yellow(config.rootPath)}]:\n`)); + _log.log.write(_chalk2.default.bold(`Running [${_chalk2.default.green(command.name)}] command from [${_chalk2.default.yellow(config.rootPath)}]:\n`)); const projectPaths = (0, _config.getProjectPaths)(config.rootPath, config.options); const projects = yield (0, _projects.getProjects)(config.rootPath, projectPaths, { exclude: toArray(config.options.exclude), include: toArray(config.options.include) }); if (projects.size === 0) { - console.log(_chalk2.default.red(`There are no projects found. Double check project name(s) in '-i/--include' and '-e/--exclude' filters.\n`)); + _log.log.write(_chalk2.default.red(`There are no projects found. Double check project name(s) in '-i/--include' and '-e/--exclude' filters.\n`)); return process.exit(1); } const projectGraph = (0, _projects.buildProjectGraph)(projects); - console.log(_chalk2.default.bold(`Found [${_chalk2.default.green(projects.size.toString())}] projects:\n`)); - console.log((0, _projects_tree.renderProjectsTree)(config.rootPath, projects)); + _log.log.write(_chalk2.default.bold(`Found [${_chalk2.default.green(projects.size.toString())}] projects:\n`)); + _log.log.write((0, _projects_tree.renderProjectsTree)(config.rootPath, projects)); yield command.run(projects, projectGraph, config); } catch (e) { - console.log(_chalk2.default.bold.red(`\n[${command.name}] failed:\n`)); + _log.log.write(_chalk2.default.bold.red(`\n[${command.name}] failed:\n`)); if (e instanceof _errors.CliError) { const msg = _chalk2.default.red(`CliError: ${e.message}\n`); - console.log((0, _wrapAnsi2.default)(msg, 80)); + _log.log.write((0, _wrapAnsi2.default)(msg, 80)); const keys = Object.keys(e.meta); if (keys.length > 0) { const metaOutput = keys.map(function (key) { const value = e.meta[key]; return `${key}: ${value}`; }); - console.log('Additional debugging info:\n'); - console.log((0, _indentString2.default)(metaOutput.join('\n'), 3)); + _log.log.write('Additional debugging info:\n'); + _log.log.write((0, _indentString2.default)(metaOutput.join('\n'), 3)); } } else { - console.log(e.stack); + _log.log.write(e.stack); } process.exit(1); } @@ -59872,25 +60228,45 @@ var _chalk = __webpack_require__(14); var _chalk2 = _interopRequireDefault(_chalk); -var _wrapAnsi = __webpack_require__(734); +var _indentString = __webpack_require__(735); -var _wrapAnsi2 = _interopRequireDefault(_wrapAnsi); +var _indentString2 = _interopRequireDefault(_indentString); -var _indentString = __webpack_require__(738); +var _wrapAnsi = __webpack_require__(736); -var _indentString2 = _interopRequireDefault(_indentString); +var _wrapAnsi2 = _interopRequireDefault(_wrapAnsi); + +var _config = __webpack_require__(322); -var _errors = __webpack_require__(55); +var _errors = __webpack_require__(58); -var _projects = __webpack_require__(22); +var _log = __webpack_require__(17); -var _projects_tree = __webpack_require__(739); +var _projects = __webpack_require__(25); -var _config = __webpack_require__(321); +var _projects_tree = __webpack_require__(740); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + function toArray(value) { if (value == null) { @@ -59900,13 +60276,47 @@ function toArray(value) { } /***/ }), -/* 734 */ +/* 735 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = (str, count, opts) => { + // Support older versions: use the third parameter as options.indent + // TODO: Remove the workaround in the next major version + const options = typeof opts === 'object' ? Object.assign({indent: ' '}, opts) : {indent: opts || ' '}; + count = count === undefined ? 1 : count; + + if (typeof str !== 'string') { + throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof str}\``); + } + + if (typeof count !== 'number') { + throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``); + } + + if (typeof options.indent !== 'string') { + throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``); + } + + if (count === 0) { + return str; + } + + const regex = options.includeEmptyLines ? /^/mg : /^(?!\s*$)/mg; + return str.replace(regex, options.indent.repeat(count)); +} +; + + +/***/ }), +/* 736 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const stringWidth = __webpack_require__(735); -const stripAnsi = __webpack_require__(320); +const stringWidth = __webpack_require__(737); +const stripAnsi = __webpack_require__(321); const ESCAPES = new Set([ '\u001B', @@ -60100,13 +60510,13 @@ module.exports = (str, cols, opts) => { /***/ }), -/* 735 */ +/* 737 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const stripAnsi = __webpack_require__(320); -const isFullwidthCodePoint = __webpack_require__(737); +const stripAnsi = __webpack_require__(321); +const isFullwidthCodePoint = __webpack_require__(739); module.exports = str => { if (typeof str !== 'string' || str.length === 0) { @@ -60143,7 +60553,7 @@ module.exports = str => { /***/ }), -/* 736 */ +/* 738 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60160,7 +60570,7 @@ module.exports = () => { /***/ }), -/* 737 */ +/* 739 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60213,41 +60623,7 @@ module.exports = x => { /***/ }), -/* 738 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = (str, count, opts) => { - // Support older versions: use the third parameter as options.indent - // TODO: Remove the workaround in the next major version - const options = typeof opts === 'object' ? Object.assign({indent: ' '}, opts) : {indent: opts || ' '}; - count = count === undefined ? 1 : count; - - if (typeof str !== 'string') { - throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof str}\``); - } - - if (typeof count !== 'number') { - throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``); - } - - if (typeof options.indent !== 'string') { - throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``); - } - - if (count === 0) { - return str; - } - - const regex = options.includeEmptyLines ? /^/mg : /^(?!\s*$)/mg; - return str.replace(regex, options.indent.repeat(count)); -} -; - - -/***/ }), -/* 739 */ +/* 740 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60258,38 +60634,56 @@ Object.defineProperty(exports, "__esModule", { }); exports.renderProjectsTree = renderProjectsTree; -var _path = __webpack_require__(3); - -var _path2 = _interopRequireDefault(_path); - var _chalk = __webpack_require__(14); var _chalk2 = _interopRequireDefault(_chalk); +var _path = __webpack_require__(3); + +var _path2 = _interopRequireDefault(_path); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ const projectKey = Symbol('__project'); function renderProjectsTree(rootPath, projects) { const projectsTree = buildProjectsTree(rootPath, projects); return treeToString(createTreeStructure(projectsTree)); } function treeToString(tree) { - return [tree.name].concat(childrenToString(tree.children, '')).join('\n'); + return [tree.name].concat(childrenToStrings(tree.children, '')).join('\n'); } -function childrenToString(tree, treePrefix) { +function childrenToStrings(tree, treePrefix) { if (tree === undefined) { return []; } - let string = []; + let strings = []; tree.forEach((node, index) => { const isLastNode = tree.length - 1 === index; const nodePrefix = isLastNode ? '└── ' : '├── '; const childPrefix = isLastNode ? ' ' : '│ '; const childrenPrefix = treePrefix + childPrefix; - string.push(`${treePrefix}${nodePrefix}${node.name}`); - string = string.concat(childrenToString(node.children, childrenPrefix)); + strings.push(`${treePrefix}${nodePrefix}${node.name}`); + strings = strings.concat(childrenToStrings(node.children, childrenPrefix)); }); - return string; + return strings; } function createTreeStructure(tree) { let name; @@ -60307,8 +60701,8 @@ function createTreeStructure(tree) { if (project.size === 1 && project.has(projectKey)) { const projectName = project.get(projectKey); children.push({ - name: dirOrProjectName(dir, projectName), - children: [] + children: [], + name: dirOrProjectName(dir, projectName) }); continue; } @@ -60318,8 +60712,8 @@ function createTreeStructure(tree) { if (subtree.name !== undefined) { const projectName = subtree.name; children.push({ - name: dirOrProjectName(dir, projectName), - children: subtree.children + children: subtree.children, + name: dirOrProjectName(dir, projectName) }); continue; } @@ -60330,14 +60724,14 @@ function createTreeStructure(tree) { const child = subtree.children[0]; const newName = _chalk2.default.dim(_path2.default.join(dir.toString(), child.name)); children.push({ - name: newName, - children: child.children + children: child.children, + name: newName }); continue; } children.push({ - name: _chalk2.default.dim(dir.toString()), - children: subtree.children + children: subtree.children, + name: _chalk2.default.dim(dir.toString()) }); } return { name, children }; @@ -60371,7 +60765,7 @@ function addProjectToTree(tree, pathParts, project) { } /***/ }), -/* 740 */ +/* 741 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60381,7 +60775,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _build_production_projects = __webpack_require__(741); +var _build_production_projects = __webpack_require__(742); Object.defineProperty(exports, 'buildProductionProjects', { enumerable: true, @@ -60390,7 +60784,7 @@ Object.defineProperty(exports, 'buildProductionProjects', { } }); -var _prepare_project_dependencies = __webpack_require__(752); +var _prepare_project_dependencies = __webpack_require__(753); Object.defineProperty(exports, 'prepareExternalProjectDependencies', { enumerable: true, @@ -60400,7 +60794,7 @@ Object.defineProperty(exports, 'prepareExternalProjectDependencies', { }); /***/ }), -/* 741 */ +/* 742 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60419,7 +60813,7 @@ let buildProductionProjects = exports.buildProductionProjects = (() => { const projectNames = [...projects.values()].map(function (project) { return project.name; }); - console.log(`Preparing production build for [${projectNames.join(', ')}]`); + _log.log.write(`Preparing production build for [${projectNames.join(', ')}]`); for (const batch of batchedProjects) { for (const project of batch) { yield deleteTarget(project); @@ -60500,9 +60894,9 @@ let copyToBuild = (() => { const buildProjectPath = (0, _path.resolve)(buildRoot, relativeProjectPath); yield (0, _cpy2.default)(['**/*', '!node_modules/**'], buildProjectPath, { cwd: project.getIntermediateBuildDirectory(), - parents: true, + dot: true, nodir: true, - dot: true + parents: true }); // If a project is using an intermediate build directory, we special-case our // handling of `package.json`, as the project build process might have copied @@ -60521,40 +60915,59 @@ let copyToBuild = (() => { }; })(); -var _del = __webpack_require__(215); +var _cpy = __webpack_require__(743); + +var _cpy2 = _interopRequireDefault(_cpy); + +var _del = __webpack_require__(216); var _del2 = _interopRequireDefault(_del); var _path = __webpack_require__(3); -var _cpy = __webpack_require__(742); - -var _cpy2 = _interopRequireDefault(_cpy); +var _config = __webpack_require__(322); -var _config = __webpack_require__(321); +var _fs = __webpack_require__(54); -var _projects = __webpack_require__(22); +var _log = __webpack_require__(17); -var _package_json = __webpack_require__(37); +var _package_json = __webpack_require__(38); -var _fs = __webpack_require__(58); +var _projects = __webpack_require__(25); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ /***/ }), -/* 742 */ +/* 743 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const EventEmitter = __webpack_require__(36); +const EventEmitter = __webpack_require__(37); const path = __webpack_require__(3); -const arrify = __webpack_require__(743); -const globby = __webpack_require__(744); -const cpFile = __webpack_require__(746); -const CpyError = __webpack_require__(751); +const arrify = __webpack_require__(744); +const globby = __webpack_require__(745); +const cpFile = __webpack_require__(747); +const CpyError = __webpack_require__(752); const preprocessSrcPath = (srcPath, opts) => opts.cwd ? path.resolve(opts.cwd, srcPath) : srcPath; @@ -60648,7 +61061,7 @@ module.exports = (src, dest, opts) => { /***/ }), -/* 743 */ +/* 744 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60663,16 +61076,16 @@ module.exports = function (val) { /***/ }), -/* 744 */ +/* 745 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Promise = __webpack_require__(216); -var arrayUnion = __webpack_require__(217); -var objectAssign = __webpack_require__(218); -var glob = __webpack_require__(23); -var pify = __webpack_require__(745); +var Promise = __webpack_require__(217); +var arrayUnion = __webpack_require__(218); +var objectAssign = __webpack_require__(219); +var glob = __webpack_require__(26); +var pify = __webpack_require__(746); var globP = pify(glob, Promise).bind(glob); @@ -60758,7 +61171,7 @@ module.exports.hasMagic = function (patterns, opts) { /***/ }), -/* 745 */ +/* 746 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60833,17 +61246,17 @@ pify.all = pify; /***/ }), -/* 746 */ +/* 747 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(3); const fsConstants = __webpack_require__(7).constants; -const Buffer = __webpack_require__(747).Buffer; -const CpFileError = __webpack_require__(322); -const fs = __webpack_require__(749); -const ProgressEmitter = __webpack_require__(750); +const Buffer = __webpack_require__(748).Buffer; +const CpFileError = __webpack_require__(323); +const fs = __webpack_require__(750); +const ProgressEmitter = __webpack_require__(751); module.exports = (src, dest, opts) => { if (!src || !dest) { @@ -60993,11 +61406,11 @@ module.exports.sync = (src, dest, opts) => { /***/ }), -/* 747 */ +/* 748 */ /***/ (function(module, exports, __webpack_require__) { /* eslint-disable node/no-deprecated-api */ -var buffer = __webpack_require__(748) +var buffer = __webpack_require__(749) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers @@ -61061,21 +61474,21 @@ SafeBuffer.allocUnsafeSlow = function (size) { /***/ }), -/* 748 */ +/* 749 */ /***/ (function(module, exports) { module.exports = require("buffer"); /***/ }), -/* 749 */ +/* 750 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(25); -const makeDir = __webpack_require__(213); -const pify = __webpack_require__(21); -const CpFileError = __webpack_require__(322); +const fs = __webpack_require__(23); +const makeDir = __webpack_require__(91); +const pify = __webpack_require__(22); +const CpFileError = __webpack_require__(323); const fsP = pify(fs); @@ -61220,12 +61633,12 @@ if (fs.copyFileSync) { /***/ }), -/* 750 */ +/* 751 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const EventEmitter = __webpack_require__(36); +const EventEmitter = __webpack_require__(37); const written = new WeakMap(); @@ -61262,12 +61675,12 @@ module.exports = ProgressEmitter; /***/ }), -/* 751 */ +/* 752 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const NestedError = __webpack_require__(323); +const NestedError = __webpack_require__(324); class CpyError extends NestedError { constructor(message, nested) { @@ -61281,7 +61694,7 @@ module.exports = CpyError; /***/ }), -/* 752 */ +/* 753 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61321,11 +61734,29 @@ let prepareExternalProjectDependencies = exports.prepareExternalProjectDependenc }; })(); -var _project = __webpack_require__(83); +var _package_json = __webpack_require__(38); + +var _project = __webpack_require__(86); + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -var _package_json = __webpack_require__(37); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** * All external projects are located within `../kibana-extra/{plugin}` relative From 02e30436a6adb2918364105d3a5ad1fc9530f346 Mon Sep 17 00:00:00 2001 From: Brandon Kobel Date: Thu, 7 Jun 2018 16:28:13 -0400 Subject: [PATCH 074/186] Skipping flaky lab mode test (#19742) * Skipping lab mode tests * Update _lab_mode.js --- test/functional/apps/visualize/_lab_mode.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/apps/visualize/_lab_mode.js b/test/functional/apps/visualize/_lab_mode.js index 6c8a79b9fe035..926a5557ab5bd 100644 --- a/test/functional/apps/visualize/_lab_mode.js +++ b/test/functional/apps/visualize/_lab_mode.js @@ -23,7 +23,8 @@ export default function ({ getService, getPageObjects }) { const log = getService('log'); const PageObjects = getPageObjects(['common', 'header', 'discover', 'settings']); - describe('visualize lab mode', () => { + // Flaky: https://github.com/elastic/kibana/issues/19743 + describe.skip('visualize lab mode', () => { it('disabling does not break loading saved searches', async () => { await PageObjects.common.navigateToUrl('discover', ''); From 123ce4bf3d4dae082e96c035868cd2bde5d76b5a Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Thu, 7 Jun 2018 17:05:43 -0700 Subject: [PATCH 075/186] [Monitoring] Fix Node Advanced page (#19740) * [Monitoring] Fix Node Advanced page * fix metrics snapshot --- .../server/lib/details/get_series.js | 3 + .../__snapshots__/metrics.test.js.snap | 137 +- .../lib/metrics/elasticsearch/classes.js | 99 + .../lib/metrics/elasticsearch/metrics.js | 64 +- .../fixtures/node_detail_advanced.json | 3643 +++++++++++++++++ .../apis/monitoring/elasticsearch/index.js | 1 + .../elasticsearch/node_detail_advanced.js | 43 + 7 files changed, 3886 insertions(+), 104 deletions(-) create mode 100644 x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/node_detail_advanced.json create mode 100644 x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail_advanced.js diff --git a/x-pack/plugins/monitoring/server/lib/details/get_series.js b/x-pack/plugins/monitoring/server/lib/details/get_series.js index 31ffe1e761688..5c74ef47b4dc2 100644 --- a/x-pack/plugins/monitoring/server/lib/details/get_series.js +++ b/x-pack/plugins/monitoring/server/lib/details/get_series.js @@ -216,6 +216,9 @@ export async function getSeries(req, indexPattern, metricName, filters, { min, m checkParam(indexPattern, 'indexPattern in details/getSeries'); const metric = metrics[metricName]; + if (!metric) { + throw new Error(`Not a valid metric: ${metricName}`); + } const response = await fetchSeries(req, indexPattern, metric, min, max, bucketSize, filters); return handleSeries(metric, min, max, bucketSize, response); diff --git a/x-pack/plugins/monitoring/server/lib/metrics/__test__/__snapshots__/metrics.test.js.snap b/x-pack/plugins/monitoring/server/lib/metrics/__test__/__snapshots__/metrics.test.js.snap index f164fac18882a..401fc150ba391 100644 --- a/x-pack/plugins/monitoring/server/lib/metrics/__test__/__snapshots__/metrics.test.js.snap +++ b/x-pack/plugins/monitoring/server/lib/metrics/__test__/__snapshots__/metrics.test.js.snap @@ -2863,36 +2863,6 @@ Object { "units": "B", "uuidField": "source_node.uuid", }, - "node_index_threads_bulk_queue": ElasticsearchMetric { - "app": "elasticsearch", - "derivative": true, - "description": "Number of bulk operations in the queue.", - "field": "node_stats.thread_pool.bulk.queue", - "format": "0,0.[00]", - "label": "Bulk Queue", - "metricAgg": "max", - "min": 0, - "timestampField": "timestamp", - "title": "Indexing Threads", - "type": "node", - "units": "", - "uuidField": "source_node.uuid", - }, - "node_index_threads_bulk_rejected": ElasticsearchMetric { - "app": "elasticsearch", - "derivative": true, - "description": "Number of bulk operations that have been rejected, which occurs when the queue is full.", - "field": "node_stats.thread_pool.bulk.rejected", - "format": "0,0.[00]", - "label": "Bulk Rejections", - "metricAgg": "max", - "min": 0, - "timestampField": "timestamp", - "title": "Indexing Threads", - "type": "node", - "units": "", - "uuidField": "source_node.uuid", - }, "node_index_threads_get_queue": ElasticsearchMetric { "app": "elasticsearch", "derivative": true, @@ -2923,62 +2893,117 @@ Object { "units": "", "uuidField": "source_node.uuid", }, - "node_index_threads_index_queue": ElasticsearchMetric { + "node_index_threads_search_queue": ElasticsearchMetric { "app": "elasticsearch", "derivative": true, - "description": "Number of non-bulk, index operations in the queue.", - "field": "node_stats.thread_pool.index.queue", + "description": "Number of search operations in the queue (e.g., shard level searches).", + "field": "node_stats.thread_pool.search.queue", "format": "0,0.[00]", - "label": "Index Queue", + "label": "Search Queue", "metricAgg": "max", "min": 0, "timestampField": "timestamp", - "title": "Indexing Threads", + "title": "Read Threads", "type": "node", "units": "", "uuidField": "source_node.uuid", }, - "node_index_threads_index_rejected": ElasticsearchMetric { + "node_index_threads_search_rejected": ElasticsearchMetric { "app": "elasticsearch", "derivative": true, - "description": "Number of non-bulk, index operations that have been rejected, which occurs when the queue is full. Generally indicates that bulk should be used.", - "field": "node_stats.thread_pool.index.rejected", + "description": "Number of search operations that have been rejected, which occurs when the queue is full.", + "field": "node_stats.thread_pool.search.rejected", "format": "0,0.[00]", - "label": "Index Rejections", + "label": "Search Rejections", "metricAgg": "max", "min": 0, "timestampField": "timestamp", - "title": "Indexing Threads", + "title": "Read Threads", "type": "node", "units": "", "uuidField": "source_node.uuid", }, - "node_index_threads_search_queue": ElasticsearchMetric { + "node_index_threads_write_queue": WriteThreadPoolQueueMetric { "app": "elasticsearch", - "derivative": true, - "description": "Number of search operations in the queue (e.g., shard level searches).", - "field": "node_stats.thread_pool.search.queue", - "format": "0,0.[00]", - "label": "Search Queue", + "calculation": [Function], + "dateHistogramSubAggs": Object { + "bulk": Object { + "max": Object { + "field": "node_stats.thread_pool.bulk.queue", + }, + }, + "index": Object { + "max": Object { + "field": "node_stats.thread_pool.index.queue", + }, + }, + "write": Object { + "max": Object { + "field": "node_stats.thread_pool.write.queue", + }, + }, + }, + "derivative": false, + "description": "Number of index, bulk, and write operations in the queue. The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.", + "field": "node_stats.thread_pool.write.queue", + "format": "0.[00]", + "label": "Write Queue", "metricAgg": "max", - "min": 0, "timestampField": "timestamp", - "title": "Read Threads", + "title": "Indexing Threads", "type": "node", "units": "", "uuidField": "source_node.uuid", }, - "node_index_threads_search_rejected": ElasticsearchMetric { + "node_index_threads_write_rejected": WriteThreadPoolRejectedMetric { "app": "elasticsearch", - "derivative": true, - "description": "Number of search operations that have been rejected, which occurs when the queue is full.", - "field": "node_stats.thread_pool.search.rejected", - "format": "0,0.[00]", - "label": "Search Rejections", + "calculation": [Function], + "dateHistogramSubAggs": Object { + "bulk_deriv": Object { + "derivative": Object { + "buckets_path": "bulk_rejections", + "gap_policy": "skip", + "unit": "1s", + }, + }, + "bulk_rejections": Object { + "max": Object { + "field": "node_stats.thread_pool.bulk.rejected", + }, + }, + "index_deriv": Object { + "derivative": Object { + "buckets_path": "index_rejections", + "gap_policy": "skip", + "unit": "1s", + }, + }, + "index_rejections": Object { + "max": Object { + "field": "node_stats.thread_pool.index.rejected", + }, + }, + "write_deriv": Object { + "derivative": Object { + "buckets_path": "write_rejections", + "gap_policy": "skip", + "unit": "1s", + }, + }, + "write_rejections": Object { + "max": Object { + "field": "node_stats.thread_pool.write.rejected", + }, + }, + }, + "derivative": false, + "description": "Number of index, bulk, and write operations that have been rejected, which occurs when the queue is full. The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.", + "field": "node_stats.thread_pool.write.rejected", + "format": "0.[00]", + "label": "Write Rejections", "metricAgg": "max", - "min": 0, "timestampField": "timestamp", - "title": "Read Threads", + "title": "Indexing Threads", "type": "node", "units": "", "uuidField": "source_node.uuid", diff --git a/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/classes.js b/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/classes.js index 8fb8a6cc9652b..b68cf3c948678 100644 --- a/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/classes.js +++ b/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/classes.js @@ -194,3 +194,102 @@ export class SingleIndexMemoryMetric extends IndexMemoryMetric { this.field = 'index_stats.total.segments.' + opts.field; } } + +export class WriteThreadPoolQueueMetric extends ElasticsearchMetric { + constructor(opts) { + super({ + ...opts, + field: 'node_stats.thread_pool.write.queue', // in 7.0, we can only check for this threadpool + type: 'node', + format: SMALL_FLOAT, + metricAgg: 'max', + units: '', + }); + + this.dateHistogramSubAggs = { + index: { + max: { field: 'node_stats.thread_pool.index.queue' }, + }, + bulk: { + max: { field: 'node_stats.thread_pool.bulk.queue' }, + }, + write: { + max: { field: 'node_stats.thread_pool.write.queue' }, + }, + }; + + this.calculation = bucket => { + const index = _.get(bucket, 'index.value', null); + const bulk = _.get(bucket, 'bulk.value', null); + const write = _.get(bucket, 'write.value', null); + + if (index !== null || bulk !== null || write !== null) { + return (index || 0) + (bulk || 0) + (write || 0); + } + + // ignore the data if none of them exist + return null; + }; + } +} + +export class WriteThreadPoolRejectedMetric extends ElasticsearchMetric { + constructor(opts) { + super({ + ...opts, + field: 'node_stats.thread_pool.write.rejected', // in 7.0, we can only check for this threadpool + type: 'node', + format: SMALL_FLOAT, + metricAgg: 'max', + units: '', + }); + + this.dateHistogramSubAggs = { + index_rejections: { + max: { field: 'node_stats.thread_pool.index.rejected' }, + }, + bulk_rejections: { + max: { field: 'node_stats.thread_pool.bulk.rejected' }, + }, + write_rejections: { + max: { field: 'node_stats.thread_pool.write.rejected' }, + }, + index_deriv: { + derivative: { + buckets_path: 'index_rejections', + gap_policy: 'skip', + unit: NORMALIZED_DERIVATIVE_UNIT, + }, + }, + bulk_deriv: { + derivative: { + buckets_path: 'bulk_rejections', + gap_policy: 'skip', + unit: NORMALIZED_DERIVATIVE_UNIT, + }, + }, + write_deriv: { + derivative: { + buckets_path: 'write_rejections', + gap_policy: 'skip', + unit: NORMALIZED_DERIVATIVE_UNIT, + }, + }, + }; + + this.calculation = bucket => { + const index = _.get(bucket, 'index_deriv.normalized_value', null); + const bulk = _.get(bucket, 'bulk_deriv.normalized_value', null); + const write = _.get(bucket, 'write_deriv.normalized_value', null); + + if (index !== null || bulk !== null || write !== null) { + const valueOrZero = value => (value < 0 ? 0 : value || 0); + + return valueOrZero(index) + valueOrZero(bulk) + valueOrZero(write); + } + + // ignore the data if none of them exist + return null; + }; + } +} diff --git a/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/metrics.js b/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/metrics.js index b6fa138b3f52f..592b4147edd98 100644 --- a/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/metrics.js +++ b/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/metrics.js @@ -13,7 +13,9 @@ import { IndexMemoryMetric, NodeIndexMemoryMetric, ThreadPoolQueueMetric, - ThreadPoolRejectedMetric + ThreadPoolRejectedMetric, + WriteThreadPoolQueueMetric, + WriteThreadPoolRejectedMetric } from './classes'; import { LARGE_FLOAT, @@ -691,31 +693,6 @@ export const metrics = { description: 'Heap memory used by the Index Writer. This is NOT a part of Lucene Total.' }), - node_index_threads_bulk_queue: new ElasticsearchMetric({ - field: 'node_stats.thread_pool.bulk.queue', - title: 'Indexing Threads', - label: 'Bulk Queue', - description: 'Number of bulk operations in the queue.', - type: 'node', - derivative: true, - format: LARGE_FLOAT, - metricAgg: 'max', - units: '', - min: 0 - }), - node_index_threads_bulk_rejected: new ElasticsearchMetric({ - field: 'node_stats.thread_pool.bulk.rejected', - title: 'Indexing Threads', - label: 'Bulk Rejections', - description: - 'Number of bulk operations that have been rejected, which occurs when the queue is full.', - type: 'node', - derivative: true, - format: LARGE_FLOAT, - metricAgg: 'max', - units: '', - min: 0 - }), node_index_threads_get_queue: new ElasticsearchMetric({ field: 'node_stats.thread_pool.get.queue', title: 'Read Threads', @@ -741,31 +718,22 @@ export const metrics = { units: '', min: 0 }), - node_index_threads_index_queue: new ElasticsearchMetric({ - field: 'node_stats.thread_pool.index.queue', + node_index_threads_write_queue: new WriteThreadPoolQueueMetric({ title: 'Indexing Threads', - label: 'Index Queue', - description: 'Number of non-bulk, index operations in the queue.', - type: 'node', - derivative: true, - format: LARGE_FLOAT, - metricAgg: 'max', - units: '', - min: 0 + label: 'Write Queue', + description: ( + 'Number of index, bulk, and write operations in the queue. ' + + 'The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.' + ), }), - node_index_threads_index_rejected: new ElasticsearchMetric({ - field: 'node_stats.thread_pool.index.rejected', + node_index_threads_write_rejected: new WriteThreadPoolRejectedMetric({ + field: 'node_stats.thread_pool.bulk.rejected', title: 'Indexing Threads', - label: 'Index Rejections', - description: - 'Number of non-bulk, index operations that have been rejected, which occurs when the queue is full. ' + - 'Generally indicates that bulk should be used.', - type: 'node', - derivative: true, - format: LARGE_FLOAT, - metricAgg: 'max', - units: '', - min: 0 + label: 'Write Rejections', + description: ( + 'Number of index, bulk, and write operations that have been rejected, which occurs when the queue is full. ' + + 'The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.' + ), }), node_index_threads_search_queue: new ElasticsearchMetric({ field: 'node_stats.thread_pool.search.queue', diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/node_detail_advanced.json b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/node_detail_advanced.json new file mode 100644 index 0000000000000..14c2faf20f17f --- /dev/null +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/node_detail_advanced.json @@ -0,0 +1,3643 @@ +{ + "nodeSummary": { + "resolver": "jUT5KdxfRbORSCWkb5zjmA", + "node_ids": [ + "jUT5KdxfRbORSCWkb5zjmA" + ], + "attributes": { + "ml.max_open_jobs": "10", + "ml.enabled": "true" + }, + "transport_address": "127.0.0.1:9300", + "name": "whatever-01", + "type": "master", + "nodeTypeLabel": "Master Node", + "nodeTypeClass": "fa-star", + "totalShards": 38, + "indexCount": 20, + "documents": 24830, + "dataSize": 52847579, + "freeSpace": 186755088384, + "usedHeap": 29, + "status": "Online", + "isOnline": true + }, + "metrics": { + "node_jvm_mem": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.mem.heap_max_in_bytes", + "metricAgg": "max", + "label": "Max Heap", + "title": "JVM Heap", + "description": "Total heap available to Elasticsearch running in the JVM.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 709623808 + ], + [ + 1507235530000, + 709623808 + ], + [ + 1507235540000, + 709623808 + ], + [ + 1507235550000, + 709623808 + ], + [ + 1507235560000, + 709623808 + ], + [ + 1507235570000, + 709623808 + ], + [ + 1507235580000, + 709623808 + ], + [ + 1507235590000, + 709623808 + ], + [ + 1507235600000, + 709623808 + ], + [ + 1507235610000, + 709623808 + ], + [ + 1507235620000, + 709623808 + ], + [ + 1507235630000, + 709623808 + ], + [ + 1507235640000, + 709623808 + ], + [ + 1507235650000, + 709623808 + ], + [ + 1507235660000, + 709623808 + ], + [ + 1507235670000, + 709623808 + ], + [ + 1507235680000, + 709623808 + ], + [ + 1507235690000, + 709623808 + ], + [ + 1507235700000, + 709623808 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.mem.heap_used_in_bytes", + "metricAgg": "max", + "label": "Used Heap", + "title": "JVM Heap", + "description": "Total heap used by Elasticsearch running in the JVM.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 317052776 + ], + [ + 1507235530000, + 344014976 + ], + [ + 1507235540000, + 368593248 + ], + [ + 1507235550000, + 253850400 + ], + [ + 1507235560000, + 348095032 + ], + [ + 1507235570000, + 182919712 + ], + [ + 1507235580000, + 212395016 + ], + [ + 1507235590000, + 244004144 + ], + [ + 1507235600000, + 270412240 + ], + [ + 1507235610000, + 245052864 + ], + [ + 1507235620000, + 370270616 + ], + [ + 1507235630000, + 196944168 + ], + [ + 1507235640000, + 223491760 + ], + [ + 1507235650000, + 253878472 + ], + [ + 1507235660000, + 280811736 + ], + [ + 1507235670000, + 371931976 + ], + [ + 1507235680000, + 329874616 + ], + [ + 1507235690000, + 363869776 + ], + [ + 1507235700000, + 211045968 + ] + ] + } + ], + "node_gc": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.gc.collectors.old.collection_count", + "metricAgg": "max", + "label": "Old", + "title": "GC Count", + "description": "Number of old Garbage Collections.", + "units": "", + "format": "0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.gc.collectors.young.collection_count", + "metricAgg": "max", + "label": "Young", + "title": "GC Count", + "description": "Number of young Garbage Collections.", + "units": "", + "format": "0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0.1 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0.1 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0.1 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0.1 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0.1 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0.1 + ] + ] + } + ], + "node_gc_time": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.gc.collectors.old.collection_time_in_millis", + "metricAgg": "max", + "label": "Old", + "title": "GC Duration", + "description": "Time spent performing old Garbage Collections.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.gc.collectors.young.collection_time_in_millis", + "metricAgg": "max", + "label": "Young", + "title": "GC Duration", + "description": "Time spent performing young Garbage Collections.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 1.1 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 1.2 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 1 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 1.1 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 2.9 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 2.1 + ] + ] + } + ], + "node_index_1": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 1", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 4797457 + ], + [ + 1507235530000, + 4797457 + ], + [ + 1507235540000, + 4797457 + ], + [ + 1507235550000, + 4797457 + ], + [ + 1507235560000, + 4823580 + ], + [ + 1507235570000, + 4823580 + ], + [ + 1507235580000, + 4823580 + ], + [ + 1507235590000, + 4823580 + ], + [ + 1507235600000, + 4823580 + ], + [ + 1507235610000, + 4838368 + ], + [ + 1507235620000, + 4741420 + ], + [ + 1507235630000, + 4741420 + ], + [ + 1507235640000, + 4741420 + ], + [ + 1507235650000, + 4741420 + ], + [ + 1507235660000, + 4741420 + ], + [ + 1507235670000, + 4757998 + ], + [ + 1507235680000, + 4787542 + ], + [ + 1507235690000, + 4787542 + ], + [ + 1507235700000, + 4787542 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.stored_fields_memory_in_bytes", + "metricAgg": "max", + "label": "Stored Fields", + "title": "Index Memory", + "description": "Heap memory used by Stored Fields (e.g., _source). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 56792 + ], + [ + 1507235530000, + 56792 + ], + [ + 1507235540000, + 56792 + ], + [ + 1507235550000, + 56792 + ], + [ + 1507235560000, + 57728 + ], + [ + 1507235570000, + 57728 + ], + [ + 1507235580000, + 57728 + ], + [ + 1507235590000, + 57728 + ], + [ + 1507235600000, + 57728 + ], + [ + 1507235610000, + 58352 + ], + [ + 1507235620000, + 56192 + ], + [ + 1507235630000, + 56192 + ], + [ + 1507235640000, + 56192 + ], + [ + 1507235650000, + 56192 + ], + [ + 1507235660000, + 56192 + ], + [ + 1507235670000, + 56816 + ], + [ + 1507235680000, + 57440 + ], + [ + 1507235690000, + 57440 + ], + [ + 1507235700000, + 57440 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.doc_values_memory_in_bytes", + "metricAgg": "max", + "label": "Doc Values", + "title": "Index Memory", + "description": "Heap memory used by Doc Values. This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 516824 + ], + [ + 1507235530000, + 516824 + ], + [ + 1507235540000, + 516824 + ], + [ + 1507235550000, + 516824 + ], + [ + 1507235560000, + 517292 + ], + [ + 1507235570000, + 517292 + ], + [ + 1507235580000, + 517292 + ], + [ + 1507235590000, + 517292 + ], + [ + 1507235600000, + 517292 + ], + [ + 1507235610000, + 517612 + ], + [ + 1507235620000, + 514808 + ], + [ + 1507235630000, + 514808 + ], + [ + 1507235640000, + 514808 + ], + [ + 1507235650000, + 514808 + ], + [ + 1507235660000, + 514808 + ], + [ + 1507235670000, + 515312 + ], + [ + 1507235680000, + 516008 + ], + [ + 1507235690000, + 516008 + ], + [ + 1507235700000, + 516008 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.norms_memory_in_bytes", + "metricAgg": "max", + "label": "Norms", + "title": "Index Memory", + "description": "Heap memory used by Norms (normalization factors for query-time, text scoring). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 447232 + ], + [ + 1507235530000, + 447232 + ], + [ + 1507235540000, + 447232 + ], + [ + 1507235550000, + 447232 + ], + [ + 1507235560000, + 449600 + ], + [ + 1507235570000, + 449600 + ], + [ + 1507235580000, + 449600 + ], + [ + 1507235590000, + 449600 + ], + [ + 1507235600000, + 449600 + ], + [ + 1507235610000, + 450880 + ], + [ + 1507235620000, + 442304 + ], + [ + 1507235630000, + 442304 + ], + [ + 1507235640000, + 442304 + ], + [ + 1507235650000, + 442304 + ], + [ + 1507235660000, + 442304 + ], + [ + 1507235670000, + 443840 + ], + [ + 1507235680000, + 446400 + ], + [ + 1507235690000, + 446400 + ], + [ + 1507235700000, + 446400 + ] + ] + } + ], + "node_index_2": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 2", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 4797457 + ], + [ + 1507235530000, + 4797457 + ], + [ + 1507235540000, + 4797457 + ], + [ + 1507235550000, + 4797457 + ], + [ + 1507235560000, + 4823580 + ], + [ + 1507235570000, + 4823580 + ], + [ + 1507235580000, + 4823580 + ], + [ + 1507235590000, + 4823580 + ], + [ + 1507235600000, + 4823580 + ], + [ + 1507235610000, + 4838368 + ], + [ + 1507235620000, + 4741420 + ], + [ + 1507235630000, + 4741420 + ], + [ + 1507235640000, + 4741420 + ], + [ + 1507235650000, + 4741420 + ], + [ + 1507235660000, + 4741420 + ], + [ + 1507235670000, + 4757998 + ], + [ + 1507235680000, + 4787542 + ], + [ + 1507235690000, + 4787542 + ], + [ + 1507235700000, + 4787542 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.terms_memory_in_bytes", + "metricAgg": "max", + "label": "Terms", + "title": "Index Memory", + "description": "Heap memory used by Terms (e.g., text). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 3764438 + ], + [ + 1507235530000, + 3764438 + ], + [ + 1507235540000, + 3764438 + ], + [ + 1507235550000, + 3764438 + ], + [ + 1507235560000, + 3786762 + ], + [ + 1507235570000, + 3786762 + ], + [ + 1507235580000, + 3786762 + ], + [ + 1507235590000, + 3786762 + ], + [ + 1507235600000, + 3786762 + ], + [ + 1507235610000, + 3799306 + ], + [ + 1507235620000, + 3715996 + ], + [ + 1507235630000, + 3715996 + ], + [ + 1507235640000, + 3715996 + ], + [ + 1507235650000, + 3715996 + ], + [ + 1507235660000, + 3715996 + ], + [ + 1507235670000, + 3729890 + ], + [ + 1507235680000, + 3755528 + ], + [ + 1507235690000, + 3755528 + ], + [ + 1507235700000, + 3755528 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.points_memory_in_bytes", + "metricAgg": "max", + "label": "Points", + "title": "Index Memory", + "description": "Heap memory used by Points (e.g., numbers, IPs, and geo data). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 12171 + ], + [ + 1507235530000, + 12171 + ], + [ + 1507235540000, + 12171 + ], + [ + 1507235550000, + 12171 + ], + [ + 1507235560000, + 12198 + ], + [ + 1507235570000, + 12198 + ], + [ + 1507235580000, + 12198 + ], + [ + 1507235590000, + 12198 + ], + [ + 1507235600000, + 12198 + ], + [ + 1507235610000, + 12218 + ], + [ + 1507235620000, + 12120 + ], + [ + 1507235630000, + 12120 + ], + [ + 1507235640000, + 12120 + ], + [ + 1507235650000, + 12120 + ], + [ + 1507235660000, + 12120 + ], + [ + 1507235670000, + 12140 + ], + [ + 1507235680000, + 12166 + ], + [ + 1507235690000, + 12166 + ], + [ + 1507235700000, + 12166 + ] + ] + } + ], + "node_index_3": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 3", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 4797457 + ], + [ + 1507235530000, + 4797457 + ], + [ + 1507235540000, + 4797457 + ], + [ + 1507235550000, + 4797457 + ], + [ + 1507235560000, + 4823580 + ], + [ + 1507235570000, + 4823580 + ], + [ + 1507235580000, + 4823580 + ], + [ + 1507235590000, + 4823580 + ], + [ + 1507235600000, + 4823580 + ], + [ + 1507235610000, + 4838368 + ], + [ + 1507235620000, + 4741420 + ], + [ + 1507235630000, + 4741420 + ], + [ + 1507235640000, + 4741420 + ], + [ + 1507235650000, + 4741420 + ], + [ + 1507235660000, + 4741420 + ], + [ + 1507235670000, + 4757998 + ], + [ + 1507235680000, + 4787542 + ], + [ + 1507235690000, + 4787542 + ], + [ + 1507235700000, + 4787542 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.fixed_bit_set_memory_in_bytes", + "metricAgg": "max", + "label": "Fixed Bitsets", + "title": "Index Memory", + "description": "Heap memory used by Fixed Bit Sets (e.g., deeply nested documents). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 4024 + ], + [ + 1507235530000, + 4024 + ], + [ + 1507235540000, + 4024 + ], + [ + 1507235550000, + 4024 + ], + [ + 1507235560000, + 4120 + ], + [ + 1507235570000, + 4120 + ], + [ + 1507235580000, + 4120 + ], + [ + 1507235590000, + 4120 + ], + [ + 1507235600000, + 4120 + ], + [ + 1507235610000, + 4168 + ], + [ + 1507235620000, + 3832 + ], + [ + 1507235630000, + 3832 + ], + [ + 1507235640000, + 3832 + ], + [ + 1507235650000, + 3832 + ], + [ + 1507235660000, + 3832 + ], + [ + 1507235670000, + 3880 + ], + [ + 1507235680000, + 3976 + ], + [ + 1507235690000, + 3976 + ], + [ + 1507235700000, + 3976 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.term_vectors_memory_in_bytes", + "metricAgg": "max", + "label": "Term Vectors", + "title": "Index Memory", + "description": "Heap memory used by Term Vectors. This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 0 + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.version_map_memory_in_bytes", + "metricAgg": "max", + "label": "Version Map", + "title": "Index Memory", + "description": "Heap memory used by Versioning (e.g., updates and deletes). This is NOT a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 5551 + ], + [ + 1507235530000, + 5551 + ], + [ + 1507235540000, + 5551 + ], + [ + 1507235550000, + 6594 + ], + [ + 1507235560000, + 6662 + ], + [ + 1507235570000, + 6662 + ], + [ + 1507235580000, + 6662 + ], + [ + 1507235590000, + 6662 + ], + [ + 1507235600000, + 6662 + ], + [ + 1507235610000, + 7531 + ], + [ + 1507235620000, + 7837 + ], + [ + 1507235630000, + 7837 + ], + [ + 1507235640000, + 7837 + ], + [ + 1507235650000, + 7837 + ], + [ + 1507235660000, + 7837 + ], + [ + 1507235670000, + 9974 + ], + [ + 1507235680000, + 9716 + ], + [ + 1507235690000, + 9716 + ], + [ + 1507235700000, + 9716 + ] + ] + } + ], + "node_index_4": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.query_cache.memory_size_in_bytes", + "metricAgg": "max", + "label": "Query Cache", + "title": "Index Memory - Elasticsearch", + "description": "Heap memory used by Query Cache (e.g., cached filters). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 0 + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.request_cache.memory_size_in_bytes", + "metricAgg": "max", + "label": "Request Cache", + "title": "Index Memory", + "description": "Heap memory used by Request Cache (e.g., instant aggregations). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 2921 + ], + [ + 1507235530000, + 2921 + ], + [ + 1507235540000, + 2921 + ], + [ + 1507235550000, + 2921 + ], + [ + 1507235560000, + 2921 + ], + [ + 1507235570000, + 2921 + ], + [ + 1507235580000, + 2921 + ], + [ + 1507235590000, + 2921 + ], + [ + 1507235600000, + 2921 + ], + [ + 1507235610000, + 2921 + ], + [ + 1507235620000, + 2921 + ], + [ + 1507235630000, + 2921 + ], + [ + 1507235640000, + 2921 + ], + [ + 1507235650000, + 2921 + ], + [ + 1507235660000, + 2921 + ], + [ + 1507235670000, + 2921 + ], + [ + 1507235680000, + 2921 + ], + [ + 1507235690000, + 2921 + ], + [ + 1507235700000, + 2921 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.fielddata.memory_size_in_bytes", + "metricAgg": "max", + "label": "Fielddata", + "title": "Index Memory", + "description": "Heap memory used by Fielddata (e.g., global ordinals or explicitly enabled fielddata on text fields). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 0 + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.index_writer_memory_in_bytes", + "metricAgg": "max", + "label": "Index Writer", + "title": "Index Memory", + "description": "Heap memory used by the Index Writer. This is NOT a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 153549 + ], + [ + 1507235530000, + 153549 + ], + [ + 1507235540000, + 153549 + ], + [ + 1507235550000, + 849833 + ], + [ + 1507235560000, + 156505 + ], + [ + 1507235570000, + 156505 + ], + [ + 1507235580000, + 156505 + ], + [ + 1507235590000, + 156505 + ], + [ + 1507235600000, + 156505 + ], + [ + 1507235610000, + 3140275 + ], + [ + 1507235620000, + 159637 + ], + [ + 1507235630000, + 159637 + ], + [ + 1507235640000, + 159637 + ], + [ + 1507235650000, + 159637 + ], + [ + 1507235660000, + 159637 + ], + [ + 1507235670000, + 3737997 + ], + [ + 1507235680000, + 164351 + ], + [ + 1507235690000, + 164351 + ], + [ + 1507235700000, + 164351 + ] + ] + } + ], + "node_request_total": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.search.query_total", + "metricAgg": "max", + "label": "Search Total", + "title": "Request Rate", + "description": "Amount of search operations (per shard).", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0.3 + ], + [ + 1507235540000, + 0.3 + ], + [ + 1507235550000, + 0.3 + ], + [ + 1507235560000, + 0.3 + ], + [ + 1507235570000, + 0.3 + ], + [ + 1507235580000, + 0.3 + ], + [ + 1507235590000, + 0.4 + ], + [ + 1507235600000, + 0.3 + ], + [ + 1507235610000, + 0.5 + ], + [ + 1507235620000, + 0.3 + ], + [ + 1507235630000, + 0.3 + ], + [ + 1507235640000, + 0.2 + ], + [ + 1507235650000, + 0.3 + ], + [ + 1507235660000, + 0.3 + ], + [ + 1507235670000, + 0.5 + ], + [ + 1507235680000, + 0.5 + ], + [ + 1507235690000, + 0.1 + ], + [ + 1507235700000, + 0.4 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.indexing.index_total", + "metricAgg": "max", + "label": "Indexing Total", + "title": "Request Rate", + "description": "Amount of indexing operations.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0.9 + ], + [ + 1507235560000, + 0.6 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0.9 + ], + [ + 1507235620000, + 0.6 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 1.8 + ], + [ + 1507235680000, + 0.8 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + } + ], + "node_index_time": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.indexing.index_time_in_millis", + "metricAgg": "max", + "label": "Index Time", + "title": "Indexing Time", + "description": "Amount of time spent on indexing operations.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0.8 + ], + [ + 1507235560000, + 0.7 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 1.2 + ], + [ + 1507235620000, + 0.7 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 4.2 + ], + [ + 1507235680000, + 2.3 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.indexing.throttle_time_in_millis", + "metricAgg": "max", + "label": "Index Throttling Time", + "title": "Indexing Time", + "description": "Amount of time spent with index throttling, which indicates slow disks on a node.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + } + ], + "node_index_threads": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.write.queue", + "metricAgg": "max", + "label": "Write Queue", + "title": "Indexing Threads", + "description": "Number of index, bulk, and write operations in the queue. The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.", + "units": "", + "format": "0.[00]", + "hasCalculation": true, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 0 + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.write.rejected", + "metricAgg": "max", + "label": "Write Rejections", + "title": "Indexing Threads", + "description": "Number of index, bulk, and write operations that have been rejected, which occurs when the queue is full. The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.", + "units": "", + "format": "0.[00]", + "hasCalculation": true, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + } + ], + "node_read_threads": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.search.queue", + "metricAgg": "max", + "label": "Search Queue", + "title": "Read Threads", + "description": "Number of search operations in the queue (e.g., shard level searches).", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0.2 + ], + [ + 1507235680000, + null + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.search.rejected", + "metricAgg": "max", + "label": "Search Rejections", + "title": "Read Threads", + "description": "Number of search operations that have been rejected, which occurs when the queue is full.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.get.queue", + "metricAgg": "max", + "label": "GET Queue", + "title": "Read Threads", + "description": "Number of GET operations in the queue.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.get.rejected", + "metricAgg": "max", + "label": "GET Rejections", + "title": "Read Threads", + "description": "Number of GET operations that have been rejected, which occurs when the queue is full.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 0 + ], + [ + 1507235560000, + 0 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 0 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 0 + ], + [ + 1507235620000, + 0 + ], + [ + 1507235630000, + 0 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 0 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 0 + ], + [ + 1507235680000, + 0 + ], + [ + 1507235690000, + 0 + ], + [ + 1507235700000, + 0 + ] + ] + } + ], + "node_cpu_utilization": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.process.cpu.percent", + "metricAgg": "max", + "label": "CPU Utilization", + "description": "Percentage of CPU usage for the Elasticsearch process.", + "units": "%", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [ + 1507235520000, + 1 + ], + [ + 1507235530000, + 0 + ], + [ + 1507235540000, + 0 + ], + [ + 1507235550000, + 1 + ], + [ + 1507235560000, + 2 + ], + [ + 1507235570000, + 0 + ], + [ + 1507235580000, + 2 + ], + [ + 1507235590000, + 0 + ], + [ + 1507235600000, + 0 + ], + [ + 1507235610000, + 3 + ], + [ + 1507235620000, + 2 + ], + [ + 1507235630000, + 2 + ], + [ + 1507235640000, + 0 + ], + [ + 1507235650000, + 1 + ], + [ + 1507235660000, + 0 + ], + [ + 1507235670000, + 2 + ], + [ + 1507235680000, + 2 + ], + [ + 1507235690000, + 1 + ], + [ + 1507235700000, + 0 + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.process.cpu.percent", + "metricAgg": "max", + "label": "Cgroup CPU Utilization", + "title": "CPU Utilization", + "description": "CPU Usage time compared to the CPU quota shown in percentage. If CPU quotas are not set, then no data will be shown.", + "units": "%", + "format": "0,0.[00]", + "hasCalculation": true, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + null + ], + [ + 1507235540000, + null + ], + [ + 1507235550000, + null + ], + [ + 1507235560000, + null + ], + [ + 1507235570000, + null + ], + [ + 1507235580000, + null + ], + [ + 1507235590000, + null + ], + [ + 1507235600000, + null + ], + [ + 1507235610000, + null + ], + [ + 1507235620000, + null + ], + [ + 1507235630000, + null + ], + [ + 1507235640000, + null + ], + [ + 1507235650000, + null + ], + [ + 1507235660000, + null + ], + [ + 1507235670000, + null + ], + [ + 1507235680000, + null + ], + [ + 1507235690000, + null + ], + [ + 1507235700000, + null + ] + ] + } + ], + "node_cgroup_cpu": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.os.cgroup.cpuacct.usage_nanos", + "metricAgg": "max", + "label": "Cgroup Usage", + "title": "Cgroup CPU Performance", + "description": "The usage, reported in nanoseconds, of the Cgroup. Compare this with the throttling to discover issues.", + "units": "ns", + "format": "0,0.[0]a", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + null + ], + [ + 1507235540000, + null + ], + [ + 1507235550000, + null + ], + [ + 1507235560000, + null + ], + [ + 1507235570000, + null + ], + [ + 1507235580000, + null + ], + [ + 1507235590000, + null + ], + [ + 1507235600000, + null + ], + [ + 1507235610000, + null + ], + [ + 1507235620000, + null + ], + [ + 1507235630000, + null + ], + [ + 1507235640000, + null + ], + [ + 1507235650000, + null + ], + [ + 1507235660000, + null + ], + [ + 1507235670000, + null + ], + [ + 1507235680000, + null + ], + [ + 1507235690000, + null + ], + [ + 1507235700000, + null + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.os.cgroup.cpu.stat.time_throttled_nanos", + "metricAgg": "max", + "label": "Cgroup Throttling", + "title": "Cgroup CPU Performance", + "description": "The amount of throttled time, reported in nanoseconds, of the Cgroup.", + "units": "ns", + "format": "0,0.[0]a", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + null + ], + [ + 1507235540000, + null + ], + [ + 1507235550000, + null + ], + [ + 1507235560000, + null + ], + [ + 1507235570000, + null + ], + [ + 1507235580000, + null + ], + [ + 1507235590000, + null + ], + [ + 1507235600000, + null + ], + [ + 1507235610000, + null + ], + [ + 1507235620000, + null + ], + [ + 1507235630000, + null + ], + [ + 1507235640000, + null + ], + [ + 1507235650000, + null + ], + [ + 1507235660000, + null + ], + [ + 1507235670000, + null + ], + [ + 1507235680000, + null + ], + [ + 1507235690000, + null + ], + [ + 1507235700000, + null + ] + ] + } + ], + "node_cgroup_stats": [ + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.os.cgroup.cpu.stat.number_of_elapsed_periods", + "metricAgg": "max", + "label": "Cgroup Elapsed Periods", + "title": "Cgroup CFS Stats", + "description": "The number of sampling periods from the Completely Fair Scheduler (CFS). Compare against the number of times throttled.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + null + ], + [ + 1507235540000, + null + ], + [ + 1507235550000, + null + ], + [ + 1507235560000, + null + ], + [ + 1507235570000, + null + ], + [ + 1507235580000, + null + ], + [ + 1507235590000, + null + ], + [ + 1507235600000, + null + ], + [ + 1507235610000, + null + ], + [ + 1507235620000, + null + ], + [ + 1507235630000, + null + ], + [ + 1507235640000, + null + ], + [ + 1507235650000, + null + ], + [ + 1507235660000, + null + ], + [ + 1507235670000, + null + ], + [ + 1507235680000, + null + ], + [ + 1507235690000, + null + ], + [ + 1507235700000, + null + ] + ] + }, + { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.os.cgroup.cpu.stat.number_of_times_throttled", + "metricAgg": "max", + "label": "Cgroup Throttled Count", + "title": "Cgroup CFS Stats", + "description": "The number of times that the CPU was throttled by the Cgroup.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [ + 1507235520000, + null + ], + [ + 1507235530000, + null + ], + [ + 1507235540000, + null + ], + [ + 1507235550000, + null + ], + [ + 1507235560000, + null + ], + [ + 1507235570000, + null + ], + [ + 1507235580000, + null + ], + [ + 1507235590000, + null + ], + [ + 1507235600000, + null + ], + [ + 1507235610000, + null + ], + [ + 1507235620000, + null + ], + [ + 1507235630000, + null + ], + [ + 1507235640000, + null + ], + [ + 1507235650000, + null + ], + [ + 1507235660000, + null + ], + [ + 1507235670000, + null + ], + [ + 1507235680000, + null + ], + [ + 1507235690000, + null + ], + [ + 1507235700000, + null + ] + ] + } + ] + } +} diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/index.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/index.js index a69144ecc5b04..1d3a0f7f5a587 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/index.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/index.js @@ -9,6 +9,7 @@ export default function ({ loadTestFile }) { loadTestFile(require.resolve('./overview')); loadTestFile(require.resolve('./nodes')); loadTestFile(require.resolve('./node_detail')); + loadTestFile(require.resolve('./node_detail_advanced')); loadTestFile(require.resolve('./indices')); loadTestFile(require.resolve('./index_detail')); }); diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail_advanced.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail_advanced.js new file mode 100644 index 0000000000000..1adfd5defc5d0 --- /dev/null +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail_advanced.js @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import expect from 'expect.js'; +import nodeDetailFixture from './fixtures/node_detail_advanced'; + +export default function ({ getService }) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + describe('node detail advanced', () => { + const archive = 'monitoring/singlecluster-three-nodes-shard-relocation'; + const timeRange = { + min: '2017-10-05T20:31:48.000Z', + max: '2017-10-05T20:35:12.000Z' + }; + + before('load archive', () => { + return esArchiver.load(archive); + }); + + after('unload archive', () => { + return esArchiver.unload(archive); + }); + + it('should summarize node with metrics', async () => { + const { body } = await supertest + .post('/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/nodes/jUT5KdxfRbORSCWkb5zjmA') + .set('kbn-xsrf', 'xxx') + .send({ + timeRange, + is_advanced: true + }) + .expect(200); + + console.log(JSON.stringify(body)); + expect(body).to.eql(nodeDetailFixture); + }); + }); +} From 26e282e7c6e1e46c903c8fa6aa75dc10cac19b22 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Fri, 8 Jun 2018 12:12:39 +0200 Subject: [PATCH 076/186] Skip flaky navigational test (#19751) --- test/functional/apps/visualize/_linked_saved_searches.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/apps/visualize/_linked_saved_searches.js b/test/functional/apps/visualize/_linked_saved_searches.js index 51239958845bf..019d7077169ca 100644 --- a/test/functional/apps/visualize/_linked_saved_searches.js +++ b/test/functional/apps/visualize/_linked_saved_searches.js @@ -23,7 +23,8 @@ export default function ({ getPageObjects, getService }) { const retry = getService('retry'); const PageObjects = getPageObjects(['common', 'discover', 'visualize', 'header']); - describe('visualize app', function describeIndexTests() { + // Blocked by: https://github.com/elastic/kibana/issues/19750 + describe.skip('visualize app', function describeIndexTests() { const fromTime = '2015-09-19 06:31:44.000'; const toTime = '2015-09-23 18:31:44.000'; From 0ea560d7219728d572ff7d9668e02d1607330ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Fri, 8 Jun 2018 13:38:12 +0200 Subject: [PATCH 077/186] [backport] Bump to 3.0.2 (#19735) --- package.json | 2 +- yarn.lock | 97 +++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 70 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 6a83f4b4c1d49..2d61c9c062f5b 100644 --- a/package.json +++ b/package.json @@ -238,7 +238,7 @@ "angular-mocks": "1.4.7", "babel-eslint": "8.1.2", "babel-jest": "^22.4.3", - "backport": "2.2.0", + "backport": "3.0.2", "chai": "3.5.0", "chance": "1.0.10", "cheerio": "0.22.0", diff --git a/yarn.lock b/yarn.lock index bd96fa9d6b2db..dbacea8b94f11 100644 --- a/yarn.lock +++ b/yarn.lock @@ -929,11 +929,11 @@ aws4@^1.2.1, aws4@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" -axios@^0.17.0: - version "0.17.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.17.1.tgz#2d8e3e5d0bdbd7327f91bc814f5c57660f81824d" +axios@^0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" dependencies: - follow-redirects "^1.2.5" + follow-redirects "^1.3.0" is-buffer "^1.1.5" b64@3.x.x: @@ -1680,22 +1680,21 @@ backo2@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" -backport@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/backport/-/backport-2.2.0.tgz#f4d6c3e6c7d71077f9b70d155795c3b1889d21cc" +backport@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/backport/-/backport-3.0.2.tgz#a95e20a2399f5a5f4de07070c9a369ef48a70ce7" dependencies: - axios "^0.17.0" - chalk "^2.3.0" - es6-promisify "^5.0.0" + axios "^0.18.0" + chalk "^2.3.2" find-up "^2.1.0" - inquirer "^4.0.0" - joi "^12.0.0" + inquirer "^5.2.0" + joi "^13.1.2" lodash.get "^4.4.2" lodash.isempty "^4.4.0" mkdirp "^0.5.1" - ora "^1.3.0" + ora "^2.0.0" strip-json-comments "^2.0.1" - yargs "^10.0.3" + yargs "^11.0.0" bail@^1.0.0: version "1.0.2" @@ -2560,6 +2559,10 @@ cli-spinners@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.1.0.tgz#f1847b168844d917a671eb9d147e3df497c90d06" +cli-spinners@^1.1.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.3.1.tgz#002c1990912d0d59580c93bd36c056de99e4259a" + cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" @@ -3639,6 +3642,12 @@ default-require-extensions@^1.0.0: dependencies: strip-bom "^2.0.0" +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + dependencies: + clone "^1.0.2" + define-properties@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" @@ -5012,9 +5021,9 @@ focus-trap@^2.0.1: dependencies: tabbable "^1.0.3" -follow-redirects@^1.2.5: - version "1.4.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.4.1.tgz#d8120f4518190f55aac65bb6fc7b85fcd666d6aa" +follow-redirects@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.0.tgz#234f49cf770b7f35b40e790f636ceba0c3a0ab77" dependencies: debug "^3.1.0" @@ -6009,6 +6018,10 @@ hoek@4.X.X, hoek@4.x.x: version "4.2.1" resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" +hoek@5.x.x: + version "5.0.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.3.tgz#b71d40d943d0a95da01956b547f83c4a5b4a34ac" + hoist-non-react-statics@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb" @@ -6314,9 +6327,9 @@ inquirer@^3.0.6, inquirer@^3.2.3: strip-ansi "^4.0.0" through "^2.3.6" -inquirer@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-4.0.2.tgz#cc678b4cbc0e183a3500cc63395831ec956ab0a3" +inquirer@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.0" @@ -6327,8 +6340,7 @@ inquirer@^4.0.0: lodash "^4.3.0" mute-stream "0.0.7" run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" + rxjs "^5.5.2" string-width "^2.1.0" strip-ansi "^4.0.0" through "^2.3.6" @@ -7317,13 +7329,13 @@ joi@9.X.X, joi@9.x.x: moment "2.x.x" topo "2.x.x" -joi@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/joi/-/joi-12.0.0.tgz#46f55e68f4d9628f01bbb695902c8b307ad8d33a" +joi@^13.1.2: + version "13.4.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-13.4.0.tgz#afc359ee3d8bc5f9b9ba6cdc31b46d44af14cecc" dependencies: - hoek "4.x.x" + hoek "5.x.x" isemail "3.x.x" - topo "2.x.x" + topo "3.x.x" jpeg-js@^0.2.0: version "0.2.0" @@ -8248,7 +8260,7 @@ log-symbols@^1.0.2: dependencies: chalk "^1.0.0" -log-symbols@^2.1.0: +log-symbols@^2.1.0, log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" dependencies: @@ -9227,6 +9239,17 @@ ora@^1.3.0: cli-spinners "^1.0.1" log-symbols "^2.1.0" +ora@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ora/-/ora-2.1.0.tgz#6caf2830eb924941861ec53a173799e008b51e5b" + dependencies: + chalk "^2.3.1" + cli-cursor "^2.1.0" + cli-spinners "^1.1.0" + log-symbols "^2.2.0" + strip-ansi "^4.0.0" + wcwidth "^1.0.1" + ordered-read-streams@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" @@ -11233,6 +11256,12 @@ rxjs@^5.4.3: dependencies: symbol-observable "1.0.1" +rxjs@^5.5.2: + version "5.5.11" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.11.tgz#f733027ca43e3bec6b994473be4ab98ad43ced87" + dependencies: + symbol-observable "1.0.1" + rxjs@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.1.0.tgz#833447de4e4f6427b9cec3e5eb9f56415cd28315" @@ -12435,6 +12464,12 @@ topo@2.x.x: dependencies: hoek "4.x.x" +topo@3.x.x: + version "3.0.0" + resolved "https://registry.yarnpkg.com/topo/-/topo-3.0.0.tgz#37e48c330efeac784538e0acd3e62ca5e231fe7a" + dependencies: + hoek "5.x.x" + topojson-client@3, topojson-client@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/topojson-client/-/topojson-client-3.0.0.tgz#1f99293a77ef42a448d032a81aa982b73f360d2f" @@ -13439,6 +13474,12 @@ watchpack@^1.4.0: graceful-fs "^4.1.2" neo-async "^2.5.0" +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + dependencies: + defaults "^1.0.3" + webcola@3.3.6: version "3.3.6" resolved "https://registry.yarnpkg.com/webcola/-/webcola-3.3.6.tgz#6ec0bc7a72b3c467a2f2346a8667d88b439a03b4" From ce2170c94c437ab468dd04c15d8e7b56672fce94 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Fri, 8 Jun 2018 17:29:39 +0530 Subject: [PATCH 078/186] Document Logstash Centralized Configuration Management HTTP APIs (#17706) * Starting to document Logstash config management APIS * Removing copy pasta * Adding delete pipeline API doc * Mention updates in Create Pipeline API doc * Capitalization fix * Adding Retrieve Pipeline API doc * Adding List Pipelines API doc * Fixing typos * Fixing DELETE pipeline API response code * Add description field to GET pipeline response * Update PUT pipeline API response to match implementation * Fixing and annotating GET pipelines response * Add AIP doc reference to index * Adding xpack role * Adding floats * Missed list item * Fixing rebase auto-merge * Adding intro section to Logstash Configuration Management API page * Bolding "experimental" * Fixing typo --- docs/api.asciidoc | 5 +- ...logstash-configuration-management.asciidoc | 20 ++++++++ .../create.asciidoc | 50 +++++++++++++++++++ .../delete.asciidoc | 30 +++++++++++ .../list.asciidoc | 44 ++++++++++++++++ .../retrieve.asciidoc | 42 ++++++++++++++++ 6 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 docs/api/logstash-configuration-management.asciidoc create mode 100644 docs/api/logstash-configuration-management/create.asciidoc create mode 100644 docs/api/logstash-configuration-management/delete.asciidoc create mode 100644 docs/api/logstash-configuration-management/list.asciidoc create mode 100644 docs/api/logstash-configuration-management/retrieve.asciidoc diff --git a/docs/api.asciidoc b/docs/api.asciidoc index cc89999d5e6a7..dc3aa6be4fbd0 100644 --- a/docs/api.asciidoc +++ b/docs/api.asciidoc @@ -28,6 +28,9 @@ entirely. == APIs * <> +* <> -- -include::api/saved-objects.asciidoc[] \ No newline at end of file +include::api/saved-objects.asciidoc[] +include::api/logstash-configuration-management.asciidoc[] + diff --git a/docs/api/logstash-configuration-management.asciidoc b/docs/api/logstash-configuration-management.asciidoc new file mode 100644 index 0000000000000..d788cfb29d711 --- /dev/null +++ b/docs/api/logstash-configuration-management.asciidoc @@ -0,0 +1,20 @@ +[role="xpack"] +[[logstash-configuration-management-api]] +== Logstash Configuration Management API + +The Logstash configuration management API allows users to programmatically integrate with the +Logstash configuration management feature. + +Traditionally users would perform this integration by accessing the the `.logstash` index +directly. *Do not do this!* The structure of this index is subject to change, which could +cause your integration to break. Instead, use the following API. + +* <> +* <> +* <> +* <> + +include::logstash-configuration-management/create.asciidoc[] +include::logstash-configuration-management/retrieve.asciidoc[] +include::logstash-configuration-management/delete.asciidoc[] +include::logstash-configuration-management/list.asciidoc[] \ No newline at end of file diff --git a/docs/api/logstash-configuration-management/create.asciidoc b/docs/api/logstash-configuration-management/create.asciidoc new file mode 100644 index 0000000000000..e3f8a6260d80a --- /dev/null +++ b/docs/api/logstash-configuration-management/create.asciidoc @@ -0,0 +1,50 @@ +[role="xpack"] +[[logstash-configuration-management-api-create]] +=== Create Pipeline + +experimental[This functionality is *experimental* and may be changed or removed completely in a future release.] + +The Create Pipeline API enables you to create a centrally-managed Logstash pipeline. You can also use +it to update an existing pipeline. + +[float] +==== Request + +`PUT /api/logstash/pipeline/` + +[float] +==== Path Parameters + +`id` (required):: + (string) ID for pipeline. Only alphanumeric characters, hyphens, and underscores may be used. + + +[float] +==== Request Body + +`description` (optional):: + (string) Description for the pipeline + +`pipeline` (required):: + (string) Pipeline definition + +`settings` (optional):: + (object) Pipeline settings. Supported settings, represented as object keys, are `pipeline.workers`, `pipeline.batch.size`, `pipeline.batch.delay`, `queue.type`, `queue.max_bytes`, and `queue.checkpoint.writes` + + +[float] +==== Examples + +[source,js] +-------------------------------------------------- +PUT api/logstash/pipeline/hello-world +{ + "pipeline": "input { stdin {} } output { stdout {} }", + "settings": { + "queue.type": "persistent" + } +} +-------------------------------------------------- +// KIBANA + +A successful call returns an HTTP `204 No Content` response. diff --git a/docs/api/logstash-configuration-management/delete.asciidoc b/docs/api/logstash-configuration-management/delete.asciidoc new file mode 100644 index 0000000000000..e286440f9075f --- /dev/null +++ b/docs/api/logstash-configuration-management/delete.asciidoc @@ -0,0 +1,30 @@ +[role="xpack"] +[[logstash-configuration-management-api-delete]] +=== Delete Pipeline + +experimental[This functionality is *experimental* and may be changed or removed completely in a future release.] + +The Delete Pipeline API enables you to delete a centrally-managed Logstash pipeline. + +[float] +==== Request + +`DELETE /api/logstash/pipeline/` + +[float] +==== Path Parameters + +`id` (required):: + (string) ID for pipeline. + + +[float] +==== Examples + +[source,js] +-------------------------------------------------- +DELETE api/logstash/pipeline/hello-world +-------------------------------------------------- +// KIBANA + +A successful call returns an HTTP `204 No Content` response. \ No newline at end of file diff --git a/docs/api/logstash-configuration-management/list.asciidoc b/docs/api/logstash-configuration-management/list.asciidoc new file mode 100644 index 0000000000000..3f60ab240ed20 --- /dev/null +++ b/docs/api/logstash-configuration-management/list.asciidoc @@ -0,0 +1,44 @@ +[role="xpack"] +[[logstash-configuration-management-api-list]] +=== List Pipelines + +experimental[This functionality is *experimental* and may be changed or removed completely in a future release.] + +The List Pipelines API enables you to list all centrally-managed Logstash pipelines. + +[float] +==== Request + +`GET /api/logstash/pipelines` + +[float] +==== Examples + +[source,js] +-------------------------------------------------- +GET api/logstash/pipelines +-------------------------------------------------- +// KIBANA + +A successful call returns a JSON structure similar to the following example: + +[source,js] +-------------------------------------------------- +{ + "pipelines": [ + { + "id": "hello-world", + "description": "Just a simple pipeline", + "last_modified": "2018-04-14T12:23:29.772Z", + "username": "elastic" <1> + }, + { + "id": "sleepy-pipeline", + "description": "", + "last_modified": "2018-03-24T03:41:30.554Z" + } + ] +} +-------------------------------------------------- + +<1> The username property may or may not be present, depending on whether Elastic Security was enabled when the pipeline was created or last updated. \ No newline at end of file diff --git a/docs/api/logstash-configuration-management/retrieve.asciidoc b/docs/api/logstash-configuration-management/retrieve.asciidoc new file mode 100644 index 0000000000000..894d8f7947d1f --- /dev/null +++ b/docs/api/logstash-configuration-management/retrieve.asciidoc @@ -0,0 +1,42 @@ +[role="xpack"] +[[logstash-configuration-management-api-retrieve]] +=== Retrieve Pipeline + +experimental[This functionality is *experimental* and may be changed or removed completely in a future release.] + +The Retrieve Pipeline API enables you to retrieve a centrally-managed Logstash pipeline. + +[float] +==== Request + +`GET /api/logstash/pipeline/` + +[float] +==== Path Parameters + +`id` (required):: + (string) ID for pipeline. + +[float] +==== Examples + +[source,js] +-------------------------------------------------- +GET api/logstash/pipeline/hello-world +-------------------------------------------------- +// KIBANA + +A successful call returns a JSON structure similar to the following example: + +[source,js] +-------------------------------------------------- +{ + "id": "hello-world", + "description": "Just a simple pipeline", + "username": "elastic", + "pipeline": "input { stdin {} } output { stdout {} }", + "settings": { + "queue.type": "persistent" + } +} +-------------------------------------------------- From 2a61e3753f73c56db1b77b4ef0c49b7422c49a8b Mon Sep 17 00:00:00 2001 From: maryia-lapata Date: Fri, 8 Jun 2018 15:03:46 +0300 Subject: [PATCH 079/186] integration i18n-ingine with index pattern tab: edit_index_pattern --- .eslintignore | 2 +- .../edit_index_pattern.html | 45 +++++---- .../edit_index_pattern/edit_index_pattern.js | 13 ++- .../edit_index_pattern/edit_sections.js | 8 +- .../edit_index_pattern/field_controls.html | 4 +- .../index_header/index_header.html | 12 +-- .../components/table/table.js | 93 +++++++++++++------ .../indexed_fields_table.js | 20 ++-- .../scripted_field_editor.html | 7 +- .../scripted_field_editor.js | 14 ++- .../components/call_outs/call_outs.js | 53 ++++++++--- .../components/header/header.js | 17 +++- .../components/table/table.js | 57 ++++++++---- .../scripted_fields_table.js | 59 +++++++----- .../components/add_filter/add_filter.js | 46 +++++---- .../components/header/header.js | 22 ++++- .../components/table/table.js | 59 ++++++++---- .../source_filters_table.js | 47 ++++++---- .../management/sections/indices/index.html | 14 +-- 19 files changed, 390 insertions(+), 202 deletions(-) diff --git a/.eslintignore b/.eslintignore index ef01aad717779..ceff2d9d22291 100644 --- a/.eslintignore +++ b/.eslintignore @@ -28,4 +28,4 @@ bower_components /x-pack/plugins/**/__tests__/fixtures/** **/*.js.snap !/.eslintrc.js -* + diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.html b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.html index 6ef99c10c25b3..b56ae2646f49a 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.html +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.html @@ -5,7 +5,7 @@ data-test-subj="editIndexPattern" class="kuiViewContent" role="region" - aria-label="Index pattern details" + aria-label="{{'management.indices.indexPattern.details_aria' | i18n: {defaultMessage: 'Index pattern details'} }}" > - Time Filter field name: {{indexPattern.timeFieldName}} +

- This page lists every field in the {{::indexPattern.title}} index and the field's associated core type as recorded by Elasticsearch. To change a field type, use the Elasticsearch + - Mapping API +

@@ -37,16 +42,18 @@ >
- - Support for repeating index patterns removed +
- Support for time-interval based index patterns has been removed! In the next major +
@@ -57,14 +64,16 @@ >
- - Mapping conflict - +
- {{conflictFields.length > 1 ? conflictFields.length : 'A'}} field{{conflictFields.length > 1 ? 's' : ''}} {{conflictFields.length > 1 ? 'are' : 'is'}} defined as several types (string, integer, etc) across the indices that match this pattern. You may still be able to use these conflict fields in parts of Kibana, but they will be unavailable for functions that require Kibana to know their type. Correcting this issue will require reindexing your data. +
@@ -96,9 +105,9 @@ @@ -115,7 +124,9 @@ ng-change="changeFilter('indexedFieldTypeFilter', indexedFieldTypeFilter)" ng-options="o for o in indexedFieldTypes" > - + @@ -130,7 +141,9 @@ ng-change="changeFilter('scriptedFieldLanguageFilter', scriptedFieldLanguageFilter)" ng-options="o for o in scriptedFieldLanguages" > - + diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.js index 0651117010d78..988b732266083 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_index_pattern.js @@ -173,7 +173,7 @@ uiRoutes uiModules.get('apps/management') .controller('managementIndicesEdit', function ( - $scope, $location, $route, config, courier, Notifier, Private, AppState, docTitle, confirmModal) { + $scope, $location, $route, config, courier, Notifier, Private, AppState, docTitle, confirmModal, i18n) { const notify = new Notifier(); const $state = $scope.state = new AppState(); const { fieldWildcardMatcher } = Private(FieldWildcardProvider); @@ -234,15 +234,17 @@ uiModules.get('apps/management') $scope.refreshFields = function () { const confirmModalOptions = { - confirmButtonText: 'Refresh', + confirmButtonText: i18n('management.indices.editIndexPattern.refresh', { defaultMessage: 'Refresh' }), onConfirm: async () => { await $scope.indexPattern.init(true); $scope.fields = $scope.indexPattern.getNonScriptedFields(); }, - title: 'Refresh field list?' + title: i18n('management.indices.editIndexPattern.refresh.question', { defaultMessage: 'Refresh field list?' }) }; confirmModal( - 'This action resets the popularity counter of each field.', + i18n( + 'management.indices.editIndexPattern.refresh.describe', + { defaultMessage: 'This action resets the popularity counter of each field.' }), confirmModalOptions ); }; @@ -278,7 +280,8 @@ uiModules.get('apps/management') $scope.setIndexPatternsTimeField = function (field) { if (field.type !== 'date') { - notify.error('That field is a ' + field.type + ' not a date.'); + notify.error(i18n('management.indices.editIndexPattern.error.wrongType', + { values: { fieldType: field.type }, defaultMessage: 'That field is a {fieldType} not a date.' })); return; } $scope.indexPattern.timeFieldName = field.name; diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_sections.js b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_sections.js index cdc65a110636f..072df93df3b24 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_sections.js +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/edit_sections.js @@ -19,7 +19,7 @@ import _ from 'lodash'; -export function IndicesEditSectionsProvider() { +export function IndicesEditSectionsProvider(i18n) { return function (indexPattern) { const fieldCount = _.countBy(indexPattern.fields, function (field) { @@ -34,17 +34,17 @@ export function IndicesEditSectionsProvider() { return [ { - title: 'Fields', + title: i18n('management.indices.editIndexPattern.tabs.fields', { defaultMessage: 'Fields' }), index: 'indexedFields', count: fieldCount.indexed }, { - title: 'Scripted fields', + title: i18n('management.indices.editIndexPattern.tabs.scripted', { defaultMessage: 'Scripted fields' }), index: 'scriptedFields', count: fieldCount.scripted }, { - title: 'Source filters', + title: i18n('management.indices.editIndexPattern.tabs.source', { defaultMessage: 'Source filters' }), index: 'sourceFilters', count: fieldCount.sourceFilters } diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/field_controls.html b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/field_controls.html index 794f1da2a7b79..6d3c6614c8926 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/field_controls.html +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/field_controls.html @@ -2,7 +2,7 @@ @@ -12,7 +12,7 @@ ng-if="field.scripted" ng-click="remove(field)" class="kuiButton kuiButton--danger kuiButton--small" - aria-label="Delete" + aria-label="{{'management.indices.indexPattern.btn.delete' | i18n: {defaultMessage: 'Delete'} }}" > diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/index_header/index_header.html b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/index_header/index_header.html index 2e2d828cd6e2e..eefc8eae9f81c 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/index_header/index_header.html +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/index_header/index_header.html @@ -18,8 +18,8 @@