diff --git a/.eslintignore b/.eslintignore
index f5df2d394adf..f460657cb3b8 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -30,3 +30,7 @@ target
/packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/
/packages/osd-ui-framework/dist
/packages/osd-ui-shared-deps/flot_charts
+
+# antlr overrides
+/src/plugins/data/public/antlr/opensearch_sql/.generated/*
+/src/plugins/data/public/antlr/opensearch_sql/grammar/**/*
diff --git a/.eslintrc.js b/.eslintrc.js
index ad6cea998136..5ab6fdc41483 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -272,26 +272,22 @@ module.exports = {
basePath: __dirname,
zones: [
{
- target: ['(src)/**/*', '!src/core/**/*'],
+ target: ['src/**/*', '!src/core/**/*'],
from: ['src/core/utils/**/*'],
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
},
{
- target: ['(src)/plugins/*/server/**/*'],
- from: ['(src)/plugins/*/public/**/*'],
+ target: ['src/plugins/*/server/**/*'],
+ from: ['src/plugins/*/public/**/*'],
errorMessage: `Server code can not import from public, use a common directory.`,
},
{
- target: ['(src)/plugins/*/common/**/*'],
- from: ['(src)/plugins/*/(server|public)/**/*'],
+ target: ['src/plugins/*/common/**/*'],
+ from: ['src/plugins/*/(server|public)/**/*'],
errorMessage: `Common code can not import from server or public, use a common directory.`,
},
{
- target: [
- 'src/legacy/**/*',
- '(src)/plugins/**/(public|server)/**/*',
- 'examples/**/*',
- ],
+ target: ['src/legacy/**/*', 'src/plugins/**/(public|server)/**/*', 'examples/**/*'],
from: [
'src/core/public/**/*',
'!src/core/public/index.ts', // relative import
@@ -320,22 +316,22 @@ module.exports = {
{
target: [
'src/legacy/**/*',
- '(src)/plugins/**/(public|server)/**/*',
+ 'src/plugins/**/(public|server)/**/*',
'examples/**/*',
- '!(src)/**/*.test.*',
+ '!src/**/*.test.*',
],
from: [
- '(src)/plugins/**/(public|server)/**/*',
- '!(src)/plugins/**/(public|server)/mocks/index.{js,mjs,ts}',
- '!(src)/plugins/**/(public|server)/(index|mocks).{js,mjs,ts,tsx}',
+ 'src/plugins/**/(public|server)/**/*',
+ '!src/plugins/**/(public|server)/mocks/index.{js,mjs,ts}',
+ '!src/plugins/**/(public|server)/(index|mocks).{js,mjs,ts,tsx}',
],
allowSameFolder: true,
errorMessage: 'Plugins may only import from top-level public and server modules.',
},
{
target: [
- '(src)/plugins/**/*',
- '!(src)/plugins/**/server/**/*',
+ 'src/plugins/**/*',
+ '!src/plugins/**/server/**/*',
'examples/**/*',
'!examples/**/server/**/*',
@@ -343,7 +339,7 @@ module.exports = {
from: [
'src/core/server',
'src/core/server/**/*',
- '(src)/plugins/*/server/**/*',
+ 'src/plugins/*/server/**/*',
'examples/**/server/**/*',
],
errorMessage:
@@ -355,7 +351,7 @@ module.exports = {
errorMessage: 'The core cannot depend on any plugins.',
},
{
- target: ['(src)/plugins/*/public/**/*'],
+ target: ['src/plugins/*/public/**/*'],
from: ['ui/**/*'],
errorMessage: 'Plugins cannot import legacy UI code.',
},
@@ -755,5 +751,14 @@ module.exports = {
'no-undef': 'off',
},
},
+ {
+ files: [
+ 'src/plugins/data/public/antlr/opensearch_sql/.generated/*',
+ 'src/plugins/data/public/antlr/opensearch_sql/grammar/**/*',
+ ],
+ rules: {
+ 'filenames/match-regex': 'off',
+ },
+ },
],
};
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index bf58f69e1c83..891c858aa1a5 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1 +1 @@
-* @ananzh @kavilla @AMoo-Miki @ashwin-pc @joshuarrrr @abbyhu2000 @zengyan-amazon @zhongnansu @manasvinibs @ZilongX @Flyingliuhub @curq @bandinib-amzn @SuZhou-Joe @ruanyl @BionIT @xinruiba @zhyuanqi @mengweieric
+* @ananzh @kavilla @AMoo-Miki @ashwin-pc @joshuarrrr @abbyhu2000 @zengyan-amazon @zhongnansu @manasvinibs @ZilongX @Flyingliuhub @curq @bandinib-amzn @SuZhou-Joe @ruanyl @BionIT @xinruiba @zhyuanqi @mengweieric @LDrago27 @virajsanghvi @sejli @joshuali925
diff --git a/.github/release.yml b/.github/release.yml
new file mode 100644
index 000000000000..52064a31d8bc
--- /dev/null
+++ b/.github/release.yml
@@ -0,0 +1,37 @@
+# .github/release.yml
+
+changelog:
+ exclude:
+ labels:
+ - ignore-for-release
+ authors:
+ - amazon-auto
+ categories:
+ - title: 💥 Breaking Changes
+ labels:
+ - breaking
+ - title: 📈 Features/Enhancements
+ labels:
+ - enhancement
+ - title: 🐛 Bug Fixes
+ labels:
+ - bug
+ - title: 🛡 Security
+ labels:
+ - cve
+ - security vulnerability
+ - title: 🚞 Infrastructure
+ labels:
+ - infra
+ - title: 📝 Documentation
+ labels:
+ - docs
+ - title: 🛠 Maintenance
+ labels:
+ - maintenance
+ - title: 🪛 Refactoring
+ labels:
+ - refactor
+ - title: 🔩 Tests
+ labels:
+ - test
\ No newline at end of file
diff --git a/.github/workflows/build_and_test_workflow.yml b/.github/workflows/build_and_test_workflow.yml
index efa86d7dc0fa..da7b5950dd97 100644
--- a/.github/workflows/build_and_test_workflow.yml
+++ b/.github/workflows/build_and_test_workflow.yml
@@ -11,6 +11,7 @@ on:
- '**/*.md'
- 'docs/**'
- '.lycheeignore'
+ - 'CODEOWNERS'
- 'changelogs/fragments/**'
pull_request:
branches: [ '**', '!feature/**' ]
@@ -18,6 +19,7 @@ on:
- '**/*.md'
- 'docs/**'
- '.lycheeignore'
+ - 'CODEOWNERS'
- 'changelogs/fragments/**'
env:
diff --git a/.github/workflows/cypress_workflow.yml b/.github/workflows/cypress_workflow.yml
index 669f596df898..b404f9c46240 100644
--- a/.github/workflows/cypress_workflow.yml
+++ b/.github/workflows/cypress_workflow.yml
@@ -32,7 +32,7 @@ env:
TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }}
TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}"
FTR_PATH: 'ftr'
- START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false'
+ START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=false'
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false'
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
diff --git a/.gitignore b/.gitignore
index d72d66a6d17d..f62e798ad6a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,3 +68,6 @@ snapshots.js
# Yarn local mirror content
.yarn-local-mirror
+
+# Ignore the generated antlr files
+/src/plugins/data/public/antlr/**/grammar/.antlr/
\ No newline at end of file
diff --git a/.lycheeignore b/.lycheeignore
index 89b3c520d87d..e5a73cf9480c 100644
--- a/.lycheeignore
+++ b/.lycheeignore
@@ -88,4 +88,5 @@ https://unpkg.com/@elastic/
https://codeload.github.com/
https://www.quandl.com/api/v1/datasets/
https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+http:/adomas.org/javascript-mouse-wheel/
site.com
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1eb066f49315..7654e95535ad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,210 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased]
+## [2.16.0-2024-07-30](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/2.16.0)
+
+### 💥 Breaking Changes
+
+### Deprecations
+
+ - Remove data enhancements config and readonly flag. Removes dead url link, ([#7291](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7291))
+
+### 🛡 Security
+
+ - [CVE-2024-28863] Bump tar from 6.1.11 to 6.2.1 ([#6492](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6492))
+ - [CVE-2024-33883] Bump ejs from `3.1.7` to `3.1.10` ([#6770](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6770))
+ - [CVE-2024-4067][CVE-2024-4068] Bump packages dependent on `braces` versions lower than 3.0.3 ([#6911](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6911))
+ - [GHSA-x565-32qp-m3vf] Bump `jimp` to remove phin dependency ([#6977](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6977))
+ - [SNYK-JS-AXIOS-6144788] Bump axios to `1.7.2` ([#7149](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7149))
+ - [CVE-2024-37890] Bump ws from `8.5.0` to `8.17.1` and from `7.5.7` to `7.5.10` ([#7153](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7153))
+
+### 📈 Features/Enhancements
+
+ - Make theme and dark mode settings user/device specific (in local storage), with opt-out ([#5652](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5652))
+ - [Workspace]Import sample data to current workspace ([#6105](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6105))
+ - [Data Explorer] Allow render from View directly, not from Data Explorer ([#6167](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6167))
+ - [MDS] Allow querying from data sources in Timeline visualizations ([#6385](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6385))
+ - [MDS] Prevent importing of data source object when MDS is not enabled ([#6395](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6395))
+ - [VisBuilder] Change VisBuilder from experimental to production ([#6436](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6436))
+ - Adds `migrations.delete` to delete saved objects by type during a migration ([#6443](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6443))
+ - [Workspace] Duplicate selected/all saved objects ([#6478](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6478))
+ - [Workspace] Dashboard admin(groups/users) implementation. ([#6554](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6554))
+ - Support language selector from the data plugin ([#6613](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6613))
+ - Add Server Side Batching for UI Metric Colector ([#6721](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6721))
+ - Make Field Name Search Filter Case Insensitive ([#6759](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6759))
+ - Add data source selection service to support storing and getting selected data source updates ([#6827](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6827))
+ - [Workspace] Only OSD admin can create workspace ([#6831](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6831))
+ - [Workspace]Add use cases to workspace form ([#6887](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6887))
+ - Add missing aria-label for discover page ([#6898](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6898))
+ - Remove endpoint validation for create data source saved object API ([#6899](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6899))
+ - [Workspace] Change description field to textarea ([#6907](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6907))
+ - Use JSON11 for handling long numerals ([#6915](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6915))
+ - [MDS] Allow adding sample data for Timeline visualizations ([#6919](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6919))
+ - [Multi DataSource] Add removedComponentIds for data source selection service ([#6920](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6920))
+ - [MD]Use placeholder for data source credentials fields when export saved object ([#6928](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6928))
+ - Query editor and UI settings toggle ([#7001](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7001))
+ - Add search bar extensions ([#7034](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7034))
+ - [Workspace] Refactor the UI of workspace picker ([#7045](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7045))
+ - Render the datasource selector component conditionally ([#7059](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7059))
+ - Introduce new interface for group ([#7060](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7060))
+ - Support data source assignment in workspace. ([#7101](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7101))
+ - [Workspace] Capabilities service add dashboard admin flag ([#7103](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7103))
+ - Onboard dataframes support to MDS and create dataframe before request ([#7106](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7106))
+ - Enhance Drag & Drop functionality in Vis Builder ([#7107](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7107))
+ - Comply `recent items` with workspace ([#7115](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7115))
+ - [Navigation-next] Add register nav group updater in chrome service ([#7117](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7117))
+ - [Workspace] Refactor workspace form UI ([#7133](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7133))
+ - [MDS] Observability Datasource Plugin migration with MDS support ([#7143](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7143))
+ - Add description field in App. ([#7152](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7152))
+ - Query editor and dataframes datasources container ([#7157](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7157))
+ - [Workspace] Delete the virtual global workspace ([#7165](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7165))
+ - 1. Add current nav group into chrome service 2. Prepend current nav group into breadcrumb ([#7166](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7166))
+ - [QueryEditorExtensions] change `isEnabled` to an observable ([#7183](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7183))
+ - Support workspace level default data source ([#7188](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7188))
+ - Introduced an new plugin contentManagement for dynamic content rendering ([#7201](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7201))
+ - Address styling of non-primary buttons by making secondary/empty ([#7211](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7211))
+ - Add query enhancements plugin as a core plugin ([#7212](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7212))
+ - Hide select data source panel for non dashboard admin in workspace create/edit page ([#7213](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7213))
+ - [DataSource] Restrict to edit data source on the DSM UI. ([#7214](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7214))
+ - Use registered nav group as workspace use case ([#7221](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7221))
+ - [navigation-next] Add new left navigation ([#7230](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7230))
+ - Add all use case ([#7235](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7235))
+ - [navigation-next] add recent works in new homepage ([#7237](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7237))
+ - [Workspace] Support workspace detail page ([#7241](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7241))
+ - [Workspace] Register workspace settings under setup and settings ([#7242](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7242))
+ - Register workspace list card into home page ([#7247](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7247))
+ - Add recent items popup in top navigation ([#7257](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7257))
+ - [navigation-next] Add new category ([#7275](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7275))
+ - Enable landing page for settings and data administration ([#7282](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7282))
+ - Support PPL in vega visualization ([#7285](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7285))
+ - [VisBuilder] Add Capability to generate dynamic vega ([#7288](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7288))
+ - Recover data source management in workspace ([#7296](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7296))
+ - Disable certain routes when data_source.manageableBy is none ([#7298](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7298))
+ - [navigation-next] fix: redirect to standard index pattern applications while nav group is enabled ([#7305](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7305))
+ - Disable inputs in edit data source screen when data_source.manageableBy is none ([#7307](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7307))
+ - Update query enhancement UI ([#7309](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7309))
+ - [Workspace]Add "All use case" option to workspace form ([#7318](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7318))
+ - [MDS] Data Connection details page with MDS support ([#7323](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7323))
+ - Use compressed DataSourceSelector ([#7329](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7329))
+ - [Workspace] Register four get started cards in home page ([#7333](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7333))
+ - [Auto Suggest] OpenSearch SQL autosuggest with ANTLR ([#7336](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7336))
+ - [navigation-next] update category ([#7339](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7339))
+ - Add home page static list card ([#7351](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7351))
+ - [Workspace]Hide create workspace button for non dashboard admin ([#7357](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7357))
+ - Enrich breadcrumbs by workspace and use case ([#7360](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7360))
+ - Bump OUI to 1.8.0 ([#7363](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7363))
+ - [MDS] Observability Datasource Plugin migration with MDS support for Data Connection Table ([#7371](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7371))
+ - Add MDS support along with a few cleanup and tests update ([#7463](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7463))
+ - Add back data set navigator to control state issues ([#7492](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7492))
+ - Fix discover options' location ([#7581](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7581))
+
+### 🐛 Bug Fixes
+
+ - [VisBuilder][BUG] Flat render structure in Metric and Table Vis ([#6674](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6674))
+ - [MDS] Add a new message to data source components when there are no compatible datasources ([#6678](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6678))
+ - Adjust the padding size for aggregated view ([#6715](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6715))
+ - Add more test for icon and aggregated view ([#6729](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6729))
+ - [OSD Availability] Prevent OSD process crashes when disk is full ([#6733](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6733))
+ - Add test for edit data source form ([#6742](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6742))
+ - Add test for data_source_error_menu, data_source_item, data_source_multi_selectable ([#6752](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6752))
+ - Add test for toast button and validation form ([#6755](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6755))
+ - Show error toast when fail to delete saved objects ([#6756](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6756))
+ - Lint checker failure fix ([#6771](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6771))
+ - Fix workspace name duplication check ([#6776](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6776))
+ - Error message is not formatted in vis_type_vega url parser. ([#6777](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6777))
+ - [Discover][Bug] Migrate global state from legacy URL ([#6780](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6780))
+ - Quickrange selection fix ([#6782](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6782))
+ - Bug Fixes for Vis Builder ([#6811](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6811))
+ - Fix endpoint validation by passing in request when creating datasource client ([#6822](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6822))
+ - Update index pattern references with data source when import sample data ([#6851](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6851))
+ - Remove unused import and property which broke compilation ([#6879](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6879))
+ - Fix not setting the default data source when creating data source bug ([#6908](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6908))
+ - Close any open system flyout when changing view mode of the dashboard ([#6923](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6923))
+ - Add TSVB Support for adding sample data ([#6940](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6940))
+ - Fix web log sample visualization & vis-builder not rendering with data source issue ([#6948](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6948))
+ - [MDS] Include data source name when importing a timeline visualization ([#6954](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6954))
+ - Update z-index of sidecar container to make it more than mask, from 1000 to 1001. ([#6964](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6964))
+ - [Discover] Check if the timestamp is already included to remove duplicate col ([#6983](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6983))
+ - Highlight the anchor row in surrounding doc view ([#7025](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7025))
+ - [MDS] Add data source engine type to data source saved object ([#7026](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7026))
+ - Fix colors of the visualizations with more than 10 items ([#7051](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7051))
+ - [BUG][NewHomePage] Temp Solution to avoid crash for anonymous user with no write permission ([#7054](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7054))
+ - [Discover] Allow the last column of a table wider than the window to show up properly ([#7058](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7058))
+ - Update error message in timeline visualization when MDS disabled ([#7069](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7069))
+ - Fix object empty check and minor perf issue in query editor extensions ([#7077](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7077))
+ - Remove angular related comment and code ([#7087](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7087))
+ - [MDS][Version Decoupling] Add support of Version Decoupling in Index Patterns Dashboards Plugin ([#7100](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7100))
+ - [Workspace]Restrict saved objects finding when workspace enabled ([#7125](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7125))
+ - [MDS][Version Decoupling] Add support of required backend plugins check on data sources ([#7146](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7146))
+ - [MDS] Fix the dsm plugin setup when mds feature flag is disabled ([#7163](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7163))
+ - [MDS][Version Decoupling] Add dataSourceVersion' and 'installedPlugins in viewer returns ([#7172](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7172))
+ - Break new lines in table cell in legacy discover ([#7207](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7207))
+ - [Sample Data] Updates sample dashboard title in sample web logs data ([#7233](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7233))
+ - Discover page status stuck in loading State ([#7252](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7252))
+ - Unassign data source before deleteByWorkspace ([#7279](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7279))
+ - Unused config setting and remove data sources as a required plugin. ([#7314](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7314))
+ - Fix wrapping of labels in filter by type popover ([#7327](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7327))
+ - [Navigation] Update dev tools tab css for new left navigation ([#7328](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7328))
+ - Data source selector in dev tools tab moved to left ([#7347](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7347))
+ - [navigation-next] Fix issues. ([#7356](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7356))
+ - [DataSource] No restriction on setting default data source ([#7396](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7396))
+ - Make breadcrumb of 4 new added applications comply with BrowserRouter. ([#7401](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7401))
+ - [Bug][Workspace] Navigate to detail page when clicking all use case workspace ([#7405](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7405))
+ - [Version Decoupling] Add data source version and installed plugins in data source viewer returns ([#7420](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7420))
+ - [Bug][Workspace] Add permission validation at workspace detail page ([#7435](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7435))
+ - [Bug][Data Source] Move data source manageable feature flag to DSM plugin ([#7440](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7440))
+ - Update recent items icon from SVG to react component ([#7478](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7478))
+ - [MDS] Fix the hide local cluster config ([#7497](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7497))
+ - Update icon of recent items from OUI library to enable dark mode ([#7508](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7508))
+ - Fix data source picker trigger local cluster call by default ([#7528](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7528))
+ - Fix babel error ([#7541](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7541))
+ - Fix tables not displaying in navigator and add local cluster to datasources ([#7542](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7542))
+ - Fixes Discover next styling ([#7546](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7546))
+ - [navigation]feat: redirect user to home in global when workspace is enabled ([#7551](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7551))
+ - [Workspace]Add workspaces and permissions fields into saved objects _bulk_get response ([#7565](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7565))
+ - Fixes databases not being displayed upon success ([#7567](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7567))
+
+### 🚞 Infrastructure
+
+### 📝 Documentation
+
+ - Add zhyuanqi as maintainer ([#6788](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6788))
+ - Move @BSFishy to emeritus maintainer ([#6790](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6790))
+ - Add mengweieric as maintainer ([#6798](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6798))
+ - Add OpenAPI specification for GET and CREATE saved object API ([#6799](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6799))
+ - Add example for saved object creation part for openapi doc. ([#6855](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6855))
+ - Add openAPI doc for saved_object find api ([#6856](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6856))
+ - Add OpenAPI specification for bulk create and bulk update saved object APIs ([#6859](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6859))
+ - Add OpenAPI specification for bulk_get saved object APIs ([#6860](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6860))
+ - Add OpenAPI specification for update, delete and migrate saved object API ([#6864](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6864))
+ - Add OpenAPI specification for import and export saved object api ([#6872](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6872))
+ - Add OpenAPI specifications for resolve import errors api ([#6885](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6885))
+ - Add Suchit as maintainer ([#6980](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6980))
+ - Add Viraj as maintainer ([#7196](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7196))
+ - Add OpenAPI specification for API for retrieving fields of index patterns ([#7270](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7270))
+ - Add Sean as maintainer ([#7458](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7458))
+ - Add Joshua as maintainer ([#7553](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7553))
+
+### 🛠 Maintenance
+
+ - Skip running tests for updates in CODEOWNERS ([#7197](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7197))
+
+### 🪛 Refactoring
+
+ - Unify getDefaultDataSourceId and export ([#6843](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6843))
+ - [MDS] Refactor error handling in data source management plugin to use DataSourceError ([#6903](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6903))
+ - [Look&Feel] Refactor to use semantic headers for page, modal & flyout ([#7192](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7192))
+ - [Look&Feel] Consistency of Plus Icons ([#7195](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7195))
+ - [Look&Feel] Update Popover Padding Size ([#7200](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7200))
+ - [Look&Feel] Replace browser tooltip usage with OUI tooltip ([#7231](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7231))
+ - [Look&Feel] Use small EuiTabs and EuiTabbedContent across the board ([#7232](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7232))
+ - Density and consistency changes for discover and query bar ([#7299](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7299))
+ - [Look&Feel] Apply guidance for visBuilder ([#7341](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7341))
+ - [Look&Feel] Apply small popover padding and add Oui tooltips ([#7523](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7523))
+ - [Look&Feel] Discover and Query Management fix ([#7530](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7530))
+
+### 🔩 Tests
+
### 💥 Breaking Changes
### Deprecations
@@ -16,6 +220,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### 📈 Features/Enhancements
- [Multiple Datasource] Add TLS configuration for multiple data sources ([#6171](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6171))
+- [Multiple DataSource] Do not support import data source object to Local cluster when not enable data source ([#6395](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6395))
### 🐛 Bug Fixes
@@ -65,7 +270,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Multiple Datasource] Able to Hide "Local Cluster" option from datasource DropDown ([#5827](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5827))
- [Multiple Datasource] Add api registry and allow it to be added into client config in data source plugin ([#5895](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5895))
- [Multiple Datasource] Refactor client and legacy client to use authentication registry ([#5881](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5881))
-- [Theme] Make theme and dark mode settings user/device specific (in local storage), with opt-out ([#5652](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5652))
### 🐛 Bug Fixes
diff --git a/MAINTAINERS.md b/MAINTAINERS.md
index 7f7dff5d37fe..321d9ab02794 100644
--- a/MAINTAINERS.md
+++ b/MAINTAINERS.md
@@ -25,6 +25,10 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
| Xinrui Bai | [xinruiba](https://github.com/xinruiba) | Amazon |
| Ella Zhu | [zhyuanqi](https://github.com/zhyuanqi) | Amazon |
| Eric Wei | [mengweieric](https://github.com/mengweieric) | Amazon |
+| Suchit Sahoo | [LDrago27](https://github.com/LDrago27) | Amazon |
+| Viraj Sanghvi | [virajsanghvi](https://github.com/virajsanghvi) | Amazon |
+| Sean Li | [sejli](https://github.com/sejli) | Amazon |
+| Joshua Li | [joshuali925](https://github.com/joshuali925) | Amazon |
## Emeritus
diff --git a/changelogs/fragments/5652.yml b/changelogs/fragments/5652.yml
deleted file mode 100644
index fe6ed9dc1da3..000000000000
--- a/changelogs/fragments/5652.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- Make theme and dark mode settings user/device specific (in local storage), with opt-out ([#5652](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5652))
\ No newline at end of file
diff --git a/changelogs/fragments/6105.yml b/changelogs/fragments/6105.yml
deleted file mode 100644
index 30038aad59c3..000000000000
--- a/changelogs/fragments/6105.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- [Workspace]Import sample data to current workspace ([#6105](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6105))
\ No newline at end of file
diff --git a/changelogs/fragments/6443.yml b/changelogs/fragments/6443.yml
deleted file mode 100644
index 2de7191e0d09..000000000000
--- a/changelogs/fragments/6443.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- Adds `migrations.delete` to delete saved objects by type during a migration ([#6443](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6443))
\ No newline at end of file
diff --git a/changelogs/fragments/6492.yml b/changelogs/fragments/6492.yml
deleted file mode 100644
index 1212133215c5..000000000000
--- a/changelogs/fragments/6492.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-security:
-- [CVE-2024-28863] Bump tar from 6.1.11 to 6.2.1 ([#6492](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6492))
\ No newline at end of file
diff --git a/changelogs/fragments/6554.yml b/changelogs/fragments/6554.yml
deleted file mode 100644
index b3944b967773..000000000000
--- a/changelogs/fragments/6554.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- [Workspace] Dashboard admin(groups/users) implementation. ([#6554](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6554))
\ No newline at end of file
diff --git a/changelogs/fragments/6613.yml b/changelogs/fragments/6613.yml
deleted file mode 100644
index 49cd01f52fdd..000000000000
--- a/changelogs/fragments/6613.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- Support language selector from the data plugin ([#6613](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6613))
\ No newline at end of file
diff --git a/changelogs/fragments/6678.yml b/changelogs/fragments/6678.yml
deleted file mode 100644
index 46e9568f5653..000000000000
--- a/changelogs/fragments/6678.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- [MDS] Add a new message to data source components when there are no compatible datasources ([#6678](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6678))
\ No newline at end of file
diff --git a/changelogs/fragments/6715.yml b/changelogs/fragments/6715.yml
deleted file mode 100644
index 4d5c07f57bd5..000000000000
--- a/changelogs/fragments/6715.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Adjust the padding size for aggregated view ([#6715](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6715))
\ No newline at end of file
diff --git a/changelogs/fragments/6721.yml b/changelogs/fragments/6721.yml
deleted file mode 100644
index 25d2a25b2fbb..000000000000
--- a/changelogs/fragments/6721.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- Add Server Side Batching for UI Metric Colector ([#6721](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6721))
\ No newline at end of file
diff --git a/changelogs/fragments/6729.yml b/changelogs/fragments/6729.yml
deleted file mode 100644
index 8a564e684ffc..000000000000
--- a/changelogs/fragments/6729.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Add more test for icon and aggregated view ([#6729](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6729))
\ No newline at end of file
diff --git a/changelogs/fragments/6733.yml b/changelogs/fragments/6733.yml
deleted file mode 100644
index 2021bce6c9dc..000000000000
--- a/changelogs/fragments/6733.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- [OSD Availability] Prevent OSD process crashes when disk is full ([#6733](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6733))
\ No newline at end of file
diff --git a/changelogs/fragments/6742.yml b/changelogs/fragments/6742.yml
deleted file mode 100644
index 390210dff311..000000000000
--- a/changelogs/fragments/6742.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Add test for edit data source form ([#6742](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6742))
\ No newline at end of file
diff --git a/changelogs/fragments/6752.yml b/changelogs/fragments/6752.yml
deleted file mode 100644
index f43473bea2b8..000000000000
--- a/changelogs/fragments/6752.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Add test for data_source_error_menu, data_source_item, data_source_multi_selectable ([#6752](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6752))
\ No newline at end of file
diff --git a/changelogs/fragments/6755.yml b/changelogs/fragments/6755.yml
deleted file mode 100644
index 8e06db889066..000000000000
--- a/changelogs/fragments/6755.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Add test for toast button and validation form ([#6755](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6755))
\ No newline at end of file
diff --git a/changelogs/fragments/6756.yml b/changelogs/fragments/6756.yml
deleted file mode 100644
index 9cad7bffc99d..000000000000
--- a/changelogs/fragments/6756.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Show error toast when fail to delete saved objects ([#6756](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6756))
\ No newline at end of file
diff --git a/changelogs/fragments/6759.yml b/changelogs/fragments/6759.yml
deleted file mode 100644
index ef7e5cddddda..000000000000
--- a/changelogs/fragments/6759.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- Make Field Name Search Filter Case Insensitive ([#6759](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6759))
\ No newline at end of file
diff --git a/changelogs/fragments/6770.yml b/changelogs/fragments/6770.yml
deleted file mode 100644
index 19dee5d37b46..000000000000
--- a/changelogs/fragments/6770.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-security:
-- [CVE-2024-33883] Bump ejs from `3.1.7` to `3.1.10` ([#6770](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6770))
\ No newline at end of file
diff --git a/changelogs/fragments/6771.yml b/changelogs/fragments/6771.yml
deleted file mode 100644
index 454dd0d17565..000000000000
--- a/changelogs/fragments/6771.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Lint checker failure fix ([#6771](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6771))
\ No newline at end of file
diff --git a/changelogs/fragments/6776.yml b/changelogs/fragments/6776.yml
deleted file mode 100644
index eb976800efa4..000000000000
--- a/changelogs/fragments/6776.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Fix workspace name duplication check ([#6776](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6776))
\ No newline at end of file
diff --git a/changelogs/fragments/6777.yml b/changelogs/fragments/6777.yml
deleted file mode 100644
index 9e3a63925baa..000000000000
--- a/changelogs/fragments/6777.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Error message is not formatted in vis_type_vega url parser. ([#6777](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6777))
\ No newline at end of file
diff --git a/changelogs/fragments/6780.yml b/changelogs/fragments/6780.yml
deleted file mode 100644
index 033cd26aec1e..000000000000
--- a/changelogs/fragments/6780.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- [Discover][Bug] Migrate global state from legacy URL ([#6780](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6780))
\ No newline at end of file
diff --git a/changelogs/fragments/6782.yml b/changelogs/fragments/6782.yml
deleted file mode 100644
index 19349a8de101..000000000000
--- a/changelogs/fragments/6782.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Quickrange selection fix ([#6782](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6782))
\ No newline at end of file
diff --git a/changelogs/fragments/6788.yml b/changelogs/fragments/6788.yml
deleted file mode 100644
index a032e911c446..000000000000
--- a/changelogs/fragments/6788.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add zhyuanqi as maintainer ([#6788](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6788))
\ No newline at end of file
diff --git a/changelogs/fragments/6790.yml b/changelogs/fragments/6790.yml
deleted file mode 100644
index afd05b60c082..000000000000
--- a/changelogs/fragments/6790.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Move @BSFishy to emeritus maintainer ([#6790](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6790))
\ No newline at end of file
diff --git a/changelogs/fragments/6798.yml b/changelogs/fragments/6798.yml
deleted file mode 100644
index de03d466154b..000000000000
--- a/changelogs/fragments/6798.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add mengweieric as maintainer ([#6798](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6798))
\ No newline at end of file
diff --git a/changelogs/fragments/6799.yml b/changelogs/fragments/6799.yml
deleted file mode 100644
index 0fc28064724d..000000000000
--- a/changelogs/fragments/6799.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add OpenAPI specification for GET and CREATE saved object API ([#6799](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6799))
\ No newline at end of file
diff --git a/changelogs/fragments/6811.yml b/changelogs/fragments/6811.yml
deleted file mode 100644
index b7901437ca61..000000000000
--- a/changelogs/fragments/6811.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Bug Fixes for Vis Builder ([#6811](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6811))
\ No newline at end of file
diff --git a/changelogs/fragments/6822.yml b/changelogs/fragments/6822.yml
deleted file mode 100644
index 83df4b59675c..000000000000
--- a/changelogs/fragments/6822.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Fix endpoint validation by passing in request when creating datasource client ([#6822](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6822))
\ No newline at end of file
diff --git a/changelogs/fragments/6827.yml b/changelogs/fragments/6827.yml
deleted file mode 100644
index ce47fd32b7bd..000000000000
--- a/changelogs/fragments/6827.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- Add data source selection service to support storing and getting selected data source updates ([#6827](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6827))
\ No newline at end of file
diff --git a/changelogs/fragments/6831.yml b/changelogs/fragments/6831.yml
deleted file mode 100644
index a7dc8210023b..000000000000
--- a/changelogs/fragments/6831.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- [Workspace] Only OSD admin can create workspace ([#6831](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6831))
\ No newline at end of file
diff --git a/changelogs/fragments/6843.yml b/changelogs/fragments/6843.yml
deleted file mode 100644
index 2c483392bc2d..000000000000
--- a/changelogs/fragments/6843.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-refactor:
-- Unify getDefaultDataSourceId and export ([#6843](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6843))
\ No newline at end of file
diff --git a/changelogs/fragments/6851.yml b/changelogs/fragments/6851.yml
deleted file mode 100644
index c4e131e73c9d..000000000000
--- a/changelogs/fragments/6851.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Update index pattern references with data source when import sample data ([#6851](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6851))
\ No newline at end of file
diff --git a/changelogs/fragments/6855.yml b/changelogs/fragments/6855.yml
deleted file mode 100644
index cc281d82b4a4..000000000000
--- a/changelogs/fragments/6855.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add example for saved object creation part for openapi doc. ([#6855](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6855))
\ No newline at end of file
diff --git a/changelogs/fragments/6856.yml b/changelogs/fragments/6856.yml
deleted file mode 100644
index c3897a3f81fd..000000000000
--- a/changelogs/fragments/6856.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add openAPI doc for saved_object find api ([#6856](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6856))
\ No newline at end of file
diff --git a/changelogs/fragments/6859.yml b/changelogs/fragments/6859.yml
deleted file mode 100644
index 499f2ccc80ff..000000000000
--- a/changelogs/fragments/6859.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add OpenAPI specification for bulk create and bulk update saved object APIs ([#6859](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6859))
\ No newline at end of file
diff --git a/changelogs/fragments/6860.yml b/changelogs/fragments/6860.yml
deleted file mode 100644
index 8390c9302386..000000000000
--- a/changelogs/fragments/6860.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add OpenAPI specification for bulk_get saved object APIs ([#6860](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6860))
\ No newline at end of file
diff --git a/changelogs/fragments/6864.yml b/changelogs/fragments/6864.yml
deleted file mode 100644
index aaab0a92be3a..000000000000
--- a/changelogs/fragments/6864.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add OpenAPI specification for update, delete and migrate saved object API ([#6864](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6864))
\ No newline at end of file
diff --git a/changelogs/fragments/6879.yml b/changelogs/fragments/6879.yml
deleted file mode 100644
index 554e3eaeeeff..000000000000
--- a/changelogs/fragments/6879.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Remove unused import and property which broke compilation ([#6879](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6879))
\ No newline at end of file
diff --git a/changelogs/fragments/6885.yml b/changelogs/fragments/6885.yml
deleted file mode 100644
index a375c6812aff..000000000000
--- a/changelogs/fragments/6885.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-doc:
-- Add OpenAPI specifications for resolve import errors api ([#6885](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6885))
\ No newline at end of file
diff --git a/changelogs/fragments/6899.yml b/changelogs/fragments/6899.yml
deleted file mode 100644
index fe930956760c..000000000000
--- a/changelogs/fragments/6899.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- Remove endpoint validation for create data source saved object API ([#6899](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6899))
\ No newline at end of file
diff --git a/changelogs/fragments/6908.yml b/changelogs/fragments/6908.yml
deleted file mode 100644
index 025eba9b10c2..000000000000
--- a/changelogs/fragments/6908.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-fix:
-- Fix not setting the default data source when creating data source bug ([#6908](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6908))
\ No newline at end of file
diff --git a/changelogs/fragments/6928.yml b/changelogs/fragments/6928.yml
deleted file mode 100644
index 66ba2e4d9e86..000000000000
--- a/changelogs/fragments/6928.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-feat:
-- [MD]Use placeholder for data source credentials fields when export saved object ([#6928](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6928))
\ No newline at end of file
diff --git a/changelogs/fragments/7391.yml b/changelogs/fragments/7391.yml
new file mode 100644
index 000000000000..7be3d1f7eaa9
--- /dev/null
+++ b/changelogs/fragments/7391.yml
@@ -0,0 +1,2 @@
+feat:
+- DQL Autocomplete ([#7391](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7391))
\ No newline at end of file
diff --git a/changelogs/fragments/7501.yml b/changelogs/fragments/7501.yml
new file mode 100644
index 000000000000..3987a2e580fb
--- /dev/null
+++ b/changelogs/fragments/7501.yml
@@ -0,0 +1,2 @@
+refactor:
+- [Workspace] Support getting workspaces client from coreStart ([#7501](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7501))
\ No newline at end of file
diff --git a/changelogs/fragments/7503.yml b/changelogs/fragments/7503.yml
new file mode 100644
index 000000000000..5f33fce038f7
--- /dev/null
+++ b/changelogs/fragments/7503.yml
@@ -0,0 +1,2 @@
+feat:
+- Provide new embeddable option to hide embeddable panel action button ([#7503](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7503))
\ No newline at end of file
diff --git a/changelogs/fragments/7512.yml b/changelogs/fragments/7512.yml
new file mode 100644
index 000000000000..a248d7644293
--- /dev/null
+++ b/changelogs/fragments/7512.yml
@@ -0,0 +1,2 @@
+fix:
+- [Workspace]add workspace name blank/empty check ([#7512](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7512))
\ No newline at end of file
diff --git a/changelogs/fragments/7516.yml b/changelogs/fragments/7516.yml
new file mode 100644
index 000000000000..3ef007d8fbf2
--- /dev/null
+++ b/changelogs/fragments/7516.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace]Optimize workspace permission validation for bulk operations ([#7516](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7516))
\ No newline at end of file
diff --git a/changelogs/fragments/7527.yml b/changelogs/fragments/7527.yml
new file mode 100644
index 000000000000..b3bebe022ac2
--- /dev/null
+++ b/changelogs/fragments/7527.yml
@@ -0,0 +1,2 @@
+fix:
+- Not highlighting Droppable Areas while dragging a field ([#7527](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7527))
\ No newline at end of file
diff --git a/changelogs/fragments/7529.yml b/changelogs/fragments/7529.yml
new file mode 100644
index 000000000000..b2031779e48c
--- /dev/null
+++ b/changelogs/fragments/7529.yml
@@ -0,0 +1,2 @@
+feat:
+- [VisBuilder-Next] Migration of legacy visualizations to VisBuilder by constructing the URL. ([#7529](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7529))
\ No newline at end of file
diff --git a/changelogs/fragments/7547.yml b/changelogs/fragments/7547.yml
new file mode 100644
index 000000000000..8921d0ba4d14
--- /dev/null
+++ b/changelogs/fragments/7547.yml
@@ -0,0 +1,2 @@
+fix:
+- [Workspace] updating workspace-list-card and home-list-card ([#7547](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7547))
\ No newline at end of file
diff --git a/changelogs/fragments/7550.yml b/changelogs/fragments/7550.yml
new file mode 100644
index 000000000000..83cb4d9f0979
--- /dev/null
+++ b/changelogs/fragments/7550.yml
@@ -0,0 +1,2 @@
+fix:
+- Resolve some browser warnings ([#7550](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7550))
\ No newline at end of file
diff --git a/changelogs/fragments/7575.yml b/changelogs/fragments/7575.yml
new file mode 100644
index 000000000000..3f1335de1ecc
--- /dev/null
+++ b/changelogs/fragments/7575.yml
@@ -0,0 +1,2 @@
+doc:
+- Add documentation for dynamic page creation ([#7575](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7575))
\ No newline at end of file
diff --git a/changelogs/fragments/7585.yml b/changelogs/fragments/7585.yml
new file mode 100644
index 000000000000..55e0de4ab9f1
--- /dev/null
+++ b/changelogs/fragments/7585.yml
@@ -0,0 +1,2 @@
+fix:
+- Do not show surround doc links for PPL ([#7585](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7585))
\ No newline at end of file
diff --git a/changelogs/fragments/7593.yml b/changelogs/fragments/7593.yml
new file mode 100644
index 000000000000..d08a386a3978
--- /dev/null
+++ b/changelogs/fragments/7593.yml
@@ -0,0 +1,2 @@
+fix:
+- Update DQL Autocomplete in code and functionality ([#7593](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7593))
\ No newline at end of file
diff --git a/changelogs/fragments/7596.yml b/changelogs/fragments/7596.yml
new file mode 100644
index 000000000000..273a8b5c1e23
--- /dev/null
+++ b/changelogs/fragments/7596.yml
@@ -0,0 +1,2 @@
+fix:
+- Add validation for data source in get and bulk_get methods ([#7596](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7596))
\ No newline at end of file
diff --git a/changelogs/fragments/7598.yml b/changelogs/fragments/7598.yml
new file mode 100644
index 000000000000..85bcda12a9d4
--- /dev/null
+++ b/changelogs/fragments/7598.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace] Refactor workspace detail page ([#7598](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7598))
\ No newline at end of file
diff --git a/changelogs/fragments/7600.yml b/changelogs/fragments/7600.yml
new file mode 100644
index 000000000000..1a295f1963c9
--- /dev/null
+++ b/changelogs/fragments/7600.yml
@@ -0,0 +1,2 @@
+feat:
+- Add a util function to generate the relative redirectUrl. ([#7600](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7600))
\ No newline at end of file
diff --git a/changelogs/fragments/7603.yml b/changelogs/fragments/7603.yml
new file mode 100644
index 000000000000..6ca9213c4fcd
--- /dev/null
+++ b/changelogs/fragments/7603.yml
@@ -0,0 +1,2 @@
+Refactor:
+- [Look&Feel] Update paragraph text sizes across remaining OSD ([#7603](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7603))
\ No newline at end of file
diff --git a/changelogs/fragments/7612.yml b/changelogs/fragments/7612.yml
new file mode 100644
index 000000000000..16e3601f9389
--- /dev/null
+++ b/changelogs/fragments/7612.yml
@@ -0,0 +1,2 @@
+feat:
+- Only allow essential use case when creating workspace if all data sources are serverless ([#7612](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7612))
\ No newline at end of file
diff --git a/changelogs/fragments/7613.yml b/changelogs/fragments/7613.yml
new file mode 100644
index 000000000000..ff6c8f6c521a
--- /dev/null
+++ b/changelogs/fragments/7613.yml
@@ -0,0 +1,2 @@
+fix:
+- [navigation] add sample data to left navigation ([#7613](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7613))
\ No newline at end of file
diff --git a/changelogs/fragments/7616.yml b/changelogs/fragments/7616.yml
new file mode 100644
index 000000000000..5a7980f4ebbe
--- /dev/null
+++ b/changelogs/fragments/7616.yml
@@ -0,0 +1,2 @@
+Refactor:
+- [Look&Feel] Use semantic headers for page, modal, & flyouts across the board ([#7616](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7616))
\ No newline at end of file
diff --git a/changelogs/fragments/7618.yml b/changelogs/fragments/7618.yml
new file mode 100644
index 000000000000..342203fbb45f
--- /dev/null
+++ b/changelogs/fragments/7618.yml
@@ -0,0 +1,2 @@
+feat:
+- Use essentials as the nav group name ([#7618](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7618))
\ No newline at end of file
diff --git a/changelogs/fragments/7619.yml b/changelogs/fragments/7619.yml
new file mode 100644
index 000000000000..4ad2ddcee19b
--- /dev/null
+++ b/changelogs/fragments/7619.yml
@@ -0,0 +1,2 @@
+feat:
+- Make parent item unclickable and fix duplicate items in landing page. ([#7619](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7619))
\ No newline at end of file
diff --git a/changelogs/fragments/7624.yml b/changelogs/fragments/7624.yml
new file mode 100644
index 000000000000..cc72302bd5ca
--- /dev/null
+++ b/changelogs/fragments/7624.yml
@@ -0,0 +1,2 @@
+fix:
+- [contentManagement] display cards by specifying a column size or display all cards in one row ([#7624](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7624))
\ No newline at end of file
diff --git a/changelogs/fragments/7625.yml b/changelogs/fragments/7625.yml
new file mode 100644
index 000000000000..e4ce4fbe7e57
--- /dev/null
+++ b/changelogs/fragments/7625.yml
@@ -0,0 +1,5 @@
+refactor:
+- Simplify theme configuration and defaulting ([#7625](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7625))
+
+deprecate:
+- Deprecating `CssDistFilename` exports in favor of `themeCssDistFilenames` in `@osd/ui-shared-deps` ([#7625](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7625))
\ No newline at end of file
diff --git a/changelogs/fragments/7627.yml b/changelogs/fragments/7627.yml
new file mode 100644
index 000000000000..8b5a7e830062
--- /dev/null
+++ b/changelogs/fragments/7627.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace] Set default color for workspace create form ([#7627](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7627))
\ No newline at end of file
diff --git a/changelogs/fragments/7633.yml b/changelogs/fragments/7633.yml
new file mode 100644
index 000000000000..685398726fe0
--- /dev/null
+++ b/changelogs/fragments/7633.yml
@@ -0,0 +1,2 @@
+feat:
+- Register section and content with the same id will not throw error but overrides the exist one ([#7633](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7633))
\ No newline at end of file
diff --git a/changelogs/fragments/7636.yml b/changelogs/fragments/7636.yml
new file mode 100644
index 000000000000..e154dc07a596
--- /dev/null
+++ b/changelogs/fragments/7636.yml
@@ -0,0 +1,2 @@
+fix:
+- [Workspace] Move set default source order to avoid dev server crash ([#7636](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7636))
\ No newline at end of file
diff --git a/changelogs/fragments/7637.yml b/changelogs/fragments/7637.yml
new file mode 100644
index 000000000000..02db1c24d3d2
--- /dev/null
+++ b/changelogs/fragments/7637.yml
@@ -0,0 +1,2 @@
+feat:
+- Introduce the redesign page and applications headers behind a switch ([#7637](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7637))
diff --git a/changelogs/fragments/7640.yml b/changelogs/fragments/7640.yml
new file mode 100644
index 000000000000..5a93e3bdb5d9
--- /dev/null
+++ b/changelogs/fragments/7640.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace] Update workspace list page table ([#7640](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7640))
\ No newline at end of file
diff --git a/changelogs/fragments/7651.yml b/changelogs/fragments/7651.yml
new file mode 100644
index 000000000000..451ec7d8c444
--- /dev/null
+++ b/changelogs/fragments/7651.yml
@@ -0,0 +1,2 @@
+feat:
+- [contentManagement] allow to update section input after page rendered ([#7651](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7651))
\ No newline at end of file
diff --git a/changelogs/fragments/7652.yml b/changelogs/fragments/7652.yml
new file mode 100644
index 000000000000..132afc64c12c
--- /dev/null
+++ b/changelogs/fragments/7652.yml
@@ -0,0 +1,2 @@
+feat:
+- Update permission settings appearance ([#7652](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7652))
\ No newline at end of file
diff --git a/changelogs/fragments/7655.yml b/changelogs/fragments/7655.yml
new file mode 100644
index 000000000000..70a921f4e6df
--- /dev/null
+++ b/changelogs/fragments/7655.yml
@@ -0,0 +1,2 @@
+feat:
+- [navigation] Left navigation collective ([#7655](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7655))
\ No newline at end of file
diff --git a/changelogs/fragments/7656.yml b/changelogs/fragments/7656.yml
new file mode 100644
index 000000000000..0447cdf6e893
--- /dev/null
+++ b/changelogs/fragments/7656.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace]Add name and description characters limitation ([#7656](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7656))
\ No newline at end of file
diff --git a/changelogs/fragments/7671.yml b/changelogs/fragments/7671.yml
new file mode 100644
index 000000000000..8d88fec48eee
--- /dev/null
+++ b/changelogs/fragments/7671.yml
@@ -0,0 +1,2 @@
+fix:
+- [Workspace]Fix page crash caused by invalid workspace color ([#7671](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7671))
\ No newline at end of file
diff --git a/changelogs/fragments/7673.yml b/changelogs/fragments/7673.yml
new file mode 100644
index 000000000000..f0a84647bad2
--- /dev/null
+++ b/changelogs/fragments/7673.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace]Essential/Analytics(All) use case overview page ([#7673](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7673))
\ No newline at end of file
diff --git a/changelogs/fragments/7686.yml b/changelogs/fragments/7686.yml
new file mode 100644
index 000000000000..f446ed68764c
--- /dev/null
+++ b/changelogs/fragments/7686.yml
@@ -0,0 +1,2 @@
+feat:
+- Change the locale dynamically by adding &i18n-locale to URL ([#7686](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7686))
\ No newline at end of file
diff --git a/changelogs/fragments/7687.yml b/changelogs/fragments/7687.yml
new file mode 100644
index 000000000000..4577e74e4d4d
--- /dev/null
+++ b/changelogs/fragments/7687.yml
@@ -0,0 +1,2 @@
+refactor:
+- Refactor search bar & filters to conditionally render new look with application header ([#7687](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7687))
\ No newline at end of file
diff --git a/changelogs/fragments/7691.yml b/changelogs/fragments/7691.yml
new file mode 100644
index 000000000000..e42b7eb3ce88
--- /dev/null
+++ b/changelogs/fragments/7691.yml
@@ -0,0 +1,2 @@
+feat:
+- Allow customizing `restrictWidth` and `paddingSize` of `TableListView` ([#7691](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7691))
\ No newline at end of file
diff --git a/changelogs/fragments/7697.yml b/changelogs/fragments/7697.yml
new file mode 100644
index 000000000000..df490d5ed68a
--- /dev/null
+++ b/changelogs/fragments/7697.yml
@@ -0,0 +1,2 @@
+feat:
+- Integrate new page header for workspace pages ([#7697](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7697))
\ No newline at end of file
diff --git a/changelogs/fragments/7699.yml b/changelogs/fragments/7699.yml
new file mode 100644
index 000000000000..24554fb44461
--- /dev/null
+++ b/changelogs/fragments/7699.yml
@@ -0,0 +1,2 @@
+feat:
+- Add a unit test case to indicate React is anti-xss ([#7699](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7699))
\ No newline at end of file
diff --git a/changelogs/fragments/7702.yml b/changelogs/fragments/7702.yml
new file mode 100644
index 000000000000..fe4b48169a40
--- /dev/null
+++ b/changelogs/fragments/7702.yml
@@ -0,0 +1,2 @@
+feat:
+- Refractor the homepage assets list section ([#7702](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7702))
\ No newline at end of file
diff --git a/changelogs/fragments/7703.yml b/changelogs/fragments/7703.yml
new file mode 100644
index 000000000000..721972dab4db
--- /dev/null
+++ b/changelogs/fragments/7703.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspaces]Add features in use case card and preselect first use case ([#7703](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7703))
\ No newline at end of file
diff --git a/changelogs/fragments/7708.yml b/changelogs/fragments/7708.yml
new file mode 100644
index 000000000000..56ead27a3644
--- /dev/null
+++ b/changelogs/fragments/7708.yml
@@ -0,0 +1,2 @@
+feat:
+- Support workspace initial page ([#7708](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7708))
\ No newline at end of file
diff --git a/changelogs/fragments/7712.yml b/changelogs/fragments/7712.yml
new file mode 100644
index 000000000000..faba262bcc6b
--- /dev/null
+++ b/changelogs/fragments/7712.yml
@@ -0,0 +1,2 @@
+feat:
+- Add New Page Header to Visualize ([#7712](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7712))
\ No newline at end of file
diff --git a/changelogs/fragments/7716.yml b/changelogs/fragments/7716.yml
new file mode 100644
index 000000000000..d1b91ff51d89
--- /dev/null
+++ b/changelogs/fragments/7716.yml
@@ -0,0 +1,2 @@
+feat:
+- Display workspace picker content when outside workspace ([#7716](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7716))
\ No newline at end of file
diff --git a/changelogs/fragments/7721.yml b/changelogs/fragments/7721.yml
new file mode 100644
index 000000000000..1963c6ea4755
--- /dev/null
+++ b/changelogs/fragments/7721.yml
@@ -0,0 +1,2 @@
+feat:
+- Allow `screenTitle` to be present when SearchBar is not in Application header ([#7721](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7721))
\ No newline at end of file
diff --git a/changelogs/fragments/7723.yml b/changelogs/fragments/7723.yml
new file mode 100644
index 000000000000..6f38d9e804be
--- /dev/null
+++ b/changelogs/fragments/7723.yml
@@ -0,0 +1,2 @@
+feat:
+- Simplify `TopNavControlDescriptionData` to to be followed by links ([#7723](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7723))
\ No newline at end of file
diff --git a/changelogs/fragments/7731.yml b/changelogs/fragments/7731.yml
new file mode 100644
index 000000000000..cab14565e6b7
--- /dev/null
+++ b/changelogs/fragments/7731.yml
@@ -0,0 +1,2 @@
+refactor:
+- Multi-datasources and multi-query languages features to use generic structured types, abstract data querying, and the language service ([#7731](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7731))
\ No newline at end of file
diff --git a/changelogs/fragments/7744.yml b/changelogs/fragments/7744.yml
new file mode 100644
index 000000000000..a9af55e1c43b
--- /dev/null
+++ b/changelogs/fragments/7744.yml
@@ -0,0 +1,2 @@
+refactor:
+- Update page header for settings, objects and index pattern page ([#7744](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7744))
\ No newline at end of file
diff --git a/changelogs/fragments/7748.yml b/changelogs/fragments/7748.yml
new file mode 100644
index 000000000000..a62a59be3178
--- /dev/null
+++ b/changelogs/fragments/7748.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace]Fix click on workspace name not navigates to use case overview page ([#7748](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7748))
\ No newline at end of file
diff --git a/changelogs/fragments/7749.yml b/changelogs/fragments/7749.yml
new file mode 100644
index 000000000000..acc4198d0d4a
--- /dev/null
+++ b/changelogs/fragments/7749.yml
@@ -0,0 +1,2 @@
+fix:
+- Breadcrumb is not correct when clicking inspect / edit in Assets page ([#7749](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7749))
\ No newline at end of file
diff --git a/changelogs/fragments/7750.yml b/changelogs/fragments/7750.yml
new file mode 100644
index 000000000000..a9ec74c2cdc9
--- /dev/null
+++ b/changelogs/fragments/7750.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace]Add right sidebar to workspace create form ([#7750](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7750))
\ No newline at end of file
diff --git a/changelogs/fragments/7757.yml b/changelogs/fragments/7757.yml
new file mode 100644
index 000000000000..0466de62dc13
--- /dev/null
+++ b/changelogs/fragments/7757.yml
@@ -0,0 +1,2 @@
+feat:
+- Add v9 theme (preview) ([#7757](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7757))
\ No newline at end of file
diff --git a/changelogs/fragments/7758.yml b/changelogs/fragments/7758.yml
new file mode 100644
index 000000000000..ecc1f7b1defa
--- /dev/null
+++ b/changelogs/fragments/7758.yml
@@ -0,0 +1,2 @@
+feat:
+- Minor interface change and move suggestion provider registration location ([#7758](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7758))
\ No newline at end of file
diff --git a/changelogs/fragments/7768.yml b/changelogs/fragments/7768.yml
new file mode 100644
index 000000000000..ac0418eb42b0
--- /dev/null
+++ b/changelogs/fragments/7768.yml
@@ -0,0 +1,2 @@
+fix:
+- Fix the parameter misalignment in the workspace_detail_page ([#7768](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7768))
\ No newline at end of file
diff --git a/changelogs/fragments/7771.yml b/changelogs/fragments/7771.yml
new file mode 100644
index 000000000000..1c9eccd32254
--- /dev/null
+++ b/changelogs/fragments/7771.yml
@@ -0,0 +1,2 @@
+refactor:
+- [Workspace] Refactor: workspace detail page header ([#7771](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7771))
\ No newline at end of file
diff --git a/changelogs/fragments/7777.yml b/changelogs/fragments/7777.yml
new file mode 100644
index 000000000000..465c80e318c3
--- /dev/null
+++ b/changelogs/fragments/7777.yml
@@ -0,0 +1,2 @@
+refactor:
+- [Look & Feel] Appearance Popover Button Change ([#7777](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7777))
\ No newline at end of file
diff --git a/changelogs/fragments/7785.yml b/changelogs/fragments/7785.yml
new file mode 100644
index 000000000000..219d33e5d831
--- /dev/null
+++ b/changelogs/fragments/7785.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace] Add workspace navigation for default route ([#7785](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7785))
\ No newline at end of file
diff --git a/changelogs/fragments/7795.yml b/changelogs/fragments/7795.yml
new file mode 100644
index 000000000000..daad28b14214
--- /dev/null
+++ b/changelogs/fragments/7795.yml
@@ -0,0 +1,2 @@
+feat:
+- Adjust the appearance of collaborator panel ([#7795](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7795))
\ No newline at end of file
diff --git a/changelogs/fragments/7796.yml b/changelogs/fragments/7796.yml
new file mode 100644
index 000000000000..1e17933facf9
--- /dev/null
+++ b/changelogs/fragments/7796.yml
@@ -0,0 +1,2 @@
+fix:
+- Fix new header allowing their single-child's overflowing ([#7796](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7796))
\ No newline at end of file
diff --git a/changelogs/fragments/7799.yml b/changelogs/fragments/7799.yml
new file mode 100644
index 000000000000..15d74ab2efde
--- /dev/null
+++ b/changelogs/fragments/7799.yml
@@ -0,0 +1,4 @@
+feat:
+- Add external icon to `TopNavControlButtonData` and `TopNavControlLinkData` with `target: '_blank'` ([#7799](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7799))
+- Add `iconGap` to `TopNavControlButtonData` and `TopNavControlLinkData` ([#7799](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7799))
+- Bump OUI to 1.11.0 ([#7799](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7799))
\ No newline at end of file
diff --git a/changelogs/fragments/7801.yml b/changelogs/fragments/7801.yml
new file mode 100644
index 000000000000..c4e0b608d6f6
--- /dev/null
+++ b/changelogs/fragments/7801.yml
@@ -0,0 +1,2 @@
+feat:
+- Add `flush` to `TopNavControlLinkData` ([#7801](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7801))
\ No newline at end of file
diff --git a/changelogs/fragments/7802.yml b/changelogs/fragments/7802.yml
new file mode 100644
index 000000000000..2937e55931ae
--- /dev/null
+++ b/changelogs/fragments/7802.yml
@@ -0,0 +1,2 @@
+feat:
+- Add home icon in left bottom ([#7802](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7802))
\ No newline at end of file
diff --git a/changelogs/fragments/7804.yml b/changelogs/fragments/7804.yml
new file mode 100644
index 000000000000..cda968bd641b
--- /dev/null
+++ b/changelogs/fragments/7804.yml
@@ -0,0 +1,2 @@
+fix:
+- Fix query assistant fetching agent bug ([#7804](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7804))
\ No newline at end of file
diff --git a/changelogs/fragments/7810.yml b/changelogs/fragments/7810.yml
new file mode 100644
index 000000000000..104d2d23e27c
--- /dev/null
+++ b/changelogs/fragments/7810.yml
@@ -0,0 +1,2 @@
+feat:
+- Add OpenSearch PPL autocomplete to discover 2.0 with query enhancements ([#7810](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7810))
\ No newline at end of file
diff --git a/changelogs/fragments/7812.yml b/changelogs/fragments/7812.yml
new file mode 100644
index 000000000000..153357ca4c58
--- /dev/null
+++ b/changelogs/fragments/7812.yml
@@ -0,0 +1,2 @@
+fix:
+- Correct size of dashboard panel options icon button ([#7812](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7812))
\ No newline at end of file
diff --git a/changelogs/fragments/7817.yml b/changelogs/fragments/7817.yml
new file mode 100644
index 000000000000..1b2a2607f264
--- /dev/null
+++ b/changelogs/fragments/7817.yml
@@ -0,0 +1,2 @@
+fix:
+- [Workspace] maximum call stack error in use case service ([#7817](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7817))
\ No newline at end of file
diff --git a/changelogs/fragments/7841.yml b/changelogs/fragments/7841.yml
new file mode 100644
index 000000000000..06fc241b193d
--- /dev/null
+++ b/changelogs/fragments/7841.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace]Remove default appended features ([#7841](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7841))
\ No newline at end of file
diff --git a/changelogs/fragments/7842.yml b/changelogs/fragments/7842.yml
new file mode 100644
index 000000000000..210ae0638c64
--- /dev/null
+++ b/changelogs/fragments/7842.yml
@@ -0,0 +1,2 @@
+refactor:
+- [Workspace] Use small button, small padding and compressed. ([#7842](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7842))
\ No newline at end of file
diff --git a/changelogs/fragments/7857.yml b/changelogs/fragments/7857.yml
new file mode 100644
index 000000000000..2e462a9cdac0
--- /dev/null
+++ b/changelogs/fragments/7857.yml
@@ -0,0 +1,2 @@
+refactor:
+- [Workspace] workspace initial page ([#7857](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7857))
\ No newline at end of file
diff --git a/changelogs/fragments/7858.yml b/changelogs/fragments/7858.yml
new file mode 100644
index 000000000000..6145c80780a7
--- /dev/null
+++ b/changelogs/fragments/7858.yml
@@ -0,0 +1,2 @@
+fix:
+- [Workspace] Revert new home page ui setting for workspace default route ([#7858](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7858))
\ No newline at end of file
diff --git a/changelogs/fragments/7865.yml b/changelogs/fragments/7865.yml
new file mode 100644
index 000000000000..13c993e56f94
--- /dev/null
+++ b/changelogs/fragments/7865.yml
@@ -0,0 +1,2 @@
+chore:
+- Update oui to 1.12 ([#7865](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7865))
\ No newline at end of file
diff --git a/changelogs/fragments/7866.yml b/changelogs/fragments/7866.yml
new file mode 100644
index 000000000000..9cc5d4863d55
--- /dev/null
+++ b/changelogs/fragments/7866.yml
@@ -0,0 +1,2 @@
+feat:
+- Query editor UI changes ([#7866](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7866))
\ No newline at end of file
diff --git a/changelogs/fragments/7870.yml b/changelogs/fragments/7870.yml
new file mode 100644
index 000000000000..cb0c33dfcb39
--- /dev/null
+++ b/changelogs/fragments/7870.yml
@@ -0,0 +1,2 @@
+fix:
+- Clean up language search interceptors and fix aggs for PPL ([#7870](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7870))
\ No newline at end of file
diff --git a/changelogs/fragments/7871.yml b/changelogs/fragments/7871.yml
new file mode 100644
index 000000000000..f25eb51445d1
--- /dev/null
+++ b/changelogs/fragments/7871.yml
@@ -0,0 +1,2 @@
+feat:
+- Support injecting `DataStructureMeta` from `QueryEditorExtensions` for Query Assist ([#7871](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7871))
\ No newline at end of file
diff --git a/changelogs/fragments/7873.yml b/changelogs/fragments/7873.yml
new file mode 100644
index 000000000000..ebf0b9e814ed
--- /dev/null
+++ b/changelogs/fragments/7873.yml
@@ -0,0 +1,2 @@
+feat:
+- Align essentials use case id ([#7873](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7873))
\ No newline at end of file
diff --git a/changelogs/fragments/7879.yml b/changelogs/fragments/7879.yml
new file mode 100644
index 000000000000..68a7f88ad045
--- /dev/null
+++ b/changelogs/fragments/7879.yml
@@ -0,0 +1,2 @@
+feat:
+- Update the collaborator input from a combobox to a text field ([#7879](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7879))
\ No newline at end of file
diff --git a/changelogs/fragments/7896.yml b/changelogs/fragments/7896.yml
new file mode 100644
index 000000000000..cfac5d806ff4
--- /dev/null
+++ b/changelogs/fragments/7896.yml
@@ -0,0 +1,2 @@
+fix:
+- Query editor UI clean up ([#7896](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7896))
\ No newline at end of file
diff --git a/changelogs/fragments/7913.yml b/changelogs/fragments/7913.yml
new file mode 100644
index 000000000000..1ab0ce89f7f1
--- /dev/null
+++ b/changelogs/fragments/7913.yml
@@ -0,0 +1,2 @@
+fix:
+- Refactor the style for the work list table ([#7913](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7913))
\ No newline at end of file
diff --git a/changelogs/fragments/7917.yml b/changelogs/fragments/7917.yml
new file mode 100644
index 000000000000..60262ad04c44
--- /dev/null
+++ b/changelogs/fragments/7917.yml
@@ -0,0 +1,2 @@
+feat:
+- Add S3 data exploration for connections, databases, and tables ([#7917](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7917))
\ No newline at end of file
diff --git a/config/opensearch_dashboards.yml b/config/opensearch_dashboards.yml
index 8dd9c3805b64..eb80d20854c4 100644
--- a/config/opensearch_dashboards.yml
+++ b/config/opensearch_dashboards.yml
@@ -88,6 +88,22 @@
# To disregard the validity of SSL certificates, change this setting's value to 'none'.
#opensearch.ssl.verificationMode: full
+# Allowed cipher suites list can be configured below, in preference order.
+# Cipher suite names should be in OpenSSL format (https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-SUITE-NAMES)
+# Default set of cipher suites for your system can be checked by running the following command in your terminal:
+# echo 'console.log(require("crypto").constants.defaultCoreCipherList.split(":"))' | node -
+# Below you can find an example of cipher suites considered to be secure
+# Keep in mind that older clients might not support them
+# Refer to https://ciphersuite.info/ and https://ssl-config.mozilla.org/ for more details and recommendations about cipher suites
+# Keep in mind that restricting cipher suites might disable older versions of TLS, as not all cipher suites are supported by them
+#server.ssl.cipherSuites:
+# - TLS_AES_256_GCM_SHA384
+# - TLS_CHACHA20_POLY1305_SHA256
+# - TLS_AES_128_GCM_SHA256
+# - ECDHE-ECDSA-AES256-GCM-SHA384
+# - ECDHE-ECDSA-CHACHA20-POLY1305
+# - ECDHE-ECDSA-AES128-GCM-SHA256
+
# Time in milliseconds to wait for OpenSearch to respond to pings. Defaults to the value of
# the opensearch.requestTimeout setting.
#opensearch.pingTimeout: 1500
@@ -305,6 +321,12 @@
# AWSSigV4:
# enabled: true
+# Optional setting that controls the permissions of data source to create, update and delete.
+# "none": The data source is readonly for all users.
+# "dashboard_admin": The data source can only be managed by dashboard admin.
+# "all": The data source can be managed by all users. Default to "all".
+# data_source_management.manageableBy: "all"
+
# Set the value of this setting to false to hide the help menu link to the OpenSearch Dashboards user survey
# opensearchDashboards.survey.url: "https://survey.opensearch.org"
@@ -321,7 +343,11 @@
# Set the value to true to enable workspace feature
# Please note, workspace will not work with multi-tenancy. To enable workspace feature, you need to disable multi-tenancy first with `opensearch_security.multitenancy.enabled: false`
+# Please uncomment below uiSettings to enable new home/navigation experience when workspace is enabled
# workspace.enabled: false
+# uiSettings:
+# overrides:
+# "home:useNewHomePage": true
# Optional settings to specify saved object types to be deleted during migration.
# This feature can help address compatibility issues that may arise during the migration of saved objects, such as types defined by legacy applications.
@@ -342,4 +368,4 @@
# Set the backend roles in groups or users, whoever has the backend roles or exactly match the user ids defined in this config will be regard as dashboard admin.
# Dashboard admin will have the access to all the workspaces(workspace.enabled: true) and objects inside OpenSearch Dashboards.
# opensearchDashboards.dashboardAdmin.groups: ["dashboard_admin"]
-# opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
+# opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
\ No newline at end of file
diff --git a/docs/openapi/README.md b/docs/openapi/README.md
index a19b2a9a830a..92779f2220b1 100644
--- a/docs/openapi/README.md
+++ b/docs/openapi/README.md
@@ -6,4 +6,9 @@ The OpenAPI (https://swagger.io/specification/) Specification defines a standard
When generated, OpenAPI definition can then be used by documentation generation tools to display the API such as swagger UI, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
### Starting Up the Swagger UI Locally
-To start up the swagger UI locally for development or validation purposes, you can simply start a server in the directory where the index.html file is located. `npx serve` is a simple way to start a server.
\ No newline at end of file
+To start up the swagger UI locally for development or validation purposes, you can simply start a server in the directory where the index.html file is located. `npx serve` is a simple way to start a server.
+
+### API Docs
+
+- [Saved Objects](https://opensearch-project.github.io/OpenSearch-Dashboards/docs/openapi/saved_objects/)
+- [Index Patterns](https://opensearch-project.github.io/OpenSearch-Dashboards/docs/openapi/index_patterns/)https://github.com/ashwin-pc/OpenSearch-Dashboards/blob/26b8c38cf4b9f6cf9a809dad370d26cf37b72571/docs/openapi/README.md
\ No newline at end of file
diff --git a/docs/openapi/index_patterns/index.html b/docs/openapi/index_patterns/index.html
new file mode 100644
index 000000000000..cdd9cff94d2a
--- /dev/null
+++ b/docs/openapi/index_patterns/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Index Patterns API
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/openapi/index_patterns/index_patterns.yml b/docs/openapi/index_patterns/index_patterns.yml
new file mode 100644
index 000000000000..7a20e5bf4862
--- /dev/null
+++ b/docs/openapi/index_patterns/index_patterns.yml
@@ -0,0 +1,83 @@
+openapi: 3.0.3
+info:
+ version: v1
+ title: OpenSearch Dashboards Index Patterns API
+ contact:
+ name: OpenSearch Dashboards Team
+ description: |-
+ OpenAPI schema for OpenSearch Dashboards Index Patterns API
+tags:
+ - name: index patterns
+paths:
+ /api/index_patterns/_fields_for_wildcard:
+ get:
+ tags:
+ - index patterns
+ summary:
+ parameters:
+ - in: query
+ name: pattern
+ description: The index pattern used to retrieve fields.
+ required: true
+ schema:
+ type: string
+ example: my-index*
+ - in: query
+ name: meta_fields
+ description: The list of metadata fields which will be included in the response, it usually contains "_source", "_id", "_type", "_index" and "_score".
+ schema:
+ oneOf:
+ - type: string
+ - type: array
+ default: []
+ example: _source
+ - in: query
+ name: data_source
+ description: The data source of index patterns and indices.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Fetching fields for index pattern is successful.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ fields:
+ type: array
+ description: Retrieved fields based on wildcard pattern.
+ items:
+ type: object
+ '400':
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/400_bad_request'
+ '404':
+ description: Not found
+ content:
+ application/json:
+ schema:
+ type: object
+components:
+ schemas:
+ 400_bad_request:
+ title: Bad request
+ type: object
+ required:
+ - error
+ - message
+ - statusCode
+ properties:
+ error:
+ type: string
+ enum:
+ - Bad Request
+ message:
+ type: string
+ statusCode:
+ type: integer
+ enum:
+ - 400
\ No newline at end of file
diff --git a/docs/theme.md b/docs/theme.md
index 293c65661c04..cf85667e1d2d 100644
--- a/docs/theme.md
+++ b/docs/theme.md
@@ -6,7 +6,7 @@
Themes are defined in OUI via https://github.com/opensearch-project/oui/blob/main/src/themes/themes.ts. When Building OUI, there are several theming artifacts generated (beyond the react components) for each mode (light/dark) of each theme:
-1. Theme compiled stylesheets (e.g. `@elastic/eui/dist/eui_theme_dark.css`). Consumed as entry files in [/packages/osd-ui-shared-deps/webpack.config.js](/packages/osd-ui-shared-deps/webpack.config.js) and republished by `osd-ui-shared-deps` (e.g. [UiSharedDeps.darkCssDistFilename](/packages/osd-ui-shared-deps/index.js)).
+1. Theme compiled stylesheets (e.g. `@elastic/eui/dist/eui_theme_dark.css`). Consumed as entry files in [/packages/osd-ui-shared-deps/webpack.config.js](/packages/osd-ui-shared-deps/webpack.config.js) and republished by `osd-ui-shared-deps` (e.g. [UiSharedDeps.themeCssDistFilenames](/packages/osd-ui-shared-deps/index.js)).
2. Theme compiled and minified stylesheets (e.g. `@elastic/eui/dist/eui_theme_dark.min.css`). These appear unused by OpenSearch Dashboards
3. Theme computed SASS variables as JSON (e.g. `@elastic/eui/dist/eui_theme_dark.json`). Consumed by [/packages/osd-ui-shared-deps/theme.ts](/packages/osd-ui-shared-deps/theme.ts) and made available to other components via the mode and theme aware `euiThemeVars`. In general, these should not be consumed by any other component directly.
4. Theme type definition file for SASS variables as JSON (e.g. `@elastic/eui/dist/eui_theme_dark.json.d.ts`)
@@ -129,3 +129,38 @@ Component styles are not loaded as stylesheets.
4. Used by `src/core/server/rendering/views/theme.ts` to inject values into `src/core/server/rendering/views/styles.tsx`
5. Used (incorrectly) to style a badge color in `src/plugins/index_pattern_management/public/components/create_button/create_button.tsx`
6. Used by `src/plugins/opensearch_dashboards_react/public/code_editor/editor_theme.ts` to create Monaco theme styles
+
+## Theme Management
+
+### Change default theme
+
+Update `DEFAULT_THEME_VERSION` in `src/core/server/ui_settings/ui_settings_config.ts` to point to the desired theme version.
+
+### Adding a new theme
+
+1. Add a [a new theme to OUI](https://github.com/opensearch-project/oui/blob/main/wiki/theming.md) and publish new OUI version
+2. Update OSD to consume new OUI version
+3. Make the following changes in OSD:
+ 1. Load your theme by creating sass files in `src/core/public/core_app/styles`
+ 2. Update [webpack config](packages/osd-ui-shared-deps/webpack.config.js) to create css files for your theme
+ 2. Add kui css files:
+ 1. Create kui sass files for your theme in `packages/osd-ui-framework/src/`
+ 2. Update `packages/osd-ui-framework/Gruntfile.js` to build these files
+ 3. Generate the files by running `npx grunt compileCss` from this package root
+ 3. Add fonts to OSD:
+ 1. Make sure your theme fonts are in [/src/core/server/core_app/assets/fonts](/src/core/server/core_app/assets/fonts/readme.md)
+ 2. Update `src/core/server/rendering/views/fonts.tsx` to reference those files
+ 3. Update src/core/server/core_app/assets/fonts/readme.md to reference the fonts
+ 4. Update `packages/osd-ui-shared-deps/theme_config.js`:
+ 1. Add version and label for version to `THEME_VERSION_LABEL_MAP`
+ 2. Update `kuiCssDistFilenames` map for new theme
+ 3. Update `ThemeTag` type in corresponding definition file (`theme_config.d.ts`)
+ 5. Load variables for new theme in `packages/osd-ui-shared-deps/theme.ts'`
+ 6. Update `src/legacy/ui/ui_render/ui_render_mixin.js':
+ 1. Load variables for your theme in `THEME_SOURCES`
+ 2. Define the text font for your theme in `fontText`
+ 3. Define the code font for your theme in `fontCode`
+ 7. If on a branch without user specific themes:
+ 1. Update `THEME_SOURCES` in `src/core/server/rendering/views/theme.ts`
+ 2. Update `fontText` and `fontCode` in `src/core/server/rendering/views/fonts.tsx`
+
\ No newline at end of file
diff --git a/examples/embeddable_examples/public/multi_task_todo/multi_task_todo_component.tsx b/examples/embeddable_examples/public/multi_task_todo/multi_task_todo_component.tsx
index dd81d612183a..46872c1f8e4f 100644
--- a/examples/embeddable_examples/public/multi_task_todo/multi_task_todo_component.tsx
+++ b/examples/embeddable_examples/public/multi_task_todo/multi_task_todo_component.tsx
@@ -72,6 +72,7 @@ function renderTasks(tasks: MultiTaskTodoInput['tasks'], search?: string) {
key={task}
data-test-subj="multiTaskTodoTask"
label={wrapSearchTerms(task, search)}
+ size="s"
/>
));
}
diff --git a/package.json b/package.json
index 59b2f89d0198..56bef8bb1c94 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,7 @@
"dashboarding"
],
"private": true,
- "version": "2.15.0",
+ "version": "2.17.0",
"branch": "2.x",
"types": "./opensearch_dashboards.d.ts",
"tsdocMetadata": "./build/tsdoc-metadata.json",
@@ -63,6 +63,7 @@
"start": "scripts/use_node scripts/opensearch_dashboards --dev",
"start:docker": "scripts/use_node scripts/opensearch_dashboards --dev --opensearch.hosts=$OPENSEARCH_HOSTS --opensearch.ignoreVersionMismatch=true --server.host=$SERVER_HOST",
"start:security": "scripts/use_node scripts/opensearch_dashboards --dev --security",
+ "start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --uiSettings.overrides['query:enhancements:enabled']=true --uiSettings.overrides['home:useNewHomePage']=true",
"debug": "scripts/use_node --nolazy --inspect scripts/opensearch_dashboards --dev",
"debug-break": "scripts/use_node --nolazy --inspect-brk scripts/opensearch_dashboards --dev",
"lint": "yarn run lint:es && yarn run lint:style",
@@ -76,17 +77,24 @@
"osd:bootstrap": "scripts/use_node scripts/build_ts_refs && scripts/use_node scripts/register_git_hook",
"spec_to_console": "scripts/use_node scripts/spec_to_console",
"pkg-version": "scripts/use_node -e \"console.log(require('./package.json').version)\"",
- "release_note:generate": "scripts/use_node scripts/generate_release_note"
+ "release_note:generate": "scripts/use_node scripts/generate_release_note",
+ "cypress:run-without-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=false",
+ "cypress:run-with-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,WAIT_FOR_LOADER_BUFFER_MS=500",
+ "osd:ciGroup10": "echo \"dashboard_sanity_test_spec.js\"",
+ "osd:ciGroup11": "echo \"apps/vis_builder/*.js\"",
+ "generate:opensearchsqlantlr": "./node_modules/antlr4ng-cli/index.js -Dlanguage=TypeScript -o ./src/plugins/data/public/antlr/opensearch_sql/.generated -visitor -no-listener -Xexact-output-dir ./src/plugins/data/public/antlr/opensearch_sql/grammar/OpenSearchSQLLexer.g4 ./src/plugins/data/public/antlr/opensearch_sql/grammar/OpenSearchSQLParser.g4",
+ "generate:opensearchpplantlr": "./node_modules/antlr4ng-cli/index.js -Dlanguage=TypeScript -o ./src/plugins/data/public/antlr/opensearch_ppl/.generated -visitor -no-listener -Xexact-output-dir ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLLexer.g4 ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4"
},
"repository": {
"type": "git",
"url": "https://github.com/opensearch-project/opensearch-dashboards.git"
},
"resolutions": {
- "**/@babel/traverse": "^7.23.2",
+ "**/@babel/traverse": "^7.25.0",
"**/@types/node": "~18.7.0",
"**/ansi-regex": "^5.0.1",
"**/async": "^3.2.3",
+ "**/cpy/globby": "^10.0.1",
"**/d3-color": "^3.1.0",
"**/flat": "^5.0.2",
"**/elasticsearch/agentkeepalive": "^4.5.0",
@@ -97,24 +105,26 @@
"**/jest-config": "npm:@amoo-miki/jest-config@27.5.1",
"**/jest-jasmine2": "npm:@amoo-miki/jest-jasmine2@27.5.1",
"**/joi/hoek": "npm:@amoo-miki/hoek@6.1.3",
+ "**/json11": "^1.1.2",
"**/json-schema": "^0.4.0",
"**/kind-of": ">=6.0.3",
+ "**/load-bmfont/phin": "^3.7.1",
"**/loader-utils": "^2.0.4",
"**/node-jose": "^2.2.0",
"**/nth-check": "^2.0.1",
"**/qs": "^6.11.0",
"**/semver": "^7.5.3",
"**/set-value": "^4.1.0",
- "**/tar":"^6.2.1",
+ "**/tar": "^6.2.1",
"**/topo/hoek": "npm:@amoo-miki/hoek@6.1.3",
"**/trim": "^0.0.3",
"**/typescript": "4.0.2",
"**/unset-value": "^2.0.1",
+ "**/watchpack-chokidar2/chokidar": "^3.5.3",
"**/minimatch": "^3.0.5",
"**/eslint-plugin-mocha-next/mocha": "npm:mocha@^10.1.0",
"**/xml2js": "^0.5.0",
"**/yaml": "^2.2.2"
-
},
"workspaces": {
"packages": [
@@ -136,7 +146,7 @@
"dependencies": {
"@aws-crypto/client-node": "^3.1.1",
"@elastic/datemath": "5.0.3",
- "@elastic/eui": "npm:@opensearch-project/oui@1.5.1",
+ "@elastic/eui": "npm:@opensearch-project/oui@1.12.0",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/numeral": "npm:@amoo-miki/numeral@2.6.0",
"@elastic/request-crypto": "2.0.0",
@@ -153,7 +163,7 @@
"@hapi/vision": "^6.1.0",
"@hapi/wreck": "^17.1.0",
"@opensearch-project/opensearch": "^1.1.0",
- "@opensearch-project/opensearch-next": "npm:@opensearch-project/opensearch@^2.6.0",
+ "@opensearch-project/opensearch-next": "npm:@opensearch-project/opensearch@^2.9.0",
"@opensearch/datemath": "5.0.3",
"@osd/ace": "1.0.0",
"@osd/analytics": "1.0.0",
@@ -173,6 +183,8 @@
"JSONStream": "1.3.5",
"abortcontroller-polyfill": "^1.4.0",
"ajv": "^8.11.0",
+ "antlr4-c3": "^3.4.1",
+ "antlr4ng": "^3.0.4",
"bluebird": "3.5.5",
"chalk": "^4.1.0",
"chokidar": "^3.4.2",
@@ -238,12 +250,13 @@
"type-detect": "^4.0.8",
"uuid": "3.3.2",
"whatwg-fetch": "^3.0.0",
- "yauzl": "^2.10.0"
-
+ "yauzl": "^2.10.0",
+ "@opensearch-dashboards-test/opensearch-dashboards-test-library": "https://github.com/opensearch-project/opensearch-dashboards-test-library/archive/refs/tags/1.0.6.tar.gz"
},
"devDependencies": {
"@babel/core": "^7.22.9",
"@babel/parser": "^7.22.9",
+ "@babel/plugin-transform-class-static-block": "^7.24.7",
"@babel/register": "^7.22.9",
"@babel/types": "^7.22.9",
"@elastic/apm-rum": "^5.6.1",
@@ -296,7 +309,6 @@
"@types/getopts": "^2.0.1",
"@types/getos": "^3.0.0",
"@types/glob": "^7.1.3",
- "@types/globby": "^8.0.0",
"@types/hapi__cookie": "^10.1.4",
"@types/hapi__h2o2": "^8.3.3",
"@types/hapi__hapi": "^20.0.10",
@@ -359,6 +371,7 @@
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^3.10.0",
"@typescript-eslint/parser": "^3.10.0",
+ "antlr4ng-cli": "^2.0.0",
"archiver": "^5.3.0",
"axe-core": "^4.0.2",
"babel-eslint": "^10.0.3",
@@ -414,10 +427,10 @@
"jest": "^27.5.1",
"jest-canvas-mock": "^2.5.1",
"jest-raw-loader": "^1.0.1",
- "jimp": "^0.14.0",
+ "jimp": "^0.22.12",
"jquery": "^3.5.0",
"json-stringify-pretty-compact": "1.2.0",
- "json5": "^1.0.1",
+ "json5": "^2.2.3",
"leaflet": "1.5.1",
"leaflet-draw": "0.4.14",
"leaflet-responsive-popup": "0.6.4",
@@ -459,6 +472,7 @@
"regenerate": "^1.4.0",
"reselect": "^4.0.0",
"resize-observer-polyfill": "^1.5.1",
+ "rimraf": "^5.0.7",
"selenium-webdriver": "^4.0.0-alpha.7",
"simple-git": "^3.16.0",
"sinon": "^7.4.2",
diff --git a/packages/osd-ace/package.json b/packages/osd-ace/package.json
index ae6c3126e99f..0778cbc40a12 100644
--- a/packages/osd-ace/package.json
+++ b/packages/osd-ace/package.json
@@ -14,7 +14,7 @@
"@osd/babel-preset": "1.0.0",
"raw-loader": "^4.0.2",
"typescript": "4.0.2",
- "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2"
+ "webpack": "npm:@amoo-miki/webpack@4.46.0-xxhash.1"
},
"@osd/pm": {
"web": true
diff --git a/packages/osd-babel-preset/webpack_preset.js b/packages/osd-babel-preset/webpack_preset.js
index 9d0a75a042c5..62b764f82941 100644
--- a/packages/osd-babel-preset/webpack_preset.js
+++ b/packages/osd-babel-preset/webpack_preset.js
@@ -55,6 +55,12 @@ module.exports = () => {
fileName: false,
},
],
+ [
+ require.resolve('@babel/plugin-transform-class-static-block'),
+ {
+ fileName: false,
+ },
+ ],
],
env: {
production: {
diff --git a/packages/osd-eslint-import-resolver-opensearch-dashboards/package.json b/packages/osd-eslint-import-resolver-opensearch-dashboards/package.json
index 2dfa00a516ba..fe6b8a19bb73 100755
--- a/packages/osd-eslint-import-resolver-opensearch-dashboards/package.json
+++ b/packages/osd-eslint-import-resolver-opensearch-dashboards/package.json
@@ -19,6 +19,6 @@
"glob-all": "^3.2.1",
"lru-cache": "^4.1.5",
"resolve": "^1.7.1",
- "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2"
+ "webpack": "npm:@amoo-miki/webpack@4.46.0-xxhash.1"
}
}
diff --git a/packages/osd-eslint-plugin-eslint/package.json b/packages/osd-eslint-plugin-eslint/package.json
index 0e82fed704c6..85d21d02de14 100644
--- a/packages/osd-eslint-plugin-eslint/package.json
+++ b/packages/osd-eslint-plugin-eslint/package.json
@@ -11,7 +11,7 @@
"babel-eslint": "^10.0.3"
},
"dependencies": {
- "micromatch": "3.1.10",
+ "micromatch": "^4.0.7",
"dedent": "^0.7.0",
"eslint-module-utils": "2.5.0"
}
diff --git a/packages/osd-eslint-plugin-eslint/rules/no_restricted_paths.test.js b/packages/osd-eslint-plugin-eslint/rules/no_restricted_paths.test.js
index 96251e8fe55c..0cc452043b45 100644
--- a/packages/osd-eslint-plugin-eslint/rules/no_restricted_paths.test.js
+++ b/packages/osd-eslint-plugin-eslint/rules/no_restricted_paths.test.js
@@ -370,7 +370,7 @@ ruleTester.run('@osd/eslint/no-restricted-paths', rule, {
},
{
- // Does not allow to import deeply within Core, using "src/core/..." Webpack alias.
+ // Does not allow to require deeply within Core, using "src/core/..." Webpack alias.
code: 'const d = require("src/core/server/saved_objects")',
filename: path.join(__dirname, './testfiles/no_restricted_paths/client/a.js'),
options: [
@@ -393,6 +393,32 @@ ruleTester.run('@osd/eslint/no-restricted-paths', rule, {
],
},
+ {
+ // Does not allow to import deeply within Core, using "src/core/...".
+ code: `
+ import { X as XX } from 'src/core/public';
+ import { X as XY } from 'src/core/server';`,
+ filename: path.join(__dirname, './testfiles/no_restricted_paths/client/a.js'),
+ options: [
+ {
+ basePath: __dirname,
+ zones: [
+ {
+ target: ['**/testfiles/**/*', '!**/testfiles/**/server/**/*'],
+ from: ['src/core/server', 'src/core/server/**/*'],
+ },
+ ],
+ },
+ ],
+ errors: [
+ {
+ message: 'Unexpected path "src/core/server" imported in restricted zone.',
+ line: 3,
+ column: 31,
+ },
+ ],
+ },
+
{
// Does not allow to import "ui/kfetch".
code: 'const d = require("ui/kfetch")',
diff --git a/packages/osd-i18n/src/core/i18n.test.ts b/packages/osd-i18n/src/core/i18n.test.ts
index 0ee114c78c95..ebfd546f8561 100644
--- a/packages/osd-i18n/src/core/i18n.test.ts
+++ b/packages/osd-i18n/src/core/i18n.test.ts
@@ -899,8 +899,17 @@ describe('I18n engine', () => {
describe('load', () => {
let mockFetch: jest.SpyInstance;
+ let originalWindow: any;
+
beforeEach(() => {
mockFetch = jest.spyOn(global as any, 'fetch').mockImplementation();
+ originalWindow = global.window;
+ global.window = { ...originalWindow };
+ });
+
+ afterEach(() => {
+ global.window = originalWindow;
+ delete (window as any).__i18nWarning; // Clear the warning after each test
});
test('fails if server returns >= 300 status code', async () => {
@@ -928,7 +937,7 @@ describe('I18n engine', () => {
mockFetch.mockResolvedValue({
status: 200,
- json: jest.fn().mockResolvedValue(translations),
+ json: jest.fn().mockResolvedValue({ translations }),
});
await expect(i18n.load('some-url')).resolves.toBeUndefined();
@@ -938,5 +947,28 @@ describe('I18n engine', () => {
expect(i18n.getTranslation()).toEqual(translations);
});
+
+ test('sets warning on window when present in response', async () => {
+ const warning = { title: 'Warning', text: 'This is a warning' };
+ mockFetch.mockResolvedValue({
+ status: 200,
+ json: jest.fn().mockResolvedValue({ translations: { locale: 'en' }, warning }),
+ });
+
+ await i18n.load('some-url');
+
+ expect((window as any).__i18nWarning).toEqual(warning);
+ });
+
+ test('does not set warning on window when not present in response', async () => {
+ mockFetch.mockResolvedValue({
+ status: 200,
+ json: jest.fn().mockResolvedValue({ translations: { locale: 'en' } }),
+ });
+
+ await i18n.load('some-url');
+
+ expect((window as any).__i18nWarning).toBeUndefined();
+ });
});
});
diff --git a/packages/osd-i18n/src/core/i18n.ts b/packages/osd-i18n/src/core/i18n.ts
index 3268fae5079f..65da4931ef13 100644
--- a/packages/osd-i18n/src/core/i18n.ts
+++ b/packages/osd-i18n/src/core/i18n.ts
@@ -261,5 +261,12 @@ export async function load(translationsUrl: string) {
throw new Error(`Translations request failed with status code: ${response.status}`);
}
- init(await response.json());
+ const data = await response.json();
+
+ if (data.warning) {
+ // Store the warning to be displayed after core system setup
+ (window as any).__i18nWarning = data.warning;
+ }
+
+ init(data.translations);
}
diff --git a/packages/osd-i18n/src/core/locales.js b/packages/osd-i18n/src/core/locales.js
index a837462b7408..14dfe95507a9 100644
--- a/packages/osd-i18n/src/core/locales.js
+++ b/packages/osd-i18n/src/core/locales.js
@@ -21,6 +21,8 @@ function addLocaleData(localeData) {
IntlRelativeFormat.__addLocaleData(localeData);
}
+addLocaleData({ locale: "pl", 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 ? "jeden" : n10 == 2 && n100 != 12 ? "dwa" : n10 == 3 && n100 != 13 ? "kilka" : "inny"; return n == 1 && v0 ? "jeden" : "inny" }, "fields": { "rok": { "displayName": "rok", "relative": { "0": "ten rok", "1": "następny rok", "-1": "poprzedni rok" }, "relativeTime": { "future": { "jeden": "za {0} rok", "other": "za {0} lat" }, "past": { "jeden": "{0} rok temu", "other": "{0} lata temu" } } }, "year-short": { "displayName": "rok", "relative": { "0": "ten rok", "1": "następny rok", "-1": "poprzedni rok" }, "relativeTime": { "future": { "one": "za {0} r.", "other": "za {0} l." }, "past": { "one": "{0} r. temu", "other": "{0} l. temu" } } }, "month": { "displayName": "miesiąc", "relative": { "0": "ten miesiąc", "1": "następny miesiąc", "-1": "poprzedni miesiąc" }, "relativeTime": { "future": { "one": "w {0} miesiącu", "other": "w {0} miesiącach" }, "past": { "one": "{0} miesiąc temu", "other": "{0} miesięcy temu" } } }, "month-short": { "displayName": "miesiąc", "relative": { "0": "ten miesiąc", "1": "następny miesiąc", "-1": "poprzedni miesiąc" }, "relativeTime": { "future": { "one": "z {0} miesiąc", "other": "za {0} miesięcy" }, "past": { "one": "{0} miesiąc temu", "other": "{0} miesięcy temu" } } }, "day": { "displayName": "dzień", "relative": { "0": "dzisiaj", "1": "jutro", "-1": "wczoraj" }, "relativeTime": { "future": { "one": "za {0} dzień", "other": "za {0} dni" }, "past": { "one": "{0} dzień temu", "other": "{0} dni temu" } } }, "day-short": { "displayName": "dzień", "relative": { "0": "dzisiaj", "1": "jutro", "-1": "wczoraj" }, "relativeTime": { "future": { "one": "za {0} dzień", "other": "za {0} dni" }, "past": { "one": "{0} dzień temu", "other": "{0} dni temu" } } }, "hour": { "displayName": "godzina", "relative": { "0": "ta godzina" }, "relativeTime": { "future": { "one": "za {0} godzinę", "other": "za {0} godzin" }, "past": { "one": "{0} godzina temu", "other": "{0} godzin temu" } } }, "hour-short": { "displayName": "godz.", "relative": { "0": "ta godzina" }, "relativeTime": { "future": { "one": "za {0} godz.", "other": "za {0} godz." }, "past": { "one": "{0} godz. temu", "other": "{0} godz. temu" } } }, "minute": { "displayName": "minuta", "relative": { "0": "ta minuta" }, "relativeTime": { "future": { "one": "za {0} minutę", "other": "za {0} minut" }, "past": { "one": "{0} minuta temu", "other": "{0} minut temu" } } }, "minute-short": { "displayName": "min.", "relative": { "0": "ta min." }, "relativeTime": { "future": { "one": "za {0} min.", "other": "za {0} min." }, "past": { "one": "{0} min. temu", "other": "{0} min. temu" } } }, "second": { "displayName": "sekunda", "relative": { "0": "teraz" }, "relativeTime": { "future": { "one": "za {0} sekundę", "other": "za {0} sekund" }, "past": { "one": "{0} sekundę temu", "other": "{0} sekund temu" } } }, "second-short": { "displayName": "sek.", "relative": { "0": "teraz" }, "relativeTime": { "future": { "one": "za {0} sek.", "other": "za {0} sek." }, "past": { "one": "{0} sek. temu", "other": "{0} sek. temu" } } } } });
+addLocaleData({ locale: "pl-PL", parentLocale: "pl" });
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"},"fields":{"year":{"displayName":"year","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"one":"in {0} year","other":"in {0} years"},"past":{"one":"{0} year ago","other":"{0} years ago"}}},"year-short":{"displayName":"yr.","relative":{"0":"this yr.","1":"next yr.","-1":"last yr."},"relativeTime":{"future":{"one":"in {0} yr.","other":"in {0} yr."},"past":{"one":"{0} yr. ago","other":"{0} yr. ago"}}},"month":{"displayName":"month","relative":{"0":"this month","1":"next month","-1":"last month"},"relativeTime":{"future":{"one":"in {0} month","other":"in {0} months"},"past":{"one":"{0} month ago","other":"{0} months ago"}}},"month-short":{"displayName":"mo.","relative":{"0":"this mo.","1":"next mo.","-1":"last mo."},"relativeTime":{"future":{"one":"in {0} mo.","other":"in {0} mo."},"past":{"one":"{0} mo. ago","other":"{0} mo. ago"}}},"day":{"displayName":"day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"day-short":{"displayName":"day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"hour":{"displayName":"hour","relative":{"0":"this hour"},"relativeTime":{"future":{"one":"in {0} hour","other":"in {0} hours"},"past":{"one":"{0} hour ago","other":"{0} hours ago"}}},"hour-short":{"displayName":"hr.","relative":{"0":"this hour"},"relativeTime":{"future":{"one":"in {0} hr.","other":"in {0} hr."},"past":{"one":"{0} hr. ago","other":"{0} hr. ago"}}},"minute":{"displayName":"minute","relative":{"0":"this minute"},"relativeTime":{"future":{"one":"in {0} minute","other":"in {0} minutes"},"past":{"one":"{0} minute ago","other":"{0} minutes ago"}}},"minute-short":{"displayName":"min.","relative":{"0":"this minute"},"relativeTime":{"future":{"one":"in {0} min.","other":"in {0} min."},"past":{"one":"{0} min. ago","other":"{0} min. ago"}}},"second":{"displayName":"second","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} second","other":"in {0} seconds"},"past":{"one":"{0} second ago","other":"{0} seconds ago"}}},"second-short":{"displayName":"sec.","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} sec.","other":"in {0} sec."},"past":{"one":"{0} sec. ago","other":"{0} sec. ago"}}}} });
addLocaleData({ locale: "en-US", parentLocale: "en" });
addLocaleData({ locale: "en-xa", 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"}, "fields":{"year":{"displayName":"ýéààŕ","relative":{"0":"ţĥîîš ýééàŕ","1":"ñéẋẋţ ýééàŕ","-1":"ļàššţ ýééàŕ"},"relativeTime":{"future":{"one":"îñ {0} ýýéàŕŕ","other":"îñ {0} ýýéàŕŕš"},"past":{"one":"{0} ýéààŕ àĝĝô","other":"{0} ýéààŕš ààĝô"}}},"year-short":{"displayName":"ýŕ.","relative":{"0":"ţĥîîš ýŕŕ.","1":"ñéẋẋţ ýŕŕ.","-1":"ļàššţ ýŕŕ."},"relativeTime":{"future":{"one":"îñ {0} ýýŕ.","other":"îñ {0} ýýŕ."},"past":{"one":"{0} ýŕ. ààĝô","other":"{0} ýŕ. ààĝô"}}},"month":{"displayName":"ɱôññţĥ","relative":{"0":"ţĥîîš ɱôôñţĥĥ","1":"ñéẋẋţ ɱôôñţĥĥ","-1":"ļàššţ ɱôôñţĥĥ"},"relativeTime":{"future":{"one":"îñ {0} ɱɱôñţţĥ","other":"îñ {0} ɱɱôñţţĥš"},"past":{"one":"{0} ɱôññţĥ ààĝô","other":"{0} ɱôññţĥšš àĝôô"}}},"month-short":{"displayName":"ɱô.","relative":{"0":"ţĥîîš ɱôô.","1":"ñéẋẋţ ɱôô.","-1":"ļàššţ ɱôô."},"relativeTime":{"future":{"one":"îñ {0} ɱɱô.","other":"îñ {0} ɱɱô."},"past":{"one":"{0} ɱô. ààĝô","other":"{0} ɱô. ààĝô"}}},"day":{"displayName":"ðàýý","relative":{"0":"ţôððàý","1":"ţôɱɱôŕŕŕôŵ","-1":"ýéššţéŕŕðàýý"},"relativeTime":{"future":{"one":"îñ {0} ððàý","other":"îñ {0} ððàýšš"},"past":{"one":"{0} ðàýý àĝôô","other":"{0} ðàýýš àĝĝô"}}},"day-short":{"displayName":"ðàýý","relative":{"0":"ţôððàý","1":"ţôɱɱôŕŕŕôŵ","-1":"ýéššţéŕŕðàýý"},"relativeTime":{"future":{"one":"îñ {0} ððàý","other":"îñ {0} ððàýšš"},"past":{"one":"{0} ðàýý àĝôô","other":"{0} ðàýýš àĝĝô"}}},"hour":{"displayName":"ĥôûûŕ","relative":{"0":"ţĥîîš ĥôôûŕ"},"relativeTime":{"future":{"one":"îñ {0} ĥĥôûŕŕ","other":"îñ {0} ĥĥôûŕŕš"},"past":{"one":"{0} ĥôûûŕ àĝĝô","other":"{0} ĥôûûŕš ààĝô"}}},"hour-short":{"displayName":"ĥŕ.","relative":{"0":"ţĥîîš ĥôôûŕ"},"relativeTime":{"future":{"one":"îñ {0} ĥĥŕ.","other":"îñ {0} ĥĥŕ."},"past":{"one":"{0} ĥŕ. ààĝô","other":"{0} ĥŕ. ààĝô"}}},"minute":{"displayName":"ɱîññûţéé","relative":{"0":"ţĥîîš ɱîîñûţţé"},"relativeTime":{"future":{"one":"îñ {0} ɱɱîñûûţé","other":"îñ {0} ɱɱîñûûţéšš"},"past":{"one":"{0} ɱîññûţéé àĝôô","other":"{0} ɱîññûţééš àĝĝô"}}},"minute-short":{"displayName":"ɱîññ.","relative":{"0":"ţĥîîš ɱîîñûţţé"},"relativeTime":{"future":{"one":"îñ {0} ɱɱîñ.","other":"îñ {0} ɱɱîñ."},"past":{"one":"{0} ɱîññ. àĝôô","other":"{0} ɱîññ. àĝôô"}}},"second":{"displayName":"šéççôñðð","relative":{"0":"ñôŵŵ"},"relativeTime":{"future":{"one":"îñ {0} ššéçôôñð","other":"îñ {0} ššéçôôñðšš"},"past":{"one":"{0} šéççôñðð àĝôô","other":"{0} šéççôñððš àĝĝô"}}},"second-short":{"displayName":"šéçç.","relative":{"0":"ñôŵŵ"},"relativeTime":{"future":{"one":"îñ {0} ššéç.","other":"îñ {0} ššéç."},"past":{"one":"{0} šéçç. àĝôô","other":"{0} šéçç. àĝôô"}}}} });
diff --git a/packages/osd-interpreter/package.json b/packages/osd-interpreter/package.json
index 34bcad460244..4bf4b61d9835 100644
--- a/packages/osd-interpreter/package.json
+++ b/packages/osd-interpreter/package.json
@@ -31,7 +31,7 @@
"style-loader": "^1.1.3",
"supports-color": "^7.0.0",
"url-loader": "^2.2.0",
- "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2",
+ "webpack": "npm:@amoo-miki/webpack@4.46.0-xxhash.1",
"webpack-cli": "^4.9.2"
}
}
diff --git a/packages/osd-monaco/package.json b/packages/osd-monaco/package.json
index ae9cfaddc53a..0c9a459d129b 100644
--- a/packages/osd-monaco/package.json
+++ b/packages/osd-monaco/package.json
@@ -22,7 +22,7 @@
"raw-loader": "^4.0.2",
"supports-color": "^7.0.0",
"typescript": "4.0.2",
- "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2",
+ "webpack": "npm:@amoo-miki/webpack@4.46.0-xxhash.1",
"webpack-cli": "^4.9.2"
}
}
diff --git a/packages/osd-monaco/src/xjson/lexer_rules/index.ts b/packages/osd-monaco/src/xjson/lexer_rules/index.ts
index b0ed41a63801..1e836eb4fed7 100644
--- a/packages/osd-monaco/src/xjson/lexer_rules/index.ts
+++ b/packages/osd-monaco/src/xjson/lexer_rules/index.ts
@@ -33,6 +33,8 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
import * as xJson from './xjson';
import * as opensearchql from './opensearchql';
import * as painless from './painless';
+import * as opensearchsql from './opensearchsql';
+import * as opensearchppl from './opensearchppl';
export const registerLexerRules = (m: typeof monaco) => {
m.languages.register({ id: xJson.ID });
@@ -41,4 +43,9 @@ export const registerLexerRules = (m: typeof monaco) => {
m.languages.setMonarchTokensProvider(painless.ID, painless.lexerRules);
m.languages.register({ id: opensearchql.ID });
m.languages.setMonarchTokensProvider(opensearchql.ID, opensearchql.lexerRules);
+ m.languages.register({ id: opensearchsql.ID });
+ m.languages.setMonarchTokensProvider(opensearchsql.ID, opensearchsql.lexerRules);
+ m.languages.register({ id: opensearchppl.ID });
+ m.languages.setMonarchTokensProvider(opensearchppl.ID, opensearchppl.lexerRules);
+ m.languages.register({ id: 'kuery' });
};
diff --git a/packages/osd-monaco/src/xjson/lexer_rules/opensearchppl.ts b/packages/osd-monaco/src/xjson/lexer_rules/opensearchppl.ts
new file mode 100644
index 000000000000..f303c8fa9e77
--- /dev/null
+++ b/packages/osd-monaco/src/xjson/lexer_rules/opensearchppl.ts
@@ -0,0 +1,529 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import { monaco } from '../../monaco';
+
+export const ID = 'PPL';
+
+const brackets = [
+ { open: '[', close: ']', token: 'delimiter.square' },
+ { open: '(', close: ')', token: 'delimiter.parenthesis' },
+];
+
+const keywords = [
+ // COMMAND KEYWORDS
+ 'SEARCH',
+ 'DESCRIBE',
+ 'SHOW',
+ 'FROM',
+ 'WHERE',
+ 'FIELDS',
+ 'RENAME',
+ 'STATS',
+ 'DEDUP',
+ 'SORT',
+ 'EVAL',
+ 'HEAD',
+ 'TOP',
+ 'RARE',
+ 'PARSE',
+ 'METHOD',
+ 'REGEX',
+ 'PUNCT',
+ 'GROK',
+ 'PATTERN',
+ 'PATTERNS',
+ 'NEW_FIELD',
+ 'KMEANS',
+ 'AD',
+ 'ML',
+
+ // COMMAND ASSIST KEYWORDS
+ 'AS',
+ 'BY',
+ 'SOURCE',
+ 'INDEX',
+ 'D',
+ 'DESC',
+ 'DATASOURCES',
+
+ // CLAUSE KEYWORDS
+ 'SORTBY',
+
+ // FIELD KEYWORDS
+ 'AUTO',
+ 'STR',
+ 'IP',
+ 'NUM',
+
+ // ARGUMENT KEYWORDS
+ 'KEEPEMPTY',
+ 'CONSECUTIVE',
+ 'DEDUP_SPLITVALUES',
+ 'PARTITIONS',
+ 'ALLNUM',
+ 'DELIM',
+ 'CENTROIDS',
+ 'ITERATIONS',
+ 'DISTANCE_TYPE',
+ 'NUMBER_OF_TREES',
+ 'SHINGLE_SIZE',
+ 'SAMPLE_SIZE',
+ 'OUTPUT_AFTER',
+ 'TIME_DECAY',
+ 'ANOMALY_RATE',
+ 'CATEGORY_FIELD',
+ 'TIME_FIELD',
+ 'TIME_ZONE',
+ 'TRAINING_DATA_SIZE',
+ 'ANOMALY_SCORE_THRESHOLD',
+
+ // COMPARISON FUNCTION KEYWORDS
+ 'CASE',
+ 'IN',
+
+ // LOGICAL KEYWORDS
+ 'NOT',
+ 'OR',
+ 'AND',
+ 'XOR',
+ 'TRUE',
+ 'FALSE',
+ 'REGEXP',
+
+ // DATETIME, INTERVAL AND UNIT KEYWORDS
+ 'CONVERT_TZ',
+ 'DATETIME',
+ 'DAY',
+ 'DAY_HOUR',
+ 'DAY_MICROSECOND',
+ 'DAY_MINUTE',
+ 'DAY_OF_YEAR',
+ 'DAY_SECOND',
+ 'HOUR',
+ 'HOUR_MICROSECOND',
+ 'HOUR_MINUTE',
+ 'HOUR_OF_DAY',
+ 'HOUR_SECOND',
+ 'INTERVAL',
+ 'MICROSECOND',
+ 'MILLISECOND',
+ 'MINUTE',
+ 'MINUTE_MICROSECOND',
+ 'MINUTE_OF_DAY',
+ 'MINUTE_OF_HOUR',
+ 'MINUTE_SECOND',
+ 'MONTH',
+ 'MONTH_OF_YEAR',
+ 'QUARTER',
+ 'SECOND',
+ 'SECOND_MICROSECOND',
+ 'SECOND_OF_MINUTE',
+ 'WEEK',
+ 'WEEK_OF_YEAR',
+ 'YEAR',
+ 'YEAR_MONTH',
+
+ // DATASET TYPES
+ 'DATAMODEL',
+ 'LOOKUP',
+ 'SAVEDSEARCH',
+
+ // CONVERTED DATA TYPES
+ 'INT',
+ 'INTEGER',
+ 'DOUBLE',
+ 'LONG',
+ 'FLOAT',
+ 'STRING',
+ 'BOOLEAN',
+
+ // SPECIAL CHARACTERS AND OPERATORS
+ 'PIPE',
+ 'COMMA',
+ 'DOT',
+ 'EQUAL',
+ 'GREATER',
+ 'LESS',
+ 'NOT_GREATER',
+ 'NOT_LESS',
+ 'NOT_EQUAL',
+ 'PLUS',
+ 'MINUS',
+ 'STAR',
+ 'DIVIDE',
+ 'MODULE',
+ 'EXCLAMATION_SYMBOL',
+ 'COLON',
+ 'LT_PRTHS',
+ 'RT_PRTHS',
+ 'LT_SQR_PRTHS',
+ 'RT_SQR_PRTHS',
+ 'SINGLE_QUOTE',
+ 'DOUBLE_QUOTE',
+ 'BACKTICK',
+
+ // AGGREGATIONS
+ 'AVG',
+ 'COUNT',
+ 'DISTINCT_COUNT',
+ 'ESTDC',
+ 'ESTDC_ERROR',
+ 'MAX',
+ 'MEAN',
+ 'MEDIAN',
+ 'MIN',
+ 'MODE',
+ 'RANGE',
+ 'STDEV',
+ 'STDEVP',
+ 'SUM',
+ 'SUMSQ',
+ 'VAR_SAMP',
+ 'VAR_POP',
+ 'STDDEV_SAMP',
+ 'STDDEV_POP',
+ 'PERCENTILE',
+ 'TAKE',
+ 'FIRST',
+ 'LAST',
+ 'LIST',
+ 'VALUES',
+ 'EARLIEST',
+ 'EARLIEST_TIME',
+ 'LATEST',
+ 'LATEST_TIME',
+ 'PER_DAY',
+ 'PER_HOUR',
+ 'PER_MINUTE',
+ 'PER_SECOND',
+ 'RATE',
+ 'SPARKLINE',
+ 'C',
+ 'DC',
+
+ // BASIC FUNCTIONS
+ 'ABS',
+ 'CBRT',
+ 'CEIL',
+ 'CEILING',
+ 'CONV',
+ 'CRC32',
+ 'E',
+ 'EXP',
+ 'FLOOR',
+ 'LN',
+ 'LOG',
+ 'LOG10',
+ 'LOG2',
+ 'MOD',
+ 'PI',
+ 'POSITION',
+ 'POW',
+ 'POWER',
+ 'RAND',
+ 'ROUND',
+ 'SIGN',
+ 'SQRT',
+ 'TRUNCATE',
+
+ // TRIGONOMETRIC FUNCTIONS
+ 'ACOS',
+ 'ASIN',
+ 'ATAN',
+ 'ATAN2',
+ 'COS',
+ 'COT',
+ 'DEGREES',
+ 'RADIANS',
+ 'SIN',
+ 'TAN',
+
+ // DATE AND TIME FUNCTIONS
+ 'ADDDATE',
+ 'ADDTIME',
+ 'CURDATE',
+ 'CURRENT_DATE',
+ 'CURRENT_TIME',
+ 'CURRENT_TIMESTAMP',
+ 'CURTIME',
+ 'DATE',
+ 'DATEDIFF',
+ 'DATE_ADD',
+ 'DATE_FORMAT',
+ 'DATE_SUB',
+ 'DAYNAME',
+ 'DAYOFMONTH',
+ 'DAYOFWEEK',
+ 'DAYOFYEAR',
+ 'DAY_OF_MONTH',
+ 'DAY_OF_WEEK',
+ 'DAY_OF_YEAR',
+ 'EXTRACT',
+ 'FROM_DAYS',
+ 'FROM_UNIXTIME',
+ 'GET_FORMAT',
+ 'LAST_DAY',
+ 'LOCALTIME',
+ 'LOCALTIMESTAMP',
+ 'MAKEDATE',
+ 'MAKETIME',
+ 'MONTHNAME',
+ 'NOW',
+ 'PERIOD_ADD',
+ 'PERIOD_DIFF',
+ 'SEC_TO_TIME',
+ 'STR_TO_DATE',
+ 'SUBDATE',
+ 'SUBTIME',
+ 'SYSDATE',
+ 'TIME',
+ 'TIMEDIFF',
+ 'TIMESTAMP',
+ 'TIMESTAMPADD',
+ 'TIMESTAMPDIFF',
+ 'TIME_FORMAT',
+ 'TIME_TO_SEC',
+ 'TO_DAYS',
+ 'TO_SECONDS',
+ 'UNIX_TIMESTAMP',
+ 'UTC_DATE',
+ 'UTC_TIME',
+ 'UTC_TIMESTAMP',
+ 'WEEKDAY',
+ 'YEARWEEK',
+
+ // TEXT FUNCTIONS
+ 'SUBSTR',
+ 'SUBSTRING',
+ 'LTRIM',
+ 'RTRIM',
+ 'TRIM',
+ 'TO',
+ 'LOWER',
+ 'UPPER',
+ 'CONCAT',
+ 'CONCAT_WS',
+ 'LENGTH',
+ 'STRCMP',
+ 'RIGHT',
+ 'LEFT',
+ 'ASCII',
+ 'LOCATE',
+ 'REPLACE',
+ 'REVERSE',
+ 'CAST',
+
+ // BOOL FUNCTIONS
+ 'LIKE',
+ 'ISNULL',
+ 'ISNOTNULL',
+
+ // FLOWCONTROL FUNCTIONS
+ 'IFNULL',
+ 'NULLIF',
+ 'IF',
+ 'TYPEOF',
+
+ // RELEVANCE FUNCTIONS AND PARAMETERS
+ 'MATCH',
+ 'MATCH_PHRASE',
+ 'MATCH_PHRASE_PREFIX',
+ 'MATCH_BOOL_PREFIX',
+ 'SIMPLE_QUERY_STRING',
+ 'MULTI_MATCH',
+ 'QUERY_STRING',
+ 'ALLOW_LEADING_WILDCARD',
+ 'ANALYZE_WILDCARD',
+ 'ANALYZER',
+ 'AUTO_GENERATE_SYNONYMS_PHRASE_QUERY',
+ 'BOOST',
+ 'CUTOFF_FREQUENCY',
+ 'DEFAULT_FIELD',
+ 'DEFAULT_OPERATOR',
+ 'ENABLE_POSITION_INCREMENTS',
+ 'ESCAPE',
+ 'FLAGS',
+ 'FUZZY_MAX_EXPANSIONS',
+ 'FUZZY_PREFIX_LENGTH',
+ 'FUZZY_TRANSPOSITIONS',
+ 'FUZZY_REWRITE',
+ 'FUZZINESS',
+ 'LENIENT',
+ 'LOW_FREQ_OPERATOR',
+ 'MAX_DETERMINIZED_STATES',
+ 'MAX_EXPANSIONS',
+ 'MINIMUM_SHOULD_MATCH',
+ 'OPERATOR',
+ 'PHRASE_SLOP',
+ 'PREFIX_LENGTH',
+ 'QUOTE_ANALYZER',
+ 'QUOTE_FIELD_SUFFIX',
+ 'REWRITE',
+ 'SLOP',
+ 'TIE_BREAKER',
+ 'TYPE',
+ 'ZERO_TERMS_QUERY',
+
+ // SPAN KEYWORDS
+ 'SPAN',
+ 'MS',
+ 'S',
+ 'M',
+ 'H',
+ 'W',
+ 'Q',
+ 'Y',
+];
+
+const builtinFunctions = [
+ 'ABS',
+ 'CBRT',
+ 'CEIL',
+ 'CEILING',
+ 'CONV',
+ 'CRC32',
+ 'E',
+ 'EXP',
+ 'FLOOR',
+ 'LN',
+ 'LOG',
+ 'LOG10',
+ 'LOG2',
+ 'MOD',
+ 'PI',
+ 'POSITION',
+ 'POW',
+ 'POWER',
+ 'RAND',
+ 'ROUND',
+ 'SIGN',
+ 'SQRT',
+ 'TRUNCATE',
+ 'ACOS',
+ 'ASIN',
+ 'ATAN',
+ 'ATAN2',
+ 'COS',
+ 'COT',
+ 'DEGREES',
+ 'RADIANS',
+ 'SIN',
+ 'TAN',
+ 'ADDDATE',
+ 'ADDTIME',
+ 'CURDATE',
+ 'CURRENT_DATE',
+ 'CURRENT_TIME',
+ 'CURRENT_TIMESTAMP',
+ 'CURTIME',
+ 'DATE',
+ 'DATEDIFF',
+ 'DATE_ADD',
+ 'DATE_FORMAT',
+ 'DATE_SUB',
+ 'DAYNAME',
+ 'DAYOFMONTH',
+ 'DAYOFWEEK',
+ 'DAYOFYEAR',
+ 'DAY_OF_MONTH',
+ 'DAY_OF_WEEK',
+ 'DAY_OF_YEAR',
+ 'EXTRACT',
+ 'FROM_DAYS',
+ 'FROM_UNIXTIME',
+ 'GET_FORMAT',
+ 'LAST_DAY',
+ 'LOCALTIME',
+ 'LOCALTIMESTAMP',
+ 'MAKEDATE',
+ 'MAKETIME',
+ 'MONTHNAME',
+ 'NOW',
+ 'PERIOD_ADD',
+ 'PERIOD_DIFF',
+ 'SEC_TO_TIME',
+ 'STR_TO_DATE',
+ 'SUBDATE',
+ 'SUBTIME',
+ 'SYSDATE',
+ 'TIME',
+ 'TIMEDIFF',
+ 'TIMESTAMP',
+ 'TIMESTAMPADD',
+ 'TIMESTAMPDIFF',
+ 'TIME_FORMAT',
+ 'TIME_TO_SEC',
+ 'TO_DAYS',
+ 'TO_SECONDS',
+ 'UNIX_TIMESTAMP',
+ 'UTC_DATE',
+ 'UTC_TIME',
+ 'UTC_TIMESTAMP',
+ 'WEEKDAY',
+ 'YEARWEEK',
+];
+
+export const lexerRules = {
+ defaultToken: 'invalid',
+ ignoreCase: true,
+ tokenPostfix: '',
+ keywords,
+ builtinFunctions,
+ brackets,
+ tokenizer: {
+ root: [
+ [
+ /[a-zA-Z_$][a-zA-Z0-9_$]*\b/,
+ {
+ cases: {
+ '@keywords': 'keyword',
+ '@builtinFunctions': 'identifier',
+ '@default': 'identifier',
+ },
+ },
+ ],
+ [/[()]/, '@brackets'],
+ [/--.*$/, 'comment'],
+ [/\/\*/, 'comment', '@comment'],
+ [/\/.*$/, 'comment'],
+
+ [/".*?"/, 'string'],
+ [/'.*?'/, 'constant'],
+ [/`.*?`/, 'string'],
+
+ // whitespace
+ [/[ \t\r\n]+/, { token: '@whitespace' }],
+ [/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/, 'number'],
+ [/⇐|<⇒|\*|\.|\:\:|\+|\-|\/|\/\/|%|&|\^|~|<|>|<=|=>|==|!=|<>|=/, 'keyword.operator'],
+ [/[\(]/, 'paren.lparen'],
+ [/[\)]/, 'paren.rparen'],
+ [/\s+/, 'text'],
+ ],
+ numbers: [
+ [/0[xX][0-9a-fA-F]*/, 'number'],
+ [/[$][+-]*\d*(\.\d*)?/, 'number'],
+ [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, 'number'],
+ ],
+ strings: [
+ [/N'/, { token: 'string', next: '@string' }],
+ [/'/, { token: 'string', next: '@string' }],
+ ],
+ string: [
+ [/[^']+/, 'string'],
+ [/''/, 'string'],
+ [/'/, { token: 'string', next: '@pop' }],
+ ],
+ comment: [
+ [/[^\/*]+/, 'comment'],
+ [/\*\//, 'comment', '@pop'],
+ [/[\/*]/, 'comment'],
+ ],
+ },
+} as monaco.languages.IMonarchLanguage;
+
+monaco.languages.register({
+ id: ID,
+});
diff --git a/packages/osd-monaco/src/xjson/lexer_rules/opensearchsql.ts b/packages/osd-monaco/src/xjson/lexer_rules/opensearchsql.ts
new file mode 100644
index 000000000000..0ff29b71c09d
--- /dev/null
+++ b/packages/osd-monaco/src/xjson/lexer_rules/opensearchsql.ts
@@ -0,0 +1,161 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import { monaco } from '../../monaco';
+
+export const ID = 'SQL';
+
+const keywords = [
+ 'ALL',
+ 'AND',
+ 'AS',
+ 'ASC',
+ 'BOOLEAN',
+ 'BETWEEN',
+ 'BY',
+ 'CASE',
+ 'CAST',
+ 'CROSS',
+ 'COLUMNS',
+ 'DATETIME',
+ 'DELETE',
+ 'DESC',
+ 'DESCRIBE',
+ 'DISTINCT',
+ 'DOUBLE',
+ 'ELSE',
+ 'EXISTS',
+ 'FALSE',
+ 'FLOAT',
+ 'FIRST',
+ 'FROM',
+ 'GROUP',
+ 'HAVING',
+ 'IN',
+ 'INNER',
+ 'INT',
+ 'INTEGER',
+ 'IS',
+ 'JOIN',
+ 'LAST',
+ 'LEFT',
+ 'LIKE',
+ 'LIMIT',
+ 'LONG',
+ 'MATCH',
+ 'NATURAL',
+ 'NOT',
+ 'NULL',
+ 'NULLS',
+ 'ON',
+ 'OR',
+ 'ORDER',
+ 'OUTER',
+ 'OVER',
+ 'PARTITION',
+ 'REGEXP',
+ 'RIGHT',
+ 'SELECT',
+ 'SHOW',
+ 'STRING',
+ 'THEN',
+ 'TRUE',
+ 'UNION',
+ 'USING',
+ 'WHEN',
+ 'WHERE',
+ 'EXCEPT',
+];
+
+const functions = [
+ 'AVG',
+ 'COUNT',
+ 'MAX',
+ 'MIN',
+ 'SUM',
+ 'VAR_POP',
+ 'VAR_SAMP',
+ 'VARIANCE',
+ 'STD',
+ 'STDDEV',
+ 'STDDEV_POP',
+ 'STDDEV_SAMP',
+ 'SUBSTRING',
+ 'TRIM',
+];
+
+const operators = [
+ '=',
+ '>',
+ '<',
+ '!',
+ '~',
+ '\\|',
+ '&',
+ '\\^',
+ '\\*',
+ '/',
+ '%',
+ '\\+',
+ '-',
+ 'DIV',
+ 'MOD',
+];
+
+const brackets = [
+ { open: '(', close: ')', token: 'delimiter.parenthesis' },
+ { open: '[', close: ']', token: 'delimiter.square' },
+];
+
+export const lexerRules = {
+ defaultToken: 'invalid',
+ ignoreCase: true,
+ tokenPostfix: '',
+ keywords,
+ functions,
+ operators,
+ brackets,
+ tokenizer: {
+ root: [
+ [
+ /[a-zA-Z_$][a-zA-Z0-9_$]*/,
+ {
+ cases: {
+ '@keywords': 'keyword',
+ '@functions': 'function',
+ '@default': 'identifier',
+ },
+ },
+ ],
+ { include: '@whitespace' },
+ [/[()]/, '@brackets'],
+ [new RegExp(operators.join('|')), 'operator'],
+ [/[0-9]+(\.[0-9]+)?/, 'number'],
+ [/'([^'\\]|\\.)*$/, 'string.invalid'], // non-terminated string
+ [/'/, 'string', '@string'],
+ [/"/, 'string', '@string'],
+ ],
+ whitespace: [
+ [/[ \t\r\n]+/, 'white'],
+ [/\/\*/, 'comment', '@comment'],
+ [/--.*$/, 'comment'],
+ ],
+ string: [
+ [/[^'\\]+/, 'string'],
+ [/\\./, 'string.escape'],
+ [/'/, 'string', '@pop'],
+ [/"/, 'string', '@pop'],
+ ],
+ comment: [
+ [/[^/*]+/, 'comment'],
+ [/\*\//, 'comment', '@pop'],
+ [/[\/*]/, 'comment'],
+ ],
+ },
+} as monaco.languages.IMonarchLanguage;
+
+monaco.languages.register({
+ id: ID,
+});
diff --git a/packages/osd-optimizer/README.md b/packages/osd-optimizer/README.md
index c10f639a38fc..e737f881f125 100644
--- a/packages/osd-optimizer/README.md
+++ b/packages/osd-optimizer/README.md
@@ -26,7 +26,7 @@ We only limit the number of workers we will start at any given time. If we start
### Caching
-Bundles built by the the optimizer include a cache file which describes the information needed to determine if the bundle needs to be rebuilt when the optimizer is restarted. Caching is enabled by default and is very aggressive about invalidating the cache output, but if you need to disable caching you can pass `--no-cache` to `node scripts/build_opensearch_dashboards_platform_plugins`, or set the `OSD_OPTIMIZER_NO_CACHE` environment variable to anything (env overrides everything).
+Bundles built by the optimizer include a cache file which describes the information needed to determine if the bundle needs to be rebuilt when the optimizer is restarted. Caching is enabled by default and is very aggressive about invalidating the cache output, but if you need to disable caching you can pass `--no-cache` to `node scripts/build_opensearch_dashboards_platform_plugins`, or set the `OSD_OPTIMIZER_NO_CACHE` environment variable to anything (env overrides everything).
When a bundle is determined to be up-to-date a worker is not started for the bundle. If running the optimizer with the `--dev/--watch` flag, then all the files referenced by cached bundles are watched for changes. Once a change is detected in any of the files referenced by the built bundle a worker is started. If a file is changed that is referenced by several bundles then workers will be started for each bundle, combining workers together to respect the worker limit.
diff --git a/packages/osd-optimizer/package.json b/packages/osd-optimizer/package.json
index b1477f176358..853075556e96 100644
--- a/packages/osd-optimizer/package.json
+++ b/packages/osd-optimizer/package.json
@@ -45,7 +45,7 @@
"@types/compression-webpack-plugin": "^6.0.6",
"@types/loader-utils": "^1.1.3",
"@types/source-map-support": "^0.5.3",
- "@types/watchpack": "^1.1.6",
+ "@types/watchpack": "^2.4.4",
"@types/webpack": "^4.41.31",
"babel-loader": "^8.2.3",
"comment-stripper": "^0.0.4",
@@ -59,6 +59,6 @@
"style-loader": "^1.1.3",
"url-loader": "^2.2.0",
"val-loader": "^2.1.2",
- "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2"
+ "webpack": "npm:@amoo-miki/webpack@4.46.0-xxhash.1"
}
}
diff --git a/packages/osd-optimizer/src/__fixtures__/mock_repo/src/core/public/core_app/styles/_globals_v9dark.scss b/packages/osd-optimizer/src/__fixtures__/mock_repo/src/core/public/core_app/styles/_globals_v9dark.scss
new file mode 100644
index 000000000000..e5f1ee131499
--- /dev/null
+++ b/packages/osd-optimizer/src/__fixtures__/mock_repo/src/core/public/core_app/styles/_globals_v9dark.scss
@@ -0,0 +1 @@
+$globalStyleConstant: 14;
diff --git a/packages/osd-optimizer/src/__fixtures__/mock_repo/src/core/public/core_app/styles/_globals_v9light.scss b/packages/osd-optimizer/src/__fixtures__/mock_repo/src/core/public/core_app/styles/_globals_v9light.scss
new file mode 100644
index 000000000000..45d508715da0
--- /dev/null
+++ b/packages/osd-optimizer/src/__fixtures__/mock_repo/src/core/public/core_app/styles/_globals_v9light.scss
@@ -0,0 +1 @@
+$globalStyleConstant: 15;
diff --git a/packages/osd-optimizer/src/common/theme_tags.test.ts b/packages/osd-optimizer/src/common/theme_tags.test.ts
index 791734e9cfb6..ae8775484e7d 100644
--- a/packages/osd-optimizer/src/common/theme_tags.test.ts
+++ b/packages/osd-optimizer/src/common/theme_tags.test.ts
@@ -37,6 +37,8 @@ it('returns default tags when passed undefined', () => {
"v7light",
"v8dark",
"v8light",
+ "v9dark",
+ "v9light",
]
`);
});
@@ -48,6 +50,8 @@ it('returns all tags when passed *', () => {
"v7light",
"v8dark",
"v8light",
+ "v9dark",
+ "v9light",
]
`);
});
@@ -81,13 +85,13 @@ it('returns specific tags when passed an array', () => {
it('throws when an invalid tag is in the array', () => {
expect(() => parseThemeTags(['v8light', 'v7light', 'bar'])).toThrowErrorMatchingInlineSnapshot(
- `"Invalid theme tags [bar], options: [v7dark, v7light, v8dark, v8light]"`
+ `"Invalid theme tags [bar], options: [v7dark, v7light, v8dark, v8light, v9dark, v9light]"`
);
});
it('throws when an invalid tags in comma separated list', () => {
expect(() => parseThemeTags('v8light ,v7light,bar,box ')).toThrowErrorMatchingInlineSnapshot(
- `"Invalid theme tags [bar, box], options: [v7dark, v7light, v8dark, v8light]"`
+ `"Invalid theme tags [bar, box], options: [v7dark, v7light, v8dark, v8light, v9dark, v9light]"`
);
});
diff --git a/packages/osd-optimizer/src/common/theme_tags.ts b/packages/osd-optimizer/src/common/theme_tags.ts
index 8170c6bcab69..3078a9c6dc06 100644
--- a/packages/osd-optimizer/src/common/theme_tags.ts
+++ b/packages/osd-optimizer/src/common/theme_tags.ts
@@ -28,6 +28,8 @@
* under the License.
*/
+import { themeTags as THEME_TAGS } from '@osd/ui-shared-deps';
+import type { ThemeTag, ThemeTags } from '@osd/ui-shared-deps';
import { ascending } from './array_helpers';
const tags = (...themeTags: string[]) =>
@@ -37,10 +39,9 @@ const validTag = (tag: any): tag is ThemeTag => ALL_THEMES.includes(tag);
const isArrayOfStrings = (input: unknown): input is string[] =>
Array.isArray(input) && input.every((v) => typeof v === 'string');
-export type ThemeTags = readonly ThemeTag[];
-export type ThemeTag = 'v7light' | 'v7dark' | 'v8light' | 'v8dark';
-export const DEFAULT_THEMES = tags('v7light', 'v7dark', 'v8light', 'v8dark');
-export const ALL_THEMES = tags('v7light', 'v7dark', 'v8light', 'v8dark');
+export type { ThemeTag, ThemeTags };
+export const DEFAULT_THEMES = tags(...THEME_TAGS);
+export const ALL_THEMES = tags(...THEME_TAGS);
export function parseThemeTags(input?: any): ThemeTags {
if (!input) {
diff --git a/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap b/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
index dbbb5bad9bf3..776298aa496c 100644
--- a/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
+++ b/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
@@ -71,12 +71,14 @@ OptimizerConfig {
"v7light",
"v8dark",
"v8light",
+ "v9dark",
+ "v9light",
],
"watch": false,
}
`;
-exports[`prepares assets for distribution: bar bundle 1`] = `"(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{enumerable:true,get:getter})}};__webpack_require__.r=function(exports){if(typeof Symbol!==\\"undefined\\"&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:\\"Module\\"})}Object.defineProperty(exports,\\"__esModule\\",{value:true})};__webpack_require__.t=function(value,mode){if(mode&1)value=__webpack_require__(value);if(mode&8)return value;if(mode&4&&typeof value===\\"object\\"&&value&&value.__esModule)return value;var ns=Object.create(null);__webpack_require__.r(ns);Object.defineProperty(ns,\\"default\\",{enumerable:true,value:value});if(mode&2&&typeof value!=\\"string\\")for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module[\\"default\\"]}:function getModuleExports(){return module};__webpack_require__.d(getter,\\"a\\",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p=\\"\\";return __webpack_require__(__webpack_require__.s=3)})([function(module,exports,__webpack_require__){\\"use strict\\";module.exports=function(cssWithMappingToString){var list=[];list.toString=function toString(){return this.map((function(item){var content=cssWithMappingToString(item);if(item[2]){return\\"@media \\".concat(item[2],\\" {\\").concat(content,\\"}\\")}return content})).join(\\"\\")};list.i=function(modules,mediaQuery,dedupe){if(typeof modules===\\"string\\"){modules=[[null,modules,\\"\\"]]}var alreadyImportedModules={};if(dedupe){for(var i=0;i {
await cpy('**/*', MOCK_REPO_DIR, {
cwd: MOCK_REPO_SRC,
parents: true,
- deep: true,
+ deep: Infinity,
});
});
@@ -176,7 +176,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
bar.cache.refresh();
expect(bar.cache.getModuleCount()).toBe(
// code + styles + style/css-loader runtimes + public path updater
- 25
+ 33
);
expect(bar.cache.getReferencedFiles()?.map(absolutePathSerializer.serialize).sort())
@@ -195,6 +195,8 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
"/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7light.scss",
"/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8dark.scss",
"/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8light.scss",
+ "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v9dark.scss",
+ "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v9light.scss",
"/packages/osd-optimizer/target/worker/entry_point_creator.js",
"/packages/osd-ui-shared-deps/public_path_module_creator.js",
]
diff --git a/packages/osd-optimizer/src/integration_tests/bundle_cache.test.ts b/packages/osd-optimizer/src/integration_tests/bundle_cache.test.ts
index 24ddfd14a832..83a503a21e7e 100644
--- a/packages/osd-optimizer/src/integration_tests/bundle_cache.test.ts
+++ b/packages/osd-optimizer/src/integration_tests/bundle_cache.test.ts
@@ -54,7 +54,7 @@ beforeEach(async () => {
await cpy('**/*', MOCK_REPO_DIR, {
cwd: MOCK_REPO_SRC,
parents: true,
- deep: true,
+ deep: Infinity,
});
});
diff --git a/packages/osd-optimizer/src/optimizer/cache_keys.test.ts b/packages/osd-optimizer/src/optimizer/cache_keys.test.ts
index 5ca5c76a566f..95cd4b4b1d32 100644
--- a/packages/osd-optimizer/src/optimizer/cache_keys.test.ts
+++ b/packages/osd-optimizer/src/optimizer/cache_keys.test.ts
@@ -103,6 +103,8 @@ describe('getOptimizerCacheKey()', () => {
"v7light",
"v8dark",
"v8light",
+ "v9dark",
+ "v9light",
],
},
}
diff --git a/packages/osd-optimizer/src/optimizer/watcher.ts b/packages/osd-optimizer/src/optimizer/watcher.ts
index cf5faadb33d8..87f2ba2b8894 100644
--- a/packages/osd-optimizer/src/optimizer/watcher.ts
+++ b/packages/osd-optimizer/src/optimizer/watcher.ts
@@ -94,7 +94,7 @@ export class Watcher {
take(1)
),
- // call watchpack.watch after listerners are setup
+ // call watchpack.watch after listeners are set up
Rx.defer(() => {
const watchPaths: string[] = [];
@@ -104,7 +104,11 @@ export class Watcher {
}
}
- this.watchpack.watch(watchPaths, [], startTime);
+ this.watchpack.watch({
+ files: watchPaths,
+ startTime,
+ });
+
return Rx.EMPTY;
})
);
diff --git a/packages/osd-optimizer/src/worker/webpack.config.ts b/packages/osd-optimizer/src/worker/webpack.config.ts
index 1bfb1f186af7..4c3ba9291ee5 100644
--- a/packages/osd-optimizer/src/worker/webpack.config.ts
+++ b/packages/osd-optimizer/src/worker/webpack.config.ts
@@ -256,6 +256,16 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
loader: 'raw-loader',
},
},
+ {
+ test: /\.cjs$/,
+ include: /node_modules/,
+ use: {
+ loader: 'babel-loader',
+ options: {
+ presets: [BABEL_PRESET_PATH],
+ },
+ },
+ },
],
},
diff --git a/packages/osd-plugin-generator/template/public/components/app.tsx.ejs b/packages/osd-plugin-generator/template/public/components/app.tsx.ejs
index 876b3f8c5e75..2029a69dd8db 100644
--- a/packages/osd-plugin-generator/template/public/components/app.tsx.ejs
+++ b/packages/osd-plugin-generator/template/public/components/app.tsx.ejs
@@ -4,7 +4,7 @@ import { FormattedMessage, I18nProvider } from '@osd/i18n/react';
import { BrowserRouter as Router } from 'react-router-dom';
import {
-EuiButton,
+EuiSmallButton,
EuiHorizontalRule,
EuiPage,
EuiPageBody,
diff --git a/packages/osd-pm/dist/index.js b/packages/osd-pm/dist/index.js
index 458aacd2256c..e3c3250acb68 100644
--- a/packages/osd-pm/dist/index.js
+++ b/packages/osd-pm/dist/index.js
@@ -735,245 +735,245 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
-/*! *****************************************************************************
-Copyright (c) Microsoft Corporation.
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-***************************************************************************** */
-/* global Reflect, Promise */
-
-var extendStatics = function(d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
- return extendStatics(d, b);
-};
-
-function __extends(d, b) {
- if (typeof b !== "function" && b !== null)
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-}
-
-var __assign = function() {
- __assign = Object.assign || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
- }
- return t;
- }
- return __assign.apply(this, arguments);
-}
-
-function __rest(s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
- t[p[i]] = s[p[i]];
- }
- return t;
-}
-
-function __decorate(decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-}
-
-function __param(paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
-}
-
-function __metadata(metadataKey, metadataValue) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
-}
-
-function __awaiter(thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-}
-
-function __generator(thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
-}
-
-var __createBinding = Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-});
-
-function __exportStar(m, o) {
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
-}
-
-function __values(o) {
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
- if (m) return m.call(o);
- if (o && typeof o.length === "number") return {
- next: function () {
- if (o && i >= o.length) o = void 0;
- return { value: o && o[i++], done: !o };
- }
- };
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
-}
-
-function __read(o, n) {
- var m = typeof Symbol === "function" && o[Symbol.iterator];
- if (!m) return o;
- var i = m.call(o), r, ar = [], e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- }
- catch (error) { e = { error: error }; }
- finally {
- try {
- if (r && !r.done && (m = i["return"])) m.call(i);
- }
- finally { if (e) throw e.error; }
- }
- return ar;
-}
-
-/** @deprecated */
-function __spread() {
- for (var ar = [], i = 0; i < arguments.length; i++)
- ar = ar.concat(__read(arguments[i]));
- return ar;
-}
-
-/** @deprecated */
-function __spreadArrays() {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
-}
-
-function __spreadArray(to, from, pack) {
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
- if (ar || !(i in from)) {
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
- ar[i] = from[i];
- }
- }
- return to.concat(ar || Array.prototype.slice.call(from));
-}
-
-function __await(v) {
- return this instanceof __await ? (this.v = v, this) : new __await(v);
-}
-
-function __asyncGenerator(thisArg, _arguments, generator) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
- function fulfill(value) { resume("next", value); }
- function reject(value) { resume("throw", value); }
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
-}
-
-function __asyncDelegator(o) {
- var i, p;
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
-}
-
-function __asyncValues(o) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var m = o[Symbol.asyncIterator], i;
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
-}
-
-function __makeTemplateObject(cooked, raw) {
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
- return cooked;
-};
-
-var __setModuleDefault = Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-};
-
-function __importStar(mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-}
-
-function __importDefault(mod) {
- return (mod && mod.__esModule) ? mod : { default: mod };
-}
-
-function __classPrivateFieldGet(receiver, state, kind, f) {
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
-}
-
-function __classPrivateFieldSet(receiver, state, value, kind, f) {
- if (kind === "m") throw new TypeError("Private method is not writable");
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
-}
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+/* global Reflect, Promise */
+
+var extendStatics = function(d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+};
+
+function __extends(d, b) {
+ if (typeof b !== "function" && b !== null)
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+}
+
+var __assign = function() {
+ __assign = Object.assign || function __assign(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ }
+ return __assign.apply(this, arguments);
+}
+
+function __rest(s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+}
+
+function __decorate(decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+}
+
+function __param(paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); }
+}
+
+function __metadata(metadataKey, metadataValue) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
+}
+
+function __awaiter(thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+}
+
+function __generator(thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+}
+
+var __createBinding = Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+});
+
+function __exportStar(m, o) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
+}
+
+function __values(o) {
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
+ if (m) return m.call(o);
+ if (o && typeof o.length === "number") return {
+ next: function () {
+ if (o && i >= o.length) o = void 0;
+ return { value: o && o[i++], done: !o };
+ }
+ };
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
+}
+
+function __read(o, n) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
+ if (!m) return o;
+ var i = m.call(o), r, ar = [], e;
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
+ }
+ catch (error) { e = { error: error }; }
+ finally {
+ try {
+ if (r && !r.done && (m = i["return"])) m.call(i);
+ }
+ finally { if (e) throw e.error; }
+ }
+ return ar;
+}
+
+/** @deprecated */
+function __spread() {
+ for (var ar = [], i = 0; i < arguments.length; i++)
+ ar = ar.concat(__read(arguments[i]));
+ return ar;
+}
+
+/** @deprecated */
+function __spreadArrays() {
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+ r[k] = a[j];
+ return r;
+}
+
+function __spreadArray(to, from, pack) {
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
+ if (ar || !(i in from)) {
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
+ ar[i] = from[i];
+ }
+ }
+ return to.concat(ar || Array.prototype.slice.call(from));
+}
+
+function __await(v) {
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
+}
+
+function __asyncGenerator(thisArg, _arguments, generator) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
+ function fulfill(value) { resume("next", value); }
+ function reject(value) { resume("throw", value); }
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
+}
+
+function __asyncDelegator(o) {
+ var i, p;
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
+}
+
+function __asyncValues(o) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator], i;
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
+}
+
+function __makeTemplateObject(cooked, raw) {
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
+ return cooked;
+};
+
+var __setModuleDefault = Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+};
+
+function __importStar(mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+}
+
+function __importDefault(mod) {
+ return (mod && mod.__esModule) ? mod : { default: mod };
+}
+
+function __classPrivateFieldGet(receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+}
+
+function __classPrivateFieldSet(receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+}
/***/ }),
@@ -1653,224 +1653,224 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
-/*! *****************************************************************************
-Copyright (c) Microsoft Corporation.
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-***************************************************************************** */
-/* global Reflect, Promise */
-
-var extendStatics = function(d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
-};
-
-function __extends(d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-}
-
-var __assign = function() {
- __assign = Object.assign || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
- }
- return t;
- }
- return __assign.apply(this, arguments);
-}
-
-function __rest(s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
- t[p[i]] = s[p[i]];
- }
- return t;
-}
-
-function __decorate(decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-}
-
-function __param(paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
-}
-
-function __metadata(metadataKey, metadataValue) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
-}
-
-function __awaiter(thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-}
-
-function __generator(thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
-}
-
-function __createBinding(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}
-
-function __exportStar(m, exports) {
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
-}
-
-function __values(o) {
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
- if (m) return m.call(o);
- if (o && typeof o.length === "number") return {
- next: function () {
- if (o && i >= o.length) o = void 0;
- return { value: o && o[i++], done: !o };
- }
- };
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
-}
-
-function __read(o, n) {
- var m = typeof Symbol === "function" && o[Symbol.iterator];
- if (!m) return o;
- var i = m.call(o), r, ar = [], e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- }
- catch (error) { e = { error: error }; }
- finally {
- try {
- if (r && !r.done && (m = i["return"])) m.call(i);
- }
- finally { if (e) throw e.error; }
- }
- return ar;
-}
-
-function __spread() {
- for (var ar = [], i = 0; i < arguments.length; i++)
- ar = ar.concat(__read(arguments[i]));
- return ar;
-}
-
-function __spreadArrays() {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
-};
-
-function __await(v) {
- return this instanceof __await ? (this.v = v, this) : new __await(v);
-}
-
-function __asyncGenerator(thisArg, _arguments, generator) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
- function fulfill(value) { resume("next", value); }
- function reject(value) { resume("throw", value); }
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
-}
-
-function __asyncDelegator(o) {
- var i, p;
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
-}
-
-function __asyncValues(o) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var m = o[Symbol.asyncIterator], i;
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
-}
-
-function __makeTemplateObject(cooked, raw) {
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
- return cooked;
-};
-
-function __importStar(mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
- result.default = mod;
- return result;
-}
-
-function __importDefault(mod) {
- return (mod && mod.__esModule) ? mod : { default: mod };
-}
-
-function __classPrivateFieldGet(receiver, privateMap) {
- if (!privateMap.has(receiver)) {
- throw new TypeError("attempted to get private field on non-instance");
- }
- return privateMap.get(receiver);
-}
-
-function __classPrivateFieldSet(receiver, privateMap, value) {
- if (!privateMap.has(receiver)) {
- throw new TypeError("attempted to set private field on non-instance");
- }
- privateMap.set(receiver, value);
- return value;
-}
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+/* global Reflect, Promise */
+
+var extendStatics = function(d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+};
+
+function __extends(d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+}
+
+var __assign = function() {
+ __assign = Object.assign || function __assign(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ }
+ return __assign.apply(this, arguments);
+}
+
+function __rest(s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+}
+
+function __decorate(decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+}
+
+function __param(paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); }
+}
+
+function __metadata(metadataKey, metadataValue) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
+}
+
+function __awaiter(thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+}
+
+function __generator(thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+}
+
+function __createBinding(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}
+
+function __exportStar(m, exports) {
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+
+function __values(o) {
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
+ if (m) return m.call(o);
+ if (o && typeof o.length === "number") return {
+ next: function () {
+ if (o && i >= o.length) o = void 0;
+ return { value: o && o[i++], done: !o };
+ }
+ };
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
+}
+
+function __read(o, n) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
+ if (!m) return o;
+ var i = m.call(o), r, ar = [], e;
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
+ }
+ catch (error) { e = { error: error }; }
+ finally {
+ try {
+ if (r && !r.done && (m = i["return"])) m.call(i);
+ }
+ finally { if (e) throw e.error; }
+ }
+ return ar;
+}
+
+function __spread() {
+ for (var ar = [], i = 0; i < arguments.length; i++)
+ ar = ar.concat(__read(arguments[i]));
+ return ar;
+}
+
+function __spreadArrays() {
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+ r[k] = a[j];
+ return r;
+};
+
+function __await(v) {
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
+}
+
+function __asyncGenerator(thisArg, _arguments, generator) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
+ function fulfill(value) { resume("next", value); }
+ function reject(value) { resume("throw", value); }
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
+}
+
+function __asyncDelegator(o) {
+ var i, p;
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
+}
+
+function __asyncValues(o) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator], i;
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
+}
+
+function __makeTemplateObject(cooked, raw) {
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
+ return cooked;
+};
+
+function __importStar(mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
+ result.default = mod;
+ return result;
+}
+
+function __importDefault(mod) {
+ return (mod && mod.__esModule) ? mod : { default: mod };
+}
+
+function __classPrivateFieldGet(receiver, privateMap) {
+ if (!privateMap.has(receiver)) {
+ throw new TypeError("attempted to get private field on non-instance");
+ }
+ return privateMap.get(receiver);
+}
+
+function __classPrivateFieldSet(receiver, privateMap, value) {
+ if (!privateMap.has(receiver)) {
+ throw new TypeError("attempted to set private field on non-instance");
+ }
+ privateMap.set(receiver, value);
+ return value;
+}
/***/ }),
@@ -8252,158 +8252,158 @@ convert.rgb.gray = function (rgb) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-
-
-module.exports = {
- "aliceblue": [240, 248, 255],
- "antiquewhite": [250, 235, 215],
- "aqua": [0, 255, 255],
- "aquamarine": [127, 255, 212],
- "azure": [240, 255, 255],
- "beige": [245, 245, 220],
- "bisque": [255, 228, 196],
- "black": [0, 0, 0],
- "blanchedalmond": [255, 235, 205],
- "blue": [0, 0, 255],
- "blueviolet": [138, 43, 226],
- "brown": [165, 42, 42],
- "burlywood": [222, 184, 135],
- "cadetblue": [95, 158, 160],
- "chartreuse": [127, 255, 0],
- "chocolate": [210, 105, 30],
- "coral": [255, 127, 80],
- "cornflowerblue": [100, 149, 237],
- "cornsilk": [255, 248, 220],
- "crimson": [220, 20, 60],
- "cyan": [0, 255, 255],
- "darkblue": [0, 0, 139],
- "darkcyan": [0, 139, 139],
- "darkgoldenrod": [184, 134, 11],
- "darkgray": [169, 169, 169],
- "darkgreen": [0, 100, 0],
- "darkgrey": [169, 169, 169],
- "darkkhaki": [189, 183, 107],
- "darkmagenta": [139, 0, 139],
- "darkolivegreen": [85, 107, 47],
- "darkorange": [255, 140, 0],
- "darkorchid": [153, 50, 204],
- "darkred": [139, 0, 0],
- "darksalmon": [233, 150, 122],
- "darkseagreen": [143, 188, 143],
- "darkslateblue": [72, 61, 139],
- "darkslategray": [47, 79, 79],
- "darkslategrey": [47, 79, 79],
- "darkturquoise": [0, 206, 209],
- "darkviolet": [148, 0, 211],
- "deeppink": [255, 20, 147],
- "deepskyblue": [0, 191, 255],
- "dimgray": [105, 105, 105],
- "dimgrey": [105, 105, 105],
- "dodgerblue": [30, 144, 255],
- "firebrick": [178, 34, 34],
- "floralwhite": [255, 250, 240],
- "forestgreen": [34, 139, 34],
- "fuchsia": [255, 0, 255],
- "gainsboro": [220, 220, 220],
- "ghostwhite": [248, 248, 255],
- "gold": [255, 215, 0],
- "goldenrod": [218, 165, 32],
- "gray": [128, 128, 128],
- "green": [0, 128, 0],
- "greenyellow": [173, 255, 47],
- "grey": [128, 128, 128],
- "honeydew": [240, 255, 240],
- "hotpink": [255, 105, 180],
- "indianred": [205, 92, 92],
- "indigo": [75, 0, 130],
- "ivory": [255, 255, 240],
- "khaki": [240, 230, 140],
- "lavender": [230, 230, 250],
- "lavenderblush": [255, 240, 245],
- "lawngreen": [124, 252, 0],
- "lemonchiffon": [255, 250, 205],
- "lightblue": [173, 216, 230],
- "lightcoral": [240, 128, 128],
- "lightcyan": [224, 255, 255],
- "lightgoldenrodyellow": [250, 250, 210],
- "lightgray": [211, 211, 211],
- "lightgreen": [144, 238, 144],
- "lightgrey": [211, 211, 211],
- "lightpink": [255, 182, 193],
- "lightsalmon": [255, 160, 122],
- "lightseagreen": [32, 178, 170],
- "lightskyblue": [135, 206, 250],
- "lightslategray": [119, 136, 153],
- "lightslategrey": [119, 136, 153],
- "lightsteelblue": [176, 196, 222],
- "lightyellow": [255, 255, 224],
- "lime": [0, 255, 0],
- "limegreen": [50, 205, 50],
- "linen": [250, 240, 230],
- "magenta": [255, 0, 255],
- "maroon": [128, 0, 0],
- "mediumaquamarine": [102, 205, 170],
- "mediumblue": [0, 0, 205],
- "mediumorchid": [186, 85, 211],
- "mediumpurple": [147, 112, 219],
- "mediumseagreen": [60, 179, 113],
- "mediumslateblue": [123, 104, 238],
- "mediumspringgreen": [0, 250, 154],
- "mediumturquoise": [72, 209, 204],
- "mediumvioletred": [199, 21, 133],
- "midnightblue": [25, 25, 112],
- "mintcream": [245, 255, 250],
- "mistyrose": [255, 228, 225],
- "moccasin": [255, 228, 181],
- "navajowhite": [255, 222, 173],
- "navy": [0, 0, 128],
- "oldlace": [253, 245, 230],
- "olive": [128, 128, 0],
- "olivedrab": [107, 142, 35],
- "orange": [255, 165, 0],
- "orangered": [255, 69, 0],
- "orchid": [218, 112, 214],
- "palegoldenrod": [238, 232, 170],
- "palegreen": [152, 251, 152],
- "paleturquoise": [175, 238, 238],
- "palevioletred": [219, 112, 147],
- "papayawhip": [255, 239, 213],
- "peachpuff": [255, 218, 185],
- "peru": [205, 133, 63],
- "pink": [255, 192, 203],
- "plum": [221, 160, 221],
- "powderblue": [176, 224, 230],
- "purple": [128, 0, 128],
- "rebeccapurple": [102, 51, 153],
- "red": [255, 0, 0],
- "rosybrown": [188, 143, 143],
- "royalblue": [65, 105, 225],
- "saddlebrown": [139, 69, 19],
- "salmon": [250, 128, 114],
- "sandybrown": [244, 164, 96],
- "seagreen": [46, 139, 87],
- "seashell": [255, 245, 238],
- "sienna": [160, 82, 45],
- "silver": [192, 192, 192],
- "skyblue": [135, 206, 235],
- "slateblue": [106, 90, 205],
- "slategray": [112, 128, 144],
- "slategrey": [112, 128, 144],
- "snow": [255, 250, 250],
- "springgreen": [0, 255, 127],
- "steelblue": [70, 130, 180],
- "tan": [210, 180, 140],
- "teal": [0, 128, 128],
- "thistle": [216, 191, 216],
- "tomato": [255, 99, 71],
- "turquoise": [64, 224, 208],
- "violet": [238, 130, 238],
- "wheat": [245, 222, 179],
- "white": [255, 255, 255],
- "whitesmoke": [245, 245, 245],
- "yellow": [255, 255, 0],
- "yellowgreen": [154, 205, 50]
-};
+
+
+module.exports = {
+ "aliceblue": [240, 248, 255],
+ "antiquewhite": [250, 235, 215],
+ "aqua": [0, 255, 255],
+ "aquamarine": [127, 255, 212],
+ "azure": [240, 255, 255],
+ "beige": [245, 245, 220],
+ "bisque": [255, 228, 196],
+ "black": [0, 0, 0],
+ "blanchedalmond": [255, 235, 205],
+ "blue": [0, 0, 255],
+ "blueviolet": [138, 43, 226],
+ "brown": [165, 42, 42],
+ "burlywood": [222, 184, 135],
+ "cadetblue": [95, 158, 160],
+ "chartreuse": [127, 255, 0],
+ "chocolate": [210, 105, 30],
+ "coral": [255, 127, 80],
+ "cornflowerblue": [100, 149, 237],
+ "cornsilk": [255, 248, 220],
+ "crimson": [220, 20, 60],
+ "cyan": [0, 255, 255],
+ "darkblue": [0, 0, 139],
+ "darkcyan": [0, 139, 139],
+ "darkgoldenrod": [184, 134, 11],
+ "darkgray": [169, 169, 169],
+ "darkgreen": [0, 100, 0],
+ "darkgrey": [169, 169, 169],
+ "darkkhaki": [189, 183, 107],
+ "darkmagenta": [139, 0, 139],
+ "darkolivegreen": [85, 107, 47],
+ "darkorange": [255, 140, 0],
+ "darkorchid": [153, 50, 204],
+ "darkred": [139, 0, 0],
+ "darksalmon": [233, 150, 122],
+ "darkseagreen": [143, 188, 143],
+ "darkslateblue": [72, 61, 139],
+ "darkslategray": [47, 79, 79],
+ "darkslategrey": [47, 79, 79],
+ "darkturquoise": [0, 206, 209],
+ "darkviolet": [148, 0, 211],
+ "deeppink": [255, 20, 147],
+ "deepskyblue": [0, 191, 255],
+ "dimgray": [105, 105, 105],
+ "dimgrey": [105, 105, 105],
+ "dodgerblue": [30, 144, 255],
+ "firebrick": [178, 34, 34],
+ "floralwhite": [255, 250, 240],
+ "forestgreen": [34, 139, 34],
+ "fuchsia": [255, 0, 255],
+ "gainsboro": [220, 220, 220],
+ "ghostwhite": [248, 248, 255],
+ "gold": [255, 215, 0],
+ "goldenrod": [218, 165, 32],
+ "gray": [128, 128, 128],
+ "green": [0, 128, 0],
+ "greenyellow": [173, 255, 47],
+ "grey": [128, 128, 128],
+ "honeydew": [240, 255, 240],
+ "hotpink": [255, 105, 180],
+ "indianred": [205, 92, 92],
+ "indigo": [75, 0, 130],
+ "ivory": [255, 255, 240],
+ "khaki": [240, 230, 140],
+ "lavender": [230, 230, 250],
+ "lavenderblush": [255, 240, 245],
+ "lawngreen": [124, 252, 0],
+ "lemonchiffon": [255, 250, 205],
+ "lightblue": [173, 216, 230],
+ "lightcoral": [240, 128, 128],
+ "lightcyan": [224, 255, 255],
+ "lightgoldenrodyellow": [250, 250, 210],
+ "lightgray": [211, 211, 211],
+ "lightgreen": [144, 238, 144],
+ "lightgrey": [211, 211, 211],
+ "lightpink": [255, 182, 193],
+ "lightsalmon": [255, 160, 122],
+ "lightseagreen": [32, 178, 170],
+ "lightskyblue": [135, 206, 250],
+ "lightslategray": [119, 136, 153],
+ "lightslategrey": [119, 136, 153],
+ "lightsteelblue": [176, 196, 222],
+ "lightyellow": [255, 255, 224],
+ "lime": [0, 255, 0],
+ "limegreen": [50, 205, 50],
+ "linen": [250, 240, 230],
+ "magenta": [255, 0, 255],
+ "maroon": [128, 0, 0],
+ "mediumaquamarine": [102, 205, 170],
+ "mediumblue": [0, 0, 205],
+ "mediumorchid": [186, 85, 211],
+ "mediumpurple": [147, 112, 219],
+ "mediumseagreen": [60, 179, 113],
+ "mediumslateblue": [123, 104, 238],
+ "mediumspringgreen": [0, 250, 154],
+ "mediumturquoise": [72, 209, 204],
+ "mediumvioletred": [199, 21, 133],
+ "midnightblue": [25, 25, 112],
+ "mintcream": [245, 255, 250],
+ "mistyrose": [255, 228, 225],
+ "moccasin": [255, 228, 181],
+ "navajowhite": [255, 222, 173],
+ "navy": [0, 0, 128],
+ "oldlace": [253, 245, 230],
+ "olive": [128, 128, 0],
+ "olivedrab": [107, 142, 35],
+ "orange": [255, 165, 0],
+ "orangered": [255, 69, 0],
+ "orchid": [218, 112, 214],
+ "palegoldenrod": [238, 232, 170],
+ "palegreen": [152, 251, 152],
+ "paleturquoise": [175, 238, 238],
+ "palevioletred": [219, 112, 147],
+ "papayawhip": [255, 239, 213],
+ "peachpuff": [255, 218, 185],
+ "peru": [205, 133, 63],
+ "pink": [255, 192, 203],
+ "plum": [221, 160, 221],
+ "powderblue": [176, 224, 230],
+ "purple": [128, 0, 128],
+ "rebeccapurple": [102, 51, 153],
+ "red": [255, 0, 0],
+ "rosybrown": [188, 143, 143],
+ "royalblue": [65, 105, 225],
+ "saddlebrown": [139, 69, 19],
+ "salmon": [250, 128, 114],
+ "sandybrown": [244, 164, 96],
+ "seagreen": [46, 139, 87],
+ "seashell": [255, 245, 238],
+ "sienna": [160, 82, 45],
+ "silver": [192, 192, 192],
+ "skyblue": [135, 206, 235],
+ "slateblue": [106, 90, 205],
+ "slategray": [112, 128, 144],
+ "slategrey": [112, 128, 144],
+ "snow": [255, 250, 250],
+ "springgreen": [0, 255, 127],
+ "steelblue": [70, 130, 180],
+ "tan": [210, 180, 140],
+ "teal": [0, 128, 128],
+ "thistle": [216, 191, 216],
+ "tomato": [255, 99, 71],
+ "turquoise": [64, 224, 208],
+ "violet": [238, 130, 238],
+ "wheat": [245, 222, 179],
+ "white": [255, 255, 255],
+ "whitesmoke": [245, 245, 245],
+ "yellow": [255, 255, 0],
+ "yellowgreen": [154, 205, 50]
+};
/***/ }),
@@ -10741,58 +10741,58 @@ mkdirP.sync = function sync (p, opts, made) {
/* 142 */
/***/ (function(module, exports) {
-exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair
-exports.convertToSetCommand = convertToSetCommand
-exports.convertToSetCommands = convertToSetCommands
-
-function convertToSetCommand(key, value) {
- var line = ""
- key = key || ""
- key = key.trim()
- value = value || ""
- value = value.trim()
- if(key && value && value.length > 0) {
- line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n"
- }
- return line
-}
-
-function extractVariableValuePairs(declarations) {
- var pairs = {}
- declarations.map(function(declaration) {
- var split = declaration.split("=")
- pairs[split[0]]=split[1]
- })
- return pairs
-}
-
-function convertToSetCommands(variableString) {
- var variableValuePairs = extractVariableValuePairs(variableString.split(" "))
- var variableDeclarationsAsBatch = ""
- Object.keys(variableValuePairs).forEach(function (key) {
- variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key])
- })
- return variableDeclarationsAsBatch
-}
-
-function replaceDollarWithPercentPair(value) {
- var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g
- var result = ""
- var startIndex = 0
- value = value || ""
- do {
- var match = dollarExpressions.exec(value)
- if(match) {
- var betweenMatches = value.substring(startIndex, match.index) || ""
- result += betweenMatches + "%" + match[1] + "%"
- startIndex = dollarExpressions.lastIndex
- }
- } while (dollarExpressions.lastIndex > 0)
- result += value.substr(startIndex)
- return result
-}
-
-
+exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair
+exports.convertToSetCommand = convertToSetCommand
+exports.convertToSetCommands = convertToSetCommands
+
+function convertToSetCommand(key, value) {
+ var line = ""
+ key = key || ""
+ key = key.trim()
+ value = value || ""
+ value = value.trim()
+ if(key && value && value.length > 0) {
+ line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n"
+ }
+ return line
+}
+
+function extractVariableValuePairs(declarations) {
+ var pairs = {}
+ declarations.map(function(declaration) {
+ var split = declaration.split("=")
+ pairs[split[0]]=split[1]
+ })
+ return pairs
+}
+
+function convertToSetCommands(variableString) {
+ var variableValuePairs = extractVariableValuePairs(variableString.split(" "))
+ var variableDeclarationsAsBatch = ""
+ Object.keys(variableValuePairs).forEach(function (key) {
+ variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key])
+ })
+ return variableDeclarationsAsBatch
+}
+
+function replaceDollarWithPercentPair(value) {
+ var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g
+ var result = ""
+ var startIndex = 0
+ value = value || ""
+ do {
+ var match = dollarExpressions.exec(value)
+ if(match) {
+ var betweenMatches = value.substring(startIndex, match.index) || ""
+ result += betweenMatches + "%" + match[1] + "%"
+ startIndex = dollarExpressions.lastIndex
+ }
+ } while (dollarExpressions.lastIndex > 0)
+ result += value.substr(startIndex)
+ return result
+}
+
+
/***/ }),
@@ -17527,158 +17527,158 @@ convert.rgb.gray = function (rgb) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-
-
-module.exports = {
- "aliceblue": [240, 248, 255],
- "antiquewhite": [250, 235, 215],
- "aqua": [0, 255, 255],
- "aquamarine": [127, 255, 212],
- "azure": [240, 255, 255],
- "beige": [245, 245, 220],
- "bisque": [255, 228, 196],
- "black": [0, 0, 0],
- "blanchedalmond": [255, 235, 205],
- "blue": [0, 0, 255],
- "blueviolet": [138, 43, 226],
- "brown": [165, 42, 42],
- "burlywood": [222, 184, 135],
- "cadetblue": [95, 158, 160],
- "chartreuse": [127, 255, 0],
- "chocolate": [210, 105, 30],
- "coral": [255, 127, 80],
- "cornflowerblue": [100, 149, 237],
- "cornsilk": [255, 248, 220],
- "crimson": [220, 20, 60],
- "cyan": [0, 255, 255],
- "darkblue": [0, 0, 139],
- "darkcyan": [0, 139, 139],
- "darkgoldenrod": [184, 134, 11],
- "darkgray": [169, 169, 169],
- "darkgreen": [0, 100, 0],
- "darkgrey": [169, 169, 169],
- "darkkhaki": [189, 183, 107],
- "darkmagenta": [139, 0, 139],
- "darkolivegreen": [85, 107, 47],
- "darkorange": [255, 140, 0],
- "darkorchid": [153, 50, 204],
- "darkred": [139, 0, 0],
- "darksalmon": [233, 150, 122],
- "darkseagreen": [143, 188, 143],
- "darkslateblue": [72, 61, 139],
- "darkslategray": [47, 79, 79],
- "darkslategrey": [47, 79, 79],
- "darkturquoise": [0, 206, 209],
- "darkviolet": [148, 0, 211],
- "deeppink": [255, 20, 147],
- "deepskyblue": [0, 191, 255],
- "dimgray": [105, 105, 105],
- "dimgrey": [105, 105, 105],
- "dodgerblue": [30, 144, 255],
- "firebrick": [178, 34, 34],
- "floralwhite": [255, 250, 240],
- "forestgreen": [34, 139, 34],
- "fuchsia": [255, 0, 255],
- "gainsboro": [220, 220, 220],
- "ghostwhite": [248, 248, 255],
- "gold": [255, 215, 0],
- "goldenrod": [218, 165, 32],
- "gray": [128, 128, 128],
- "green": [0, 128, 0],
- "greenyellow": [173, 255, 47],
- "grey": [128, 128, 128],
- "honeydew": [240, 255, 240],
- "hotpink": [255, 105, 180],
- "indianred": [205, 92, 92],
- "indigo": [75, 0, 130],
- "ivory": [255, 255, 240],
- "khaki": [240, 230, 140],
- "lavender": [230, 230, 250],
- "lavenderblush": [255, 240, 245],
- "lawngreen": [124, 252, 0],
- "lemonchiffon": [255, 250, 205],
- "lightblue": [173, 216, 230],
- "lightcoral": [240, 128, 128],
- "lightcyan": [224, 255, 255],
- "lightgoldenrodyellow": [250, 250, 210],
- "lightgray": [211, 211, 211],
- "lightgreen": [144, 238, 144],
- "lightgrey": [211, 211, 211],
- "lightpink": [255, 182, 193],
- "lightsalmon": [255, 160, 122],
- "lightseagreen": [32, 178, 170],
- "lightskyblue": [135, 206, 250],
- "lightslategray": [119, 136, 153],
- "lightslategrey": [119, 136, 153],
- "lightsteelblue": [176, 196, 222],
- "lightyellow": [255, 255, 224],
- "lime": [0, 255, 0],
- "limegreen": [50, 205, 50],
- "linen": [250, 240, 230],
- "magenta": [255, 0, 255],
- "maroon": [128, 0, 0],
- "mediumaquamarine": [102, 205, 170],
- "mediumblue": [0, 0, 205],
- "mediumorchid": [186, 85, 211],
- "mediumpurple": [147, 112, 219],
- "mediumseagreen": [60, 179, 113],
- "mediumslateblue": [123, 104, 238],
- "mediumspringgreen": [0, 250, 154],
- "mediumturquoise": [72, 209, 204],
- "mediumvioletred": [199, 21, 133],
- "midnightblue": [25, 25, 112],
- "mintcream": [245, 255, 250],
- "mistyrose": [255, 228, 225],
- "moccasin": [255, 228, 181],
- "navajowhite": [255, 222, 173],
- "navy": [0, 0, 128],
- "oldlace": [253, 245, 230],
- "olive": [128, 128, 0],
- "olivedrab": [107, 142, 35],
- "orange": [255, 165, 0],
- "orangered": [255, 69, 0],
- "orchid": [218, 112, 214],
- "palegoldenrod": [238, 232, 170],
- "palegreen": [152, 251, 152],
- "paleturquoise": [175, 238, 238],
- "palevioletred": [219, 112, 147],
- "papayawhip": [255, 239, 213],
- "peachpuff": [255, 218, 185],
- "peru": [205, 133, 63],
- "pink": [255, 192, 203],
- "plum": [221, 160, 221],
- "powderblue": [176, 224, 230],
- "purple": [128, 0, 128],
- "rebeccapurple": [102, 51, 153],
- "red": [255, 0, 0],
- "rosybrown": [188, 143, 143],
- "royalblue": [65, 105, 225],
- "saddlebrown": [139, 69, 19],
- "salmon": [250, 128, 114],
- "sandybrown": [244, 164, 96],
- "seagreen": [46, 139, 87],
- "seashell": [255, 245, 238],
- "sienna": [160, 82, 45],
- "silver": [192, 192, 192],
- "skyblue": [135, 206, 235],
- "slateblue": [106, 90, 205],
- "slategray": [112, 128, 144],
- "slategrey": [112, 128, 144],
- "snow": [255, 250, 250],
- "springgreen": [0, 255, 127],
- "steelblue": [70, 130, 180],
- "tan": [210, 180, 140],
- "teal": [0, 128, 128],
- "thistle": [216, 191, 216],
- "tomato": [255, 99, 71],
- "turquoise": [64, 224, 208],
- "violet": [238, 130, 238],
- "wheat": [245, 222, 179],
- "white": [255, 255, 255],
- "whitesmoke": [245, 245, 245],
- "yellow": [255, 255, 0],
- "yellowgreen": [154, 205, 50]
-};
+
+
+module.exports = {
+ "aliceblue": [240, 248, 255],
+ "antiquewhite": [250, 235, 215],
+ "aqua": [0, 255, 255],
+ "aquamarine": [127, 255, 212],
+ "azure": [240, 255, 255],
+ "beige": [245, 245, 220],
+ "bisque": [255, 228, 196],
+ "black": [0, 0, 0],
+ "blanchedalmond": [255, 235, 205],
+ "blue": [0, 0, 255],
+ "blueviolet": [138, 43, 226],
+ "brown": [165, 42, 42],
+ "burlywood": [222, 184, 135],
+ "cadetblue": [95, 158, 160],
+ "chartreuse": [127, 255, 0],
+ "chocolate": [210, 105, 30],
+ "coral": [255, 127, 80],
+ "cornflowerblue": [100, 149, 237],
+ "cornsilk": [255, 248, 220],
+ "crimson": [220, 20, 60],
+ "cyan": [0, 255, 255],
+ "darkblue": [0, 0, 139],
+ "darkcyan": [0, 139, 139],
+ "darkgoldenrod": [184, 134, 11],
+ "darkgray": [169, 169, 169],
+ "darkgreen": [0, 100, 0],
+ "darkgrey": [169, 169, 169],
+ "darkkhaki": [189, 183, 107],
+ "darkmagenta": [139, 0, 139],
+ "darkolivegreen": [85, 107, 47],
+ "darkorange": [255, 140, 0],
+ "darkorchid": [153, 50, 204],
+ "darkred": [139, 0, 0],
+ "darksalmon": [233, 150, 122],
+ "darkseagreen": [143, 188, 143],
+ "darkslateblue": [72, 61, 139],
+ "darkslategray": [47, 79, 79],
+ "darkslategrey": [47, 79, 79],
+ "darkturquoise": [0, 206, 209],
+ "darkviolet": [148, 0, 211],
+ "deeppink": [255, 20, 147],
+ "deepskyblue": [0, 191, 255],
+ "dimgray": [105, 105, 105],
+ "dimgrey": [105, 105, 105],
+ "dodgerblue": [30, 144, 255],
+ "firebrick": [178, 34, 34],
+ "floralwhite": [255, 250, 240],
+ "forestgreen": [34, 139, 34],
+ "fuchsia": [255, 0, 255],
+ "gainsboro": [220, 220, 220],
+ "ghostwhite": [248, 248, 255],
+ "gold": [255, 215, 0],
+ "goldenrod": [218, 165, 32],
+ "gray": [128, 128, 128],
+ "green": [0, 128, 0],
+ "greenyellow": [173, 255, 47],
+ "grey": [128, 128, 128],
+ "honeydew": [240, 255, 240],
+ "hotpink": [255, 105, 180],
+ "indianred": [205, 92, 92],
+ "indigo": [75, 0, 130],
+ "ivory": [255, 255, 240],
+ "khaki": [240, 230, 140],
+ "lavender": [230, 230, 250],
+ "lavenderblush": [255, 240, 245],
+ "lawngreen": [124, 252, 0],
+ "lemonchiffon": [255, 250, 205],
+ "lightblue": [173, 216, 230],
+ "lightcoral": [240, 128, 128],
+ "lightcyan": [224, 255, 255],
+ "lightgoldenrodyellow": [250, 250, 210],
+ "lightgray": [211, 211, 211],
+ "lightgreen": [144, 238, 144],
+ "lightgrey": [211, 211, 211],
+ "lightpink": [255, 182, 193],
+ "lightsalmon": [255, 160, 122],
+ "lightseagreen": [32, 178, 170],
+ "lightskyblue": [135, 206, 250],
+ "lightslategray": [119, 136, 153],
+ "lightslategrey": [119, 136, 153],
+ "lightsteelblue": [176, 196, 222],
+ "lightyellow": [255, 255, 224],
+ "lime": [0, 255, 0],
+ "limegreen": [50, 205, 50],
+ "linen": [250, 240, 230],
+ "magenta": [255, 0, 255],
+ "maroon": [128, 0, 0],
+ "mediumaquamarine": [102, 205, 170],
+ "mediumblue": [0, 0, 205],
+ "mediumorchid": [186, 85, 211],
+ "mediumpurple": [147, 112, 219],
+ "mediumseagreen": [60, 179, 113],
+ "mediumslateblue": [123, 104, 238],
+ "mediumspringgreen": [0, 250, 154],
+ "mediumturquoise": [72, 209, 204],
+ "mediumvioletred": [199, 21, 133],
+ "midnightblue": [25, 25, 112],
+ "mintcream": [245, 255, 250],
+ "mistyrose": [255, 228, 225],
+ "moccasin": [255, 228, 181],
+ "navajowhite": [255, 222, 173],
+ "navy": [0, 0, 128],
+ "oldlace": [253, 245, 230],
+ "olive": [128, 128, 0],
+ "olivedrab": [107, 142, 35],
+ "orange": [255, 165, 0],
+ "orangered": [255, 69, 0],
+ "orchid": [218, 112, 214],
+ "palegoldenrod": [238, 232, 170],
+ "palegreen": [152, 251, 152],
+ "paleturquoise": [175, 238, 238],
+ "palevioletred": [219, 112, 147],
+ "papayawhip": [255, 239, 213],
+ "peachpuff": [255, 218, 185],
+ "peru": [205, 133, 63],
+ "pink": [255, 192, 203],
+ "plum": [221, 160, 221],
+ "powderblue": [176, 224, 230],
+ "purple": [128, 0, 128],
+ "rebeccapurple": [102, 51, 153],
+ "red": [255, 0, 0],
+ "rosybrown": [188, 143, 143],
+ "royalblue": [65, 105, 225],
+ "saddlebrown": [139, 69, 19],
+ "salmon": [250, 128, 114],
+ "sandybrown": [244, 164, 96],
+ "seagreen": [46, 139, 87],
+ "seashell": [255, 245, 238],
+ "sienna": [160, 82, 45],
+ "silver": [192, 192, 192],
+ "skyblue": [135, 206, 235],
+ "slateblue": [106, 90, 205],
+ "slategray": [112, 128, 144],
+ "slategrey": [112, 128, 144],
+ "snow": [255, 250, 250],
+ "springgreen": [0, 255, 127],
+ "steelblue": [70, 130, 180],
+ "tan": [210, 180, 140],
+ "teal": [0, 128, 128],
+ "thistle": [216, 191, 216],
+ "tomato": [255, 99, 71],
+ "turquoise": [64, 224, 208],
+ "violet": [238, 130, 238],
+ "wheat": [245, 222, 179],
+ "white": [255, 255, 255],
+ "whitesmoke": [245, 245, 245],
+ "yellow": [255, 255, 0],
+ "yellowgreen": [154, 205, 50]
+};
/***/ }),
@@ -24189,7 +24189,7 @@ module.exports = function (x, opts) {
"use strict";
-var has = __webpack_require__(263);
+var hasOwn = __webpack_require__(263);
function specifierIncluded(current, specifier) {
var nodeParts = current.split('.');
@@ -24254,7 +24254,7 @@ function versionIncluded(nodeVersion, specifierValue) {
var data = __webpack_require__(266);
module.exports = function isCore(x, nodeVersion) {
- return has(data, x) && versionIncluded(nodeVersion, data[x]);
+ return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
};
@@ -24265,9 +24265,12 @@ module.exports = function isCore(x, nodeVersion) {
"use strict";
+var call = Function.prototype.call;
+var $hasOwn = Object.prototype.hasOwnProperty;
var bind = __webpack_require__(264);
-module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
+/** @type {(o: {}, p: PropertyKey) => p is keyof o} */
+module.exports = bind.call(call, $hasOwn);
/***/ }),
@@ -24292,43 +24295,75 @@ module.exports = Function.prototype.bind || implementation;
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
-var slice = Array.prototype.slice;
var toStr = Object.prototype.toString;
+var max = Math.max;
var funcType = '[object Function]';
+var concatty = function concatty(a, b) {
+ var arr = [];
+
+ for (var i = 0; i < a.length; i += 1) {
+ arr[i] = a[i];
+ }
+ for (var j = 0; j < b.length; j += 1) {
+ arr[j + a.length] = b[j];
+ }
+
+ return arr;
+};
+
+var slicy = function slicy(arrLike, offset) {
+ var arr = [];
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
+ arr[j] = arrLike[i];
+ }
+ return arr;
+};
+
+var joiny = function (arr, joiner) {
+ var str = '';
+ for (var i = 0; i < arr.length; i += 1) {
+ str += arr[i];
+ if (i + 1 < arr.length) {
+ str += joiner;
+ }
+ }
+ return str;
+};
+
module.exports = function bind(that) {
var target = this;
- if (typeof target !== 'function' || toStr.call(target) !== funcType) {
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
- var args = slice.call(arguments, 1);
+ var args = slicy(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
- args.concat(slice.call(arguments))
+ concatty(args, arguments)
);
if (Object(result) === result) {
return result;
}
return this;
- } else {
- return target.apply(
- that,
- args.concat(slice.call(arguments))
- );
}
+ return target.apply(
+ that,
+ concatty(args, arguments)
+ );
+
};
- var boundLength = Math.max(0, target.length - args.length);
+ var boundLength = max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
- boundArgs.push('$' + i);
+ boundArgs[i] = '$' + i;
}
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
@@ -24345,7 +24380,7 @@ module.exports = function bind(that) {
/* 266 */
/***/ (function(module) {
-module.exports = JSON.parse("{\"assert\":true,\"node:assert\":[\">= 14.18 && < 15\",\">= 16\"],\"assert/strict\":\">= 15\",\"node:assert/strict\":\">= 16\",\"async_hooks\":\">= 8\",\"node:async_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"buffer_ieee754\":\">= 0.5 && < 0.9.7\",\"buffer\":true,\"node:buffer\":[\">= 14.18 && < 15\",\">= 16\"],\"child_process\":true,\"node:child_process\":[\">= 14.18 && < 15\",\">= 16\"],\"cluster\":\">= 0.5\",\"node:cluster\":[\">= 14.18 && < 15\",\">= 16\"],\"console\":true,\"node:console\":[\">= 14.18 && < 15\",\">= 16\"],\"constants\":true,\"node:constants\":[\">= 14.18 && < 15\",\">= 16\"],\"crypto\":true,\"node:crypto\":[\">= 14.18 && < 15\",\">= 16\"],\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"node:dgram\":[\">= 14.18 && < 15\",\">= 16\"],\"diagnostics_channel\":[\">= 14.17 && < 15\",\">= 15.1\"],\"node:diagnostics_channel\":[\">= 14.18 && < 15\",\">= 16\"],\"dns\":true,\"node:dns\":[\">= 14.18 && < 15\",\">= 16\"],\"dns/promises\":\">= 15\",\"node:dns/promises\":\">= 16\",\"domain\":\">= 0.7.12\",\"node:domain\":[\">= 14.18 && < 15\",\">= 16\"],\"events\":true,\"node:events\":[\">= 14.18 && < 15\",\">= 16\"],\"freelist\":\"< 6\",\"fs\":true,\"node:fs\":[\">= 14.18 && < 15\",\">= 16\"],\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"node:fs/promises\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_agent\":\">= 0.11.1\",\"node:_http_agent\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_client\":\">= 0.11.1\",\"node:_http_client\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_common\":\">= 0.11.1\",\"node:_http_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_incoming\":\">= 0.11.1\",\"node:_http_incoming\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_outgoing\":\">= 0.11.1\",\"node:_http_outgoing\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_server\":\">= 0.11.1\",\"node:_http_server\":[\">= 14.18 && < 15\",\">= 16\"],\"http\":true,\"node:http\":[\">= 14.18 && < 15\",\">= 16\"],\"http2\":\">= 8.8\",\"node:http2\":[\">= 14.18 && < 15\",\">= 16\"],\"https\":true,\"node:https\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector\":\">= 8\",\"node:inspector\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector/promises\":[\">= 19\"],\"node:inspector/promises\":[\">= 19\"],\"_linklist\":\"< 8\",\"module\":true,\"node:module\":[\">= 14.18 && < 15\",\">= 16\"],\"net\":true,\"node:net\":[\">= 14.18 && < 15\",\">= 16\"],\"node-inspect/lib/_inspect\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6 && < 12\",\"os\":true,\"node:os\":[\">= 14.18 && < 15\",\">= 16\"],\"path\":true,\"node:path\":[\">= 14.18 && < 15\",\">= 16\"],\"path/posix\":\">= 15.3\",\"node:path/posix\":\">= 16\",\"path/win32\":\">= 15.3\",\"node:path/win32\":\">= 16\",\"perf_hooks\":\">= 8.5\",\"node:perf_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"process\":\">= 1\",\"node:process\":[\">= 14.18 && < 15\",\">= 16\"],\"punycode\":\">= 0.5\",\"node:punycode\":[\">= 14.18 && < 15\",\">= 16\"],\"querystring\":true,\"node:querystring\":[\">= 14.18 && < 15\",\">= 16\"],\"readline\":true,\"node:readline\":[\">= 14.18 && < 15\",\">= 16\"],\"readline/promises\":\">= 17\",\"node:readline/promises\":\">= 17\",\"repl\":true,\"node:repl\":[\">= 14.18 && < 15\",\">= 16\"],\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"node:_stream_duplex\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_transform\":\">= 0.9.4\",\"node:_stream_transform\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_wrap\":\">= 1.4.1\",\"node:_stream_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_passthrough\":\">= 0.9.4\",\"node:_stream_passthrough\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_readable\":\">= 0.9.4\",\"node:_stream_readable\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_writable\":\">= 0.9.4\",\"node:_stream_writable\":[\">= 14.18 && < 15\",\">= 16\"],\"stream\":true,\"node:stream\":[\">= 14.18 && < 15\",\">= 16\"],\"stream/consumers\":\">= 16.7\",\"node:stream/consumers\":\">= 16.7\",\"stream/promises\":\">= 15\",\"node:stream/promises\":\">= 16\",\"stream/web\":\">= 16.5\",\"node:stream/web\":\">= 16.5\",\"string_decoder\":true,\"node:string_decoder\":[\">= 14.18 && < 15\",\">= 16\"],\"sys\":[\">= 0.4 && < 0.7\",\">= 0.8\"],\"node:sys\":[\">= 14.18 && < 15\",\">= 16\"],\"node:test\":[\">= 16.17 && < 17\",\">= 18\"],\"timers\":true,\"node:timers\":[\">= 14.18 && < 15\",\">= 16\"],\"timers/promises\":\">= 15\",\"node:timers/promises\":\">= 16\",\"_tls_common\":\">= 0.11.13\",\"node:_tls_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"node:_tls_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"tls\":true,\"node:tls\":[\">= 14.18 && < 15\",\">= 16\"],\"trace_events\":\">= 10\",\"node:trace_events\":[\">= 14.18 && < 15\",\">= 16\"],\"tty\":true,\"node:tty\":[\">= 14.18 && < 15\",\">= 16\"],\"url\":true,\"node:url\":[\">= 14.18 && < 15\",\">= 16\"],\"util\":true,\"node:util\":[\">= 14.18 && < 15\",\">= 16\"],\"util/types\":\">= 15.3\",\"node:util/types\":\">= 16\",\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/consarray\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/logreader\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8\":\">= 1\",\"node:v8\":[\">= 14.18 && < 15\",\">= 16\"],\"vm\":true,\"node:vm\":[\">= 14.18 && < 15\",\">= 16\"],\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"node:worker_threads\":[\">= 14.18 && < 15\",\">= 16\"],\"zlib\":\">= 0.5\",\"node:zlib\":[\">= 14.18 && < 15\",\">= 16\"]}");
+module.exports = JSON.parse("{\"assert\":true,\"node:assert\":[\">= 14.18 && < 15\",\">= 16\"],\"assert/strict\":\">= 15\",\"node:assert/strict\":\">= 16\",\"async_hooks\":\">= 8\",\"node:async_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"buffer_ieee754\":\">= 0.5 && < 0.9.7\",\"buffer\":true,\"node:buffer\":[\">= 14.18 && < 15\",\">= 16\"],\"child_process\":true,\"node:child_process\":[\">= 14.18 && < 15\",\">= 16\"],\"cluster\":\">= 0.5\",\"node:cluster\":[\">= 14.18 && < 15\",\">= 16\"],\"console\":true,\"node:console\":[\">= 14.18 && < 15\",\">= 16\"],\"constants\":true,\"node:constants\":[\">= 14.18 && < 15\",\">= 16\"],\"crypto\":true,\"node:crypto\":[\">= 14.18 && < 15\",\">= 16\"],\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"node:dgram\":[\">= 14.18 && < 15\",\">= 16\"],\"diagnostics_channel\":[\">= 14.17 && < 15\",\">= 15.1\"],\"node:diagnostics_channel\":[\">= 14.18 && < 15\",\">= 16\"],\"dns\":true,\"node:dns\":[\">= 14.18 && < 15\",\">= 16\"],\"dns/promises\":\">= 15\",\"node:dns/promises\":\">= 16\",\"domain\":\">= 0.7.12\",\"node:domain\":[\">= 14.18 && < 15\",\">= 16\"],\"events\":true,\"node:events\":[\">= 14.18 && < 15\",\">= 16\"],\"freelist\":\"< 6\",\"fs\":true,\"node:fs\":[\">= 14.18 && < 15\",\">= 16\"],\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"node:fs/promises\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_agent\":\">= 0.11.1\",\"node:_http_agent\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_client\":\">= 0.11.1\",\"node:_http_client\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_common\":\">= 0.11.1\",\"node:_http_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_incoming\":\">= 0.11.1\",\"node:_http_incoming\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_outgoing\":\">= 0.11.1\",\"node:_http_outgoing\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_server\":\">= 0.11.1\",\"node:_http_server\":[\">= 14.18 && < 15\",\">= 16\"],\"http\":true,\"node:http\":[\">= 14.18 && < 15\",\">= 16\"],\"http2\":\">= 8.8\",\"node:http2\":[\">= 14.18 && < 15\",\">= 16\"],\"https\":true,\"node:https\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector\":\">= 8\",\"node:inspector\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector/promises\":[\">= 19\"],\"node:inspector/promises\":[\">= 19\"],\"_linklist\":\"< 8\",\"module\":true,\"node:module\":[\">= 14.18 && < 15\",\">= 16\"],\"net\":true,\"node:net\":[\">= 14.18 && < 15\",\">= 16\"],\"node-inspect/lib/_inspect\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6 && < 12\",\"os\":true,\"node:os\":[\">= 14.18 && < 15\",\">= 16\"],\"path\":true,\"node:path\":[\">= 14.18 && < 15\",\">= 16\"],\"path/posix\":\">= 15.3\",\"node:path/posix\":\">= 16\",\"path/win32\":\">= 15.3\",\"node:path/win32\":\">= 16\",\"perf_hooks\":\">= 8.5\",\"node:perf_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"process\":\">= 1\",\"node:process\":[\">= 14.18 && < 15\",\">= 16\"],\"punycode\":\">= 0.5\",\"node:punycode\":[\">= 14.18 && < 15\",\">= 16\"],\"querystring\":true,\"node:querystring\":[\">= 14.18 && < 15\",\">= 16\"],\"readline\":true,\"node:readline\":[\">= 14.18 && < 15\",\">= 16\"],\"readline/promises\":\">= 17\",\"node:readline/promises\":\">= 17\",\"repl\":true,\"node:repl\":[\">= 14.18 && < 15\",\">= 16\"],\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"node:_stream_duplex\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_transform\":\">= 0.9.4\",\"node:_stream_transform\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_wrap\":\">= 1.4.1\",\"node:_stream_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_passthrough\":\">= 0.9.4\",\"node:_stream_passthrough\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_readable\":\">= 0.9.4\",\"node:_stream_readable\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_writable\":\">= 0.9.4\",\"node:_stream_writable\":[\">= 14.18 && < 15\",\">= 16\"],\"stream\":true,\"node:stream\":[\">= 14.18 && < 15\",\">= 16\"],\"stream/consumers\":\">= 16.7\",\"node:stream/consumers\":\">= 16.7\",\"stream/promises\":\">= 15\",\"node:stream/promises\":\">= 16\",\"stream/web\":\">= 16.5\",\"node:stream/web\":\">= 16.5\",\"string_decoder\":true,\"node:string_decoder\":[\">= 14.18 && < 15\",\">= 16\"],\"sys\":[\">= 0.4 && < 0.7\",\">= 0.8\"],\"node:sys\":[\">= 14.18 && < 15\",\">= 16\"],\"test/reporters\":\">= 19.9 && < 20.2\",\"node:test/reporters\":[\">= 18.17 && < 19\",\">= 19.9\",\">= 20\"],\"node:test\":[\">= 16.17 && < 17\",\">= 18\"],\"timers\":true,\"node:timers\":[\">= 14.18 && < 15\",\">= 16\"],\"timers/promises\":\">= 15\",\"node:timers/promises\":\">= 16\",\"_tls_common\":\">= 0.11.13\",\"node:_tls_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"node:_tls_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"tls\":true,\"node:tls\":[\">= 14.18 && < 15\",\">= 16\"],\"trace_events\":\">= 10\",\"node:trace_events\":[\">= 14.18 && < 15\",\">= 16\"],\"tty\":true,\"node:tty\":[\">= 14.18 && < 15\",\">= 16\"],\"url\":true,\"node:url\":[\">= 14.18 && < 15\",\">= 16\"],\"util\":true,\"node:util\":[\">= 14.18 && < 15\",\">= 16\"],\"util/types\":\">= 15.3\",\"node:util/types\":\">= 16\",\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/consarray\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/logreader\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8\":\">= 1\",\"node:v8\":[\">= 14.18 && < 15\",\">= 16\"],\"vm\":true,\"node:vm\":[\">= 14.18 && < 15\",\">= 16\"],\"wasi\":[\">= 13.4 && < 13.5\",\">= 18.17 && < 19\",\">= 20\"],\"node:wasi\":[\">= 18.17 && < 19\",\">= 20\"],\"worker_threads\":\">= 11.7\",\"node:worker_threads\":[\">= 14.18 && < 15\",\">= 16\"],\"zlib\":\">= 0.5\",\"node:zlib\":[\">= 14.18 && < 15\",\">= 16\"]}");
/***/ }),
/* 267 */
@@ -25991,7 +26026,7 @@ const YARN_EXEC = process.env.npm_execpath || 'yarn';
* Install all dependencies in the given directory
*/
async function installInDir(directory, extraArgs = [], useAdd = false) {
- const options = [useAdd ? 'add' : 'install', '--non-interactive', ...extraArgs];
+ const options = [useAdd ? 'add' : 'install', '--non-interactive', '--ignore-engines', ...extraArgs];
// We pass the mutex flag to ensure only one instance of yarn runs at any
// given time (e.g. to avoid conflicts).
@@ -42996,8 +43031,8 @@ const braces = (input, options = {}) => {
let output = [];
if (Array.isArray(input)) {
- for (let pattern of input) {
- let result = braces.create(pattern, options);
+ for (const pattern of input) {
+ const result = braces.create(pattern, options);
if (Array.isArray(result)) {
output.push(...result);
} else {
@@ -43131,7 +43166,7 @@ braces.create = (input, options = {}) => {
return [input];
}
- return options.expand !== true
+ return options.expand !== true
? braces.compile(input, options)
: braces.expand(input, options);
};
@@ -43153,9 +43188,9 @@ module.exports = braces;
const utils = __webpack_require__(369);
module.exports = (ast, options = {}) => {
- let stringify = (node, parent = {}) => {
- let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
+ const stringify = (node, parent = {}) => {
+ const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
let output = '';
if (node.value) {
@@ -43170,7 +43205,7 @@ module.exports = (ast, options = {}) => {
}
if (node.nodes) {
- for (let child of node.nodes) {
+ for (const child of node.nodes) {
output += stringify(child);
}
}
@@ -43220,7 +43255,7 @@ exports.exceedsLimit = (min, max, step = 1, limit) => {
*/
exports.escapeNode = (block, n = 0, type) => {
- let node = block.nodes[n];
+ const node = block.nodes[n];
if (!node) return;
if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
@@ -43289,13 +43324,23 @@ exports.reduce = nodes => nodes.reduce((acc, node) => {
exports.flatten = (...args) => {
const result = [];
+
const flat = arr => {
for (let i = 0; i < arr.length; i++) {
- let ele = arr[i];
- Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
+ const ele = arr[i];
+
+ if (Array.isArray(ele)) {
+ flat(ele);
+ continue;
+ }
+
+ if (ele !== undefined) {
+ result.push(ele);
+ }
}
return result;
};
+
flat(args);
return result;
};
@@ -43312,30 +43357,32 @@ const fill = __webpack_require__(371);
const utils = __webpack_require__(369);
const compile = (ast, options = {}) => {
- let walk = (node, parent = {}) => {
- let invalidBlock = utils.isInvalidBrace(parent);
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
- let invalid = invalidBlock === true || invalidNode === true;
- let prefix = options.escapeInvalid === true ? '\\' : '';
+ const walk = (node, parent = {}) => {
+ const invalidBlock = utils.isInvalidBrace(parent);
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
+ const invalid = invalidBlock === true || invalidNode === true;
+ const prefix = options.escapeInvalid === true ? '\\' : '';
let output = '';
if (node.isOpen === true) {
return prefix + node.value;
}
+
if (node.isClose === true) {
+ console.log('node.isClose', prefix, node.value);
return prefix + node.value;
}
if (node.type === 'open') {
- return invalid ? (prefix + node.value) : '(';
+ return invalid ? prefix + node.value : '(';
}
if (node.type === 'close') {
- return invalid ? (prefix + node.value) : ')';
+ return invalid ? prefix + node.value : ')';
}
if (node.type === 'comma') {
- return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
+ return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
}
if (node.value) {
@@ -43343,8 +43390,8 @@ const compile = (ast, options = {}) => {
}
if (node.nodes && node.ranges > 0) {
- let args = utils.reduce(node.nodes);
- let range = fill(...args, { ...options, wrap: false, toRegex: true });
+ const args = utils.reduce(node.nodes);
+ const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
if (range.length !== 0) {
return args.length > 1 && range.length > 1 ? `(${range})` : range;
@@ -43352,10 +43399,11 @@ const compile = (ast, options = {}) => {
}
if (node.nodes) {
- for (let child of node.nodes) {
+ for (const child of node.nodes) {
output += walk(child, node);
}
}
+
return output;
};
@@ -43432,7 +43480,7 @@ const toMaxLen = (input, maxLength) => {
return negative ? ('-' + input) : input;
};
-const toSequence = (parts, options) => {
+const toSequence = (parts, options, maxLen) => {
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
@@ -43442,11 +43490,11 @@ const toSequence = (parts, options) => {
let result;
if (parts.positives.length) {
- positives = parts.positives.join('|');
+ positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
}
if (parts.negatives.length) {
- negatives = `-(${prefix}${parts.negatives.join('|')})`;
+ negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
}
if (positives && negatives) {
@@ -43544,7 +43592,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
if (options.toRegex === true) {
return step > 1
- ? toSequence(parts, options)
+ ? toSequence(parts, options, maxLen)
: toRegex(range, null, { wrap: false, ...options });
}
@@ -43556,7 +43604,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
return invalidRange(start, end, options);
}
-
let format = options.transform || (val => String.fromCharCode(val));
let a = `${start}`.charCodeAt(0);
let b = `${end}`.charCodeAt(0);
@@ -43953,7 +44000,7 @@ const stringify = __webpack_require__(368);
const utils = __webpack_require__(369);
const append = (queue = '', stash = '', enclose = false) => {
- let result = [];
+ const result = [];
queue = [].concat(queue);
stash = [].concat(stash);
@@ -43963,15 +44010,15 @@ const append = (queue = '', stash = '', enclose = false) => {
return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
}
- for (let item of queue) {
+ for (const item of queue) {
if (Array.isArray(item)) {
- for (let value of item) {
+ for (const value of item) {
result.push(append(value, stash, enclose));
}
} else {
for (let ele of stash) {
if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
- result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
+ result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
}
}
}
@@ -43979,9 +44026,9 @@ const append = (queue = '', stash = '', enclose = false) => {
};
const expand = (ast, options = {}) => {
- let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
+ const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
- let walk = (node, parent = {}) => {
+ const walk = (node, parent = {}) => {
node.queue = [];
let p = parent;
@@ -44003,7 +44050,7 @@ const expand = (ast, options = {}) => {
}
if (node.nodes && node.ranges > 0) {
- let args = utils.reduce(node.nodes);
+ const args = utils.reduce(node.nodes);
if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
@@ -44019,7 +44066,7 @@ const expand = (ast, options = {}) => {
return;
}
- let enclose = utils.encloseBrace(node);
+ const enclose = utils.encloseBrace(node);
let queue = node.queue;
let block = node;
@@ -44029,7 +44076,7 @@ const expand = (ast, options = {}) => {
}
for (let i = 0; i < node.nodes.length; i++) {
- let child = node.nodes[i];
+ const child = node.nodes[i];
if (child.type === 'comma' && node.type === 'brace') {
if (i === 1) queue.push('');
@@ -44101,22 +44148,21 @@ const parse = (input, options = {}) => {
throw new TypeError('Expected a string');
}
- let opts = options || {};
- let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+ const opts = options || {};
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
if (input.length > max) {
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
}
- let ast = { type: 'root', input, nodes: [] };
- let stack = [ast];
+ const ast = { type: 'root', input, nodes: [] };
+ const stack = [ast];
let block = ast;
let prev = ast;
let brackets = 0;
- let length = input.length;
+ const length = input.length;
let index = 0;
let depth = 0;
let value;
- let memo = {};
/**
* Helpers
@@ -44179,7 +44225,6 @@ const parse = (input, options = {}) => {
if (value === CHAR_LEFT_SQUARE_BRACKET) {
brackets++;
- let closed = true;
let next;
while (index < length && (next = advance())) {
@@ -44235,7 +44280,7 @@ const parse = (input, options = {}) => {
*/
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
- let open = value;
+ const open = value;
let next;
if (options.keepQuotes !== true) {
@@ -44267,8 +44312,8 @@ const parse = (input, options = {}) => {
if (value === CHAR_LEFT_CURLY_BRACE) {
depth++;
- let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
- let brace = {
+ const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
+ const brace = {
type: 'brace',
open: true,
close: false,
@@ -44295,7 +44340,7 @@ const parse = (input, options = {}) => {
continue;
}
- let type = 'close';
+ const type = 'close';
block = stack.pop();
block.close = true;
@@ -44313,7 +44358,7 @@ const parse = (input, options = {}) => {
if (value === CHAR_COMMA && depth > 0) {
if (block.ranges > 0) {
block.ranges = 0;
- let open = block.nodes.shift();
+ const open = block.nodes.shift();
block.nodes = [open, { type: 'text', value: stringify(block) }];
}
@@ -44327,7 +44372,7 @@ const parse = (input, options = {}) => {
*/
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
- let siblings = block.nodes;
+ const siblings = block.nodes;
if (depth === 0 || siblings.length === 0) {
push({ type: 'text', value });
@@ -44354,7 +44399,7 @@ const parse = (input, options = {}) => {
if (prev.type === 'range') {
siblings.pop();
- let before = siblings[siblings.length - 1];
+ const before = siblings[siblings.length - 1];
before.value += prev.value + value;
prev = before;
block.ranges--;
@@ -44387,8 +44432,8 @@ const parse = (input, options = {}) => {
});
// get the location of the block on parent.nodes (block's siblings)
- let parent = stack[stack.length - 1];
- let index = parent.nodes.indexOf(block);
+ const parent = stack[stack.length - 1];
+ const index = parent.nodes.indexOf(block);
// replace the (invalid) block with it's nodes
parent.nodes.splice(index, 1, ...block.nodes);
}
@@ -44409,7 +44454,7 @@ module.exports = parse;
module.exports = {
- MAX_LENGTH: 1024 * 64,
+ MAX_LENGTH: 10000,
// Digits
CHAR_0: '0', /* 0 */
@@ -59089,7 +59134,6 @@ async function copyToBuild(project, opensearchDashboardsRoot, buildRoot) {
await (0, _cpy.default)(['**/*', '!node_modules/**'], buildProjectPath, {
cwd: project.getIntermediateBuildDirectory(),
dot: true,
- nodir: true,
parents: true
});
@@ -59116,11 +59160,11 @@ const os = __webpack_require__(121);
const pMap = __webpack_require__(571);
const arrify = __webpack_require__(567);
const globby = __webpack_require__(572);
-const hasGlob = __webpack_require__(752);
-const cpFile = __webpack_require__(754);
-const junk = __webpack_require__(763);
-const pFilter = __webpack_require__(764);
-const CpyError = __webpack_require__(766);
+const hasGlob = __webpack_require__(575);
+const cpFile = __webpack_require__(577);
+const junk = __webpack_require__(586);
+const pFilter = __webpack_require__(587);
+const CpyError = __webpack_require__(589);
const defaultOptions = {
ignoreJunk: true
@@ -59365,28 +59409,43 @@ module.exports = async (
"use strict";
const fs = __webpack_require__(134);
-const arrayUnion = __webpack_require__(573);
+const arrayUnion = __webpack_require__(353);
+const merge2 = __webpack_require__(354);
const glob = __webpack_require__(148);
-const fastGlob = __webpack_require__(575);
-const dirGlob = __webpack_require__(746);
-const gitignore = __webpack_require__(749);
+const fastGlob = __webpack_require__(355);
+const dirGlob = __webpack_require__(427);
+const gitignore = __webpack_require__(573);
+const {FilterStream, UniqueStream} = __webpack_require__(574);
const DEFAULT_FILTER = () => false;
const isNegative = pattern => pattern[0] === '!';
const assertPatternsInput = patterns => {
- if (!patterns.every(x => typeof x === 'string')) {
+ if (!patterns.every(pattern => typeof pattern === 'string')) {
throw new TypeError('Patterns must be a string or an array of strings');
}
};
-const checkCwdOption = options => {
- if (options && options.cwd && !fs.statSync(options.cwd).isDirectory()) {
+const checkCwdOption = (options = {}) => {
+ if (!options.cwd) {
+ return;
+ }
+
+ let stat;
+ try {
+ stat = fs.statSync(options.cwd);
+ } catch (_) {
+ return;
+ }
+
+ if (!stat.isDirectory()) {
throw new Error('The `cwd` option must be a path to a directory');
}
};
+const getPathString = p => p.stats instanceof fs.Stats ? p.path : p;
+
const generateGlobTasks = (patterns, taskOptions) => {
patterns = arrayUnion([].concat(patterns));
assertPatternsInput(patterns);
@@ -59394,27 +59453,29 @@ const generateGlobTasks = (patterns, taskOptions) => {
const globTasks = [];
- taskOptions = Object.assign({
+ taskOptions = {
ignore: [],
- expandDirectories: true
- }, taskOptions);
+ expandDirectories: true,
+ ...taskOptions
+ };
- patterns.forEach((pattern, i) => {
+ for (const [index, pattern] of patterns.entries()) {
if (isNegative(pattern)) {
- return;
+ continue;
}
const ignore = patterns
- .slice(i)
+ .slice(index)
.filter(isNegative)
.map(pattern => pattern.slice(1));
- const options = Object.assign({}, taskOptions, {
+ const options = {
+ ...taskOptions,
ignore: taskOptions.ignore.concat(ignore)
- });
+ };
globTasks.push({pattern, options});
- });
+ }
return globTasks;
};
@@ -59426,9 +59487,15 @@ const globDirs = (task, fn) => {
}
if (Array.isArray(task.options.expandDirectories)) {
- options = Object.assign(options, {files: task.options.expandDirectories});
+ options = {
+ ...options,
+ files: task.options.expandDirectories
+ };
} else if (typeof task.options.expandDirectories === 'object') {
- options = Object.assign(options, task.options.expandDirectories);
+ options = {
+ ...options,
+ ...task.options.expandDirectories
+ };
}
return fn(task.pattern, options);
@@ -59436,6 +59503,12 @@ const globDirs = (task, fn) => {
const getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern];
+const getFilterSync = options => {
+ return options && options.gitignore ?
+ gitignore.sync({cwd: options.cwd, ignore: options.ignore}) :
+ DEFAULT_FILTER;
+};
+
const globToTask = task => glob => {
const {options} = task;
if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) {
@@ -59448,60 +59521,61 @@ const globToTask = task => glob => {
};
};
-const globby = (patterns, options) => {
- let globTasks;
+module.exports = async (patterns, options) => {
+ const globTasks = generateGlobTasks(patterns, options);
- try {
- globTasks = generateGlobTasks(patterns, options);
- } catch (error) {
- return Promise.reject(error);
- }
+ const getFilter = async () => {
+ return options && options.gitignore ?
+ gitignore({cwd: options.cwd, ignore: options.ignore}) :
+ DEFAULT_FILTER;
+ };
- const getTasks = Promise.all(globTasks.map(task => Promise.resolve(getPattern(task, dirGlob))
- .then(globs => Promise.all(globs.map(globToTask(task))))
- ))
- .then(tasks => arrayUnion(...tasks));
+ const getTasks = async () => {
+ const tasks = await Promise.all(globTasks.map(async task => {
+ const globs = await getPattern(task, dirGlob);
+ return Promise.all(globs.map(globToTask(task)));
+ }));
- const getFilter = () => {
- return Promise.resolve(
- options && options.gitignore ?
- gitignore({cwd: options.cwd, ignore: options.ignore}) :
- DEFAULT_FILTER
- );
+ return arrayUnion(...tasks);
};
- return getFilter()
- .then(filter => {
- return getTasks
- .then(tasks => Promise.all(tasks.map(task => fastGlob(task.pattern, task.options))))
- .then(paths => arrayUnion(...paths))
- .then(paths => paths.filter(p => !filter(p)));
- });
-};
+ const [filter, tasks] = await Promise.all([getFilter(), getTasks()]);
+ const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options)));
-module.exports = globby;
-// TODO: Remove this for the next major release
-module.exports.default = globby;
+ return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_)));
+};
module.exports.sync = (patterns, options) => {
const globTasks = generateGlobTasks(patterns, options);
- const getFilter = () => {
- return options && options.gitignore ?
- gitignore.sync({cwd: options.cwd, ignore: options.ignore}) :
- DEFAULT_FILTER;
- };
-
const tasks = globTasks.reduce((tasks, task) => {
const newTask = getPattern(task, dirGlob.sync).map(globToTask(task));
return tasks.concat(newTask);
}, []);
- const filter = getFilter();
+ const filter = getFilterSync(options);
+
return tasks.reduce(
(matches, task) => arrayUnion(matches, fastGlob.sync(task.pattern, task.options)),
[]
- ).filter(p => !filter(p));
+ ).filter(path_ => !filter(path_));
+};
+
+module.exports.stream = (patterns, options) => {
+ const globTasks = generateGlobTasks(patterns, options);
+
+ const tasks = globTasks.reduce((tasks, task) => {
+ const newTask = getPattern(task, dirGlob.sync).map(globToTask(task));
+ return tasks.concat(newTask);
+ }, []);
+
+ const filter = getFilterSync(options);
+ const filterStream = new FilterStream(p => !filter(p));
+ const uniqueStream = new UniqueStream();
+
+ return merge2(tasks.map(task => fastGlob.stream(task.pattern, task.options)))
+ .pipe(filterStream)
+ .pipe(uniqueStream);
};
module.exports.generateGlobTasks = generateGlobTasks;
@@ -59519,23684 +59593,226 @@ module.exports.gitignore = gitignore;
"use strict";
-var arrayUniq = __webpack_require__(574);
+const {promisify} = __webpack_require__(112);
+const fs = __webpack_require__(134);
+const path = __webpack_require__(4);
+const fastGlob = __webpack_require__(355);
+const gitIgnore = __webpack_require__(430);
+const slash = __webpack_require__(431);
-module.exports = function () {
- return arrayUniq([].concat.apply([], arguments));
-};
+const DEFAULT_IGNORE = [
+ '**/node_modules/**',
+ '**/flow-typed/**',
+ '**/coverage/**',
+ '**/.git'
+];
+const readFileP = promisify(fs.readFile);
-/***/ }),
-/* 574 */
-/***/ (function(module, exports, __webpack_require__) {
+const mapGitIgnorePatternTo = base => ignore => {
+ if (ignore.startsWith('!')) {
+ return '!' + path.posix.join(base, ignore.slice(1));
+ }
-"use strict";
+ return path.posix.join(base, ignore);
+};
+const parseGitIgnore = (content, options) => {
+ const base = slash(path.relative(options.cwd, path.dirname(options.fileName)));
-// there's 3 implementations written in increasing order of efficiency
+ return content
+ .split(/\r?\n/)
+ .filter(Boolean)
+ .filter(line => !line.startsWith('#'))
+ .map(mapGitIgnorePatternTo(base));
+};
-// 1 - no Set type is defined
-function uniqNoSet(arr) {
- var ret = [];
+const reduceIgnore = files => {
+ return files.reduce((ignores, file) => {
+ ignores.add(parseGitIgnore(file.content, {
+ cwd: file.cwd,
+ fileName: file.filePath
+ }));
+ return ignores;
+ }, gitIgnore());
+};
- for (var i = 0; i < arr.length; i++) {
- if (ret.indexOf(arr[i]) === -1) {
- ret.push(arr[i]);
+const ensureAbsolutePathForCwd = (cwd, p) => {
+ if (path.isAbsolute(p)) {
+ if (p.startsWith(cwd)) {
+ return p;
}
- }
- return ret;
-}
+ throw new Error(`Path ${p} is not in cwd ${cwd}`);
+ }
-// 2 - a simple Set type is defined
-function uniqSet(arr) {
- var seen = new Set();
- return arr.filter(function (el) {
- if (!seen.has(el)) {
- seen.add(el);
- return true;
- }
+ return path.join(cwd, p);
+};
- return false;
- });
-}
+const getIsIgnoredPredecate = (ignores, cwd) => {
+ return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p))));
+};
-// 3 - a standard Set type is defined and it has a forEach method
-function uniqSetWithForEach(arr) {
- var ret = [];
+const getFile = async (file, cwd) => {
+ const filePath = path.join(cwd, file);
+ const content = await readFileP(filePath, 'utf8');
- (new Set(arr)).forEach(function (el) {
- ret.push(el);
- });
+ return {
+ cwd,
+ filePath,
+ content
+ };
+};
- return ret;
-}
+const getFileSync = (file, cwd) => {
+ const filePath = path.join(cwd, file);
+ const content = fs.readFileSync(filePath, 'utf8');
-// V8 currently has a broken implementation
-// https://github.com/joyent/node/issues/8449
-function doesForEachActuallyWork() {
- var ret = false;
+ return {
+ cwd,
+ filePath,
+ content
+ };
+};
- (new Set([true])).forEach(function (el) {
- ret = el;
- });
+const normalizeOptions = ({
+ ignore = [],
+ cwd = slash(process.cwd())
+} = {}) => {
+ return {ignore, cwd};
+};
- return ret === true;
-}
+module.exports = async options => {
+ options = normalizeOptions(options);
-if ('Set' in global) {
- if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) {
- module.exports = uniqSetWithForEach;
- } else {
- module.exports = uniqSet;
- }
-} else {
- module.exports = uniqNoSet;
-}
+ const paths = await fastGlob('**/.gitignore', {
+ ignore: DEFAULT_IGNORE.concat(options.ignore),
+ cwd: options.cwd
+ });
+ const files = await Promise.all(paths.map(file => getFile(file, options.cwd)));
+ const ignores = reduceIgnore(files);
-/***/ }),
-/* 575 */
-/***/ (function(module, exports, __webpack_require__) {
+ return getIsIgnoredPredecate(ignores, options.cwd);
+};
-const pkg = __webpack_require__(576);
+module.exports.sync = options => {
+ options = normalizeOptions(options);
-module.exports = pkg.async;
-module.exports.default = pkg.async;
+ const paths = fastGlob.sync('**/.gitignore', {
+ ignore: DEFAULT_IGNORE.concat(options.ignore),
+ cwd: options.cwd
+ });
-module.exports.async = pkg.async;
-module.exports.sync = pkg.sync;
-module.exports.stream = pkg.stream;
+ const files = paths.map(file => getFileSync(file, options.cwd));
+ const ignores = reduceIgnore(files);
-module.exports.generateTasks = pkg.generateTasks;
+ return getIsIgnoredPredecate(ignores, options.cwd);
+};
/***/ }),
-/* 576 */
+/* 574 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-
-Object.defineProperty(exports, "__esModule", { value: true });
-var optionsManager = __webpack_require__(577);
-var taskManager = __webpack_require__(578);
-var reader_async_1 = __webpack_require__(717);
-var reader_stream_1 = __webpack_require__(741);
-var reader_sync_1 = __webpack_require__(742);
-var arrayUtils = __webpack_require__(744);
-var streamUtils = __webpack_require__(745);
-/**
- * Synchronous API.
- */
-function sync(source, opts) {
- assertPatternsInput(source);
- var works = getWorks(source, reader_sync_1.default, opts);
- return arrayUtils.flatten(works);
-}
-exports.sync = sync;
-/**
- * Asynchronous API.
- */
-function async(source, opts) {
- try {
- assertPatternsInput(source);
- }
- catch (error) {
- return Promise.reject(error);
- }
- var works = getWorks(source, reader_async_1.default, opts);
- return Promise.all(works).then(arrayUtils.flatten);
-}
-exports.async = async;
-/**
- * Stream API.
- */
-function stream(source, opts) {
- assertPatternsInput(source);
- var works = getWorks(source, reader_stream_1.default, opts);
- return streamUtils.merge(works);
-}
-exports.stream = stream;
-/**
- * Return a set of tasks based on provided patterns.
- */
-function generateTasks(source, opts) {
- assertPatternsInput(source);
- var patterns = [].concat(source);
- var options = optionsManager.prepare(opts);
- return taskManager.generate(patterns, options);
-}
-exports.generateTasks = generateTasks;
-/**
- * Returns a set of works based on provided tasks and class of the reader.
- */
-function getWorks(source, _Reader, opts) {
- var patterns = [].concat(source);
- var options = optionsManager.prepare(opts);
- var tasks = taskManager.generate(patterns, options);
- var reader = new _Reader(options);
- return tasks.map(reader.read, reader);
-}
-function assertPatternsInput(source) {
- if ([].concat(source).every(isString)) {
- return;
- }
- throw new TypeError('Patterns must be a string or an array of strings');
-}
-function isString(source) {
- /* tslint:disable-next-line strict-type-predicates */
- return typeof source === 'string';
-}
+const {Transform} = __webpack_require__(138);
-/***/ }),
-/* 577 */
-/***/ (function(module, exports, __webpack_require__) {
+class ObjectTransform extends Transform {
+ constructor() {
+ super({
+ objectMode: true
+ });
+ }
+}
-"use strict";
-
-var __assign = (this && this.__assign) || function () {
- __assign = Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-function prepare(options) {
- var opts = __assign({ cwd: process.cwd(), deep: true, ignore: [], dot: false, stats: false, onlyFiles: true, onlyDirectories: false, followSymlinkedDirectories: true, unique: true, markDirectories: false, absolute: false, nobrace: false, brace: true, noglobstar: false, globstar: true, noext: false, extension: true, nocase: false, case: true, matchBase: false, transform: null }, options);
- if (opts.onlyDirectories) {
- opts.onlyFiles = false;
- }
- opts.brace = !opts.nobrace;
- opts.globstar = !opts.noglobstar;
- opts.extension = !opts.noext;
- opts.case = !opts.nocase;
- if (options) {
- opts.brace = ('brace' in options ? options.brace : opts.brace);
- opts.globstar = ('globstar' in options ? options.globstar : opts.globstar);
- opts.extension = ('extension' in options ? options.extension : opts.extension);
- opts.case = ('case' in options ? options.case : opts.case);
- }
- return opts;
-}
-exports.prepare = prepare;
+class FilterStream extends ObjectTransform {
+ constructor(filter) {
+ super();
+ this._filter = filter;
+ }
+ _transform(data, encoding, callback) {
+ if (this._filter(data)) {
+ this.push(data);
+ }
-/***/ }),
-/* 578 */
-/***/ (function(module, exports, __webpack_require__) {
+ callback();
+ }
+}
-"use strict";
-
-Object.defineProperty(exports, "__esModule", { value: true });
-var patternUtils = __webpack_require__(579);
-/**
- * Generate tasks based on parent directory of each pattern.
- */
-function generate(patterns, options) {
- var unixPatterns = patterns.map(patternUtils.unixifyPattern);
- var unixIgnore = options.ignore.map(patternUtils.unixifyPattern);
- var positivePatterns = getPositivePatterns(unixPatterns);
- var negativePatterns = getNegativePatternsAsPositive(unixPatterns, unixIgnore);
- /**
- * When the `case` option is disabled, all patterns must be marked as dynamic, because we cannot check filepath
- * directly (without read directory).
- */
- var staticPatterns = !options.case ? [] : positivePatterns.filter(patternUtils.isStaticPattern);
- var dynamicPatterns = !options.case ? positivePatterns : positivePatterns.filter(patternUtils.isDynamicPattern);
- var staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
- var dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
- return staticTasks.concat(dynamicTasks);
-}
-exports.generate = generate;
-/**
- * Convert patterns to tasks based on parent directory of each pattern.
- */
-function convertPatternsToTasks(positive, negative, dynamic) {
- var positivePatternsGroup = groupPatternsByBaseDirectory(positive);
- // When we have a global group – there is no reason to divide the patterns into independent tasks.
- // In this case, the global task covers the rest.
- if ('.' in positivePatternsGroup) {
- var task = convertPatternGroupToTask('.', positive, negative, dynamic);
- return [task];
- }
- return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic);
-}
-exports.convertPatternsToTasks = convertPatternsToTasks;
-/**
- * Return only positive patterns.
- */
-function getPositivePatterns(patterns) {
- return patternUtils.getPositivePatterns(patterns);
-}
-exports.getPositivePatterns = getPositivePatterns;
-/**
- * Return only negative patterns.
- */
-function getNegativePatternsAsPositive(patterns, ignore) {
- var negative = patternUtils.getNegativePatterns(patterns).concat(ignore);
- var positive = negative.map(patternUtils.convertToPositivePattern);
- return positive;
-}
-exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
-/**
- * Group patterns by base directory of each pattern.
- */
-function groupPatternsByBaseDirectory(patterns) {
- return patterns.reduce(function (collection, pattern) {
- var base = patternUtils.getBaseDirectory(pattern);
- if (base in collection) {
- collection[base].push(pattern);
- }
- else {
- collection[base] = [pattern];
- }
- return collection;
- }, {});
-}
-exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
-/**
- * Convert group of patterns to tasks.
- */
-function convertPatternGroupsToTasks(positive, negative, dynamic) {
- return Object.keys(positive).map(function (base) {
- return convertPatternGroupToTask(base, positive[base], negative, dynamic);
- });
-}
-exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
-/**
- * Create a task for positive and negative patterns.
- */
-function convertPatternGroupToTask(base, positive, negative, dynamic) {
- return {
- base: base,
- dynamic: dynamic,
- positive: positive,
- negative: negative,
- patterns: [].concat(positive, negative.map(patternUtils.convertToNegativePattern))
- };
-}
-exports.convertPatternGroupToTask = convertPatternGroupToTask;
+class UniqueStream extends ObjectTransform {
+ constructor() {
+ super();
+ this._pushed = new Set();
+ }
+ _transform(data, encoding, callback) {
+ if (!this._pushed.has(data)) {
+ this.push(data);
+ this._pushed.add(data);
+ }
-/***/ }),
-/* 579 */
-/***/ (function(module, exports, __webpack_require__) {
+ callback();
+ }
+}
-"use strict";
-
-Object.defineProperty(exports, "__esModule", { value: true });
-var path = __webpack_require__(4);
-var globParent = __webpack_require__(363);
-var isGlob = __webpack_require__(364);
-var micromatch = __webpack_require__(580);
-var GLOBSTAR = '**';
-/**
- * Return true for static pattern.
- */
-function isStaticPattern(pattern) {
- return !isDynamicPattern(pattern);
-}
-exports.isStaticPattern = isStaticPattern;
-/**
- * Return true for pattern that looks like glob.
- */
-function isDynamicPattern(pattern) {
- return isGlob(pattern, { strict: false });
-}
-exports.isDynamicPattern = isDynamicPattern;
-/**
- * Convert a windows «path» to a unix-style «path».
- */
-function unixifyPattern(pattern) {
- return pattern.replace(/\\/g, '/');
-}
-exports.unixifyPattern = unixifyPattern;
-/**
- * Returns negative pattern as positive pattern.
- */
-function convertToPositivePattern(pattern) {
- return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
-}
-exports.convertToPositivePattern = convertToPositivePattern;
-/**
- * Returns positive pattern as negative pattern.
- */
-function convertToNegativePattern(pattern) {
- return '!' + pattern;
-}
-exports.convertToNegativePattern = convertToNegativePattern;
-/**
- * Return true if provided pattern is negative pattern.
- */
-function isNegativePattern(pattern) {
- return pattern.startsWith('!') && pattern[1] !== '(';
-}
-exports.isNegativePattern = isNegativePattern;
-/**
- * Return true if provided pattern is positive pattern.
- */
-function isPositivePattern(pattern) {
- return !isNegativePattern(pattern);
-}
-exports.isPositivePattern = isPositivePattern;
-/**
- * Extracts negative patterns from array of patterns.
- */
-function getNegativePatterns(patterns) {
- return patterns.filter(isNegativePattern);
-}
-exports.getNegativePatterns = getNegativePatterns;
-/**
- * Extracts positive patterns from array of patterns.
- */
-function getPositivePatterns(patterns) {
- return patterns.filter(isPositivePattern);
-}
-exports.getPositivePatterns = getPositivePatterns;
-/**
- * Extract base directory from provided pattern.
- */
-function getBaseDirectory(pattern) {
- return globParent(pattern);
-}
-exports.getBaseDirectory = getBaseDirectory;
-/**
- * Return true if provided pattern has globstar.
- */
-function hasGlobStar(pattern) {
- return pattern.indexOf(GLOBSTAR) !== -1;
-}
-exports.hasGlobStar = hasGlobStar;
-/**
- * Return true if provided pattern ends with slash and globstar.
- */
-function endsWithSlashGlobStar(pattern) {
- return pattern.endsWith('/' + GLOBSTAR);
-}
-exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
-/**
- * Returns «true» when pattern ends with a slash and globstar or the last partial of the pattern is static pattern.
- */
-function isAffectDepthOfReadingPattern(pattern) {
- var basename = path.basename(pattern);
- return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
-}
-exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
-/**
- * Return naive depth of provided pattern without depth of the base directory.
- */
-function getNaiveDepth(pattern) {
- var base = getBaseDirectory(pattern);
- var patternDepth = pattern.split('/').length;
- var patternBaseDepth = base.split('/').length;
- /**
- * This is a hack for pattern that has no base directory.
- *
- * This is related to the `*\something\*` pattern.
- */
- if (base === '.') {
- return patternDepth - patternBaseDepth;
- }
- return patternDepth - patternBaseDepth - 1;
-}
-exports.getNaiveDepth = getNaiveDepth;
-/**
- * Return max naive depth of provided patterns without depth of the base directory.
- */
-function getMaxNaivePatternsDepth(patterns) {
- return patterns.reduce(function (max, pattern) {
- var depth = getNaiveDepth(pattern);
- return depth > max ? depth : max;
- }, 0);
-}
-exports.getMaxNaivePatternsDepth = getMaxNaivePatternsDepth;
-/**
- * Make RegExp for provided pattern.
- */
-function makeRe(pattern, options) {
- return micromatch.makeRe(pattern, options);
-}
-exports.makeRe = makeRe;
-/**
- * Convert patterns to regexps.
- */
-function convertPatternsToRe(patterns, options) {
- return patterns.map(function (pattern) { return makeRe(pattern, options); });
-}
-exports.convertPatternsToRe = convertPatternsToRe;
-/**
- * Returns true if the entry match any of the given RegExp's.
- */
-function matchAny(entry, patternsRe) {
- return patternsRe.some(function (patternRe) { return patternRe.test(entry); });
-}
-exports.matchAny = matchAny;
+module.exports = {
+ FilterStream,
+ UniqueStream
+};
/***/ }),
-/* 580 */
+/* 575 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
+/*!
+ * has-glob
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
-/**
- * Module dependencies
- */
-var util = __webpack_require__(112);
-var braces = __webpack_require__(581);
-var toRegex = __webpack_require__(582);
-var extend = __webpack_require__(595);
+var isGlob = __webpack_require__(576);
-/**
- * Local dependencies
- */
+module.exports = function hasGlob(val) {
+ if (val == null) return false;
+ if (typeof val === 'string') {
+ return isGlob(val);
+ }
+ if (Array.isArray(val)) {
+ var len = val.length;
+ while (len--) {
+ if (isGlob(val[len])) {
+ return true;
+ }
+ }
+ }
+ return false;
+};
-var compilers = __webpack_require__(684);
-var parsers = __webpack_require__(713);
-var cache = __webpack_require__(714);
-var utils = __webpack_require__(715);
-var MAX_LENGTH = 1024 * 64;
-/**
- * The main function takes a list of strings and one or more
- * glob patterns to use for matching.
- *
- * ```js
- * var mm = require('micromatch');
- * mm(list, patterns[, options]);
+/***/ }),
+/* 576 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/*!
+ * is-glob
*
- * console.log(mm(['a.js', 'a.txt'], ['*.js']));
- * //=> [ 'a.js' ]
- * ```
- * @param {Array} `list` A list of strings to match
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Array} Returns an array of matches
- * @summary false
- * @api public
+ * Copyright (c) 2014-2016, Jon Schlinkert.
+ * Licensed under the MIT License.
*/
-function micromatch(list, patterns, options) {
- patterns = utils.arrayify(patterns);
- list = utils.arrayify(list);
+var isExtglob = __webpack_require__(365);
- var len = patterns.length;
- if (list.length === 0 || len === 0) {
- return [];
- }
-
- if (len === 1) {
- return micromatch.match(list, patterns[0], options);
- }
-
- var omit = [];
- var keep = [];
- var idx = -1;
-
- while (++idx < len) {
- var pattern = patterns[idx];
-
- if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) {
- omit.push.apply(omit, micromatch.match(list, pattern.slice(1), options));
- } else {
- keep.push.apply(keep, micromatch.match(list, pattern, options));
- }
- }
-
- var matches = utils.diff(keep, omit);
- if (!options || options.nodupes !== false) {
- return utils.unique(matches);
- }
-
- return matches;
-}
-
-/**
- * Similar to the main function, but `pattern` must be a string.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.match(list, pattern[, options]);
- *
- * console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a'));
- * //=> ['a.a', 'a.aa']
- * ```
- * @param {Array} `list` Array of strings to match
- * @param {String} `pattern` Glob pattern to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Array} Returns an array of matches
- * @api public
- */
-
-micromatch.match = function(list, pattern, options) {
- if (Array.isArray(pattern)) {
- throw new TypeError('expected pattern to be a string');
- }
-
- var unixify = utils.unixify(options);
- var isMatch = memoize('match', pattern, options, micromatch.matcher);
- var matches = [];
-
- list = utils.arrayify(list);
- var len = list.length;
- var idx = -1;
-
- while (++idx < len) {
- var ele = list[idx];
- if (ele === pattern || isMatch(ele)) {
- matches.push(utils.value(ele, unixify, options));
- }
- }
-
- // if no options were passed, uniquify results and return
- if (typeof options === 'undefined') {
- return utils.unique(matches);
- }
-
- if (matches.length === 0) {
- if (options.failglob === true) {
- throw new Error('no matches found for "' + pattern + '"');
- }
- if (options.nonull === true || options.nullglob === true) {
- return [options.unescape ? utils.unescape(pattern) : pattern];
- }
- }
-
- // if `opts.ignore` was defined, diff ignored list
- if (options.ignore) {
- matches = micromatch.not(matches, options.ignore, options);
- }
-
- return options.nodupes !== false ? utils.unique(matches) : matches;
-};
-
-/**
- * Returns true if the specified `string` matches the given glob `pattern`.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.isMatch(string, pattern[, options]);
- *
- * console.log(mm.isMatch('a.a', '*.a'));
- * //=> true
- * console.log(mm.isMatch('a.b', '*.a'));
- * //=> false
- * ```
- * @param {String} `string` String to match
- * @param {String} `pattern` Glob pattern to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if the string matches the glob pattern.
- * @api public
- */
-
-micromatch.isMatch = function(str, pattern, options) {
- if (typeof str !== 'string') {
- throw new TypeError('expected a string: "' + util.inspect(str) + '"');
- }
-
- if (isEmptyString(str) || isEmptyString(pattern)) {
- return false;
- }
-
- var equals = utils.equalsPattern(options);
- if (equals(str)) {
- return true;
- }
-
- var isMatch = memoize('isMatch', pattern, options, micromatch.matcher);
- return isMatch(str);
-};
-
-/**
- * Returns true if some of the strings in the given `list` match any of the
- * given glob `patterns`.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.some(list, patterns[, options]);
- *
- * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
- * // true
- * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
- * // false
- * ```
- * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
-
-micromatch.some = function(list, patterns, options) {
- if (typeof list === 'string') {
- list = [list];
- }
- for (var i = 0; i < list.length; i++) {
- if (micromatch(list[i], patterns, options).length === 1) {
- return true;
- }
- }
- return false;
-};
-
-/**
- * Returns true if every string in the given `list` matches
- * any of the given glob `patterns`.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.every(list, patterns[, options]);
- *
- * console.log(mm.every('foo.js', ['foo.js']));
- * // true
- * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
- * // true
- * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
- * // false
- * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
- * // false
- * ```
- * @param {String|Array} `list` The string or array of strings to test.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
-
-micromatch.every = function(list, patterns, options) {
- if (typeof list === 'string') {
- list = [list];
- }
- for (var i = 0; i < list.length; i++) {
- if (micromatch(list[i], patterns, options).length !== 1) {
- return false;
- }
- }
- return true;
-};
-
-/**
- * Returns true if **any** of the given glob `patterns`
- * match the specified `string`.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.any(string, patterns[, options]);
- *
- * console.log(mm.any('a.a', ['b.*', '*.a']));
- * //=> true
- * console.log(mm.any('a.a', 'b.*'));
- * //=> false
- * ```
- * @param {String|Array} `str` The string to test.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
-
-micromatch.any = function(str, patterns, options) {
- if (typeof str !== 'string') {
- throw new TypeError('expected a string: "' + util.inspect(str) + '"');
- }
-
- if (isEmptyString(str) || isEmptyString(patterns)) {
- return false;
- }
-
- if (typeof patterns === 'string') {
- patterns = [patterns];
- }
-
- for (var i = 0; i < patterns.length; i++) {
- if (micromatch.isMatch(str, patterns[i], options)) {
- return true;
- }
- }
- return false;
-};
-
-/**
- * Returns true if **all** of the given `patterns` match
- * the specified string.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.all(string, patterns[, options]);
- *
- * console.log(mm.all('foo.js', ['foo.js']));
- * // true
- *
- * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
- * // false
- *
- * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
- * // true
- *
- * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
- * // true
- * ```
- * @param {String|Array} `str` The string to test.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
-
-micromatch.all = function(str, patterns, options) {
- if (typeof str !== 'string') {
- throw new TypeError('expected a string: "' + util.inspect(str) + '"');
- }
- if (typeof patterns === 'string') {
- patterns = [patterns];
- }
- for (var i = 0; i < patterns.length; i++) {
- if (!micromatch.isMatch(str, patterns[i], options)) {
- return false;
- }
- }
- return true;
-};
-
-/**
- * Returns a list of strings that _**do not match any**_ of the given `patterns`.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.not(list, patterns[, options]);
- *
- * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
- * //=> ['b.b', 'c.c']
- * ```
- * @param {Array} `list` Array of strings to match.
- * @param {String|Array} `patterns` One or more glob pattern to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Array} Returns an array of strings that **do not match** the given patterns.
- * @api public
- */
-
-micromatch.not = function(list, patterns, options) {
- var opts = extend({}, options);
- var ignore = opts.ignore;
- delete opts.ignore;
-
- var unixify = utils.unixify(opts);
- list = utils.arrayify(list).map(unixify);
-
- var matches = utils.diff(list, micromatch(list, patterns, opts));
- if (ignore) {
- matches = utils.diff(matches, micromatch(list, ignore));
- }
-
- return opts.nodupes !== false ? utils.unique(matches) : matches;
-};
-
-/**
- * Returns true if the given `string` contains the given pattern. Similar
- * to [.isMatch](#isMatch) but the pattern can match any part of the string.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.contains(string, pattern[, options]);
- *
- * console.log(mm.contains('aa/bb/cc', '*b'));
- * //=> true
- * console.log(mm.contains('aa/bb/cc', '*d'));
- * //=> false
- * ```
- * @param {String} `str` The string to match.
- * @param {String|Array} `patterns` Glob pattern to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if the patter matches any part of `str`.
- * @api public
- */
-
-micromatch.contains = function(str, patterns, options) {
- if (typeof str !== 'string') {
- throw new TypeError('expected a string: "' + util.inspect(str) + '"');
- }
-
- if (typeof patterns === 'string') {
- if (isEmptyString(str) || isEmptyString(patterns)) {
- return false;
- }
-
- var equals = utils.equalsPattern(patterns, options);
- if (equals(str)) {
- return true;
- }
- var contains = utils.containsPattern(patterns, options);
- if (contains(str)) {
- return true;
- }
- }
-
- var opts = extend({}, options, {contains: true});
- return micromatch.any(str, patterns, opts);
-};
-
-/**
- * Returns true if the given pattern and options should enable
- * the `matchBase` option.
- * @return {Boolean}
- * @api private
- */
-
-micromatch.matchBase = function(pattern, options) {
- if (pattern && pattern.indexOf('/') !== -1 || !options) return false;
- return options.basename === true || options.matchBase === true;
-};
-
-/**
- * Filter the keys of the given object with the given `glob` pattern
- * and `options`. Does not attempt to match nested keys. If you need this feature,
- * use [glob-object][] instead.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.matchKeys(object, patterns[, options]);
- *
- * var obj = { aa: 'a', ab: 'b', ac: 'c' };
- * console.log(mm.matchKeys(obj, '*b'));
- * //=> { ab: 'b' }
- * ```
- * @param {Object} `object` The object with keys to filter.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Object} Returns an object with only keys that match the given patterns.
- * @api public
- */
-
-micromatch.matchKeys = function(obj, patterns, options) {
- if (!utils.isObject(obj)) {
- throw new TypeError('expected the first argument to be an object');
- }
- var keys = micromatch(Object.keys(obj), patterns, options);
- return utils.pick(obj, keys);
-};
-
-/**
- * Returns a memoized matcher function from the given glob `pattern` and `options`.
- * The returned function takes a string to match as its only argument and returns
- * true if the string is a match.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.matcher(pattern[, options]);
- *
- * var isMatch = mm.matcher('*.!(*a)');
- * console.log(isMatch('a.a'));
- * //=> false
- * console.log(isMatch('a.b'));
- * //=> true
- * ```
- * @param {String} `pattern` Glob pattern
- * @param {Object} `options` See available [options](#options) for changing how matches are performed.
- * @return {Function} Returns a matcher function.
- * @api public
- */
-
-micromatch.matcher = function matcher(pattern, options) {
- if (Array.isArray(pattern)) {
- return compose(pattern, options, matcher);
- }
-
- // if pattern is a regex
- if (pattern instanceof RegExp) {
- return test(pattern);
- }
-
- // if pattern is invalid
- if (!utils.isString(pattern)) {
- throw new TypeError('expected pattern to be an array, string or regex');
- }
-
- // if pattern is a non-glob string
- if (!utils.hasSpecialChars(pattern)) {
- if (options && options.nocase === true) {
- pattern = pattern.toLowerCase();
- }
- return utils.matchPath(pattern, options);
- }
-
- // if pattern is a glob string
- var re = micromatch.makeRe(pattern, options);
-
- // if `options.matchBase` or `options.basename` is defined
- if (micromatch.matchBase(pattern, options)) {
- return utils.matchBasename(re, options);
- }
-
- function test(regex) {
- var equals = utils.equalsPattern(options);
- var unixify = utils.unixify(options);
-
- return function(str) {
- if (equals(str)) {
- return true;
- }
-
- if (regex.test(unixify(str))) {
- return true;
- }
- return false;
- };
- }
-
- var fn = test(re);
- Object.defineProperty(fn, 'result', {
- configurable: true,
- enumerable: false,
- value: re.result
- });
- return fn;
-};
-
-/**
- * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.capture(pattern, string[, options]);
- *
- * console.log(mm.capture('test/*.js', 'test/foo.js'));
- * //=> ['foo']
- * console.log(mm.capture('test/*.js', 'foo/bar.css'));
- * //=> null
- * ```
- * @param {String} `pattern` Glob pattern to use for matching.
- * @param {String} `string` String to match
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`.
- * @api public
- */
-
-micromatch.capture = function(pattern, str, options) {
- var re = micromatch.makeRe(pattern, extend({capture: true}, options));
- var unixify = utils.unixify(options);
-
- function match() {
- return function(string) {
- var match = re.exec(unixify(string));
- if (!match) {
- return null;
- }
-
- return match.slice(1);
- };
- }
-
- var capture = memoize('capture', pattern, options, match);
- return capture(str);
-};
-
-/**
- * Create a regular expression from the given glob `pattern`.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.makeRe(pattern[, options]);
- *
- * console.log(mm.makeRe('*.js'));
- * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
- * ```
- * @param {String} `pattern` A glob pattern to convert to regex.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed.
- * @return {RegExp} Returns a regex created from the given pattern.
- * @api public
- */
-
-micromatch.makeRe = function(pattern, options) {
- if (typeof pattern !== 'string') {
- throw new TypeError('expected pattern to be a string');
- }
-
- if (pattern.length > MAX_LENGTH) {
- throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
- }
-
- function makeRe() {
- var result = micromatch.create(pattern, options);
- var ast_array = [];
- var output = result.map(function(obj) {
- obj.ast.state = obj.state;
- ast_array.push(obj.ast);
- return obj.output;
- });
-
- var regex = toRegex(output.join('|'), options);
- Object.defineProperty(regex, 'result', {
- configurable: true,
- enumerable: false,
- value: ast_array
- });
- return regex;
- }
-
- return memoize('makeRe', pattern, options, makeRe);
-};
-
-/**
- * Expand the given brace `pattern`.
- *
- * ```js
- * var mm = require('micromatch');
- * console.log(mm.braces('foo/{a,b}/bar'));
- * //=> ['foo/(a|b)/bar']
- *
- * console.log(mm.braces('foo/{a,b}/bar', {expand: true}));
- * //=> ['foo/(a|b)/bar']
- * ```
- * @param {String} `pattern` String with brace pattern to expand.
- * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
- * @return {Array}
- * @api public
- */
-
-micromatch.braces = function(pattern, options) {
- if (typeof pattern !== 'string' && !Array.isArray(pattern)) {
- throw new TypeError('expected pattern to be an array or string');
- }
-
- function expand() {
- if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
- return utils.arrayify(pattern);
- }
- return braces(pattern, options);
- }
-
- return memoize('braces', pattern, options, expand);
-};
-
-/**
- * Proxy to the [micromatch.braces](#method), for parity with
- * minimatch.
- */
-
-micromatch.braceExpand = function(pattern, options) {
- var opts = extend({}, options, {expand: true});
- return micromatch.braces(pattern, opts);
-};
-
-/**
- * Parses the given glob `pattern` and returns an array of abstract syntax
- * trees (ASTs), with the compiled `output` and optional source `map` on
- * each AST.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.create(pattern[, options]);
- *
- * console.log(mm.create('abc/*.js'));
- * // [{ options: { source: 'string', sourcemap: true },
- * // state: {},
- * // compilers:
- * // { ... },
- * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js',
- * // ast:
- * // { type: 'root',
- * // errors: [],
- * // nodes:
- * // [ ... ],
- * // dot: false,
- * // input: 'abc/*.js' },
- * // parsingErrors: [],
- * // map:
- * // { version: 3,
- * // sources: [ 'string' ],
- * // names: [],
- * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE',
- * // sourcesContent: [ 'abc/*.js' ] },
- * // position: { line: 1, column: 28 },
- * // content: {},
- * // files: {},
- * // idx: 6 }]
- * ```
- * @param {String} `pattern` Glob pattern to parse and compile.
- * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed.
- * @return {Object} Returns an object with the parsed AST, compiled string and optional source map.
- * @api public
- */
-
-micromatch.create = function(pattern, options) {
- return memoize('create', pattern, options, function() {
- function create(str, opts) {
- return micromatch.compile(micromatch.parse(str, opts), opts);
- }
-
- pattern = micromatch.braces(pattern, options);
- var len = pattern.length;
- var idx = -1;
- var res = [];
-
- while (++idx < len) {
- res.push(create(pattern[idx], options));
- }
- return res;
- });
-};
-
-/**
- * Parse the given `str` with the given `options`.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.parse(pattern[, options]);
- *
- * var ast = mm.parse('a/{b,c}/d');
- * console.log(ast);
- * // { type: 'root',
- * // errors: [],
- * // input: 'a/{b,c}/d',
- * // nodes:
- * // [ { type: 'bos', val: '' },
- * // { type: 'text', val: 'a/' },
- * // { type: 'brace',
- * // nodes:
- * // [ { type: 'brace.open', val: '{' },
- * // { type: 'text', val: 'b,c' },
- * // { type: 'brace.close', val: '}' } ] },
- * // { type: 'text', val: '/d' },
- * // { type: 'eos', val: '' } ] }
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {Object} Returns an AST
- * @api public
- */
-
-micromatch.parse = function(pattern, options) {
- if (typeof pattern !== 'string') {
- throw new TypeError('expected a string');
- }
-
- function parse() {
- var snapdragon = utils.instantiate(null, options);
- parsers(snapdragon, options);
-
- var ast = snapdragon.parse(pattern, options);
- utils.define(ast, 'snapdragon', snapdragon);
- ast.input = pattern;
- return ast;
- }
-
- return memoize('parse', pattern, options, parse);
-};
-
-/**
- * Compile the given `ast` or string with the given `options`.
- *
- * ```js
- * var mm = require('micromatch');
- * mm.compile(ast[, options]);
- *
- * var ast = mm.parse('a/{b,c}/d');
- * console.log(mm.compile(ast));
- * // { options: { source: 'string' },
- * // state: {},
- * // compilers:
- * // { eos: [Function],
- * // noop: [Function],
- * // bos: [Function],
- * // brace: [Function],
- * // 'brace.open': [Function],
- * // text: [Function],
- * // 'brace.close': [Function] },
- * // output: [ 'a/(b|c)/d' ],
- * // ast:
- * // { ... },
- * // parsingErrors: [] }
- * ```
- * @param {Object|String} `ast`
- * @param {Object} `options`
- * @return {Object} Returns an object that has an `output` property with the compiled string.
- * @api public
- */
-
-micromatch.compile = function(ast, options) {
- if (typeof ast === 'string') {
- ast = micromatch.parse(ast, options);
- }
-
- return memoize('compile', ast.input, options, function() {
- var snapdragon = utils.instantiate(ast, options);
- compilers(snapdragon, options);
- return snapdragon.compile(ast, options);
- });
-};
-
-/**
- * Clear the regex cache.
- *
- * ```js
- * mm.clearCache();
- * ```
- * @api public
- */
-
-micromatch.clearCache = function() {
- micromatch.cache.caches = {};
-};
-
-/**
- * Returns true if the given value is effectively an empty string
- */
-
-function isEmptyString(val) {
- return String(val) === '' || String(val) === './';
-}
-
-/**
- * Compose a matcher function with the given patterns.
- * This allows matcher functions to be compiled once and
- * called multiple times.
- */
-
-function compose(patterns, options, matcher) {
- var matchers;
-
- return memoize('compose', String(patterns), options, function() {
- return function(file) {
- // delay composition until it's invoked the first time,
- // after that it won't be called again
- if (!matchers) {
- matchers = [];
- for (var i = 0; i < patterns.length; i++) {
- matchers.push(matcher(patterns[i], options));
- }
- }
-
- var len = matchers.length;
- while (len--) {
- if (matchers[len](file) === true) {
- return true;
- }
- }
- return false;
- };
- });
-}
-
-/**
- * Memoize a generated regex or function. A unique key is generated
- * from the `type` (usually method name), the `pattern`, and
- * user-defined options.
- */
-
-function memoize(type, pattern, options, fn) {
- var key = utils.createKey(type + '=' + pattern, options);
-
- if (options && options.cache === false) {
- return fn(pattern, options);
- }
-
- if (cache.has(type, key)) {
- return cache.get(type, key);
- }
-
- var val = fn(pattern, options);
- cache.set(type, key, val);
- return val;
-}
-
-/**
- * Expose compiler, parser and cache on `micromatch`
- */
-
-micromatch.compilers = compilers;
-micromatch.parsers = parsers;
-micromatch.caches = cache.caches;
-
-/**
- * Expose `micromatch`
- * @type {Function}
- */
-
-module.exports = micromatch;
-
-
-/***/ }),
-/* 581 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Module dependencies
- */
-
-var toRegex = __webpack_require__(582);
-var unique = __webpack_require__(600);
-var extend = __webpack_require__(601);
-
-/**
- * Local dependencies
- */
-
-var compilers = __webpack_require__(603);
-var parsers = __webpack_require__(613);
-var Braces = __webpack_require__(617);
-var utils = __webpack_require__(604);
-var MAX_LENGTH = 1024 * 64;
-var cache = {};
-
-/**
- * Convert the given `braces` pattern into a regex-compatible string. By default, only one string is generated for every input string. Set `options.expand` to true to return an array of patterns (similar to Bash or minimatch. Before using `options.expand`, it's recommended that you read the [performance notes](#performance)).
- *
- * ```js
- * var braces = require('braces');
- * console.log(braces('{a,b,c}'));
- * //=> ['(a|b|c)']
- *
- * console.log(braces('{a,b,c}', {expand: true}));
- * //=> ['a', 'b', 'c']
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {String}
- * @api public
- */
-
-function braces(pattern, options) {
- var key = utils.createKey(String(pattern), options);
- var arr = [];
-
- var disabled = options && options.cache === false;
- if (!disabled && cache.hasOwnProperty(key)) {
- return cache[key];
- }
-
- if (Array.isArray(pattern)) {
- for (var i = 0; i < pattern.length; i++) {
- arr.push.apply(arr, braces.create(pattern[i], options));
- }
- } else {
- arr = braces.create(pattern, options);
- }
-
- if (options && options.nodupes === true) {
- arr = unique(arr);
- }
-
- if (!disabled) {
- cache[key] = arr;
- }
- return arr;
-}
-
-/**
- * Expands a brace pattern into an array. This method is called by the main [braces](#braces) function when `options.expand` is true. Before using this method it's recommended that you read the [performance notes](#performance)) and advantages of using [.optimize](#optimize) instead.
- *
- * ```js
- * var braces = require('braces');
- * console.log(braces.expand('a/{b,c}/d'));
- * //=> ['a/b/d', 'a/c/d'];
- * ```
- * @param {String} `pattern` Brace pattern
- * @param {Object} `options`
- * @return {Array} Returns an array of expanded values.
- * @api public
- */
-
-braces.expand = function(pattern, options) {
- return braces.create(pattern, extend({}, options, {expand: true}));
-};
-
-/**
- * Expands a brace pattern into a regex-compatible, optimized string. This method is called by the main [braces](#braces) function by default.
- *
- * ```js
- * var braces = require('braces');
- * console.log(braces.expand('a/{b,c}/d'));
- * //=> ['a/(b|c)/d']
- * ```
- * @param {String} `pattern` Brace pattern
- * @param {Object} `options`
- * @return {Array} Returns an array of expanded values.
- * @api public
- */
-
-braces.optimize = function(pattern, options) {
- return braces.create(pattern, options);
-};
-
-/**
- * Processes a brace pattern and returns either an expanded array (if `options.expand` is true), a highly optimized regex-compatible string. This method is called by the main [braces](#braces) function.
- *
- * ```js
- * var braces = require('braces');
- * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
- * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
- * ```
- * @param {String} `pattern` Brace pattern
- * @param {Object} `options`
- * @return {Array} Returns an array of expanded values.
- * @api public
- */
-
-braces.create = function(pattern, options) {
- if (typeof pattern !== 'string') {
- throw new TypeError('expected a string');
- }
-
- var maxLength = (options && options.maxLength) || MAX_LENGTH;
- if (pattern.length >= maxLength) {
- throw new Error('expected pattern to be less than ' + maxLength + ' characters');
- }
-
- function create() {
- if (pattern === '' || pattern.length < 3) {
- return [pattern];
- }
-
- if (utils.isEmptySets(pattern)) {
- return [];
- }
-
- if (utils.isQuotedString(pattern)) {
- return [pattern.slice(1, -1)];
- }
-
- var proto = new Braces(options);
- var result = !options || options.expand !== true
- ? proto.optimize(pattern, options)
- : proto.expand(pattern, options);
-
- // get the generated pattern(s)
- var arr = result.output;
-
- // filter out empty strings if specified
- if (options && options.noempty === true) {
- arr = arr.filter(Boolean);
- }
-
- // filter out duplicates if specified
- if (options && options.nodupes === true) {
- arr = unique(arr);
- }
-
- Object.defineProperty(arr, 'result', {
- enumerable: false,
- value: result
- });
-
- return arr;
- }
-
- return memoize('create', pattern, options, create);
-};
-
-/**
- * Create a regular expression from the given string `pattern`.
- *
- * ```js
- * var braces = require('braces');
- *
- * console.log(braces.makeRe('id-{200..300}'));
- * //=> /^(?:id-(20[0-9]|2[1-9][0-9]|300))$/
- * ```
- * @param {String} `pattern` The pattern to convert to regex.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
-
-braces.makeRe = function(pattern, options) {
- if (typeof pattern !== 'string') {
- throw new TypeError('expected a string');
- }
-
- var maxLength = (options && options.maxLength) || MAX_LENGTH;
- if (pattern.length >= maxLength) {
- throw new Error('expected pattern to be less than ' + maxLength + ' characters');
- }
-
- function makeRe() {
- var arr = braces(pattern, options);
- var opts = extend({strictErrors: false}, options);
- return toRegex(arr, opts);
- }
-
- return memoize('makeRe', pattern, options, makeRe);
-};
-
-/**
- * Parse the given `str` with the given `options`.
- *
- * ```js
- * var braces = require('braces');
- * var ast = braces.parse('a/{b,c}/d');
- * console.log(ast);
- * // { type: 'root',
- * // errors: [],
- * // input: 'a/{b,c}/d',
- * // nodes:
- * // [ { type: 'bos', val: '' },
- * // { type: 'text', val: 'a/' },
- * // { type: 'brace',
- * // nodes:
- * // [ { type: 'brace.open', val: '{' },
- * // { type: 'text', val: 'b,c' },
- * // { type: 'brace.close', val: '}' } ] },
- * // { type: 'text', val: '/d' },
- * // { type: 'eos', val: '' } ] }
- * ```
- * @param {String} `pattern` Brace pattern to parse
- * @param {Object} `options`
- * @return {Object} Returns an AST
- * @api public
- */
-
-braces.parse = function(pattern, options) {
- var proto = new Braces(options);
- return proto.parse(pattern, options);
-};
-
-/**
- * Compile the given `ast` or string with the given `options`.
- *
- * ```js
- * var braces = require('braces');
- * var ast = braces.parse('a/{b,c}/d');
- * console.log(braces.compile(ast));
- * // { options: { source: 'string' },
- * // state: {},
- * // compilers:
- * // { eos: [Function],
- * // noop: [Function],
- * // bos: [Function],
- * // brace: [Function],
- * // 'brace.open': [Function],
- * // text: [Function],
- * // 'brace.close': [Function] },
- * // output: [ 'a/(b|c)/d' ],
- * // ast:
- * // { ... },
- * // parsingErrors: [] }
- * ```
- * @param {Object|String} `ast` AST from [.parse](#parse). If a string is passed it will be parsed first.
- * @param {Object} `options`
- * @return {Object} Returns an object that has an `output` property with the compiled string.
- * @api public
- */
-
-braces.compile = function(ast, options) {
- var proto = new Braces(options);
- return proto.compile(ast, options);
-};
-
-/**
- * Clear the regex cache.
- *
- * ```js
- * braces.clearCache();
- * ```
- * @api public
- */
-
-braces.clearCache = function() {
- cache = braces.cache = {};
-};
-
-/**
- * Memoize a generated regex or function. A unique key is generated
- * from the method name, pattern, and user-defined options. Set
- * options.memoize to false to disable.
- */
-
-function memoize(type, pattern, options, fn) {
- var key = utils.createKey(type + ':' + pattern, options);
- var disabled = options && options.cache === false;
- if (disabled) {
- braces.clearCache();
- return fn(pattern, options);
- }
-
- if (cache.hasOwnProperty(key)) {
- return cache[key];
- }
-
- var res = fn(pattern, options);
- cache[key] = res;
- return res;
-}
-
-/**
- * Expose `Braces` constructor and methods
- * @type {Function}
- */
-
-braces.Braces = Braces;
-braces.compilers = compilers;
-braces.parsers = parsers;
-braces.cache = cache;
-
-/**
- * Expose `braces`
- * @type {Function}
- */
-
-module.exports = braces;
-
-
-/***/ }),
-/* 582 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var safe = __webpack_require__(583);
-var define = __webpack_require__(589);
-var extend = __webpack_require__(595);
-var not = __webpack_require__(599);
-var MAX_LENGTH = 1024 * 64;
-
-/**
- * Session cache
- */
-
-var cache = {};
-
-/**
- * Create a regular expression from the given `pattern` string.
- *
- * @param {String|RegExp} `pattern` Pattern can be a string or regular expression.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
-
-module.exports = function(patterns, options) {
- if (!Array.isArray(patterns)) {
- return makeRe(patterns, options);
- }
- return makeRe(patterns.join('|'), options);
-};
-
-/**
- * Create a regular expression from the given `pattern` string.
- *
- * @param {String|RegExp} `pattern` Pattern can be a string or regular expression.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
-
-function makeRe(pattern, options) {
- if (pattern instanceof RegExp) {
- return pattern;
- }
-
- if (typeof pattern !== 'string') {
- throw new TypeError('expected a string');
- }
-
- if (pattern.length > MAX_LENGTH) {
- throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
- }
-
- var key = pattern;
- // do this before shallow cloning options, it's a lot faster
- if (!options || (options && options.cache !== false)) {
- key = createKey(pattern, options);
-
- if (cache.hasOwnProperty(key)) {
- return cache[key];
- }
- }
-
- var opts = extend({}, options);
- if (opts.contains === true) {
- if (opts.negate === true) {
- opts.strictNegate = false;
- } else {
- opts.strict = false;
- }
- }
-
- if (opts.strict === false) {
- opts.strictOpen = false;
- opts.strictClose = false;
- }
-
- var open = opts.strictOpen !== false ? '^' : '';
- var close = opts.strictClose !== false ? '$' : '';
- var flags = opts.flags || '';
- var regex;
-
- if (opts.nocase === true && !/i/.test(flags)) {
- flags += 'i';
- }
-
- try {
- if (opts.negate || typeof opts.strictNegate === 'boolean') {
- pattern = not.create(pattern, opts);
- }
-
- var str = open + '(?:' + pattern + ')' + close;
- regex = new RegExp(str, flags);
-
- if (opts.safe === true && safe(regex) === false) {
- throw new Error('potentially unsafe regular expression: ' + regex.source);
- }
-
- } catch (err) {
- if (opts.strictErrors === true || opts.safe === true) {
- err.key = key;
- err.pattern = pattern;
- err.originalOptions = options;
- err.createdOptions = opts;
- throw err;
- }
-
- try {
- regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$');
- } catch (err) {
- regex = /.^/; //<= match nothing
- }
- }
-
- if (opts.cache !== false) {
- memoize(regex, key, pattern, opts);
- }
- return regex;
-}
-
-/**
- * Memoize generated regex. This can result in dramatic speed improvements
- * and simplify debugging by adding options and pattern to the regex. It can be
- * disabled by passing setting `options.cache` to false.
- */
-
-function memoize(regex, key, pattern, options) {
- define(regex, 'cached', true);
- define(regex, 'pattern', pattern);
- define(regex, 'options', options);
- define(regex, 'key', key);
- cache[key] = regex;
-}
-
-/**
- * Create the key to use for memoization. The key is generated
- * by iterating over the options and concatenating key-value pairs
- * to the pattern string.
- */
-
-function createKey(pattern, options) {
- if (!options) return pattern;
- var key = pattern;
- for (var prop in options) {
- if (options.hasOwnProperty(prop)) {
- key += ';' + prop + '=' + String(options[prop]);
- }
- }
- return key;
-}
-
-/**
- * Expose `makeRe`
- */
-
-module.exports.makeRe = makeRe;
-
-
-/***/ }),
-/* 583 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var parse = __webpack_require__(584);
-var types = parse.types;
-
-module.exports = function (re, opts) {
- if (!opts) opts = {};
- var replimit = opts.limit === undefined ? 25 : opts.limit;
-
- if (isRegExp(re)) re = re.source;
- else if (typeof re !== 'string') re = String(re);
-
- try { re = parse(re) }
- catch (err) { return false }
-
- var reps = 0;
- return (function walk (node, starHeight) {
- if (node.type === types.REPETITION) {
- starHeight ++;
- reps ++;
- if (starHeight > 1) return false;
- if (reps > replimit) return false;
- }
-
- if (node.options) {
- for (var i = 0, len = node.options.length; i < len; i++) {
- var ok = walk({ stack: node.options[i] }, starHeight);
- if (!ok) return false;
- }
- }
- var stack = node.stack || (node.value && node.value.stack);
- if (!stack) return true;
-
- for (var i = 0; i < stack.length; i++) {
- var ok = walk(stack[i], starHeight);
- if (!ok) return false;
- }
-
- return true;
- })(re, 0);
-};
-
-function isRegExp (x) {
- return {}.toString.call(x) === '[object RegExp]';
-}
-
-
-/***/ }),
-/* 584 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var util = __webpack_require__(585);
-var types = __webpack_require__(586);
-var sets = __webpack_require__(587);
-var positions = __webpack_require__(588);
-
-
-module.exports = function(regexpStr) {
- var i = 0, l, c,
- start = { type: types.ROOT, stack: []},
-
- // Keep track of last clause/group and stack.
- lastGroup = start,
- last = start.stack,
- groupStack = [];
-
-
- var repeatErr = function(i) {
- util.error(regexpStr, 'Nothing to repeat at column ' + (i - 1));
- };
-
- // Decode a few escaped characters.
- var str = util.strToChars(regexpStr);
- l = str.length;
-
- // Iterate through each character in string.
- while (i < l) {
- c = str[i++];
-
- switch (c) {
- // Handle escaped characters, inclues a few sets.
- case '\\':
- c = str[i++];
-
- switch (c) {
- case 'b':
- last.push(positions.wordBoundary());
- break;
-
- case 'B':
- last.push(positions.nonWordBoundary());
- break;
-
- case 'w':
- last.push(sets.words());
- break;
-
- case 'W':
- last.push(sets.notWords());
- break;
-
- case 'd':
- last.push(sets.ints());
- break;
-
- case 'D':
- last.push(sets.notInts());
- break;
-
- case 's':
- last.push(sets.whitespace());
- break;
-
- case 'S':
- last.push(sets.notWhitespace());
- break;
-
- default:
- // Check if c is integer.
- // In which case it's a reference.
- if (/\d/.test(c)) {
- last.push({ type: types.REFERENCE, value: parseInt(c, 10) });
-
- // Escaped character.
- } else {
- last.push({ type: types.CHAR, value: c.charCodeAt(0) });
- }
- }
-
- break;
-
-
- // Positionals.
- case '^':
- last.push(positions.begin());
- break;
-
- case '$':
- last.push(positions.end());
- break;
-
-
- // Handle custom sets.
- case '[':
- // Check if this class is 'anti' i.e. [^abc].
- var not;
- if (str[i] === '^') {
- not = true;
- i++;
- } else {
- not = false;
- }
-
- // Get all the characters in class.
- var classTokens = util.tokenizeClass(str.slice(i), regexpStr);
-
- // Increase index by length of class.
- i += classTokens[1];
- last.push({
- type: types.SET,
- set: classTokens[0],
- not: not,
- });
-
- break;
-
-
- // Class of any character except \n.
- case '.':
- last.push(sets.anyChar());
- break;
-
-
- // Push group onto stack.
- case '(':
- // Create group.
- var group = {
- type: types.GROUP,
- stack: [],
- remember: true,
- };
-
- c = str[i];
-
- // If if this is a special kind of group.
- if (c === '?') {
- c = str[i + 1];
- i += 2;
-
- // Match if followed by.
- if (c === '=') {
- group.followedBy = true;
-
- // Match if not followed by.
- } else if (c === '!') {
- group.notFollowedBy = true;
-
- } else if (c !== ':') {
- util.error(regexpStr,
- 'Invalid group, character \'' + c +
- '\' after \'?\' at column ' + (i - 1));
- }
-
- group.remember = false;
- }
-
- // Insert subgroup into current group stack.
- last.push(group);
-
- // Remember the current group for when the group closes.
- groupStack.push(lastGroup);
-
- // Make this new group the current group.
- lastGroup = group;
- last = group.stack;
- break;
-
-
- // Pop group out of stack.
- case ')':
- if (groupStack.length === 0) {
- util.error(regexpStr, 'Unmatched ) at column ' + (i - 1));
- }
- lastGroup = groupStack.pop();
-
- // Check if this group has a PIPE.
- // To get back the correct last stack.
- last = lastGroup.options ?
- lastGroup.options[lastGroup.options.length - 1] : lastGroup.stack;
- break;
-
-
- // Use pipe character to give more choices.
- case '|':
- // Create array where options are if this is the first PIPE
- // in this clause.
- if (!lastGroup.options) {
- lastGroup.options = [lastGroup.stack];
- delete lastGroup.stack;
- }
-
- // Create a new stack and add to options for rest of clause.
- var stack = [];
- lastGroup.options.push(stack);
- last = stack;
- break;
-
-
- // Repetition.
- // For every repetition, remove last element from last stack
- // then insert back a RANGE object.
- // This design is chosen because there could be more than
- // one repetition symbols in a regex i.e. `a?+{2,3}`.
- case '{':
- var rs = /^(\d+)(,(\d+)?)?\}/.exec(str.slice(i)), min, max;
- if (rs !== null) {
- if (last.length === 0) {
- repeatErr(i);
- }
- min = parseInt(rs[1], 10);
- max = rs[2] ? rs[3] ? parseInt(rs[3], 10) : Infinity : min;
- i += rs[0].length;
-
- last.push({
- type: types.REPETITION,
- min: min,
- max: max,
- value: last.pop(),
- });
- } else {
- last.push({
- type: types.CHAR,
- value: 123,
- });
- }
- break;
-
- case '?':
- if (last.length === 0) {
- repeatErr(i);
- }
- last.push({
- type: types.REPETITION,
- min: 0,
- max: 1,
- value: last.pop(),
- });
- break;
-
- case '+':
- if (last.length === 0) {
- repeatErr(i);
- }
- last.push({
- type: types.REPETITION,
- min: 1,
- max: Infinity,
- value: last.pop(),
- });
- break;
-
- case '*':
- if (last.length === 0) {
- repeatErr(i);
- }
- last.push({
- type: types.REPETITION,
- min: 0,
- max: Infinity,
- value: last.pop(),
- });
- break;
-
-
- // Default is a character that is not `\[](){}?+*^$`.
- default:
- last.push({
- type: types.CHAR,
- value: c.charCodeAt(0),
- });
- }
-
- }
-
- // Check if any groups have not been closed.
- if (groupStack.length !== 0) {
- util.error(regexpStr, 'Unterminated group');
- }
-
- return start;
-};
-
-module.exports.types = types;
-
-
-/***/ }),
-/* 585 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var types = __webpack_require__(586);
-var sets = __webpack_require__(587);
-
-
-// All of these are private and only used by randexp.
-// It's assumed that they will always be called with the correct input.
-
-var CTRL = '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?';
-var SLSH = { '0': 0, 't': 9, 'n': 10, 'v': 11, 'f': 12, 'r': 13 };
-
-/**
- * Finds character representations in str and convert all to
- * their respective characters
- *
- * @param {String} str
- * @return {String}
- */
-exports.strToChars = function(str) {
- /* jshint maxlen: false */
- var chars_regex = /(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z\[\\\]\^?])|([0tnvfr]))/g;
- str = str.replace(chars_regex, function(s, b, lbs, a16, b16, c8, dctrl, eslsh) {
- if (lbs) {
- return s;
- }
-
- var code = b ? 8 :
- a16 ? parseInt(a16, 16) :
- b16 ? parseInt(b16, 16) :
- c8 ? parseInt(c8, 8) :
- dctrl ? CTRL.indexOf(dctrl) :
- SLSH[eslsh];
-
- var c = String.fromCharCode(code);
-
- // Escape special regex characters.
- if (/[\[\]{}\^$.|?*+()]/.test(c)) {
- c = '\\' + c;
- }
-
- return c;
- });
-
- return str;
-};
-
-
-/**
- * turns class into tokens
- * reads str until it encounters a ] not preceeded by a \
- *
- * @param {String} str
- * @param {String} regexpStr
- * @return {Array., Number>}
- */
-exports.tokenizeClass = function(str, regexpStr) {
- /* jshint maxlen: false */
- var tokens = [];
- var regexp = /\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?(.)/g;
- var rs, c;
-
-
- while ((rs = regexp.exec(str)) != null) {
- if (rs[1]) {
- tokens.push(sets.words());
-
- } else if (rs[2]) {
- tokens.push(sets.ints());
-
- } else if (rs[3]) {
- tokens.push(sets.whitespace());
-
- } else if (rs[4]) {
- tokens.push(sets.notWords());
-
- } else if (rs[5]) {
- tokens.push(sets.notInts());
-
- } else if (rs[6]) {
- tokens.push(sets.notWhitespace());
-
- } else if (rs[7]) {
- tokens.push({
- type: types.RANGE,
- from: (rs[8] || rs[9]).charCodeAt(0),
- to: rs[10].charCodeAt(0),
- });
-
- } else if (c = rs[12]) {
- tokens.push({
- type: types.CHAR,
- value: c.charCodeAt(0),
- });
-
- } else {
- return [tokens, regexp.lastIndex];
- }
- }
-
- exports.error(regexpStr, 'Unterminated character class');
-};
-
-
-/**
- * Shortcut to throw errors.
- *
- * @param {String} regexp
- * @param {String} msg
- */
-exports.error = function(regexp, msg) {
- throw new SyntaxError('Invalid regular expression: /' + regexp + '/: ' + msg);
-};
-
-
-/***/ }),
-/* 586 */
-/***/ (function(module, exports) {
-
-module.exports = {
- ROOT : 0,
- GROUP : 1,
- POSITION : 2,
- SET : 3,
- RANGE : 4,
- REPETITION : 5,
- REFERENCE : 6,
- CHAR : 7,
-};
-
-
-/***/ }),
-/* 587 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var types = __webpack_require__(586);
-
-var INTS = function() {
- return [{ type: types.RANGE , from: 48, to: 57 }];
-};
-
-var WORDS = function() {
- return [
- { type: types.CHAR, value: 95 },
- { type: types.RANGE, from: 97, to: 122 },
- { type: types.RANGE, from: 65, to: 90 }
- ].concat(INTS());
-};
-
-var WHITESPACE = function() {
- return [
- { type: types.CHAR, value: 9 },
- { type: types.CHAR, value: 10 },
- { type: types.CHAR, value: 11 },
- { type: types.CHAR, value: 12 },
- { type: types.CHAR, value: 13 },
- { type: types.CHAR, value: 32 },
- { type: types.CHAR, value: 160 },
- { type: types.CHAR, value: 5760 },
- { type: types.CHAR, value: 6158 },
- { type: types.CHAR, value: 8192 },
- { type: types.CHAR, value: 8193 },
- { type: types.CHAR, value: 8194 },
- { type: types.CHAR, value: 8195 },
- { type: types.CHAR, value: 8196 },
- { type: types.CHAR, value: 8197 },
- { type: types.CHAR, value: 8198 },
- { type: types.CHAR, value: 8199 },
- { type: types.CHAR, value: 8200 },
- { type: types.CHAR, value: 8201 },
- { type: types.CHAR, value: 8202 },
- { type: types.CHAR, value: 8232 },
- { type: types.CHAR, value: 8233 },
- { type: types.CHAR, value: 8239 },
- { type: types.CHAR, value: 8287 },
- { type: types.CHAR, value: 12288 },
- { type: types.CHAR, value: 65279 }
- ];
-};
-
-var NOTANYCHAR = function() {
- return [
- { type: types.CHAR, value: 10 },
- { type: types.CHAR, value: 13 },
- { type: types.CHAR, value: 8232 },
- { type: types.CHAR, value: 8233 },
- ];
-};
-
-// Predefined class objects.
-exports.words = function() {
- return { type: types.SET, set: WORDS(), not: false };
-};
-
-exports.notWords = function() {
- return { type: types.SET, set: WORDS(), not: true };
-};
-
-exports.ints = function() {
- return { type: types.SET, set: INTS(), not: false };
-};
-
-exports.notInts = function() {
- return { type: types.SET, set: INTS(), not: true };
-};
-
-exports.whitespace = function() {
- return { type: types.SET, set: WHITESPACE(), not: false };
-};
-
-exports.notWhitespace = function() {
- return { type: types.SET, set: WHITESPACE(), not: true };
-};
-
-exports.anyChar = function() {
- return { type: types.SET, set: NOTANYCHAR(), not: true };
-};
-
-
-/***/ }),
-/* 588 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var types = __webpack_require__(586);
-
-exports.wordBoundary = function() {
- return { type: types.POSITION, value: 'b' };
-};
-
-exports.nonWordBoundary = function() {
- return { type: types.POSITION, value: 'B' };
-};
-
-exports.begin = function() {
- return { type: types.POSITION, value: '^' };
-};
-
-exports.end = function() {
- return { type: types.POSITION, value: '$' };
-};
-
-
-/***/ }),
-/* 589 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * define-property
- *
- * Copyright (c) 2015-2018, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var isobject = __webpack_require__(590);
-var isDescriptor = __webpack_require__(591);
-var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty)
- ? Reflect.defineProperty
- : Object.defineProperty;
-
-module.exports = function defineProperty(obj, key, val) {
- if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) {
- throw new TypeError('expected an object, function, or array');
- }
-
- if (typeof key !== 'string') {
- throw new TypeError('expected "key" to be a string');
- }
-
- if (isDescriptor(val)) {
- define(obj, key, val);
- return obj;
- }
-
- define(obj, key, {
- configurable: true,
- enumerable: false,
- writable: true,
- value: val
- });
-
- return obj;
-};
-
-
-/***/ }),
-/* 590 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * isobject
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-module.exports = function isObject(val) {
- return val != null && typeof val === 'object' && Array.isArray(val) === false;
-};
-
-
-/***/ }),
-/* 591 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-descriptor
- *
- * Copyright (c) 2015-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-var isAccessor = __webpack_require__(593);
-var isData = __webpack_require__(594);
-
-module.exports = function isDescriptor(obj, key) {
- if (typeOf(obj) !== 'object') {
- return false;
- }
- if ('get' in obj) {
- return isAccessor(obj, key);
- }
- return isData(obj, key);
-};
-
-
-/***/ }),
-/* 592 */
-/***/ (function(module, exports) {
-
-var toString = Object.prototype.toString;
-
-module.exports = function kindOf(val) {
- if (val === void 0) return 'undefined';
- if (val === null) return 'null';
-
- var type = typeof val;
- if (type === 'boolean') return 'boolean';
- if (type === 'string') return 'string';
- if (type === 'number') return 'number';
- if (type === 'symbol') return 'symbol';
- if (type === 'function') {
- return isGeneratorFn(val) ? 'generatorfunction' : 'function';
- }
-
- if (isArray(val)) return 'array';
- if (isBuffer(val)) return 'buffer';
- if (isArguments(val)) return 'arguments';
- if (isDate(val)) return 'date';
- if (isError(val)) return 'error';
- if (isRegexp(val)) return 'regexp';
-
- switch (ctorName(val)) {
- case 'Symbol': return 'symbol';
- case 'Promise': return 'promise';
-
- // Set, Map, WeakSet, WeakMap
- case 'WeakMap': return 'weakmap';
- case 'WeakSet': return 'weakset';
- case 'Map': return 'map';
- case 'Set': return 'set';
-
- // 8-bit typed arrays
- case 'Int8Array': return 'int8array';
- case 'Uint8Array': return 'uint8array';
- case 'Uint8ClampedArray': return 'uint8clampedarray';
-
- // 16-bit typed arrays
- case 'Int16Array': return 'int16array';
- case 'Uint16Array': return 'uint16array';
-
- // 32-bit typed arrays
- case 'Int32Array': return 'int32array';
- case 'Uint32Array': return 'uint32array';
- case 'Float32Array': return 'float32array';
- case 'Float64Array': return 'float64array';
- }
-
- if (isGeneratorObj(val)) {
- return 'generator';
- }
-
- // Non-plain objects
- type = toString.call(val);
- switch (type) {
- case '[object Object]': return 'object';
- // iterators
- case '[object Map Iterator]': return 'mapiterator';
- case '[object Set Iterator]': return 'setiterator';
- case '[object String Iterator]': return 'stringiterator';
- case '[object Array Iterator]': return 'arrayiterator';
- }
-
- // other
- return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
-};
-
-function ctorName(val) {
- return typeof val.constructor === 'function' ? val.constructor.name : null;
-}
-
-function isArray(val) {
- if (Array.isArray) return Array.isArray(val);
- return val instanceof Array;
-}
-
-function isError(val) {
- return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number');
-}
-
-function isDate(val) {
- if (val instanceof Date) return true;
- return typeof val.toDateString === 'function'
- && typeof val.getDate === 'function'
- && typeof val.setDate === 'function';
-}
-
-function isRegexp(val) {
- if (val instanceof RegExp) return true;
- return typeof val.flags === 'string'
- && typeof val.ignoreCase === 'boolean'
- && typeof val.multiline === 'boolean'
- && typeof val.global === 'boolean';
-}
-
-function isGeneratorFn(name, val) {
- return ctorName(name) === 'GeneratorFunction';
-}
-
-function isGeneratorObj(val) {
- return typeof val.throw === 'function'
- && typeof val.return === 'function'
- && typeof val.next === 'function';
-}
-
-function isArguments(val) {
- try {
- if (typeof val.length === 'number' && typeof val.callee === 'function') {
- return true;
- }
- } catch (err) {
- if (err.message.indexOf('callee') !== -1) {
- return true;
- }
- }
- return false;
-}
-
-/**
- * If you need to support Safari 5-7 (8-10 yr-old browser),
- * take a look at https://github.com/feross/is-buffer
- */
-
-function isBuffer(val) {
- if (val.constructor && typeof val.constructor.isBuffer === 'function') {
- return val.constructor.isBuffer(val);
- }
- return false;
-}
-
-
-/***/ }),
-/* 593 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-accessor-descriptor
- *
- * Copyright (c) 2015-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-
-// accessor descriptor properties
-var accessor = {
- get: 'function',
- set: 'function',
- configurable: 'boolean',
- enumerable: 'boolean'
-};
-
-function isAccessorDescriptor(obj, prop) {
- if (typeof prop === 'string') {
- var val = Object.getOwnPropertyDescriptor(obj, prop);
- return typeof val !== 'undefined';
- }
-
- if (typeOf(obj) !== 'object') {
- return false;
- }
-
- if (has(obj, 'value') || has(obj, 'writable')) {
- return false;
- }
-
- if (!has(obj, 'get') || typeof obj.get !== 'function') {
- return false;
- }
-
- // tldr: it's valid to have "set" be undefined
- // "set" might be undefined if `Object.getOwnPropertyDescriptor`
- // was used to get the value, and only `get` was defined by the user
- if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') {
- return false;
- }
-
- for (var key in obj) {
- if (!accessor.hasOwnProperty(key)) {
- continue;
- }
-
- if (typeOf(obj[key]) === accessor[key]) {
- continue;
- }
-
- if (typeof obj[key] !== 'undefined') {
- return false;
- }
- }
- return true;
-}
-
-function has(obj, key) {
- return {}.hasOwnProperty.call(obj, key);
-}
-
-/**
- * Expose `isAccessorDescriptor`
- */
-
-module.exports = isAccessorDescriptor;
-
-
-/***/ }),
-/* 594 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-data-descriptor
- *
- * Copyright (c) 2015-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-
-module.exports = function isDataDescriptor(obj, prop) {
- // data descriptor properties
- var data = {
- configurable: 'boolean',
- enumerable: 'boolean',
- writable: 'boolean'
- };
-
- if (typeOf(obj) !== 'object') {
- return false;
- }
-
- if (typeof prop === 'string') {
- var val = Object.getOwnPropertyDescriptor(obj, prop);
- return typeof val !== 'undefined';
- }
-
- if (!('value' in obj) && !('writable' in obj)) {
- return false;
- }
-
- for (var key in obj) {
- if (key === 'value') continue;
-
- if (!data.hasOwnProperty(key)) {
- continue;
- }
-
- if (typeOf(obj[key]) === data[key]) {
- continue;
- }
-
- if (typeof obj[key] !== 'undefined') {
- return false;
- }
- }
- return true;
-};
-
-
-/***/ }),
-/* 595 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var isExtendable = __webpack_require__(596);
-var assignSymbols = __webpack_require__(598);
-
-module.exports = Object.assign || function(obj/*, objects*/) {
- if (obj === null || typeof obj === 'undefined') {
- throw new TypeError('Cannot convert undefined or null to object');
- }
- if (!isObject(obj)) {
- obj = {};
- }
- for (var i = 1; i < arguments.length; i++) {
- var val = arguments[i];
- if (isString(val)) {
- val = toObject(val);
- }
- if (isObject(val)) {
- assign(obj, val);
- assignSymbols(obj, val);
- }
- }
- return obj;
-};
-
-function assign(a, b) {
- for (var key in b) {
- if (hasOwn(b, key)) {
- a[key] = b[key];
- }
- }
-}
-
-function isString(val) {
- return (val && typeof val === 'string');
-}
-
-function toObject(str) {
- var obj = {};
- for (var i in str) {
- obj[i] = str[i];
- }
- return obj;
-}
-
-function isObject(val) {
- return (val && typeof val === 'object') || isExtendable(val);
-}
-
-/**
- * Returns true if the given `key` is an own property of `obj`.
- */
-
-function hasOwn(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
-}
-
-function isEnum(obj, key) {
- return Object.prototype.propertyIsEnumerable.call(obj, key);
-}
-
-
-/***/ }),
-/* 596 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-extendable
- *
- * Copyright (c) 2015-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var isPlainObject = __webpack_require__(597);
-
-module.exports = function isExtendable(val) {
- return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
-};
-
-
-/***/ }),
-/* 597 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-plain-object
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var isObject = __webpack_require__(590);
-
-function isObjectObject(o) {
- return isObject(o) === true
- && Object.prototype.toString.call(o) === '[object Object]';
-}
-
-module.exports = function isPlainObject(o) {
- var ctor,prot;
-
- if (isObjectObject(o) === false) return false;
-
- // If has modified constructor
- ctor = o.constructor;
- if (typeof ctor !== 'function') return false;
-
- // If has modified prototype
- prot = ctor.prototype;
- if (isObjectObject(prot) === false) return false;
-
- // If constructor does not have an Object-specific method
- if (prot.hasOwnProperty('isPrototypeOf') === false) {
- return false;
- }
-
- // Most likely a plain Object
- return true;
-};
-
-
-/***/ }),
-/* 598 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * assign-symbols
- *
- * Copyright (c) 2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-module.exports = function(receiver, objects) {
- if (receiver === null || typeof receiver === 'undefined') {
- throw new TypeError('expected first argument to be an object.');
- }
-
- if (typeof objects === 'undefined' || typeof Symbol === 'undefined') {
- return receiver;
- }
-
- if (typeof Object.getOwnPropertySymbols !== 'function') {
- return receiver;
- }
-
- var isEnumerable = Object.prototype.propertyIsEnumerable;
- var target = Object(receiver);
- var len = arguments.length, i = 0;
-
- while (++i < len) {
- var provider = Object(arguments[i]);
- var names = Object.getOwnPropertySymbols(provider);
-
- for (var j = 0; j < names.length; j++) {
- var key = names[j];
-
- if (isEnumerable.call(provider, key)) {
- target[key] = provider[key];
- }
- }
- }
- return target;
-};
-
-
-/***/ }),
-/* 599 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var extend = __webpack_require__(595);
-var safe = __webpack_require__(583);
-
-/**
- * The main export is a function that takes a `pattern` string and an `options` object.
- *
- * ```js
- & var not = require('regex-not');
- & console.log(not('foo'));
- & //=> /^(?:(?!^(?:foo)$).)*$/
- * ```
- *
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {RegExp} Converts the given `pattern` to a regex using the specified `options`.
- * @api public
- */
-
-function toRegex(pattern, options) {
- return new RegExp(toRegex.create(pattern, options));
-}
-
-/**
- * Create a regex-compatible string from the given `pattern` and `options`.
- *
- * ```js
- & var not = require('regex-not');
- & console.log(not.create('foo'));
- & //=> '^(?:(?!^(?:foo)$).)*$'
- * ```
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {String}
- * @api public
- */
-
-toRegex.create = function(pattern, options) {
- if (typeof pattern !== 'string') {
- throw new TypeError('expected a string');
- }
-
- var opts = extend({}, options);
- if (opts.contains === true) {
- opts.strictNegate = false;
- }
-
- var open = opts.strictOpen !== false ? '^' : '';
- var close = opts.strictClose !== false ? '$' : '';
- var endChar = opts.endChar ? opts.endChar : '+';
- var str = pattern;
-
- if (opts.strictNegate === false) {
- str = '(?:(?!(?:' + pattern + ')).)' + endChar;
- } else {
- str = '(?:(?!^(?:' + pattern + ')$).)' + endChar;
- }
-
- var res = open + str + close;
- if (opts.safe === true && safe(res) === false) {
- throw new Error('potentially unsafe regular expression: ' + res);
- }
-
- return res;
-};
-
-/**
- * Expose `toRegex`
- */
-
-module.exports = toRegex;
-
-
-/***/ }),
-/* 600 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * array-unique
- *
- * Copyright (c) 2014-2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-module.exports = function unique(arr) {
- if (!Array.isArray(arr)) {
- throw new TypeError('array-unique expects an array.');
- }
-
- var len = arr.length;
- var i = -1;
-
- while (i++ < len) {
- var j = i + 1;
-
- for (; j < arr.length; ++j) {
- if (arr[i] === arr[j]) {
- arr.splice(j--, 1);
- }
- }
- }
- return arr;
-};
-
-module.exports.immutable = function uniqueImmutable(arr) {
- if (!Array.isArray(arr)) {
- throw new TypeError('array-unique expects an array.');
- }
-
- var arrLen = arr.length;
- var newArr = new Array(arrLen);
-
- for (var i = 0; i < arrLen; i++) {
- newArr[i] = arr[i];
- }
-
- return module.exports(newArr);
-};
-
-
-/***/ }),
-/* 601 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var isObject = __webpack_require__(602);
-
-module.exports = function extend(o/*, objects*/) {
- if (!isObject(o)) { o = {}; }
-
- var len = arguments.length;
- for (var i = 1; i < len; i++) {
- var obj = arguments[i];
-
- if (isObject(obj)) {
- assign(o, obj);
- }
- }
- return o;
-};
-
-function assign(a, b) {
- for (var key in b) {
- if (hasOwn(b, key)) {
- a[key] = b[key];
- }
- }
-}
-
-/**
- * Returns true if the given `key` is an own property of `obj`.
- */
-
-function hasOwn(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
-}
-
-
-/***/ }),
-/* 602 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-extendable
- *
- * Copyright (c) 2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-module.exports = function isExtendable(val) {
- return typeof val !== 'undefined' && val !== null
- && (typeof val === 'object' || typeof val === 'function');
-};
-
-
-/***/ }),
-/* 603 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var utils = __webpack_require__(604);
-
-module.exports = function(braces, options) {
- braces.compiler
-
- /**
- * bos
- */
-
- .set('bos', function() {
- if (this.output) return;
- this.ast.queue = isEscaped(this.ast) ? [this.ast.val] : [];
- this.ast.count = 1;
- })
-
- /**
- * Square brackets
- */
-
- .set('bracket', function(node) {
- var close = node.close;
- var open = !node.escaped ? '[' : '\\[';
- var negated = node.negated;
- var inner = node.inner;
-
- inner = inner.replace(/\\(?=[\\\w]|$)/g, '\\\\');
- if (inner === ']-') {
- inner = '\\]\\-';
- }
-
- if (negated && inner.indexOf('.') === -1) {
- inner += '.';
- }
- if (negated && inner.indexOf('/') === -1) {
- inner += '/';
- }
-
- var val = open + negated + inner + close;
- var queue = node.parent.queue;
- var last = utils.arrayify(queue.pop());
-
- queue.push(utils.join(last, val));
- queue.push.apply(queue, []);
- })
-
- /**
- * Brace
- */
-
- .set('brace', function(node) {
- node.queue = isEscaped(node) ? [node.val] : [];
- node.count = 1;
- return this.mapVisit(node.nodes);
- })
-
- /**
- * Open
- */
-
- .set('brace.open', function(node) {
- node.parent.open = node.val;
- })
-
- /**
- * Inner
- */
-
- .set('text', function(node) {
- var queue = node.parent.queue;
- var escaped = node.escaped;
- var segs = [node.val];
-
- if (node.optimize === false) {
- options = utils.extend({}, options, {optimize: false});
- }
-
- if (node.multiplier > 1) {
- node.parent.count *= node.multiplier;
- }
-
- if (options.quantifiers === true && utils.isQuantifier(node.val)) {
- escaped = true;
-
- } else if (node.val.length > 1) {
- if (isType(node.parent, 'brace') && !isEscaped(node)) {
- var expanded = utils.expand(node.val, options);
- segs = expanded.segs;
-
- if (expanded.isOptimized) {
- node.parent.isOptimized = true;
- }
-
- // if nothing was expanded, we probably have a literal brace
- if (!segs.length) {
- var val = (expanded.val || node.val);
- if (options.unescape !== false) {
- // unescape unexpanded brace sequence/set separators
- val = val.replace(/\\([,.])/g, '$1');
- // strip quotes
- val = val.replace(/["'`]/g, '');
- }
-
- segs = [val];
- escaped = true;
- }
- }
-
- } else if (node.val === ',') {
- if (options.expand) {
- node.parent.queue.push(['']);
- segs = [''];
- } else {
- segs = ['|'];
- }
- } else {
- escaped = true;
- }
-
- if (escaped && isType(node.parent, 'brace')) {
- if (node.parent.nodes.length <= 4 && node.parent.count === 1) {
- node.parent.escaped = true;
- } else if (node.parent.length <= 3) {
- node.parent.escaped = true;
- }
- }
-
- if (!hasQueue(node.parent)) {
- node.parent.queue = segs;
- return;
- }
-
- var last = utils.arrayify(queue.pop());
- if (node.parent.count > 1 && options.expand) {
- last = multiply(last, node.parent.count);
- node.parent.count = 1;
- }
-
- queue.push(utils.join(utils.flatten(last), segs.shift()));
- queue.push.apply(queue, segs);
- })
-
- /**
- * Close
- */
-
- .set('brace.close', function(node) {
- var queue = node.parent.queue;
- var prev = node.parent.parent;
- var last = prev.queue.pop();
- var open = node.parent.open;
- var close = node.val;
-
- if (open && close && isOptimized(node, options)) {
- open = '(';
- close = ')';
- }
-
- // if a close brace exists, and the previous segment is one character
- // don't wrap the result in braces or parens
- var ele = utils.last(queue);
- if (node.parent.count > 1 && options.expand) {
- ele = multiply(queue.pop(), node.parent.count);
- node.parent.count = 1;
- queue.push(ele);
- }
-
- if (close && typeof ele === 'string' && ele.length === 1) {
- open = '';
- close = '';
- }
-
- if ((isLiteralBrace(node, options) || noInner(node)) && !node.parent.hasEmpty) {
- queue.push(utils.join(open, queue.pop() || ''));
- queue = utils.flatten(utils.join(queue, close));
- }
-
- if (typeof last === 'undefined') {
- prev.queue = [queue];
- } else {
- prev.queue.push(utils.flatten(utils.join(last, queue)));
- }
- })
-
- /**
- * eos
- */
-
- .set('eos', function(node) {
- if (this.input) return;
-
- if (options.optimize !== false) {
- this.output = utils.last(utils.flatten(this.ast.queue));
- } else if (Array.isArray(utils.last(this.ast.queue))) {
- this.output = utils.flatten(this.ast.queue.pop());
- } else {
- this.output = utils.flatten(this.ast.queue);
- }
-
- if (node.parent.count > 1 && options.expand) {
- this.output = multiply(this.output, node.parent.count);
- }
-
- this.output = utils.arrayify(this.output);
- this.ast.queue = [];
- });
-
-};
-
-/**
- * Multiply the segments in the current brace level
- */
-
-function multiply(queue, n, options) {
- return utils.flatten(utils.repeat(utils.arrayify(queue), n));
-}
-
-/**
- * Return true if `node` is escaped
- */
-
-function isEscaped(node) {
- return node.escaped === true;
-}
-
-/**
- * Returns true if regex parens should be used for sets. If the parent `type`
- * is not `brace`, then we're on a root node, which means we should never
- * expand segments and open/close braces should be `{}` (since this indicates
- * a brace is missing from the set)
- */
-
-function isOptimized(node, options) {
- if (node.parent.isOptimized) return true;
- return isType(node.parent, 'brace')
- && !isEscaped(node.parent)
- && options.expand !== true;
-}
-
-/**
- * Returns true if the value in `node` should be wrapped in a literal brace.
- * @return {Boolean}
- */
-
-function isLiteralBrace(node, options) {
- return isEscaped(node.parent) || options.optimize !== false;
-}
-
-/**
- * Returns true if the given `node` does not have an inner value.
- * @return {Boolean}
- */
-
-function noInner(node, type) {
- if (node.parent.queue.length === 1) {
- return true;
- }
- var nodes = node.parent.nodes;
- return nodes.length === 3
- && isType(nodes[0], 'brace.open')
- && !isType(nodes[1], 'text')
- && isType(nodes[2], 'brace.close');
-}
-
-/**
- * Returns true if the given `node` is the given `type`
- * @return {Boolean}
- */
-
-function isType(node, type) {
- return typeof node !== 'undefined' && node.type === type;
-}
-
-/**
- * Returns true if the given `node` has a non-empty queue.
- * @return {Boolean}
- */
-
-function hasQueue(node) {
- return Array.isArray(node.queue) && node.queue.length;
-}
-
-
-/***/ }),
-/* 604 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var splitString = __webpack_require__(605);
-var utils = module.exports;
-
-/**
- * Module dependencies
- */
-
-utils.extend = __webpack_require__(601);
-utils.flatten = __webpack_require__(606);
-utils.isObject = __webpack_require__(590);
-utils.fillRange = __webpack_require__(607);
-utils.repeat = __webpack_require__(612);
-utils.unique = __webpack_require__(600);
-
-utils.define = function(obj, key, val) {
- Object.defineProperty(obj, key, {
- writable: true,
- configurable: true,
- enumerable: false,
- value: val
- });
-};
-
-/**
- * Returns true if the given string contains only empty brace sets.
- */
-
-utils.isEmptySets = function(str) {
- return /^(?:\{,\})+$/.test(str);
-};
-
-/**
- * Returns true if the given string contains only empty brace sets.
- */
-
-utils.isQuotedString = function(str) {
- var open = str.charAt(0);
- if (open === '\'' || open === '"' || open === '`') {
- return str.slice(-1) === open;
- }
- return false;
-};
-
-/**
- * Create the key to use for memoization. The unique key is generated
- * by iterating over the options and concatenating key-value pairs
- * to the pattern string.
- */
-
-utils.createKey = function(pattern, options) {
- var id = pattern;
- if (typeof options === 'undefined') {
- return id;
- }
- var keys = Object.keys(options);
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- id += ';' + key + '=' + String(options[key]);
- }
- return id;
-};
-
-/**
- * Normalize options
- */
-
-utils.createOptions = function(options) {
- var opts = utils.extend.apply(null, arguments);
- if (typeof opts.expand === 'boolean') {
- opts.optimize = !opts.expand;
- }
- if (typeof opts.optimize === 'boolean') {
- opts.expand = !opts.optimize;
- }
- if (opts.optimize === true) {
- opts.makeRe = true;
- }
- return opts;
-};
-
-/**
- * Join patterns in `a` to patterns in `b`
- */
-
-utils.join = function(a, b, options) {
- options = options || {};
- a = utils.arrayify(a);
- b = utils.arrayify(b);
-
- if (!a.length) return b;
- if (!b.length) return a;
-
- var len = a.length;
- var idx = -1;
- var arr = [];
-
- while (++idx < len) {
- var val = a[idx];
- if (Array.isArray(val)) {
- for (var i = 0; i < val.length; i++) {
- val[i] = utils.join(val[i], b, options);
- }
- arr.push(val);
- continue;
- }
-
- for (var j = 0; j < b.length; j++) {
- var bval = b[j];
-
- if (Array.isArray(bval)) {
- arr.push(utils.join(val, bval, options));
- } else {
- arr.push(val + bval);
- }
- }
- }
- return arr;
-};
-
-/**
- * Split the given string on `,` if not escaped.
- */
-
-utils.split = function(str, options) {
- var opts = utils.extend({sep: ','}, options);
- if (typeof opts.keepQuotes !== 'boolean') {
- opts.keepQuotes = true;
- }
- if (opts.unescape === false) {
- opts.keepEscaping = true;
- }
- return splitString(str, opts, utils.escapeBrackets(opts));
-};
-
-/**
- * Expand ranges or sets in the given `pattern`.
- *
- * @param {String} `str`
- * @param {Object} `options`
- * @return {Object}
- */
-
-utils.expand = function(str, options) {
- var opts = utils.extend({rangeLimit: 10000}, options);
- var segs = utils.split(str, opts);
- var tok = { segs: segs };
-
- if (utils.isQuotedString(str)) {
- return tok;
- }
-
- if (opts.rangeLimit === true) {
- opts.rangeLimit = 10000;
- }
-
- if (segs.length > 1) {
- if (opts.optimize === false) {
- tok.val = segs[0];
- return tok;
- }
-
- tok.segs = utils.stringifyArray(tok.segs);
- } else if (segs.length === 1) {
- var arr = str.split('..');
-
- if (arr.length === 1) {
- tok.val = tok.segs[tok.segs.length - 1] || tok.val || str;
- tok.segs = [];
- return tok;
- }
-
- if (arr.length === 2 && arr[0] === arr[1]) {
- tok.escaped = true;
- tok.val = arr[0];
- tok.segs = [];
- return tok;
- }
-
- if (arr.length > 1) {
- if (opts.optimize !== false) {
- opts.optimize = true;
- delete opts.expand;
- }
-
- if (opts.optimize !== true) {
- var min = Math.min(arr[0], arr[1]);
- var max = Math.max(arr[0], arr[1]);
- var step = arr[2] || 1;
-
- if (opts.rangeLimit !== false && ((max - min) / step >= opts.rangeLimit)) {
- throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
- }
- }
-
- arr.push(opts);
- tok.segs = utils.fillRange.apply(null, arr);
-
- if (!tok.segs.length) {
- tok.escaped = true;
- tok.val = str;
- return tok;
- }
-
- if (opts.optimize === true) {
- tok.segs = utils.stringifyArray(tok.segs);
- }
-
- if (tok.segs === '') {
- tok.val = str;
- } else {
- tok.val = tok.segs[0];
- }
- return tok;
- }
- } else {
- tok.val = str;
- }
- return tok;
-};
-
-/**
- * Ensure commas inside brackets and parens are not split.
- * @param {Object} `tok` Token from the `split-string` module
- * @return {undefined}
- */
-
-utils.escapeBrackets = function(options) {
- return function(tok) {
- if (tok.escaped && tok.val === 'b') {
- tok.val = '\\b';
- return;
- }
-
- if (tok.val !== '(' && tok.val !== '[') return;
- var opts = utils.extend({}, options);
- var brackets = [];
- var parens = [];
- var stack = [];
- var val = tok.val;
- var str = tok.str;
- var i = tok.idx - 1;
-
- while (++i < str.length) {
- var ch = str[i];
-
- if (ch === '\\') {
- val += (opts.keepEscaping === false ? '' : ch) + str[++i];
- continue;
- }
-
- if (ch === '(') {
- parens.push(ch);
- stack.push(ch);
- }
-
- if (ch === '[') {
- brackets.push(ch);
- stack.push(ch);
- }
-
- if (ch === ')') {
- parens.pop();
- stack.pop();
- if (!stack.length) {
- val += ch;
- break;
- }
- }
-
- if (ch === ']') {
- brackets.pop();
- stack.pop();
- if (!stack.length) {
- val += ch;
- break;
- }
- }
- val += ch;
- }
-
- tok.split = false;
- tok.val = val.slice(1);
- tok.idx = i;
- };
-};
-
-/**
- * Returns true if the given string looks like a regex quantifier
- * @return {Boolean}
- */
-
-utils.isQuantifier = function(str) {
- return /^(?:[0-9]?,[0-9]|[0-9],)$/.test(str);
-};
-
-/**
- * Cast `val` to an array.
- * @param {*} `val`
- */
-
-utils.stringifyArray = function(arr) {
- return [utils.arrayify(arr).join('|')];
-};
-
-/**
- * Cast `val` to an array.
- * @param {*} `val`
- */
-
-utils.arrayify = function(arr) {
- if (typeof arr === 'undefined') {
- return [];
- }
- if (typeof arr === 'string') {
- return [arr];
- }
- return arr;
-};
-
-/**
- * Returns true if the given `str` is a non-empty string
- * @return {Boolean}
- */
-
-utils.isString = function(str) {
- return str != null && typeof str === 'string';
-};
-
-/**
- * Get the last element from `array`
- * @param {Array} `array`
- * @return {*}
- */
-
-utils.last = function(arr, n) {
- return arr[arr.length - (n || 1)];
-};
-
-utils.escapeRegex = function(str) {
- return str.replace(/\\?([!^*?()[\]{}+?/])/g, '\\$1');
-};
-
-
-/***/ }),
-/* 605 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * split-string
- *
- * Copyright (c) 2015-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var extend = __webpack_require__(595);
-
-module.exports = function(str, options, fn) {
- if (typeof str !== 'string') {
- throw new TypeError('expected a string');
- }
-
- if (typeof options === 'function') {
- fn = options;
- options = null;
- }
-
- // allow separator to be defined as a string
- if (typeof options === 'string') {
- options = { sep: options };
- }
-
- var opts = extend({sep: '.'}, options);
- var quotes = opts.quotes || ['"', "'", '`'];
- var brackets;
-
- if (opts.brackets === true) {
- brackets = {
- '<': '>',
- '(': ')',
- '[': ']',
- '{': '}'
- };
- } else if (opts.brackets) {
- brackets = opts.brackets;
- }
-
- var tokens = [];
- var stack = [];
- var arr = [''];
- var sep = opts.sep;
- var len = str.length;
- var idx = -1;
- var closeIdx;
-
- function expected() {
- if (brackets && stack.length) {
- return brackets[stack[stack.length - 1]];
- }
- }
-
- while (++idx < len) {
- var ch = str[idx];
- var next = str[idx + 1];
- var tok = { val: ch, idx: idx, arr: arr, str: str };
- tokens.push(tok);
-
- if (ch === '\\') {
- tok.val = keepEscaping(opts, str, idx) === true ? (ch + next) : next;
- tok.escaped = true;
- if (typeof fn === 'function') {
- fn(tok);
- }
- arr[arr.length - 1] += tok.val;
- idx++;
- continue;
- }
-
- if (brackets && brackets[ch]) {
- stack.push(ch);
- var e = expected();
- var i = idx + 1;
-
- if (str.indexOf(e, i + 1) !== -1) {
- while (stack.length && i < len) {
- var s = str[++i];
- if (s === '\\') {
- s++;
- continue;
- }
-
- if (quotes.indexOf(s) !== -1) {
- i = getClosingQuote(str, s, i + 1);
- continue;
- }
-
- e = expected();
- if (stack.length && str.indexOf(e, i + 1) === -1) {
- break;
- }
-
- if (brackets[s]) {
- stack.push(s);
- continue;
- }
-
- if (e === s) {
- stack.pop();
- }
- }
- }
-
- closeIdx = i;
- if (closeIdx === -1) {
- arr[arr.length - 1] += ch;
- continue;
- }
-
- ch = str.slice(idx, closeIdx + 1);
- tok.val = ch;
- tok.idx = idx = closeIdx;
- }
-
- if (quotes.indexOf(ch) !== -1) {
- closeIdx = getClosingQuote(str, ch, idx + 1);
- if (closeIdx === -1) {
- arr[arr.length - 1] += ch;
- continue;
- }
-
- if (keepQuotes(ch, opts) === true) {
- ch = str.slice(idx, closeIdx + 1);
- } else {
- ch = str.slice(idx + 1, closeIdx);
- }
-
- tok.val = ch;
- tok.idx = idx = closeIdx;
- }
-
- if (typeof fn === 'function') {
- fn(tok, tokens);
- ch = tok.val;
- idx = tok.idx;
- }
-
- if (tok.val === sep && tok.split !== false) {
- arr.push('');
- continue;
- }
-
- arr[arr.length - 1] += tok.val;
- }
-
- return arr;
-};
-
-function getClosingQuote(str, ch, i, brackets) {
- var idx = str.indexOf(ch, i);
- if (str.charAt(idx - 1) === '\\') {
- return getClosingQuote(str, ch, idx + 1);
- }
- return idx;
-}
-
-function keepQuotes(ch, opts) {
- if (opts.keepDoubleQuotes === true && ch === '"') return true;
- if (opts.keepSingleQuotes === true && ch === "'") return true;
- return opts.keepQuotes;
-}
-
-function keepEscaping(opts, str, idx) {
- if (typeof opts.keepEscaping === 'function') {
- return opts.keepEscaping(str, idx);
- }
- return opts.keepEscaping === true || str[idx + 1] === '\\';
-}
-
-
-/***/ }),
-/* 606 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * arr-flatten
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-module.exports = function (arr) {
- return flat(arr, []);
-};
-
-function flat(arr, res) {
- var i = 0, cur;
- var len = arr.length;
- for (; i < len; i++) {
- cur = arr[i];
- Array.isArray(cur) ? flat(cur, res) : res.push(cur);
- }
- return res;
-}
-
-
-/***/ }),
-/* 607 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * fill-range
- *
- * Copyright (c) 2014-2015, 2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var util = __webpack_require__(112);
-var isNumber = __webpack_require__(608);
-var extend = __webpack_require__(609);
-var repeat = __webpack_require__(610);
-var toRegex = __webpack_require__(611);
-
-/**
- * Return a range of numbers or letters.
- *
- * @param {String} `start` Start of the range
- * @param {String} `stop` End of the range
- * @param {String} `step` Increment or decrement to use.
- * @param {Function} `fn` Custom function to modify each element in the range.
- * @return {Array}
- */
-
-function fillRange(start, stop, step, options) {
- if (typeof start === 'undefined') {
- return [];
- }
-
- if (typeof stop === 'undefined' || start === stop) {
- // special case, for handling negative zero
- var isString = typeof start === 'string';
- if (isNumber(start) && !toNumber(start)) {
- return [isString ? '0' : 0];
- }
- return [start];
- }
-
- if (typeof step !== 'number' && typeof step !== 'string') {
- options = step;
- step = undefined;
- }
-
- if (typeof options === 'function') {
- options = { transform: options };
- }
-
- var opts = extend({step: step}, options);
- if (opts.step && !isValidNumber(opts.step)) {
- if (opts.strictRanges === true) {
- throw new TypeError('expected options.step to be a number');
- }
- return [];
- }
-
- opts.isNumber = isValidNumber(start) && isValidNumber(stop);
- if (!opts.isNumber && !isValid(start, stop)) {
- if (opts.strictRanges === true) {
- throw new RangeError('invalid range arguments: ' + util.inspect([start, stop]));
- }
- return [];
- }
-
- opts.isPadded = isPadded(start) || isPadded(stop);
- opts.toString = opts.stringify
- || typeof opts.step === 'string'
- || typeof start === 'string'
- || typeof stop === 'string'
- || !opts.isNumber;
-
- if (opts.isPadded) {
- opts.maxLength = Math.max(String(start).length, String(stop).length);
- }
-
- // support legacy minimatch/fill-range options
- if (typeof opts.optimize === 'boolean') opts.toRegex = opts.optimize;
- if (typeof opts.makeRe === 'boolean') opts.toRegex = opts.makeRe;
- return expand(start, stop, opts);
-}
-
-function expand(start, stop, options) {
- var a = options.isNumber ? toNumber(start) : start.charCodeAt(0);
- var b = options.isNumber ? toNumber(stop) : stop.charCodeAt(0);
-
- var step = Math.abs(toNumber(options.step)) || 1;
- if (options.toRegex && step === 1) {
- return toRange(a, b, start, stop, options);
- }
-
- var zero = {greater: [], lesser: []};
- var asc = a < b;
- var arr = new Array(Math.round((asc ? b - a : a - b) / step));
- var idx = 0;
-
- while (asc ? a <= b : a >= b) {
- var val = options.isNumber ? a : String.fromCharCode(a);
- if (options.toRegex && (val >= 0 || !options.isNumber)) {
- zero.greater.push(val);
- } else {
- zero.lesser.push(Math.abs(val));
- }
-
- if (options.isPadded) {
- val = zeros(val, options);
- }
-
- if (options.toString) {
- val = String(val);
- }
-
- if (typeof options.transform === 'function') {
- arr[idx++] = options.transform(val, a, b, step, idx, arr, options);
- } else {
- arr[idx++] = val;
- }
-
- if (asc) {
- a += step;
- } else {
- a -= step;
- }
- }
-
- if (options.toRegex === true) {
- return toSequence(arr, zero, options);
- }
- return arr;
-}
-
-function toRange(a, b, start, stop, options) {
- if (options.isPadded) {
- return toRegex(start, stop, options);
- }
-
- if (options.isNumber) {
- return toRegex(Math.min(a, b), Math.max(a, b), options);
- }
-
- var start = String.fromCharCode(Math.min(a, b));
- var stop = String.fromCharCode(Math.max(a, b));
- return '[' + start + '-' + stop + ']';
-}
-
-function toSequence(arr, zeros, options) {
- var greater = '', lesser = '';
- if (zeros.greater.length) {
- greater = zeros.greater.join('|');
- }
- if (zeros.lesser.length) {
- lesser = '-(' + zeros.lesser.join('|') + ')';
- }
- var res = greater && lesser
- ? greater + '|' + lesser
- : greater || lesser;
-
- if (options.capture) {
- return '(' + res + ')';
- }
- return res;
-}
-
-function zeros(val, options) {
- if (options.isPadded) {
- var str = String(val);
- var len = str.length;
- var dash = '';
- if (str.charAt(0) === '-') {
- dash = '-';
- str = str.slice(1);
- }
- var diff = options.maxLength - len;
- var pad = repeat('0', diff);
- val = (dash + pad + str);
- }
- if (options.stringify) {
- return String(val);
- }
- return val;
-}
-
-function toNumber(val) {
- return Number(val) || 0;
-}
-
-function isPadded(str) {
- return /^-?0\d/.test(str);
-}
-
-function isValid(min, max) {
- return (isValidNumber(min) || isValidLetter(min))
- && (isValidNumber(max) || isValidLetter(max));
-}
-
-function isValidLetter(ch) {
- return typeof ch === 'string' && ch.length === 1 && /^\w+$/.test(ch);
-}
-
-function isValidNumber(n) {
- return isNumber(n) && !/\./.test(n);
-}
-
-/**
- * Expose `fillRange`
- * @type {Function}
- */
-
-module.exports = fillRange;
-
-
-/***/ }),
-/* 608 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-number
- *
- * Copyright (c) 2014-2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-
-module.exports = function isNumber(num) {
- var type = typeOf(num);
-
- if (type === 'string') {
- if (!num.trim()) return false;
- } else if (type !== 'number') {
- return false;
- }
-
- return (num - num + 1) >= 0;
-};
-
-
-/***/ }),
-/* 609 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var isObject = __webpack_require__(602);
-
-module.exports = function extend(o/*, objects*/) {
- if (!isObject(o)) { o = {}; }
-
- var len = arguments.length;
- for (var i = 1; i < len; i++) {
- var obj = arguments[i];
-
- if (isObject(obj)) {
- assign(o, obj);
- }
- }
- return o;
-};
-
-function assign(a, b) {
- for (var key in b) {
- if (hasOwn(b, key)) {
- a[key] = b[key];
- }
- }
-}
-
-/**
- * Returns true if the given `key` is an own property of `obj`.
- */
-
-function hasOwn(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
-}
-
-
-/***/ }),
-/* 610 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * repeat-string
- *
- * Copyright (c) 2014-2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-/**
- * Results cache
- */
-
-var res = '';
-var cache;
-
-/**
- * Expose `repeat`
- */
-
-module.exports = repeat;
-
-/**
- * Repeat the given `string` the specified `number`
- * of times.
- *
- * **Example:**
- *
- * ```js
- * var repeat = require('repeat-string');
- * repeat('A', 5);
- * //=> AAAAA
- * ```
- *
- * @param {String} `string` The string to repeat
- * @param {Number} `number` The number of times to repeat the string
- * @return {String} Repeated string
- * @api public
- */
-
-function repeat(str, num) {
- if (typeof str !== 'string') {
- throw new TypeError('expected a string');
- }
-
- // cover common, quick use cases
- if (num === 1) return str;
- if (num === 2) return str + str;
-
- var max = str.length * num;
- if (cache !== str || typeof cache === 'undefined') {
- cache = str;
- res = '';
- } else if (res.length >= max) {
- return res.substr(0, max);
- }
-
- while (max > res.length && num > 1) {
- if (num & 1) {
- res += str;
- }
-
- num >>= 1;
- str += str;
- }
-
- res += str;
- res = res.substr(0, max);
- return res;
-}
-
-
-/***/ }),
-/* 611 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * to-regex-range
- *
- * Copyright (c) 2015, 2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var repeat = __webpack_require__(610);
-var isNumber = __webpack_require__(608);
-var cache = {};
-
-function toRegexRange(min, max, options) {
- if (isNumber(min) === false) {
- throw new RangeError('toRegexRange: first argument is invalid.');
- }
-
- if (typeof max === 'undefined' || min === max) {
- return String(min);
- }
-
- if (isNumber(max) === false) {
- throw new RangeError('toRegexRange: second argument is invalid.');
- }
-
- options = options || {};
- var relax = String(options.relaxZeros);
- var shorthand = String(options.shorthand);
- var capture = String(options.capture);
- var key = min + ':' + max + '=' + relax + shorthand + capture;
- if (cache.hasOwnProperty(key)) {
- return cache[key].result;
- }
-
- var a = Math.min(min, max);
- var b = Math.max(min, max);
-
- if (Math.abs(a - b) === 1) {
- var result = min + '|' + max;
- if (options.capture) {
- return '(' + result + ')';
- }
- return result;
- }
-
- var isPadded = padding(min) || padding(max);
- var positives = [];
- var negatives = [];
-
- var tok = {min: min, max: max, a: a, b: b};
- if (isPadded) {
- tok.isPadded = isPadded;
- tok.maxLen = String(tok.max).length;
- }
-
- if (a < 0) {
- var newMin = b < 0 ? Math.abs(b) : 1;
- var newMax = Math.abs(a);
- negatives = splitToPatterns(newMin, newMax, tok, options);
- a = tok.a = 0;
- }
-
- if (b >= 0) {
- positives = splitToPatterns(a, b, tok, options);
- }
-
- tok.negatives = negatives;
- tok.positives = positives;
- tok.result = siftPatterns(negatives, positives, options);
-
- if (options.capture && (positives.length + negatives.length) > 1) {
- tok.result = '(' + tok.result + ')';
- }
-
- cache[key] = tok;
- return tok.result;
-}
-
-function siftPatterns(neg, pos, options) {
- var onlyNegative = filterPatterns(neg, pos, '-', false, options) || [];
- var onlyPositive = filterPatterns(pos, neg, '', false, options) || [];
- var intersected = filterPatterns(neg, pos, '-?', true, options) || [];
- var subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
- return subpatterns.join('|');
-}
-
-function splitToRanges(min, max) {
- min = Number(min);
- max = Number(max);
-
- var nines = 1;
- var stops = [max];
- var stop = +countNines(min, nines);
-
- while (min <= stop && stop <= max) {
- stops = push(stops, stop);
- nines += 1;
- stop = +countNines(min, nines);
- }
-
- var zeros = 1;
- stop = countZeros(max + 1, zeros) - 1;
-
- while (min < stop && stop <= max) {
- stops = push(stops, stop);
- zeros += 1;
- stop = countZeros(max + 1, zeros) - 1;
- }
-
- stops.sort(compare);
- return stops;
-}
-
-/**
- * Convert a range to a regex pattern
- * @param {Number} `start`
- * @param {Number} `stop`
- * @return {String}
- */
-
-function rangeToPattern(start, stop, options) {
- if (start === stop) {
- return {pattern: String(start), digits: []};
- }
-
- var zipped = zip(String(start), String(stop));
- var len = zipped.length, i = -1;
-
- var pattern = '';
- var digits = 0;
-
- while (++i < len) {
- var numbers = zipped[i];
- var startDigit = numbers[0];
- var stopDigit = numbers[1];
-
- if (startDigit === stopDigit) {
- pattern += startDigit;
-
- } else if (startDigit !== '0' || stopDigit !== '9') {
- pattern += toCharacterClass(startDigit, stopDigit);
-
- } else {
- digits += 1;
- }
- }
-
- if (digits) {
- pattern += options.shorthand ? '\\d' : '[0-9]';
- }
-
- return { pattern: pattern, digits: [digits] };
-}
-
-function splitToPatterns(min, max, tok, options) {
- var ranges = splitToRanges(min, max);
- var len = ranges.length;
- var idx = -1;
-
- var tokens = [];
- var start = min;
- var prev;
-
- while (++idx < len) {
- var range = ranges[idx];
- var obj = rangeToPattern(start, range, options);
- var zeros = '';
-
- if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
- if (prev.digits.length > 1) {
- prev.digits.pop();
- }
- prev.digits.push(obj.digits[0]);
- prev.string = prev.pattern + toQuantifier(prev.digits);
- start = range + 1;
- continue;
- }
-
- if (tok.isPadded) {
- zeros = padZeros(range, tok);
- }
-
- obj.string = zeros + obj.pattern + toQuantifier(obj.digits);
- tokens.push(obj);
- start = range + 1;
- prev = obj;
- }
-
- return tokens;
-}
-
-function filterPatterns(arr, comparison, prefix, intersection, options) {
- var res = [];
-
- for (var i = 0; i < arr.length; i++) {
- var tok = arr[i];
- var ele = tok.string;
-
- if (options.relaxZeros !== false) {
- if (prefix === '-' && ele.charAt(0) === '0') {
- if (ele.charAt(1) === '{') {
- ele = '0*' + ele.replace(/^0\{\d+\}/, '');
- } else {
- ele = '0*' + ele.slice(1);
- }
- }
- }
-
- if (!intersection && !contains(comparison, 'string', ele)) {
- res.push(prefix + ele);
- }
-
- if (intersection && contains(comparison, 'string', ele)) {
- res.push(prefix + ele);
- }
- }
- return res;
-}
-
-/**
- * Zip strings (`for in` can be used on string characters)
- */
-
-function zip(a, b) {
- var arr = [];
- for (var ch in a) arr.push([a[ch], b[ch]]);
- return arr;
-}
-
-function compare(a, b) {
- return a > b ? 1 : b > a ? -1 : 0;
-}
-
-function push(arr, ele) {
- if (arr.indexOf(ele) === -1) arr.push(ele);
- return arr;
-}
-
-function contains(arr, key, val) {
- for (var i = 0; i < arr.length; i++) {
- if (arr[i][key] === val) {
- return true;
- }
- }
- return false;
-}
-
-function countNines(min, len) {
- return String(min).slice(0, -len) + repeat('9', len);
-}
-
-function countZeros(integer, zeros) {
- return integer - (integer % Math.pow(10, zeros));
-}
-
-function toQuantifier(digits) {
- var start = digits[0];
- var stop = digits[1] ? (',' + digits[1]) : '';
- if (!stop && (!start || start === 1)) {
- return '';
- }
- return '{' + start + stop + '}';
-}
-
-function toCharacterClass(a, b) {
- return '[' + a + ((b - a === 1) ? '' : '-') + b + ']';
-}
-
-function padding(str) {
- return /^-?(0+)\d/.exec(str);
-}
-
-function padZeros(val, tok) {
- if (tok.isPadded) {
- var diff = Math.abs(tok.maxLen - String(val).length);
- switch (diff) {
- case 0:
- return '';
- case 1:
- return '0';
- default: {
- return '0{' + diff + '}';
- }
- }
- }
- return val;
-}
-
-/**
- * Expose `toRegexRange`
- */
-
-module.exports = toRegexRange;
-
-
-/***/ }),
-/* 612 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * repeat-element
- *
- * Copyright (c) 2015-present, Jon Schlinkert.
- * Licensed under the MIT license.
- */
-
-
-
-module.exports = function repeat(ele, num) {
- if (Array.prototype.fill) {
- return new Array(num).fill(ele);
- }
-
- var arr = new Array(num);
-
- for (var i = 0; i < num; i++) {
- arr[i] = ele;
- }
-
- return arr;
-};
-
-
-/***/ }),
-/* 613 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Node = __webpack_require__(614);
-var utils = __webpack_require__(604);
-
-/**
- * Braces parsers
- */
-
-module.exports = function(braces, options) {
- braces.parser
- .set('bos', function() {
- if (!this.parsed) {
- this.ast = this.nodes[0] = new Node(this.ast);
- }
- })
-
- /**
- * Character parsers
- */
-
- .set('escape', function() {
- var pos = this.position();
- var m = this.match(/^(?:\\(.)|\$\{)/);
- if (!m) return;
-
- var prev = this.prev();
- var last = utils.last(prev.nodes);
-
- var node = pos(new Node({
- type: 'text',
- multiplier: 1,
- val: m[0]
- }));
-
- if (node.val === '\\\\') {
- return node;
- }
-
- if (node.val === '${') {
- var str = this.input;
- var idx = -1;
- var ch;
-
- while ((ch = str[++idx])) {
- this.consume(1);
- node.val += ch;
- if (ch === '\\') {
- node.val += str[++idx];
- continue;
- }
- if (ch === '}') {
- break;
- }
- }
- }
-
- if (this.options.unescape !== false) {
- node.val = node.val.replace(/\\([{}])/g, '$1');
- }
-
- if (last.val === '"' && this.input.charAt(0) === '"') {
- last.val = node.val;
- this.consume(1);
- return;
- }
-
- return concatNodes.call(this, pos, node, prev, options);
- })
-
- /**
- * Brackets: "[...]" (basic, this is overridden by
- * other parsers in more advanced implementations)
- */
-
- .set('bracket', function() {
- var isInside = this.isInside('brace');
- var pos = this.position();
- var m = this.match(/^(?:\[([!^]?)([^\]]{2,}|\]-)(\]|[^*+?]+)|\[)/);
- if (!m) return;
-
- var prev = this.prev();
- var val = m[0];
- var negated = m[1] ? '^' : '';
- var inner = m[2] || '';
- var close = m[3] || '';
-
- if (isInside && prev.type === 'brace') {
- prev.text = prev.text || '';
- prev.text += val;
- }
-
- var esc = this.input.slice(0, 2);
- if (inner === '' && esc === '\\]') {
- inner += esc;
- this.consume(2);
-
- var str = this.input;
- var idx = -1;
- var ch;
-
- while ((ch = str[++idx])) {
- this.consume(1);
- if (ch === ']') {
- close = ch;
- break;
- }
- inner += ch;
- }
- }
-
- return pos(new Node({
- type: 'bracket',
- val: val,
- escaped: close !== ']',
- negated: negated,
- inner: inner,
- close: close
- }));
- })
-
- /**
- * Empty braces (we capture these early to
- * speed up processing in the compiler)
- */
-
- .set('multiplier', function() {
- var isInside = this.isInside('brace');
- var pos = this.position();
- var m = this.match(/^\{((?:,|\{,+\})+)\}/);
- if (!m) return;
-
- this.multiplier = true;
- var prev = this.prev();
- var val = m[0];
-
- if (isInside && prev.type === 'brace') {
- prev.text = prev.text || '';
- prev.text += val;
- }
-
- var node = pos(new Node({
- type: 'text',
- multiplier: 1,
- match: m,
- val: val
- }));
-
- return concatNodes.call(this, pos, node, prev, options);
- })
-
- /**
- * Open
- */
-
- .set('brace.open', function() {
- var pos = this.position();
- var m = this.match(/^\{(?!(?:[^\\}]?|,+)\})/);
- if (!m) return;
-
- var prev = this.prev();
- var last = utils.last(prev.nodes);
-
- // if the last parsed character was an extglob character
- // we need to _not optimize_ the brace pattern because
- // it might be mistaken for an extglob by a downstream parser
- if (last && last.val && isExtglobChar(last.val.slice(-1))) {
- last.optimize = false;
- }
-
- var open = pos(new Node({
- type: 'brace.open',
- val: m[0]
- }));
-
- var node = pos(new Node({
- type: 'brace',
- nodes: []
- }));
-
- node.push(open);
- prev.push(node);
- this.push('brace', node);
- })
-
- /**
- * Close
- */
-
- .set('brace.close', function() {
- var pos = this.position();
- var m = this.match(/^\}/);
- if (!m || !m[0]) return;
-
- var brace = this.pop('brace');
- var node = pos(new Node({
- type: 'brace.close',
- val: m[0]
- }));
-
- if (!this.isType(brace, 'brace')) {
- if (this.options.strict) {
- throw new Error('missing opening "{"');
- }
- node.type = 'text';
- node.multiplier = 0;
- node.escaped = true;
- return node;
- }
-
- var prev = this.prev();
- var last = utils.last(prev.nodes);
- if (last.text) {
- var lastNode = utils.last(last.nodes);
- if (lastNode.val === ')' && /[!@*?+]\(/.test(last.text)) {
- var open = last.nodes[0];
- var text = last.nodes[1];
- if (open.type === 'brace.open' && text && text.type === 'text') {
- text.optimize = false;
- }
- }
- }
-
- if (brace.nodes.length > 2) {
- var first = brace.nodes[1];
- if (first.type === 'text' && first.val === ',') {
- brace.nodes.splice(1, 1);
- brace.nodes.push(first);
- }
- }
-
- brace.push(node);
- })
-
- /**
- * Capture boundary characters
- */
-
- .set('boundary', function() {
- var pos = this.position();
- var m = this.match(/^[$^](?!\{)/);
- if (!m) return;
- return pos(new Node({
- type: 'text',
- val: m[0]
- }));
- })
-
- /**
- * One or zero, non-comma characters wrapped in braces
- */
-
- .set('nobrace', function() {
- var isInside = this.isInside('brace');
- var pos = this.position();
- var m = this.match(/^\{[^,]?\}/);
- if (!m) return;
-
- var prev = this.prev();
- var val = m[0];
-
- if (isInside && prev.type === 'brace') {
- prev.text = prev.text || '';
- prev.text += val;
- }
-
- return pos(new Node({
- type: 'text',
- multiplier: 0,
- val: val
- }));
- })
-
- /**
- * Text
- */
-
- .set('text', function() {
- var isInside = this.isInside('brace');
- var pos = this.position();
- var m = this.match(/^((?!\\)[^${}[\]])+/);
- if (!m) return;
-
- var prev = this.prev();
- var val = m[0];
-
- if (isInside && prev.type === 'brace') {
- prev.text = prev.text || '';
- prev.text += val;
- }
-
- var node = pos(new Node({
- type: 'text',
- multiplier: 1,
- val: val
- }));
-
- return concatNodes.call(this, pos, node, prev, options);
- });
-};
-
-/**
- * Returns true if the character is an extglob character.
- */
-
-function isExtglobChar(ch) {
- return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';
-}
-
-/**
- * Combine text nodes, and calculate empty sets (`{,,}`)
- * @param {Function} `pos` Function to calculate node position
- * @param {Object} `node` AST node
- * @return {Object}
- */
-
-function concatNodes(pos, node, parent, options) {
- node.orig = node.val;
- var prev = this.prev();
- var last = utils.last(prev.nodes);
- var isEscaped = false;
-
- if (node.val.length > 1) {
- var a = node.val.charAt(0);
- var b = node.val.slice(-1);
-
- isEscaped = (a === '"' && b === '"')
- || (a === "'" && b === "'")
- || (a === '`' && b === '`');
- }
-
- if (isEscaped && options.unescape !== false) {
- node.val = node.val.slice(1, node.val.length - 1);
- node.escaped = true;
- }
-
- if (node.match) {
- var match = node.match[1];
- if (!match || match.indexOf('}') === -1) {
- match = node.match[0];
- }
-
- // replace each set with a single ","
- var val = match.replace(/\{/g, ',').replace(/\}/g, '');
- node.multiplier *= val.length;
- node.val = '';
- }
-
- var simpleText = last.type === 'text'
- && last.multiplier === 1
- && node.multiplier === 1
- && node.val;
-
- if (simpleText) {
- last.val += node.val;
- return;
- }
-
- prev.push(node);
-}
-
-
-/***/ }),
-/* 614 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var isObject = __webpack_require__(590);
-var define = __webpack_require__(615);
-var utils = __webpack_require__(616);
-var ownNames;
-
-/**
- * Create a new AST `Node` with the given `val` and `type`.
- *
- * ```js
- * var node = new Node('*', 'Star');
- * var node = new Node({type: 'star', val: '*'});
- * ```
- * @name Node
- * @param {String|Object} `val` Pass a matched substring, or an object to merge onto the node.
- * @param {String} `type` The node type to use when `val` is a string.
- * @return {Object} node instance
- * @api public
- */
-
-function Node(val, type, parent) {
- if (typeof type !== 'string') {
- parent = type;
- type = null;
- }
-
- define(this, 'parent', parent);
- define(this, 'isNode', true);
- define(this, 'expect', null);
-
- if (typeof type !== 'string' && isObject(val)) {
- lazyKeys();
- var keys = Object.keys(val);
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (ownNames.indexOf(key) === -1) {
- this[key] = val[key];
- }
- }
- } else {
- this.type = type;
- this.val = val;
- }
-}
-
-/**
- * Returns true if the given value is a node.
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var node = new Node({type: 'foo'});
- * console.log(Node.isNode(node)); //=> true
- * console.log(Node.isNode({})); //=> false
- * ```
- * @param {Object} `node`
- * @returns {Boolean}
- * @api public
- */
-
-Node.isNode = function(node) {
- return utils.isNode(node);
-};
-
-/**
- * Define a non-enumberable property on the node instance.
- * Useful for adding properties that shouldn't be extended
- * or visible during debugging.
- *
- * ```js
- * var node = new Node();
- * node.define('foo', 'something non-enumerable');
- * ```
- * @param {String} `name`
- * @param {any} `val`
- * @return {Object} returns the node instance
- * @api public
- */
-
-Node.prototype.define = function(name, val) {
- define(this, name, val);
- return this;
-};
-
-/**
- * Returns true if `node.val` is an empty string, or `node.nodes` does
- * not contain any non-empty text nodes.
- *
- * ```js
- * var node = new Node({type: 'text'});
- * node.isEmpty(); //=> true
- * node.val = 'foo';
- * node.isEmpty(); //=> false
- * ```
- * @param {Function} `fn` (optional) Filter function that is called on `node` and/or child nodes. `isEmpty` will return false immediately when the filter function returns false on any nodes.
- * @return {Boolean}
- * @api public
- */
-
-Node.prototype.isEmpty = function(fn) {
- return utils.isEmpty(this, fn);
-};
-
-/**
- * Given node `foo` and node `bar`, push node `bar` onto `foo.nodes`, and
- * set `foo` as `bar.parent`.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * foo.push(bar);
- * ```
- * @param {Object} `node`
- * @return {Number} Returns the length of `node.nodes`
- * @api public
- */
-
-Node.prototype.push = function(node) {
- assert(Node.isNode(node), 'expected node to be an instance of Node');
- define(node, 'parent', this);
-
- this.nodes = this.nodes || [];
- return this.nodes.push(node);
-};
-
-/**
- * Given node `foo` and node `bar`, unshift node `bar` onto `foo.nodes`, and
- * set `foo` as `bar.parent`.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * foo.unshift(bar);
- * ```
- * @param {Object} `node`
- * @return {Number} Returns the length of `node.nodes`
- * @api public
- */
-
-Node.prototype.unshift = function(node) {
- assert(Node.isNode(node), 'expected node to be an instance of Node');
- define(node, 'parent', this);
-
- this.nodes = this.nodes || [];
- return this.nodes.unshift(node);
-};
-
-/**
- * Pop a node from `node.nodes`.
- *
- * ```js
- * var node = new Node({type: 'foo'});
- * node.push(new Node({type: 'a'}));
- * node.push(new Node({type: 'b'}));
- * node.push(new Node({type: 'c'}));
- * node.push(new Node({type: 'd'}));
- * console.log(node.nodes.length);
- * //=> 4
- * node.pop();
- * console.log(node.nodes.length);
- * //=> 3
- * ```
- * @return {Number} Returns the popped `node`
- * @api public
- */
-
-Node.prototype.pop = function() {
- return this.nodes && this.nodes.pop();
-};
-
-/**
- * Shift a node from `node.nodes`.
- *
- * ```js
- * var node = new Node({type: 'foo'});
- * node.push(new Node({type: 'a'}));
- * node.push(new Node({type: 'b'}));
- * node.push(new Node({type: 'c'}));
- * node.push(new Node({type: 'd'}));
- * console.log(node.nodes.length);
- * //=> 4
- * node.shift();
- * console.log(node.nodes.length);
- * //=> 3
- * ```
- * @return {Object} Returns the shifted `node`
- * @api public
- */
-
-Node.prototype.shift = function() {
- return this.nodes && this.nodes.shift();
-};
-
-/**
- * Remove `node` from `node.nodes`.
- *
- * ```js
- * node.remove(childNode);
- * ```
- * @param {Object} `node`
- * @return {Object} Returns the removed node.
- * @api public
- */
-
-Node.prototype.remove = function(node) {
- assert(Node.isNode(node), 'expected node to be an instance of Node');
- this.nodes = this.nodes || [];
- var idx = node.index;
- if (idx !== -1) {
- node.index = -1;
- return this.nodes.splice(idx, 1);
- }
- return null;
-};
-
-/**
- * Get the first child node from `node.nodes` that matches the given `type`.
- * If `type` is a number, the child node at that index is returned.
- *
- * ```js
- * var child = node.find(1); //<= index of the node to get
- * var child = node.find('foo'); //<= node.type of a child node
- * var child = node.find(/^(foo|bar)$/); //<= regex to match node.type
- * var child = node.find(['foo', 'bar']); //<= array of node.type(s)
- * ```
- * @param {String} `type`
- * @return {Object} Returns a child node or undefined.
- * @api public
- */
-
-Node.prototype.find = function(type) {
- return utils.findNode(this.nodes, type);
-};
-
-/**
- * Return true if the node is the given `type`.
- *
- * ```js
- * var node = new Node({type: 'bar'});
- * cosole.log(node.isType('foo')); // false
- * cosole.log(node.isType(/^(foo|bar)$/)); // true
- * cosole.log(node.isType(['foo', 'bar'])); // true
- * ```
- * @param {String} `type`
- * @return {Boolean}
- * @api public
- */
-
-Node.prototype.isType = function(type) {
- return utils.isType(this, type);
-};
-
-/**
- * Return true if the `node.nodes` has the given `type`.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * foo.push(bar);
- *
- * cosole.log(foo.hasType('qux')); // false
- * cosole.log(foo.hasType(/^(qux|bar)$/)); // true
- * cosole.log(foo.hasType(['qux', 'bar'])); // true
- * ```
- * @param {String} `type`
- * @return {Boolean}
- * @api public
- */
-
-Node.prototype.hasType = function(type) {
- return utils.hasType(this, type);
-};
-
-/**
- * Get the siblings array, or `null` if it doesn't exist.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * var baz = new Node({type: 'baz'});
- * foo.push(bar);
- * foo.push(baz);
- *
- * console.log(bar.siblings.length) // 2
- * console.log(baz.siblings.length) // 2
- * ```
- * @return {Array}
- * @api public
- */
-
-Object.defineProperty(Node.prototype, 'siblings', {
- set: function() {
- throw new Error('node.siblings is a getter and cannot be defined');
- },
- get: function() {
- return this.parent ? this.parent.nodes : null;
- }
-});
-
-/**
- * Get the node's current index from `node.parent.nodes`.
- * This should always be correct, even when the parent adds nodes.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * var baz = new Node({type: 'baz'});
- * var qux = new Node({type: 'qux'});
- * foo.push(bar);
- * foo.push(baz);
- * foo.unshift(qux);
- *
- * console.log(bar.index) // 1
- * console.log(baz.index) // 2
- * console.log(qux.index) // 0
- * ```
- * @return {Number}
- * @api public
- */
-
-Object.defineProperty(Node.prototype, 'index', {
- set: function(index) {
- define(this, 'idx', index);
- },
- get: function() {
- if (!Array.isArray(this.siblings)) {
- return -1;
- }
- var tok = this.idx !== -1 ? this.siblings[this.idx] : null;
- if (tok !== this) {
- this.idx = this.siblings.indexOf(this);
- }
- return this.idx;
- }
-});
-
-/**
- * Get the previous node from the siblings array or `null`.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * var baz = new Node({type: 'baz'});
- * foo.push(bar);
- * foo.push(baz);
- *
- * console.log(baz.prev.type) // 'bar'
- * ```
- * @return {Object}
- * @api public
- */
-
-Object.defineProperty(Node.prototype, 'prev', {
- set: function() {
- throw new Error('node.prev is a getter and cannot be defined');
- },
- get: function() {
- if (Array.isArray(this.siblings)) {
- return this.siblings[this.index - 1] || this.parent.prev;
- }
- return null;
- }
-});
-
-/**
- * Get the siblings array, or `null` if it doesn't exist.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * var baz = new Node({type: 'baz'});
- * foo.push(bar);
- * foo.push(baz);
- *
- * console.log(bar.siblings.length) // 2
- * console.log(baz.siblings.length) // 2
- * ```
- * @return {Object}
- * @api public
- */
-
-Object.defineProperty(Node.prototype, 'next', {
- set: function() {
- throw new Error('node.next is a getter and cannot be defined');
- },
- get: function() {
- if (Array.isArray(this.siblings)) {
- return this.siblings[this.index + 1] || this.parent.next;
- }
- return null;
- }
-});
-
-/**
- * Get the first node from `node.nodes`.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * var baz = new Node({type: 'baz'});
- * var qux = new Node({type: 'qux'});
- * foo.push(bar);
- * foo.push(baz);
- * foo.push(qux);
- *
- * console.log(foo.first.type) // 'bar'
- * ```
- * @return {Object} The first node, or undefiend
- * @api public
- */
-
-Object.defineProperty(Node.prototype, 'first', {
- get: function() {
- return this.nodes ? this.nodes[0] : null;
- }
-});
-
-/**
- * Get the last node from `node.nodes`.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * var baz = new Node({type: 'baz'});
- * var qux = new Node({type: 'qux'});
- * foo.push(bar);
- * foo.push(baz);
- * foo.push(qux);
- *
- * console.log(foo.last.type) // 'qux'
- * ```
- * @return {Object} The last node, or undefiend
- * @api public
- */
-
-Object.defineProperty(Node.prototype, 'last', {
- get: function() {
- return this.nodes ? utils.last(this.nodes) : null;
- }
-});
-
-/**
- * Get the last node from `node.nodes`.
- *
- * ```js
- * var foo = new Node({type: 'foo'});
- * var bar = new Node({type: 'bar'});
- * var baz = new Node({type: 'baz'});
- * var qux = new Node({type: 'qux'});
- * foo.push(bar);
- * foo.push(baz);
- * foo.push(qux);
- *
- * console.log(foo.last.type) // 'qux'
- * ```
- * @return {Object} The last node, or undefiend
- * @api public
- */
-
-Object.defineProperty(Node.prototype, 'scope', {
- get: function() {
- if (this.isScope !== true) {
- return this.parent ? this.parent.scope : this;
- }
- return this;
- }
-});
-
-/**
- * Get own property names from Node prototype, but only the
- * first time `Node` is instantiated
- */
-
-function lazyKeys() {
- if (!ownNames) {
- ownNames = Object.getOwnPropertyNames(Node.prototype);
- }
-}
-
-/**
- * Simplified assertion. Throws an error is `val` is falsey.
- */
-
-function assert(val, message) {
- if (!val) throw new Error(message);
-}
-
-/**
- * Expose `Node`
- */
-
-exports = module.exports = Node;
-
-
-/***/ }),
-/* 615 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * define-property
- *
- * Copyright (c) 2015, 2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var isDescriptor = __webpack_require__(591);
-
-module.exports = function defineProperty(obj, prop, val) {
- if (typeof obj !== 'object' && typeof obj !== 'function') {
- throw new TypeError('expected an object or function.');
- }
-
- if (typeof prop !== 'string') {
- throw new TypeError('expected `prop` to be a string.');
- }
-
- if (isDescriptor(val) && ('set' in val || 'get' in val)) {
- return Object.defineProperty(obj, prop, val);
- }
-
- return Object.defineProperty(obj, prop, {
- configurable: true,
- enumerable: false,
- writable: true,
- value: val
- });
-};
-
-
-/***/ }),
-/* 616 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var typeOf = __webpack_require__(592);
-var utils = module.exports;
-
-/**
- * Returns true if the given value is a node.
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var node = new Node({type: 'foo'});
- * console.log(utils.isNode(node)); //=> true
- * console.log(utils.isNode({})); //=> false
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @returns {Boolean}
- * @api public
- */
-
-utils.isNode = function(node) {
- return typeOf(node) === 'object' && node.isNode === true;
-};
-
-/**
- * Emit an empty string for the given `node`.
- *
- * ```js
- * // do nothing for beginning-of-string
- * snapdragon.compiler.set('bos', utils.noop);
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @returns {undefined}
- * @api public
- */
-
-utils.noop = function(node) {
- append(this, '', node);
-};
-
-/**
- * Appdend `node.val` to `compiler.output`, exactly as it was created
- * by the parser.
- *
- * ```js
- * snapdragon.compiler.set('text', utils.identity);
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @returns {undefined}
- * @api public
- */
-
-utils.identity = function(node) {
- append(this, node.val, node);
-};
-
-/**
- * Previously named `.emit`, this method appends the given `val`
- * to `compiler.output` for the given node. Useful when you know
- * what value should be appended advance, regardless of the actual
- * value of `node.val`.
- *
- * ```js
- * snapdragon.compiler
- * .set('i', function(node) {
- * this.mapVisit(node);
- * })
- * .set('i.open', utils.append(''))
- * .set('i.close', utils.append(''))
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @returns {Function} Returns a compiler middleware function.
- * @api public
- */
-
-utils.append = function(val) {
- return function(node) {
- append(this, val, node);
- };
-};
-
-/**
- * Used in compiler middleware, this onverts an AST node into
- * an empty `text` node and deletes `node.nodes` if it exists.
- * The advantage of this method is that, as opposed to completely
- * removing the node, indices will not need to be re-calculated
- * in sibling nodes, and nothing is appended to the output.
- *
- * ```js
- * utils.toNoop(node);
- * // convert `node.nodes` to the given value instead of deleting it
- * utils.toNoop(node, []);
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {Array} `nodes` Optionally pass a new `nodes` value, to replace the existing `node.nodes` array.
- * @api public
- */
-
-utils.toNoop = function(node, nodes) {
- if (nodes) {
- node.nodes = nodes;
- } else {
- delete node.nodes;
- node.type = 'text';
- node.val = '';
- }
-};
-
-/**
- * Visit `node` with the given `fn`. The built-in `.visit` method in snapdragon
- * automatically calls registered compilers, this allows you to pass a visitor
- * function.
- *
- * ```js
- * snapdragon.compiler.set('i', function(node) {
- * utils.visit(node, function(childNode) {
- * // do stuff with "childNode"
- * return childNode;
- * });
- * });
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {Function} `fn`
- * @return {Object} returns the node after recursively visiting all child nodes.
- * @api public
- */
-
-utils.visit = function(node, fn) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- assert(isFunction(fn), 'expected a visitor function');
- fn(node);
- return node.nodes ? utils.mapVisit(node, fn) : node;
-};
-
-/**
- * Map [visit](#visit) the given `fn` over `node.nodes`. This is called by
- * [visit](#visit), use this method if you do not want `fn` to be called on
- * the first node.
- *
- * ```js
- * snapdragon.compiler.set('i', function(node) {
- * utils.mapVisit(node, function(childNode) {
- * // do stuff with "childNode"
- * return childNode;
- * });
- * });
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {Object} `options`
- * @param {Function} `fn`
- * @return {Object} returns the node
- * @api public
- */
-
-utils.mapVisit = function(node, fn) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- assert(isArray(node.nodes), 'expected node.nodes to be an array');
- assert(isFunction(fn), 'expected a visitor function');
-
- for (var i = 0; i < node.nodes.length; i++) {
- utils.visit(node.nodes[i], fn);
- }
- return node;
-};
-
-/**
- * Unshift an `*.open` node onto `node.nodes`.
- *
- * ```js
- * var Node = require('snapdragon-node');
- * snapdragon.parser.set('brace', function(node) {
- * var match = this.match(/^{/);
- * if (match) {
- * var parent = new Node({type: 'brace'});
- * utils.addOpen(parent, Node);
- * console.log(parent.nodes[0]):
- * // { type: 'brace.open', val: '' };
- *
- * // push the parent "brace" node onto the stack
- * this.push(parent);
- *
- * // return the parent node, so it's also added to the AST
- * return brace;
- * }
- * });
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][].
- * @param {Function} `filter` Optionaly specify a filter function to exclude the node.
- * @return {Object} Returns the created opening node.
- * @api public
- */
-
-utils.addOpen = function(node, Node, val, filter) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- assert(isFunction(Node), 'expected Node to be a constructor function');
-
- if (typeof val === 'function') {
- filter = val;
- val = '';
- }
-
- if (typeof filter === 'function' && !filter(node)) return;
- var open = new Node({ type: node.type + '.open', val: val});
- var unshift = node.unshift || node.unshiftNode;
- if (typeof unshift === 'function') {
- unshift.call(node, open);
- } else {
- utils.unshiftNode(node, open);
- }
- return open;
-};
-
-/**
- * Push a `*.close` node onto `node.nodes`.
- *
- * ```js
- * var Node = require('snapdragon-node');
- * snapdragon.parser.set('brace', function(node) {
- * var match = this.match(/^}/);
- * if (match) {
- * var parent = this.parent();
- * if (parent.type !== 'brace') {
- * throw new Error('missing opening: ' + '}');
- * }
- *
- * utils.addClose(parent, Node);
- * console.log(parent.nodes[parent.nodes.length - 1]):
- * // { type: 'brace.close', val: '' };
- *
- * // no need to return a node, since the parent
- * // was already added to the AST
- * return;
- * }
- * });
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][].
- * @param {Function} `filter` Optionaly specify a filter function to exclude the node.
- * @return {Object} Returns the created closing node.
- * @api public
- */
-
-utils.addClose = function(node, Node, val, filter) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- assert(isFunction(Node), 'expected Node to be a constructor function');
-
- if (typeof val === 'function') {
- filter = val;
- val = '';
- }
-
- if (typeof filter === 'function' && !filter(node)) return;
- var close = new Node({ type: node.type + '.close', val: val});
- var push = node.push || node.pushNode;
- if (typeof push === 'function') {
- push.call(node, close);
- } else {
- utils.pushNode(node, close);
- }
- return close;
-};
-
-/**
- * Wraps the given `node` with `*.open` and `*.close` nodes.
- *
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][].
- * @param {Function} `filter` Optionaly specify a filter function to exclude the node.
- * @return {Object} Returns the node
- * @api public
- */
-
-utils.wrapNodes = function(node, Node, filter) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- assert(isFunction(Node), 'expected Node to be a constructor function');
-
- utils.addOpen(node, Node, filter);
- utils.addClose(node, Node, filter);
- return node;
-};
-
-/**
- * Push the given `node` onto `parent.nodes`, and set `parent` as `node.parent.
- *
- * ```js
- * var parent = new Node({type: 'foo'});
- * var node = new Node({type: 'bar'});
- * utils.pushNode(parent, node);
- * console.log(parent.nodes[0].type) // 'bar'
- * console.log(node.parent.type) // 'foo'
- * ```
- * @param {Object} `parent`
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Object} Returns the child node
- * @api public
- */
-
-utils.pushNode = function(parent, node) {
- assert(utils.isNode(parent), 'expected parent node to be an instance of Node');
- assert(utils.isNode(node), 'expected node to be an instance of Node');
-
- node.define('parent', parent);
- parent.nodes = parent.nodes || [];
- parent.nodes.push(node);
- return node;
-};
-
-/**
- * Unshift `node` onto `parent.nodes`, and set `parent` as `node.parent.
- *
- * ```js
- * var parent = new Node({type: 'foo'});
- * var node = new Node({type: 'bar'});
- * utils.unshiftNode(parent, node);
- * console.log(parent.nodes[0].type) // 'bar'
- * console.log(node.parent.type) // 'foo'
- * ```
- * @param {Object} `parent`
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {undefined}
- * @api public
- */
-
-utils.unshiftNode = function(parent, node) {
- assert(utils.isNode(parent), 'expected parent node to be an instance of Node');
- assert(utils.isNode(node), 'expected node to be an instance of Node');
-
- node.define('parent', parent);
- parent.nodes = parent.nodes || [];
- parent.nodes.unshift(node);
-};
-
-/**
- * Pop the last `node` off of `parent.nodes`. The advantage of
- * using this method is that it checks for `node.nodes` and works
- * with any version of `snapdragon-node`.
- *
- * ```js
- * var parent = new Node({type: 'foo'});
- * utils.pushNode(parent, new Node({type: 'foo'}));
- * utils.pushNode(parent, new Node({type: 'bar'}));
- * utils.pushNode(parent, new Node({type: 'baz'}));
- * console.log(parent.nodes.length); //=> 3
- * utils.popNode(parent);
- * console.log(parent.nodes.length); //=> 2
- * ```
- * @param {Object} `parent`
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Number|Undefined} Returns the length of `node.nodes` or undefined.
- * @api public
- */
-
-utils.popNode = function(node) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- if (typeof node.pop === 'function') {
- return node.pop();
- }
- return node.nodes && node.nodes.pop();
-};
-
-/**
- * Shift the first `node` off of `parent.nodes`. The advantage of
- * using this method is that it checks for `node.nodes` and works
- * with any version of `snapdragon-node`.
- *
- * ```js
- * var parent = new Node({type: 'foo'});
- * utils.pushNode(parent, new Node({type: 'foo'}));
- * utils.pushNode(parent, new Node({type: 'bar'}));
- * utils.pushNode(parent, new Node({type: 'baz'}));
- * console.log(parent.nodes.length); //=> 3
- * utils.shiftNode(parent);
- * console.log(parent.nodes.length); //=> 2
- * ```
- * @param {Object} `parent`
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Number|Undefined} Returns the length of `node.nodes` or undefined.
- * @api public
- */
-
-utils.shiftNode = function(node) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- if (typeof node.shift === 'function') {
- return node.shift();
- }
- return node.nodes && node.nodes.shift();
-};
-
-/**
- * Remove the specified `node` from `parent.nodes`.
- *
- * ```js
- * var parent = new Node({type: 'abc'});
- * var foo = new Node({type: 'foo'});
- * utils.pushNode(parent, foo);
- * utils.pushNode(parent, new Node({type: 'bar'}));
- * utils.pushNode(parent, new Node({type: 'baz'}));
- * console.log(parent.nodes.length); //=> 3
- * utils.removeNode(parent, foo);
- * console.log(parent.nodes.length); //=> 2
- * ```
- * @param {Object} `parent`
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Object|undefined} Returns the removed node, if successful, or undefined if it does not exist on `parent.nodes`.
- * @api public
- */
-
-utils.removeNode = function(parent, node) {
- assert(utils.isNode(parent), 'expected parent.node to be an instance of Node');
- assert(utils.isNode(node), 'expected node to be an instance of Node');
-
- if (!parent.nodes) {
- return null;
- }
-
- if (typeof parent.remove === 'function') {
- return parent.remove(node);
- }
-
- var idx = parent.nodes.indexOf(node);
- if (idx !== -1) {
- return parent.nodes.splice(idx, 1);
- }
-};
-
-/**
- * Returns true if `node.type` matches the given `type`. Throws a
- * `TypeError` if `node` is not an instance of `Node`.
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var node = new Node({type: 'foo'});
- * console.log(utils.isType(node, 'foo')); // false
- * console.log(utils.isType(node, 'bar')); // true
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {String} `type`
- * @return {Boolean}
- * @api public
- */
-
-utils.isType = function(node, type) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- switch (typeOf(type)) {
- case 'array':
- var types = type.slice();
- for (var i = 0; i < types.length; i++) {
- if (utils.isType(node, types[i])) {
- return true;
- }
- }
- return false;
- case 'string':
- return node.type === type;
- case 'regexp':
- return type.test(node.type);
- default: {
- throw new TypeError('expected "type" to be an array, string or regexp');
- }
- }
-};
-
-/**
- * Returns true if the given `node` has the given `type` in `node.nodes`.
- * Throws a `TypeError` if `node` is not an instance of `Node`.
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var node = new Node({
- * type: 'foo',
- * nodes: [
- * new Node({type: 'bar'}),
- * new Node({type: 'baz'})
- * ]
- * });
- * console.log(utils.hasType(node, 'xyz')); // false
- * console.log(utils.hasType(node, 'baz')); // true
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {String} `type`
- * @return {Boolean}
- * @api public
- */
-
-utils.hasType = function(node, type) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- if (!Array.isArray(node.nodes)) return false;
- for (var i = 0; i < node.nodes.length; i++) {
- if (utils.isType(node.nodes[i], type)) {
- return true;
- }
- }
- return false;
-};
-
-/**
- * Returns the first node from `node.nodes` of the given `type`
- *
- * ```js
- * var node = new Node({
- * type: 'foo',
- * nodes: [
- * new Node({type: 'text', val: 'abc'}),
- * new Node({type: 'text', val: 'xyz'})
- * ]
- * });
- *
- * var textNode = utils.firstOfType(node.nodes, 'text');
- * console.log(textNode.val);
- * //=> 'abc'
- * ```
- * @param {Array} `nodes`
- * @param {String} `type`
- * @return {Object|undefined} Returns the first matching node or undefined.
- * @api public
- */
-
-utils.firstOfType = function(nodes, type) {
- for (var i = 0; i < nodes.length; i++) {
- var node = nodes[i];
- if (utils.isType(node, type)) {
- return node;
- }
- }
-};
-
-/**
- * Returns the node at the specified index, or the first node of the
- * given `type` from `node.nodes`.
- *
- * ```js
- * var node = new Node({
- * type: 'foo',
- * nodes: [
- * new Node({type: 'text', val: 'abc'}),
- * new Node({type: 'text', val: 'xyz'})
- * ]
- * });
- *
- * var nodeOne = utils.findNode(node.nodes, 'text');
- * console.log(nodeOne.val);
- * //=> 'abc'
- *
- * var nodeTwo = utils.findNode(node.nodes, 1);
- * console.log(nodeTwo.val);
- * //=> 'xyz'
- * ```
- *
- * @param {Array} `nodes`
- * @param {String|Number} `type` Node type or index.
- * @return {Object} Returns a node or undefined.
- * @api public
- */
-
-utils.findNode = function(nodes, type) {
- if (!Array.isArray(nodes)) {
- return null;
- }
- if (typeof type === 'number') {
- return nodes[type];
- }
- return utils.firstOfType(nodes, type);
-};
-
-/**
- * Returns true if the given node is an "*.open" node.
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var brace = new Node({type: 'brace'});
- * var open = new Node({type: 'brace.open'});
- * var close = new Node({type: 'brace.close'});
- *
- * console.log(utils.isOpen(brace)); // false
- * console.log(utils.isOpen(open)); // true
- * console.log(utils.isOpen(close)); // false
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Boolean}
- * @api public
- */
-
-utils.isOpen = function(node) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- return node.type.slice(-5) === '.open';
-};
-
-/**
- * Returns true if the given node is a "*.close" node.
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var brace = new Node({type: 'brace'});
- * var open = new Node({type: 'brace.open'});
- * var close = new Node({type: 'brace.close'});
- *
- * console.log(utils.isClose(brace)); // false
- * console.log(utils.isClose(open)); // false
- * console.log(utils.isClose(close)); // true
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Boolean}
- * @api public
- */
-
-utils.isClose = function(node) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- return node.type.slice(-6) === '.close';
-};
-
-/**
- * Returns true if `node.nodes` **has** an `.open` node
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var brace = new Node({
- * type: 'brace',
- * nodes: []
- * });
- *
- * var open = new Node({type: 'brace.open'});
- * console.log(utils.hasOpen(brace)); // false
- *
- * brace.pushNode(open);
- * console.log(utils.hasOpen(brace)); // true
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Boolean}
- * @api public
- */
-
-utils.hasOpen = function(node) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- var first = node.first || node.nodes ? node.nodes[0] : null;
- if (utils.isNode(first)) {
- return first.type === node.type + '.open';
- }
- return false;
-};
-
-/**
- * Returns true if `node.nodes` **has** a `.close` node
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var brace = new Node({
- * type: 'brace',
- * nodes: []
- * });
- *
- * var close = new Node({type: 'brace.close'});
- * console.log(utils.hasClose(brace)); // false
- *
- * brace.pushNode(close);
- * console.log(utils.hasClose(brace)); // true
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Boolean}
- * @api public
- */
-
-utils.hasClose = function(node) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- var last = node.last || node.nodes ? node.nodes[node.nodes.length - 1] : null;
- if (utils.isNode(last)) {
- return last.type === node.type + '.close';
- }
- return false;
-};
-
-/**
- * Returns true if `node.nodes` has both `.open` and `.close` nodes
- *
- * ```js
- * var Node = require('snapdragon-node');
- * var brace = new Node({
- * type: 'brace',
- * nodes: []
- * });
- *
- * var open = new Node({type: 'brace.open'});
- * var close = new Node({type: 'brace.close'});
- * console.log(utils.hasOpen(brace)); // false
- * console.log(utils.hasClose(brace)); // false
- *
- * brace.pushNode(open);
- * brace.pushNode(close);
- * console.log(utils.hasOpen(brace)); // true
- * console.log(utils.hasClose(brace)); // true
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Boolean}
- * @api public
- */
-
-utils.hasOpenAndClose = function(node) {
- return utils.hasOpen(node) && utils.hasClose(node);
-};
-
-/**
- * Push the given `node` onto the `state.inside` array for the
- * given type. This array is used as a specialized "stack" for
- * only the given `node.type`.
- *
- * ```js
- * var state = { inside: {}};
- * var node = new Node({type: 'brace'});
- * utils.addType(state, node);
- * console.log(state.inside);
- * //=> { brace: [{type: 'brace'}] }
- * ```
- * @param {Object} `state` The `compiler.state` object or custom state object.
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Array} Returns the `state.inside` stack for the given type.
- * @api public
- */
-
-utils.addType = function(state, node) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- assert(isObject(state), 'expected state to be an object');
-
- var type = node.parent
- ? node.parent.type
- : node.type.replace(/\.open$/, '');
-
- if (!state.hasOwnProperty('inside')) {
- state.inside = {};
- }
- if (!state.inside.hasOwnProperty(type)) {
- state.inside[type] = [];
- }
-
- var arr = state.inside[type];
- arr.push(node);
- return arr;
-};
-
-/**
- * Remove the given `node` from the `state.inside` array for the
- * given type. This array is used as a specialized "stack" for
- * only the given `node.type`.
- *
- * ```js
- * var state = { inside: {}};
- * var node = new Node({type: 'brace'});
- * utils.addType(state, node);
- * console.log(state.inside);
- * //=> { brace: [{type: 'brace'}] }
- * utils.removeType(state, node);
- * //=> { brace: [] }
- * ```
- * @param {Object} `state` The `compiler.state` object or custom state object.
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @return {Array} Returns the `state.inside` stack for the given type.
- * @api public
- */
-
-utils.removeType = function(state, node) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- assert(isObject(state), 'expected state to be an object');
-
- var type = node.parent
- ? node.parent.type
- : node.type.replace(/\.close$/, '');
-
- if (state.inside.hasOwnProperty(type)) {
- return state.inside[type].pop();
- }
-};
-
-/**
- * Returns true if `node.val` is an empty string, or `node.nodes` does
- * not contain any non-empty text nodes.
- *
- * ```js
- * var node = new Node({type: 'text'});
- * utils.isEmpty(node); //=> true
- * node.val = 'foo';
- * utils.isEmpty(node); //=> false
- * ```
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {Function} `fn`
- * @return {Boolean}
- * @api public
- */
-
-utils.isEmpty = function(node, fn) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
-
- if (!Array.isArray(node.nodes)) {
- if (node.type !== 'text') {
- return true;
- }
- if (typeof fn === 'function') {
- return fn(node, node.parent);
- }
- return !utils.trim(node.val);
- }
-
- for (var i = 0; i < node.nodes.length; i++) {
- var child = node.nodes[i];
- if (utils.isOpen(child) || utils.isClose(child)) {
- continue;
- }
- if (!utils.isEmpty(child, fn)) {
- return false;
- }
- }
-
- return true;
-};
-
-/**
- * Returns true if the `state.inside` stack for the given type exists
- * and has one or more nodes on it.
- *
- * ```js
- * var state = { inside: {}};
- * var node = new Node({type: 'brace'});
- * console.log(utils.isInsideType(state, 'brace')); //=> false
- * utils.addType(state, node);
- * console.log(utils.isInsideType(state, 'brace')); //=> true
- * utils.removeType(state, node);
- * console.log(utils.isInsideType(state, 'brace')); //=> false
- * ```
- * @param {Object} `state`
- * @param {String} `type`
- * @return {Boolean}
- * @api public
- */
-
-utils.isInsideType = function(state, type) {
- assert(isObject(state), 'expected state to be an object');
- assert(isString(type), 'expected type to be a string');
-
- if (!state.hasOwnProperty('inside')) {
- return false;
- }
-
- if (!state.inside.hasOwnProperty(type)) {
- return false;
- }
-
- return state.inside[type].length > 0;
-};
-
-/**
- * Returns true if `node` is either a child or grand-child of the given `type`,
- * or `state.inside[type]` is a non-empty array.
- *
- * ```js
- * var state = { inside: {}};
- * var node = new Node({type: 'brace'});
- * var open = new Node({type: 'brace.open'});
- * console.log(utils.isInside(state, open, 'brace')); //=> false
- * utils.pushNode(node, open);
- * console.log(utils.isInside(state, open, 'brace')); //=> true
- * ```
- * @param {Object} `state` Either the `compiler.state` object, if it exists, or a user-supplied state object.
- * @param {Object} `node` Instance of [snapdragon-node][]
- * @param {String} `type` The `node.type` to check for.
- * @return {Boolean}
- * @api public
- */
-
-utils.isInside = function(state, node, type) {
- assert(utils.isNode(node), 'expected node to be an instance of Node');
- assert(isObject(state), 'expected state to be an object');
-
- if (Array.isArray(type)) {
- for (var i = 0; i < type.length; i++) {
- if (utils.isInside(state, node, type[i])) {
- return true;
- }
- }
- return false;
- }
-
- var parent = node.parent;
- if (typeof type === 'string') {
- return (parent && parent.type === type) || utils.isInsideType(state, type);
- }
-
- if (typeOf(type) === 'regexp') {
- if (parent && parent.type && type.test(parent.type)) {
- return true;
- }
-
- var keys = Object.keys(state.inside);
- var len = keys.length;
- var idx = -1;
- while (++idx < len) {
- var key = keys[idx];
- var val = state.inside[key];
-
- if (Array.isArray(val) && val.length !== 0 && type.test(key)) {
- return true;
- }
- }
- }
- return false;
-};
-
-/**
- * Get the last `n` element from the given `array`. Used for getting
- * a node from `node.nodes.`
- *
- * @param {Array} `array`
- * @param {Number} `n`
- * @return {undefined}
- * @api public
- */
-
-utils.last = function(arr, n) {
- return arr[arr.length - (n || 1)];
-};
-
-/**
- * Cast the given `val` to an array.
- *
- * ```js
- * console.log(utils.arrayify(''));
- * //=> []
- * console.log(utils.arrayify('foo'));
- * //=> ['foo']
- * console.log(utils.arrayify(['foo']));
- * //=> ['foo']
- * ```
- * @param {any} `val`
- * @return {Array}
- * @api public
- */
-
-utils.arrayify = function(val) {
- if (typeof val === 'string' && val !== '') {
- return [val];
- }
- if (!Array.isArray(val)) {
- return [];
- }
- return val;
-};
-
-/**
- * Convert the given `val` to a string by joining with `,`. Useful
- * for creating a cheerio/CSS/DOM-style selector from a list of strings.
- *
- * @param {any} `val`
- * @return {Array}
- * @api public
- */
-
-utils.stringify = function(val) {
- return utils.arrayify(val).join(',');
-};
-
-/**
- * Ensure that the given value is a string and call `.trim()` on it,
- * or return an empty string.
- *
- * @param {String} `str`
- * @return {String}
- * @api public
- */
-
-utils.trim = function(str) {
- return typeof str === 'string' ? str.trim() : '';
-};
-
-/**
- * Return true if val is an object
- */
-
-function isObject(val) {
- return typeOf(val) === 'object';
-}
-
-/**
- * Return true if val is a string
- */
-
-function isString(val) {
- return typeof val === 'string';
-}
-
-/**
- * Return true if val is a function
- */
-
-function isFunction(val) {
- return typeof val === 'function';
-}
-
-/**
- * Return true if val is an array
- */
-
-function isArray(val) {
- return Array.isArray(val);
-}
-
-/**
- * Shim to ensure the `.append` methods work with any version of snapdragon
- */
-
-function append(compiler, val, node) {
- if (typeof compiler.append !== 'function') {
- return compiler.emit(val, node);
- }
- return compiler.append(val, node);
-}
-
-/**
- * Simplified assertion. Throws an error is `val` is falsey.
- */
-
-function assert(val, message) {
- if (!val) throw new Error(message);
-}
-
-
-/***/ }),
-/* 617 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var extend = __webpack_require__(601);
-var Snapdragon = __webpack_require__(618);
-var compilers = __webpack_require__(603);
-var parsers = __webpack_require__(613);
-var utils = __webpack_require__(604);
-
-/**
- * Customize Snapdragon parser and renderer
- */
-
-function Braces(options) {
- this.options = extend({}, options);
-}
-
-/**
- * Initialize braces
- */
-
-Braces.prototype.init = function(options) {
- if (this.isInitialized) return;
- this.isInitialized = true;
- var opts = utils.createOptions({}, this.options, options);
- this.snapdragon = this.options.snapdragon || new Snapdragon(opts);
- this.compiler = this.snapdragon.compiler;
- this.parser = this.snapdragon.parser;
-
- compilers(this.snapdragon, opts);
- parsers(this.snapdragon, opts);
-
- /**
- * Call Snapdragon `.parse` method. When AST is returned, we check to
- * see if any unclosed braces are left on the stack and, if so, we iterate
- * over the stack and correct the AST so that compilers are called in the correct
- * order and unbalance braces are properly escaped.
- */
-
- utils.define(this.snapdragon, 'parse', function(pattern, options) {
- var parsed = Snapdragon.prototype.parse.apply(this, arguments);
- this.parser.ast.input = pattern;
-
- var stack = this.parser.stack;
- while (stack.length) {
- addParent({type: 'brace.close', val: ''}, stack.pop());
- }
-
- function addParent(node, parent) {
- utils.define(node, 'parent', parent);
- parent.nodes.push(node);
- }
-
- // add non-enumerable parser reference
- utils.define(parsed, 'parser', this.parser);
- return parsed;
- });
-};
-
-/**
- * Decorate `.parse` method
- */
-
-Braces.prototype.parse = function(ast, options) {
- if (ast && typeof ast === 'object' && ast.nodes) return ast;
- this.init(options);
- return this.snapdragon.parse(ast, options);
-};
-
-/**
- * Decorate `.compile` method
- */
-
-Braces.prototype.compile = function(ast, options) {
- if (typeof ast === 'string') {
- ast = this.parse(ast, options);
- } else {
- this.init(options);
- }
- return this.snapdragon.compile(ast, options);
-};
-
-/**
- * Expand
- */
-
-Braces.prototype.expand = function(pattern) {
- var ast = this.parse(pattern, {expand: true});
- return this.compile(ast, {expand: true});
-};
-
-/**
- * Optimize
- */
-
-Braces.prototype.optimize = function(pattern) {
- var ast = this.parse(pattern, {optimize: true});
- return this.compile(ast, {optimize: true});
-};
-
-/**
- * Expose `Braces`
- */
-
-module.exports = Braces;
-
-
-/***/ }),
-/* 618 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Base = __webpack_require__(619);
-var define = __webpack_require__(645);
-var Compiler = __webpack_require__(652);
-var Parser = __webpack_require__(681);
-var utils = __webpack_require__(660);
-var regexCache = {};
-var cache = {};
-
-/**
- * Create a new instance of `Snapdragon` with the given `options`.
- *
- * ```js
- * var snapdragon = new Snapdragon();
- * ```
- *
- * @param {Object} `options`
- * @api public
- */
-
-function Snapdragon(options) {
- Base.call(this, null, options);
- this.options = utils.extend({source: 'string'}, this.options);
- this.compiler = new Compiler(this.options);
- this.parser = new Parser(this.options);
-
- Object.defineProperty(this, 'compilers', {
- get: function() {
- return this.compiler.compilers;
- }
- });
-
- Object.defineProperty(this, 'parsers', {
- get: function() {
- return this.parser.parsers;
- }
- });
-
- Object.defineProperty(this, 'regex', {
- get: function() {
- return this.parser.regex;
- }
- });
-}
-
-/**
- * Inherit Base
- */
-
-Base.extend(Snapdragon);
-
-/**
- * Add a parser to `snapdragon.parsers` for capturing the given `type` using
- * the specified regex or parser function. A function is useful if you need
- * to customize how the token is created and/or have access to the parser
- * instance to check options, etc.
- *
- * ```js
- * snapdragon
- * .capture('slash', /^\//)
- * .capture('dot', function() {
- * var pos = this.position();
- * var m = this.match(/^\./);
- * if (!m) return;
- * return pos({
- * type: 'dot',
- * val: m[0]
- * });
- * });
- * ```
- * @param {String} `type`
- * @param {RegExp|Function} `regex`
- * @return {Object} Returns the parser instance for chaining
- * @api public
- */
-
-Snapdragon.prototype.capture = function() {
- return this.parser.capture.apply(this.parser, arguments);
-};
-
-/**
- * Register a plugin `fn`.
- *
- * ```js
- * var snapdragon = new Snapdgragon([options]);
- * snapdragon.use(function() {
- * console.log(this); //<= snapdragon instance
- * console.log(this.parser); //<= parser instance
- * console.log(this.compiler); //<= compiler instance
- * });
- * ```
- * @param {Object} `fn`
- * @api public
- */
-
-Snapdragon.prototype.use = function(fn) {
- fn.call(this, this);
- return this;
-};
-
-/**
- * Parse the given `str`.
- *
- * ```js
- * var snapdragon = new Snapdgragon([options]);
- * // register parsers
- * snapdragon.parser.use(function() {});
- *
- * // parse
- * var ast = snapdragon.parse('foo/bar');
- * console.log(ast);
- * ```
- * @param {String} `str`
- * @param {Object} `options` Set `options.sourcemap` to true to enable source maps.
- * @return {Object} Returns an AST.
- * @api public
- */
-
-Snapdragon.prototype.parse = function(str, options) {
- this.options = utils.extend({}, this.options, options);
- var parsed = this.parser.parse(str, this.options);
-
- // add non-enumerable parser reference
- define(parsed, 'parser', this.parser);
- return parsed;
-};
-
-/**
- * Compile the given `AST`.
- *
- * ```js
- * var snapdragon = new Snapdgragon([options]);
- * // register plugins
- * snapdragon.use(function() {});
- * // register parser plugins
- * snapdragon.parser.use(function() {});
- * // register compiler plugins
- * snapdragon.compiler.use(function() {});
- *
- * // parse
- * var ast = snapdragon.parse('foo/bar');
- *
- * // compile
- * var res = snapdragon.compile(ast);
- * console.log(res.output);
- * ```
- * @param {Object} `ast`
- * @param {Object} `options`
- * @return {Object} Returns an object with an `output` property with the rendered string.
- * @api public
- */
-
-Snapdragon.prototype.compile = function(ast, options) {
- this.options = utils.extend({}, this.options, options);
- var compiled = this.compiler.compile(ast, this.options);
-
- // add non-enumerable compiler reference
- define(compiled, 'compiler', this.compiler);
- return compiled;
-};
-
-/**
- * Expose `Snapdragon`
- */
-
-module.exports = Snapdragon;
-
-/**
- * Expose `Parser` and `Compiler`
- */
-
-module.exports.Compiler = Compiler;
-module.exports.Parser = Parser;
-
-
-/***/ }),
-/* 619 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var util = __webpack_require__(112);
-var define = __webpack_require__(620);
-var CacheBase = __webpack_require__(621);
-var Emitter = __webpack_require__(622);
-var isObject = __webpack_require__(590);
-var merge = __webpack_require__(640);
-var pascal = __webpack_require__(643);
-var cu = __webpack_require__(644);
-
-/**
- * Optionally define a custom `cache` namespace to use.
- */
-
-function namespace(name) {
- var Cache = name ? CacheBase.namespace(name) : CacheBase;
- var fns = [];
-
- /**
- * Create an instance of `Base` with the given `config` and `options`.
- *
- * ```js
- * // initialize with `config` and `options`
- * var app = new Base({isApp: true}, {abc: true});
- * app.set('foo', 'bar');
- *
- * // values defined with the given `config` object will be on the root of the instance
- * console.log(app.baz); //=> undefined
- * console.log(app.foo); //=> 'bar'
- * // or use `.get`
- * console.log(app.get('isApp')); //=> true
- * console.log(app.get('foo')); //=> 'bar'
- *
- * // values defined with the given `options` object will be on `app.options
- * console.log(app.options.abc); //=> true
- * ```
- *
- * @param {Object} `config` If supplied, this object is passed to [cache-base][] to merge onto the the instance upon instantiation.
- * @param {Object} `options` If supplied, this object is used to initialize the `base.options` object.
- * @api public
- */
-
- function Base(config, options) {
- if (!(this instanceof Base)) {
- return new Base(config, options);
- }
- Cache.call(this, config);
- this.is('base');
- this.initBase(config, options);
- }
-
- /**
- * Inherit cache-base
- */
-
- util.inherits(Base, Cache);
-
- /**
- * Add static emitter methods
- */
-
- Emitter(Base);
-
- /**
- * Initialize `Base` defaults with the given `config` object
- */
-
- Base.prototype.initBase = function(config, options) {
- this.options = merge({}, this.options, options);
- this.cache = this.cache || {};
- this.define('registered', {});
- if (name) this[name] = {};
-
- // make `app._callbacks` non-enumerable
- this.define('_callbacks', this._callbacks);
- if (isObject(config)) {
- this.visit('set', config);
- }
- Base.run(this, 'use', fns);
- };
-
- /**
- * Set the given `name` on `app._name` and `app.is*` properties. Used for doing
- * lookups in plugins.
- *
- * ```js
- * app.is('foo');
- * console.log(app._name);
- * //=> 'foo'
- * console.log(app.isFoo);
- * //=> true
- * app.is('bar');
- * console.log(app.isFoo);
- * //=> true
- * console.log(app.isBar);
- * //=> true
- * console.log(app._name);
- * //=> 'bar'
- * ```
- * @name .is
- * @param {String} `name`
- * @return {Boolean}
- * @api public
- */
-
- Base.prototype.is = function(name) {
- if (typeof name !== 'string') {
- throw new TypeError('expected name to be a string');
- }
- this.define('is' + pascal(name), true);
- this.define('_name', name);
- this.define('_appname', name);
- return this;
- };
-
- /**
- * Returns true if a plugin has already been registered on an instance.
- *
- * Plugin implementors are encouraged to use this first thing in a plugin
- * to prevent the plugin from being called more than once on the same
- * instance.
- *
- * ```js
- * var base = new Base();
- * base.use(function(app) {
- * if (app.isRegistered('myPlugin')) return;
- * // do stuff to `app`
- * });
- *
- * // to also record the plugin as being registered
- * base.use(function(app) {
- * if (app.isRegistered('myPlugin', true)) return;
- * // do stuff to `app`
- * });
- * ```
- * @name .isRegistered
- * @emits `plugin` Emits the name of the plugin being registered. Useful for unit tests, to ensure plugins are only registered once.
- * @param {String} `name` The plugin name.
- * @param {Boolean} `register` If the plugin if not already registered, to record it as being registered pass `true` as the second argument.
- * @return {Boolean} Returns true if a plugin is already registered.
- * @api public
- */
-
- Base.prototype.isRegistered = function(name, register) {
- if (this.registered.hasOwnProperty(name)) {
- return true;
- }
- if (register !== false) {
- this.registered[name] = true;
- this.emit('plugin', name);
- }
- return false;
- };
-
- /**
- * Define a plugin function to be called immediately upon init. Plugins are chainable
- * and expose the following arguments to the plugin function:
- *
- * - `app`: the current instance of `Base`
- * - `base`: the [first ancestor instance](#base) of `Base`
- *
- * ```js
- * var app = new Base()
- * .use(foo)
- * .use(bar)
- * .use(baz)
- * ```
- * @name .use
- * @param {Function} `fn` plugin function to call
- * @return {Object} Returns the item instance for chaining.
- * @api public
- */
-
- Base.prototype.use = function(fn) {
- fn.call(this, this);
- return this;
- };
-
- /**
- * The `.define` method is used for adding non-enumerable property on the instance.
- * Dot-notation is **not supported** with `define`.
- *
- * ```js
- * // arbitrary `render` function using lodash `template`
- * app.define('render', function(str, locals) {
- * return _.template(str)(locals);
- * });
- * ```
- * @name .define
- * @param {String} `key` The name of the property to define.
- * @param {any} `value`
- * @return {Object} Returns the instance for chaining.
- * @api public
- */
-
- Base.prototype.define = function(key, val) {
- if (isObject(key)) {
- return this.visit('define', key);
- }
- define(this, key, val);
- return this;
- };
-
- /**
- * Mix property `key` onto the Base prototype. If base is inherited using
- * `Base.extend` this method will be overridden by a new `mixin` method that will
- * only add properties to the prototype of the inheriting application.
- *
- * ```js
- * app.mixin('foo', function() {
- * // do stuff
- * });
- * ```
- * @name .mixin
- * @param {String} `key`
- * @param {Object|Array} `val`
- * @return {Object} Returns the `base` instance for chaining.
- * @api public
- */
-
- Base.prototype.mixin = function(key, val) {
- Base.prototype[key] = val;
- return this;
- };
-
- /**
- * Non-enumberable mixin array, used by the static [Base.mixin]() method.
- */
-
- Base.prototype.mixins = Base.prototype.mixins || [];
-
- /**
- * Getter/setter used when creating nested instances of `Base`, for storing a reference
- * to the first ancestor instance. This works by setting an instance of `Base` on the `parent`
- * property of a "child" instance. The `base` property defaults to the current instance if
- * no `parent` property is defined.
- *
- * ```js
- * // create an instance of `Base`, this is our first ("base") instance
- * var first = new Base();
- * first.foo = 'bar'; // arbitrary property, to make it easier to see what's happening later
- *
- * // create another instance
- * var second = new Base();
- * // create a reference to the first instance (`first`)
- * second.parent = first;
- *
- * // create another instance
- * var third = new Base();
- * // create a reference to the previous instance (`second`)
- * // repeat this pattern every time a "child" instance is created
- * third.parent = second;
- *
- * // we can always access the first instance using the `base` property
- * console.log(first.base.foo);
- * //=> 'bar'
- * console.log(second.base.foo);
- * //=> 'bar'
- * console.log(third.base.foo);
- * //=> 'bar'
- * // and now you know how to get to third base ;)
- * ```
- * @name .base
- * @api public
- */
-
- Object.defineProperty(Base.prototype, 'base', {
- configurable: true,
- get: function() {
- return this.parent ? this.parent.base : this;
- }
- });
-
- /**
- * Static method for adding global plugin functions that will
- * be added to an instance when created.
- *
- * ```js
- * Base.use(function(app) {
- * app.foo = 'bar';
- * });
- * var app = new Base();
- * console.log(app.foo);
- * //=> 'bar'
- * ```
- * @name #use
- * @param {Function} `fn` Plugin function to use on each instance.
- * @return {Object} Returns the `Base` constructor for chaining
- * @api public
- */
-
- define(Base, 'use', function(fn) {
- fns.push(fn);
- return Base;
- });
-
- /**
- * Run an array of functions by passing each function
- * to a method on the given object specified by the given property.
- *
- * @param {Object} `obj` Object containing method to use.
- * @param {String} `prop` Name of the method on the object to use.
- * @param {Array} `arr` Array of functions to pass to the method.
- */
-
- define(Base, 'run', function(obj, prop, arr) {
- var len = arr.length, i = 0;
- while (len--) {
- obj[prop](arr[i++]);
- }
- return Base;
- });
-
- /**
- * Static method for inheriting the prototype and static methods of the `Base` class.
- * This method greatly simplifies the process of creating inheritance-based applications.
- * See [static-extend][] for more details.
- *
- * ```js
- * var extend = cu.extend(Parent);
- * Parent.extend(Child);
- *
- * // optional methods
- * Parent.extend(Child, {
- * foo: function() {},
- * bar: function() {}
- * });
- * ```
- * @name #extend
- * @param {Function} `Ctor` constructor to extend
- * @param {Object} `methods` Optional prototype properties to mix in.
- * @return {Object} Returns the `Base` constructor for chaining
- * @api public
- */
-
- define(Base, 'extend', cu.extend(Base, function(Ctor, Parent) {
- Ctor.prototype.mixins = Ctor.prototype.mixins || [];
-
- define(Ctor, 'mixin', function(fn) {
- var mixin = fn(Ctor.prototype, Ctor);
- if (typeof mixin === 'function') {
- Ctor.prototype.mixins.push(mixin);
- }
- return Ctor;
- });
-
- define(Ctor, 'mixins', function(Child) {
- Base.run(Child, 'mixin', Ctor.prototype.mixins);
- return Ctor;
- });
-
- Ctor.prototype.mixin = function(key, value) {
- Ctor.prototype[key] = value;
- return this;
- };
- return Base;
- }));
-
- /**
- * Used for adding methods to the `Base` prototype, and/or to the prototype of child instances.
- * When a mixin function returns a function, the returned function is pushed onto the `.mixins`
- * array, making it available to be used on inheriting classes whenever `Base.mixins()` is
- * called (e.g. `Base.mixins(Child)`).
- *
- * ```js
- * Base.mixin(function(proto) {
- * proto.foo = function(msg) {
- * return 'foo ' + msg;
- * };
- * });
- * ```
- * @name #mixin
- * @param {Function} `fn` Function to call
- * @return {Object} Returns the `Base` constructor for chaining
- * @api public
- */
-
- define(Base, 'mixin', function(fn) {
- var mixin = fn(Base.prototype, Base);
- if (typeof mixin === 'function') {
- Base.prototype.mixins.push(mixin);
- }
- return Base;
- });
-
- /**
- * Static method for running global mixin functions against a child constructor.
- * Mixins must be registered before calling this method.
- *
- * ```js
- * Base.extend(Child);
- * Base.mixins(Child);
- * ```
- * @name #mixins
- * @param {Function} `Child` Constructor function of a child class
- * @return {Object} Returns the `Base` constructor for chaining
- * @api public
- */
-
- define(Base, 'mixins', function(Child) {
- Base.run(Child, 'mixin', Base.prototype.mixins);
- return Base;
- });
-
- /**
- * Similar to `util.inherit`, but copies all static properties, prototype properties, and
- * getters/setters from `Provider` to `Receiver`. See [class-utils][]{#inherit} for more details.
- *
- * ```js
- * Base.inherit(Foo, Bar);
- * ```
- * @name #inherit
- * @param {Function} `Receiver` Receiving (child) constructor
- * @param {Function} `Provider` Providing (parent) constructor
- * @return {Object} Returns the `Base` constructor for chaining
- * @api public
- */
-
- define(Base, 'inherit', cu.inherit);
- define(Base, 'bubble', cu.bubble);
- return Base;
-}
-
-/**
- * Expose `Base` with default settings
- */
-
-module.exports = namespace();
-
-/**
- * Allow users to define a namespace
- */
-
-module.exports.namespace = namespace;
-
-
-/***/ }),
-/* 620 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * define-property
- *
- * Copyright (c) 2015, 2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var isDescriptor = __webpack_require__(591);
-
-module.exports = function defineProperty(obj, prop, val) {
- if (typeof obj !== 'object' && typeof obj !== 'function') {
- throw new TypeError('expected an object or function.');
- }
-
- if (typeof prop !== 'string') {
- throw new TypeError('expected `prop` to be a string.');
- }
-
- if (isDescriptor(val) && ('set' in val || 'get' in val)) {
- return Object.defineProperty(obj, prop, val);
- }
-
- return Object.defineProperty(obj, prop, {
- configurable: true,
- enumerable: false,
- writable: true,
- value: val
- });
-};
-
-
-/***/ }),
-/* 621 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var isObject = __webpack_require__(590);
-var Emitter = __webpack_require__(622);
-var visit = __webpack_require__(623);
-var toPath = __webpack_require__(626);
-var union = __webpack_require__(627);
-var del = __webpack_require__(632);
-var get = __webpack_require__(629);
-var has = __webpack_require__(638);
-var set = __webpack_require__(630);
-
-/**
- * Create a `Cache` constructor that when instantiated will
- * store values on the given `prop`.
- *
- * ```js
- * var Cache = require('cache-base').namespace('data');
- * var cache = new Cache();
- *
- * cache.set('foo', 'bar');
- * //=> {data: {foo: 'bar'}}
- * ```
- * @param {String} `prop` The property name to use for storing values.
- * @return {Function} Returns a custom `Cache` constructor
- * @api public
- */
-
-function namespace(prop) {
-
- /**
- * Create a new `Cache`. Internally the `Cache` constructor is created using
- * the `namespace` function, with `cache` defined as the storage object.
- *
- * ```js
- * var app = new Cache();
- * ```
- * @param {Object} `cache` Optionally pass an object to initialize with.
- * @constructor
- * @api public
- */
-
- function Cache(cache) {
- if (prop) {
- this[prop] = {};
- }
- if (cache) {
- this.set(cache);
- }
- }
-
- /**
- * Inherit Emitter
- */
-
- Emitter(Cache.prototype);
-
- /**
- * Assign `value` to `key`. Also emits `set` with
- * the key and value.
- *
- * ```js
- * app.on('set', function(key, val) {
- * // do something when `set` is emitted
- * });
- *
- * app.set(key, value);
- *
- * // also takes an object or array
- * app.set({name: 'Halle'});
- * app.set([{foo: 'bar'}, {baz: 'quux'}]);
- * console.log(app);
- * //=> {name: 'Halle', foo: 'bar', baz: 'quux'}
- * ```
- *
- * @name .set
- * @emits `set` with `key` and `value` as arguments.
- * @param {String} `key`
- * @param {any} `value`
- * @return {Object} Returns the instance for chaining.
- * @api public
- */
-
- Cache.prototype.set = function(key, val) {
- if (Array.isArray(key) && arguments.length === 2) {
- key = toPath(key);
- }
- if (isObject(key) || Array.isArray(key)) {
- this.visit('set', key);
- } else {
- set(prop ? this[prop] : this, key, val);
- this.emit('set', key, val);
- }
- return this;
- };
-
- /**
- * Union `array` to `key`. Also emits `set` with
- * the key and value.
- *
- * ```js
- * app.union('a.b', ['foo']);
- * app.union('a.b', ['bar']);
- * console.log(app.get('a'));
- * //=> {b: ['foo', 'bar']}
- * ```
- * @name .union
- * @param {String} `key`
- * @param {any} `value`
- * @return {Object} Returns the instance for chaining.
- * @api public
- */
-
- Cache.prototype.union = function(key, val) {
- if (Array.isArray(key) && arguments.length === 2) {
- key = toPath(key);
- }
- var ctx = prop ? this[prop] : this;
- union(ctx, key, arrayify(val));
- this.emit('union', val);
- return this;
- };
-
- /**
- * Return the value of `key`. Dot notation may be used
- * to get [nested property values][get-value].
- *
- * ```js
- * app.set('a.b.c', 'd');
- * app.get('a.b');
- * //=> {c: 'd'}
- *
- * app.get(['a', 'b']);
- * //=> {c: 'd'}
- * ```
- *
- * @name .get
- * @emits `get` with `key` and `value` as arguments.
- * @param {String} `key` The name of the property to get. Dot-notation may be used.
- * @return {any} Returns the value of `key`
- * @api public
- */
-
- Cache.prototype.get = function(key) {
- key = toPath(arguments);
-
- var ctx = prop ? this[prop] : this;
- var val = get(ctx, key);
-
- this.emit('get', key, val);
- return val;
- };
-
- /**
- * Return true if app has a stored value for `key`,
- * false only if value is `undefined`.
- *
- * ```js
- * app.set('foo', 'bar');
- * app.has('foo');
- * //=> true
- * ```
- *
- * @name .has
- * @emits `has` with `key` and true or false as arguments.
- * @param {String} `key`
- * @return {Boolean}
- * @api public
- */
-
- Cache.prototype.has = function(key) {
- key = toPath(arguments);
-
- var ctx = prop ? this[prop] : this;
- var val = get(ctx, key);
-
- var has = typeof val !== 'undefined';
- this.emit('has', key, has);
- return has;
- };
-
- /**
- * Delete one or more properties from the instance.
- *
- * ```js
- * app.del(); // delete all
- * // or
- * app.del('foo');
- * // or
- * app.del(['foo', 'bar']);
- * ```
- * @name .del
- * @emits `del` with the `key` as the only argument.
- * @param {String|Array} `key` Property name or array of property names.
- * @return {Object} Returns the instance for chaining.
- * @api public
- */
-
- Cache.prototype.del = function(key) {
- if (Array.isArray(key)) {
- this.visit('del', key);
- } else {
- del(prop ? this[prop] : this, key);
- this.emit('del', key);
- }
- return this;
- };
-
- /**
- * Reset the entire cache to an empty object.
- *
- * ```js
- * app.clear();
- * ```
- * @api public
- */
-
- Cache.prototype.clear = function() {
- if (prop) {
- this[prop] = {};
- }
- };
-
- /**
- * Visit `method` over the properties in the given object, or map
- * visit over the object-elements in an array.
- *
- * @name .visit
- * @param {String} `method` The name of the `base` method to call.
- * @param {Object|Array} `val` The object or array to iterate over.
- * @return {Object} Returns the instance for chaining.
- * @api public
- */
-
- Cache.prototype.visit = function(method, val) {
- visit(this, method, val);
- return this;
- };
-
- return Cache;
-}
-
-/**
- * Cast val to an array
- */
-
-function arrayify(val) {
- return val ? (Array.isArray(val) ? val : [val]) : [];
-}
-
-/**
- * Expose `Cache`
- */
-
-module.exports = namespace();
-
-/**
- * Expose `Cache.namespace`
- */
-
-module.exports.namespace = namespace;
-
-
-/***/ }),
-/* 622 */
-/***/ (function(module, exports, __webpack_require__) {
-
-
-/**
- * Expose `Emitter`.
- */
-
-if (true) {
- module.exports = Emitter;
-}
-
-/**
- * Initialize a new `Emitter`.
- *
- * @api public
- */
-
-function Emitter(obj) {
- if (obj) return mixin(obj);
-};
-
-/**
- * Mixin the emitter properties.
- *
- * @param {Object} obj
- * @return {Object}
- * @api private
- */
-
-function mixin(obj) {
- for (var key in Emitter.prototype) {
- obj[key] = Emitter.prototype[key];
- }
- return obj;
-}
-
-/**
- * Listen on the given `event` with `fn`.
- *
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
- */
-
-Emitter.prototype.on =
-Emitter.prototype.addEventListener = function(event, fn){
- this._callbacks = this._callbacks || {};
- (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
- .push(fn);
- return this;
-};
-
-/**
- * Adds an `event` listener that will be invoked a single
- * time then automatically removed.
- *
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
- */
-
-Emitter.prototype.once = function(event, fn){
- function on() {
- this.off(event, on);
- fn.apply(this, arguments);
- }
-
- on.fn = fn;
- this.on(event, on);
- return this;
-};
-
-/**
- * Remove the given callback for `event` or all
- * registered callbacks.
- *
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
- */
-
-Emitter.prototype.off =
-Emitter.prototype.removeListener =
-Emitter.prototype.removeAllListeners =
-Emitter.prototype.removeEventListener = function(event, fn){
- this._callbacks = this._callbacks || {};
-
- // all
- if (0 == arguments.length) {
- this._callbacks = {};
- return this;
- }
-
- // specific event
- var callbacks = this._callbacks['$' + event];
- if (!callbacks) return this;
-
- // remove all handlers
- if (1 == arguments.length) {
- delete this._callbacks['$' + event];
- return this;
- }
-
- // remove specific handler
- var cb;
- for (var i = 0; i < callbacks.length; i++) {
- cb = callbacks[i];
- if (cb === fn || cb.fn === fn) {
- callbacks.splice(i, 1);
- break;
- }
- }
-
- // Remove event specific arrays for event types that no
- // one is subscribed for to avoid memory leak.
- if (callbacks.length === 0) {
- delete this._callbacks['$' + event];
- }
-
- return this;
-};
-
-/**
- * Emit `event` with the given args.
- *
- * @param {String} event
- * @param {Mixed} ...
- * @return {Emitter}
- */
-
-Emitter.prototype.emit = function(event){
- this._callbacks = this._callbacks || {};
-
- var args = new Array(arguments.length - 1)
- , callbacks = this._callbacks['$' + event];
-
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
-
- if (callbacks) {
- callbacks = callbacks.slice(0);
- for (var i = 0, len = callbacks.length; i < len; ++i) {
- callbacks[i].apply(this, args);
- }
- }
-
- return this;
-};
-
-/**
- * Return array of callbacks for `event`.
- *
- * @param {String} event
- * @return {Array}
- * @api public
- */
-
-Emitter.prototype.listeners = function(event){
- this._callbacks = this._callbacks || {};
- return this._callbacks['$' + event] || [];
-};
-
-/**
- * Check if this emitter has `event` handlers.
- *
- * @param {String} event
- * @return {Boolean}
- * @api public
- */
-
-Emitter.prototype.hasListeners = function(event){
- return !! this.listeners(event).length;
-};
-
-
-/***/ }),
-/* 623 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * collection-visit
- *
- * Copyright (c) 2015, 2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var visit = __webpack_require__(624);
-var mapVisit = __webpack_require__(625);
-
-module.exports = function(collection, method, val) {
- var result;
-
- if (typeof val === 'string' && (method in collection)) {
- var args = [].slice.call(arguments, 2);
- result = collection[method].apply(collection, args);
- } else if (Array.isArray(val)) {
- result = mapVisit.apply(null, arguments);
- } else {
- result = visit.apply(null, arguments);
- }
-
- if (typeof result !== 'undefined') {
- return result;
- }
-
- return collection;
-};
-
-
-/***/ }),
-/* 624 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * object-visit
- *
- * Copyright (c) 2015, 2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var isObject = __webpack_require__(590);
-
-module.exports = function visit(thisArg, method, target, val) {
- if (!isObject(thisArg) && typeof thisArg !== 'function') {
- throw new Error('object-visit expects `thisArg` to be an object.');
- }
-
- if (typeof method !== 'string') {
- throw new Error('object-visit expects `method` name to be a string');
- }
-
- if (typeof thisArg[method] !== 'function') {
- return thisArg;
- }
-
- var args = [].slice.call(arguments, 3);
- target = target || {};
-
- for (var key in target) {
- var arr = [key, target[key]].concat(args);
- thisArg[method].apply(thisArg, arr);
- }
- return thisArg;
-};
-
-
-/***/ }),
-/* 625 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var util = __webpack_require__(112);
-var visit = __webpack_require__(624);
-
-/**
- * Map `visit` over an array of objects.
- *
- * @param {Object} `collection` The context in which to invoke `method`
- * @param {String} `method` Name of the method to call on `collection`
- * @param {Object} `arr` Array of objects.
- */
-
-module.exports = function mapVisit(collection, method, val) {
- if (isObject(val)) {
- return visit.apply(null, arguments);
- }
-
- if (!Array.isArray(val)) {
- throw new TypeError('expected an array: ' + util.inspect(val));
- }
-
- var args = [].slice.call(arguments, 3);
-
- for (var i = 0; i < val.length; i++) {
- var ele = val[i];
- if (isObject(ele)) {
- visit.apply(null, [collection, method, ele].concat(args));
- } else {
- collection[method].apply(collection, [ele].concat(args));
- }
- }
-};
-
-function isObject(val) {
- return val && (typeof val === 'function' || (!Array.isArray(val) && typeof val === 'object'));
-}
-
-
-/***/ }),
-/* 626 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * to-object-path
- *
- * Copyright (c) 2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-
-module.exports = function toPath(args) {
- if (typeOf(args) !== 'arguments') {
- args = arguments;
- }
- return filter(args).join('.');
-};
-
-function filter(arr) {
- var len = arr.length;
- var idx = -1;
- var res = [];
-
- while (++idx < len) {
- var ele = arr[idx];
- if (typeOf(ele) === 'arguments' || Array.isArray(ele)) {
- res.push.apply(res, filter(ele));
- } else if (typeof ele === 'string') {
- res.push(ele);
- }
- }
- return res;
-}
-
-
-/***/ }),
-/* 627 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var isObject = __webpack_require__(602);
-var union = __webpack_require__(628);
-var get = __webpack_require__(629);
-var set = __webpack_require__(630);
-
-module.exports = function unionValue(obj, prop, value) {
- if (!isObject(obj)) {
- throw new TypeError('union-value expects the first argument to be an object.');
- }
-
- if (typeof prop !== 'string') {
- throw new TypeError('union-value expects `prop` to be a string.');
- }
-
- var arr = arrayify(get(obj, prop));
- set(obj, prop, union(arr, arrayify(value)));
- return obj;
-};
-
-function arrayify(val) {
- if (val === null || typeof val === 'undefined') {
- return [];
- }
- if (Array.isArray(val)) {
- return val;
- }
- return [val];
-}
-
-
-/***/ }),
-/* 628 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-module.exports = function union(init) {
- if (!Array.isArray(init)) {
- throw new TypeError('arr-union expects the first argument to be an array.');
- }
-
- var len = arguments.length;
- var i = 0;
-
- while (++i < len) {
- var arg = arguments[i];
- if (!arg) continue;
-
- if (!Array.isArray(arg)) {
- arg = [arg];
- }
-
- for (var j = 0; j < arg.length; j++) {
- var ele = arg[j];
-
- if (init.indexOf(ele) >= 0) {
- continue;
- }
- init.push(ele);
- }
- }
- return init;
-};
-
-
-/***/ }),
-/* 629 */
-/***/ (function(module, exports) {
-
-/*!
- * get-value
- *
- * Copyright (c) 2014-2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-module.exports = function(obj, prop, a, b, c) {
- if (!isObject(obj) || !prop) {
- return obj;
- }
-
- prop = toString(prop);
-
- // allowing for multiple properties to be passed as
- // a string or array, but much faster (3-4x) than doing
- // `[].slice.call(arguments)`
- if (a) prop += '.' + toString(a);
- if (b) prop += '.' + toString(b);
- if (c) prop += '.' + toString(c);
-
- if (prop in obj) {
- return obj[prop];
- }
-
- var segs = prop.split('.');
- var len = segs.length;
- var i = -1;
-
- while (obj && (++i < len)) {
- var key = segs[i];
- while (key[key.length - 1] === '\\') {
- key = key.slice(0, -1) + '.' + segs[++i];
- }
- obj = obj[key];
- }
- return obj;
-};
-
-function isObject(val) {
- return val !== null && (typeof val === 'object' || typeof val === 'function');
-}
-
-function toString(val) {
- if (!val) return '';
- if (Array.isArray(val)) {
- return val.join('.');
- }
- return val;
-}
-
-
-/***/ }),
-/* 630 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * set-value
- *
- * Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert).
- * Released under the MIT License.
- */
-
-
-
-const { deleteProperty } = Reflect;
-const isPrimitive = __webpack_require__(631);
-const isPlainObject = __webpack_require__(597);
-
-const isObject = value => {
- return (typeof value === 'object' && value !== null) || typeof value === 'function';
-};
-
-const isUnsafeKey = key => {
- return key === '__proto__' || key === 'constructor' || key === 'prototype';
-};
-
-const validateKey = key => {
- if (!isPrimitive(key)) {
- throw new TypeError('Object keys must be strings or symbols');
- }
-
- if (isUnsafeKey(key)) {
- throw new Error(`Cannot set unsafe key: "${key}"`);
- }
-};
-
-const toStringKey = input => {
- return Array.isArray(input) ? input.flat().map(String).join(',') : input;
-};
-
-const createMemoKey = (input, options) => {
- if (typeof input !== 'string' || !options) return input;
- let key = input + ';';
- if (options.arrays !== undefined) key += `arrays=${options.arrays};`;
- if (options.separator !== undefined) key += `separator=${options.separator};`;
- if (options.split !== undefined) key += `split=${options.split};`;
- if (options.merge !== undefined) key += `merge=${options.merge};`;
- if (options.preservePaths !== undefined) key += `preservePaths=${options.preservePaths};`;
- return key;
-};
-
-const memoize = (input, options, fn) => {
- const key = toStringKey(options ? createMemoKey(input, options) : input);
- validateKey(key);
-
- const value = setValue.cache.get(key) || fn();
- setValue.cache.set(key, value);
- return value;
-};
-
-const splitString = (input, options = {}) => {
- const sep = options.separator || '.';
- const preserve = sep === '/' ? false : options.preservePaths;
-
- if (typeof input === 'string' && preserve !== false && /\//.test(input)) {
- return [input];
- }
-
- const parts = [];
- let part = '';
-
- const push = part => {
- let number;
- if (part.trim() !== '' && Number.isInteger((number = Number(part)))) {
- parts.push(number);
- } else {
- parts.push(part);
- }
- };
-
- for (let i = 0; i < input.length; i++) {
- const value = input[i];
-
- if (value === '\\') {
- part += input[++i];
- continue;
- }
-
- if (value === sep) {
- push(part);
- part = '';
- continue;
- }
-
- part += value;
- }
-
- if (part) {
- push(part);
- }
-
- return parts;
-};
-
-const split = (input, options) => {
- if (options && typeof options.split === 'function') return options.split(input);
- if (typeof input === 'symbol') return [input];
- if (Array.isArray(input)) return input;
- return memoize(input, options, () => splitString(input, options));
-};
-
-const assignProp = (obj, prop, value, options) => {
- validateKey(prop);
-
- // Delete property when "value" is undefined
- if (value === undefined) {
- deleteProperty(obj, prop);
-
- } else if (options && options.merge) {
- const merge = options.merge === 'function' ? options.merge : Object.assign;
-
- // Only merge plain objects
- if (merge && isPlainObject(obj[prop]) && isPlainObject(value)) {
- obj[prop] = merge(obj[prop], value);
- } else {
- obj[prop] = value;
- }
-
- } else {
- obj[prop] = value;
- }
-
- return obj;
-};
-
-const setValue = (target, path, value, options) => {
- if (!path || !isObject(target)) return target;
-
- const keys = split(path, options);
- let obj = target;
-
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i];
- const next = keys[i + 1];
-
- validateKey(key);
-
- if (next === undefined) {
- assignProp(obj, key, value, options);
- break;
- }
-
- if (typeof next === 'number' && !Array.isArray(obj[key])) {
- obj = obj[key] = [];
- continue;
- }
-
- if (!isObject(obj[key])) {
- obj[key] = {};
- }
-
- obj = obj[key];
- }
-
- return target;
-};
-
-setValue.split = split;
-setValue.cache = new Map();
-setValue.clear = () => {
- setValue.cache = new Map();
-};
-
-module.exports = setValue;
-
-
-/***/ }),
-/* 631 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-primitive
- *
- * Copyright (c) 2014-present, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-module.exports = function isPrimitive(val) {
- if (typeof val === 'object') {
- return val === null;
- }
- return typeof val !== 'function';
-};
-
-
-/***/ }),
-/* 632 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * unset-value
- *
- * Copyright (c) 2015, 2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var isObject = __webpack_require__(633);
-var has = __webpack_require__(634);
-
-const isUnsafeKey = key => {
- return key === '__proto__' || key === 'constructor' || key === 'prototype';
-};
-
-const validateKey = key => {
- if (isUnsafeKey(key)) {
- throw new Error(`Cannot set unsafe key: "${key}"`);
- }
-};
-
-module.exports = function unset(obj, prop) {
- if (!isObject(obj)) {
- throw new TypeError('expected an object.');
- }
-
- var isArray = Array.isArray(prop);
-
- if (!isArray && obj.hasOwnProperty(prop)) {
- delete obj[prop];
- return true;
- }
-
- if (has(obj, prop)) {
- var segs = isArray ? prop.slice() : prop.split('.');
- var last = segs.pop();
- while (segs.length && segs[segs.length - 1].slice(-1) === '\\') {
- last = segs.pop().slice(0, -1) + '.' + last;
- }
- while (segs.length) {
- prop = segs.shift();
- validateKey(prop);
- obj = obj[prop];
- }
- return (delete obj[last]);
- }
- return true;
-};
-
-
-/***/ }),
-/* 633 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isObject; });
-/*!
- * isobject
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-function isObject(val) {
- return val != null && typeof val === 'object' && Array.isArray(val) === false;
-};
-
-
-/***/ }),
-/* 634 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * has-value
- *
- * Copyright (c) 2014-2018, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-const get = __webpack_require__(635);
-const has = __webpack_require__(637);
-
-module.exports = function(obj, path, options) {
- if (isObject(obj) && (typeof path === 'string' || Array.isArray(path))) {
- return has(get(obj, path, options));
- }
- return false;
-};
-
-function isObject(val) {
- return val != null && (typeof val === 'object' || typeof val === 'function' || Array.isArray(val));
-}
-
-
-/***/ }),
-/* 635 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/*!
- * get-value
- *
- * Copyright (c) 2014-2018, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-const isObject = __webpack_require__(636);
-
-module.exports = function(target, path, options) {
- if (!isObject(options)) {
- options = { default: options };
- }
-
- if (!isValidObject(target)) {
- return typeof options.default !== 'undefined' ? options.default : target;
- }
-
- if (typeof path === 'number') {
- path = String(path);
- }
-
- const isArray = Array.isArray(path);
- const isString = typeof path === 'string';
- const splitChar = options.separator || '.';
- const joinChar = options.joinChar || (typeof splitChar === 'string' ? splitChar : '.');
-
- if (!isString && !isArray) {
- return target;
- }
-
- if (isString && path in target) {
- return isValid(path, target, options) ? target[path] : options.default;
- }
-
- let segs = isArray ? path : split(path, splitChar, options);
- let len = segs.length;
- let idx = 0;
-
- do {
- let prop = segs[idx];
- if (typeof prop === 'number') {
- prop = String(prop);
- }
-
- while (prop && prop.slice(-1) === '\\') {
- prop = join([prop.slice(0, -1), segs[++idx] || ''], joinChar, options);
- }
-
- if (prop in target) {
- if (!isValid(prop, target, options)) {
- return options.default;
- }
-
- target = target[prop];
- } else {
- let hasProp = false;
- let n = idx + 1;
-
- while (n < len) {
- prop = join([prop, segs[n++]], joinChar, options);
-
- if ((hasProp = prop in target)) {
- if (!isValid(prop, target, options)) {
- return options.default;
- }
-
- target = target[prop];
- idx = n - 1;
- break;
- }
- }
-
- if (!hasProp) {
- return options.default;
- }
- }
- } while (++idx < len && isValidObject(target));
-
- if (idx === len) {
- return target;
- }
-
- return options.default;
-};
-
-function join(segs, joinChar, options) {
- if (typeof options.join === 'function') {
- return options.join(segs);
- }
- return segs[0] + joinChar + segs[1];
-}
-
-function split(path, splitChar, options) {
- if (typeof options.split === 'function') {
- return options.split(path);
- }
- return path.split(splitChar);
-}
-
-function isValid(key, target, options) {
- if (typeof options.isValid === 'function') {
- return options.isValid(key, target);
- }
- return true;
-}
-
-function isValidObject(val) {
- return isObject(val) || Array.isArray(val) || typeof val === 'function';
-}
-
-
-/***/ }),
-/* 636 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * isobject
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-module.exports = function isObject(val) {
- return val != null && typeof val === 'object' && Array.isArray(val) === false;
-};
-
-
-/***/ }),
-/* 637 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * has-values
- *
- * Copyright (c) 2014-2018, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-const typeOf = __webpack_require__(592);
-
-module.exports = function has(val) {
- switch (typeOf(val)) {
- case 'boolean':
- case 'date':
- case 'function':
- case 'null':
- case 'number':
- return true;
- case 'undefined':
- return false;
- case 'regexp':
- return val.source !== '(?:)' && val.source !== '';
- case 'buffer':
- return val.toString() !== '';
- case 'error':
- return val.message !== '';
- case 'string':
- case 'arguments':
- return val.length !== 0;
- case 'file':
- case 'map':
- case 'set':
- return val.size !== 0;
- case 'array':
- case 'object':
- for (const key of Object.keys(val)) {
- if (has(val[key])) {
- return true;
- }
- }
- return false;
-
- // everything else
- default: {
- return true;
- }
- }
-};
-
-
-/***/ }),
-/* 638 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * has-value
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-var isObject = __webpack_require__(590);
-var hasValues = __webpack_require__(639);
-var get = __webpack_require__(629);
-
-module.exports = function(val, prop) {
- return hasValues(isObject(val) && prop ? get(val, prop) : val);
-};
-
-
-/***/ }),
-/* 639 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * has-values
- *
- * Copyright (c) 2014-2015, 2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-var isNumber = __webpack_require__(608);
-
-module.exports = function hasValue(val) {
- // is-number checks for NaN and other edge cases
- if (isNumber(val)) {
- return true;
- }
-
- switch (typeOf(val)) {
- case 'null':
- case 'boolean':
- case 'function':
- return true;
- case 'string':
- case 'arguments':
- return val.length !== 0;
- case 'error':
- return val.message !== '';
- case 'array':
- var len = val.length;
- if (len === 0) {
- return false;
- }
- for (var i = 0; i < len; i++) {
- if (hasValue(val[i])) {
- return true;
- }
- }
- return false;
- case 'file':
- case 'map':
- case 'set':
- return val.size !== 0;
- case 'object':
- var keys = Object.keys(val);
- if (keys.length === 0) {
- return false;
- }
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (hasValue(val[key])) {
- return true;
- }
- }
- return false;
- default: {
- return false;
- }
- }
-};
-
-
-/***/ }),
-/* 640 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var isExtendable = __webpack_require__(641);
-var forIn = __webpack_require__(642);
-
-function mixinDeep(target, objects) {
- var len = arguments.length, i = 0;
- while (++i < len) {
- var obj = arguments[i];
- if (isObject(obj)) {
- forIn(obj, copy, target);
- }
- }
- return target;
-}
-
-/**
- * Copy properties from the source object to the
- * target object.
- *
- * @param {*} `val`
- * @param {String} `key`
- */
-
-function copy(val, key) {
- if (!isValidKey(key)) {
- return;
- }
-
- var obj = this[key];
- if (isObject(val) && isObject(obj)) {
- mixinDeep(obj, val);
- } else {
- this[key] = val;
- }
-}
-
-/**
- * Returns true if `val` is an object or function.
- *
- * @param {any} val
- * @return {Boolean}
- */
-
-function isObject(val) {
- return isExtendable(val) && !Array.isArray(val);
-}
-
-/**
- * Returns true if `key` is a valid key to use when extending objects.
- *
- * @param {String} `key`
- * @return {Boolean}
- */
-
-function isValidKey(key) {
- return key !== '__proto__' && key !== 'constructor' && key !== 'prototype';
-};
-
-/**
- * Expose `mixinDeep`
- */
-
-module.exports = mixinDeep;
-
-
-/***/ }),
-/* 641 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-extendable
- *
- * Copyright (c) 2015-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var isPlainObject = __webpack_require__(597);
-
-module.exports = function isExtendable(val) {
- return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
-};
-
-
-/***/ }),
-/* 642 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * for-in
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-module.exports = function forIn(obj, fn, thisArg) {
- for (var key in obj) {
- if (fn.call(thisArg, obj[key], key, obj) === false) {
- break;
- }
- }
-};
-
-
-/***/ }),
-/* 643 */
-/***/ (function(module, exports) {
-
-/*!
- * pascalcase
- *
- * Copyright (c) 2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-function pascalcase(str) {
- if (typeof str !== 'string') {
- throw new TypeError('expected a string.');
- }
- str = str.replace(/([A-Z])/g, ' $1');
- if (str.length === 1) { return str.toUpperCase(); }
- str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase();
- str = str.charAt(0).toUpperCase() + str.slice(1);
- return str.replace(/[\W_]+(\w|$)/g, function (_, ch) {
- return ch.toUpperCase();
- });
-}
-
-module.exports = pascalcase;
-
-
-/***/ }),
-/* 644 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var util = __webpack_require__(112);
-var union = __webpack_require__(628);
-var define = __webpack_require__(645);
-var staticExtend = __webpack_require__(649);
-var isObj = __webpack_require__(590);
-
-/**
- * Expose class utils
- */
-
-var cu = module.exports;
-
-/**
- * Expose class utils: `cu`
- */
-
-cu.isObject = function isObject(val) {
- return isObj(val) || typeof val === 'function';
-};
-
-/**
- * Returns true if an array has any of the given elements, or an
- * object has any of the give keys.
- *
- * ```js
- * cu.has(['a', 'b', 'c'], 'c');
- * //=> true
- *
- * cu.has(['a', 'b', 'c'], ['c', 'z']);
- * //=> true
- *
- * cu.has({a: 'b', c: 'd'}, ['c', 'z']);
- * //=> true
- * ```
- * @param {Object} `obj`
- * @param {String|Array} `val`
- * @return {Boolean}
- * @api public
- */
-
-cu.has = function has(obj, val) {
- val = cu.arrayify(val);
- var len = val.length;
-
- if (cu.isObject(obj)) {
- for (var key in obj) {
- if (val.indexOf(key) > -1) {
- return true;
- }
- }
-
- var keys = cu.nativeKeys(obj);
- return cu.has(keys, val);
- }
-
- if (Array.isArray(obj)) {
- var arr = obj;
- while (len--) {
- if (arr.indexOf(val[len]) > -1) {
- return true;
- }
- }
- return false;
- }
-
- throw new TypeError('expected an array or object.');
-};
-
-/**
- * Returns true if an array or object has all of the given values.
- *
- * ```js
- * cu.hasAll(['a', 'b', 'c'], 'c');
- * //=> true
- *
- * cu.hasAll(['a', 'b', 'c'], ['c', 'z']);
- * //=> false
- *
- * cu.hasAll({a: 'b', c: 'd'}, ['c', 'z']);
- * //=> false
- * ```
- * @param {Object|Array} `val`
- * @param {String|Array} `values`
- * @return {Boolean}
- * @api public
- */
-
-cu.hasAll = function hasAll(val, values) {
- values = cu.arrayify(values);
- var len = values.length;
- while (len--) {
- if (!cu.has(val, values[len])) {
- return false;
- }
- }
- return true;
-};
-
-/**
- * Cast the given value to an array.
- *
- * ```js
- * cu.arrayify('foo');
- * //=> ['foo']
- *
- * cu.arrayify(['foo']);
- * //=> ['foo']
- * ```
- *
- * @param {String|Array} `val`
- * @return {Array}
- * @api public
- */
-
-cu.arrayify = function arrayify(val) {
- return val ? (Array.isArray(val) ? val : [val]) : [];
-};
-
-/**
- * Noop
- */
-
-cu.noop = function noop() {
- return;
-};
-
-/**
- * Returns the first argument passed to the function.
- */
-
-cu.identity = function identity(val) {
- return val;
-};
-
-/**
- * Returns true if a value has a `contructor`
- *
- * ```js
- * cu.hasConstructor({});
- * //=> true
- *
- * cu.hasConstructor(Object.create(null));
- * //=> false
- * ```
- * @param {Object} `value`
- * @return {Boolean}
- * @api public
- */
-
-cu.hasConstructor = function hasConstructor(val) {
- return cu.isObject(val) && typeof val.constructor !== 'undefined';
-};
-
-/**
- * Get the native `ownPropertyNames` from the constructor of the
- * given `object`. An empty array is returned if the object does
- * not have a constructor.
- *
- * ```js
- * cu.nativeKeys({a: 'b', b: 'c', c: 'd'})
- * //=> ['a', 'b', 'c']
- *
- * cu.nativeKeys(function(){})
- * //=> ['length', 'caller']
- * ```
- *
- * @param {Object} `obj` Object that has a `constructor`.
- * @return {Array} Array of keys.
- * @api public
- */
-
-cu.nativeKeys = function nativeKeys(val) {
- if (!cu.hasConstructor(val)) return [];
- var keys = Object.getOwnPropertyNames(val);
- if ('caller' in val) keys.push('caller');
- return keys;
-};
-
-/**
- * Returns property descriptor `key` if it's an "own" property
- * of the given object.
- *
- * ```js
- * function App() {}
- * Object.defineProperty(App.prototype, 'count', {
- * get: function() {
- * return Object.keys(this).length;
- * }
- * });
- * cu.getDescriptor(App.prototype, 'count');
- * // returns:
- * // {
- * // get: [Function],
- * // set: undefined,
- * // enumerable: false,
- * // configurable: false
- * // }
- * ```
- *
- * @param {Object} `obj`
- * @param {String} `key`
- * @return {Object} Returns descriptor `key`
- * @api public
- */
-
-cu.getDescriptor = function getDescriptor(obj, key) {
- if (!cu.isObject(obj)) {
- throw new TypeError('expected an object.');
- }
- if (typeof key !== 'string') {
- throw new TypeError('expected key to be a string.');
- }
- return Object.getOwnPropertyDescriptor(obj, key);
-};
-
-/**
- * Copy a descriptor from one object to another.
- *
- * ```js
- * function App() {}
- * Object.defineProperty(App.prototype, 'count', {
- * get: function() {
- * return Object.keys(this).length;
- * }
- * });
- * var obj = {};
- * cu.copyDescriptor(obj, App.prototype, 'count');
- * ```
- * @param {Object} `receiver`
- * @param {Object} `provider`
- * @param {String} `name`
- * @return {Object}
- * @api public
- */
-
-cu.copyDescriptor = function copyDescriptor(receiver, provider, name) {
- if (!cu.isObject(receiver)) {
- throw new TypeError('expected receiving object to be an object.');
- }
- if (!cu.isObject(provider)) {
- throw new TypeError('expected providing object to be an object.');
- }
- if (typeof name !== 'string') {
- throw new TypeError('expected name to be a string.');
- }
-
- var val = cu.getDescriptor(provider, name);
- if (val) Object.defineProperty(receiver, name, val);
-};
-
-/**
- * Copy static properties, prototype properties, and descriptors
- * from one object to another.
- *
- * @param {Object} `receiver`
- * @param {Object} `provider`
- * @param {String|Array} `omit` One or more properties to omit
- * @return {Object}
- * @api public
- */
-
-cu.copy = function copy(receiver, provider, omit) {
- if (!cu.isObject(receiver)) {
- throw new TypeError('expected receiving object to be an object.');
- }
- if (!cu.isObject(provider)) {
- throw new TypeError('expected providing object to be an object.');
- }
- var props = Object.getOwnPropertyNames(provider);
- var keys = Object.keys(provider);
- var len = props.length,
- key;
- omit = cu.arrayify(omit);
-
- while (len--) {
- key = props[len];
-
- if (cu.has(keys, key)) {
- define(receiver, key, provider[key]);
- } else if (!(key in receiver) && !cu.has(omit, key)) {
- cu.copyDescriptor(receiver, provider, key);
- }
- }
-};
-
-/**
- * Inherit the static properties, prototype properties, and descriptors
- * from of an object.
- *
- * @param {Object} `receiver`
- * @param {Object} `provider`
- * @param {String|Array} `omit` One or more properties to omit
- * @return {Object}
- * @api public
- */
-
-cu.inherit = function inherit(receiver, provider, omit) {
- if (!cu.isObject(receiver)) {
- throw new TypeError('expected receiving object to be an object.');
- }
- if (!cu.isObject(provider)) {
- throw new TypeError('expected providing object to be an object.');
- }
-
- var keys = [];
- for (var key in provider) {
- keys.push(key);
- receiver[key] = provider[key];
- }
-
- keys = keys.concat(cu.arrayify(omit));
-
- var a = provider.prototype || provider;
- var b = receiver.prototype || receiver;
- cu.copy(b, a, keys);
-};
-
-/**
- * Returns a function for extending the static properties,
- * prototype properties, and descriptors from the `Parent`
- * constructor onto `Child` constructors.
- *
- * ```js
- * var extend = cu.extend(Parent);
- * Parent.extend(Child);
- *
- * // optional methods
- * Parent.extend(Child, {
- * foo: function() {},
- * bar: function() {}
- * });
- * ```
- * @param {Function} `Parent` Parent ctor
- * @param {Function} `extend` Optional extend function to handle custom extensions. Useful when updating methods that require a specific prototype.
- * @param {Function} `Child` Child ctor
- * @param {Object} `proto` Optionally pass additional prototype properties to inherit.
- * @return {Object}
- * @api public
- */
-
-cu.extend = function() {
- // keep it lazy, instead of assigning to `cu.extend`
- return staticExtend.apply(null, arguments);
-};
-
-/**
- * Bubble up events emitted from static methods on the Parent ctor.
- *
- * @param {Object} `Parent`
- * @param {Array} `events` Event names to bubble up
- * @api public
- */
-
-cu.bubble = function(Parent, events) {
- events = events || [];
- Parent.bubble = function(Child, arr) {
- if (Array.isArray(arr)) {
- events = union([], events, arr);
- }
- var len = events.length;
- var idx = -1;
- while (++idx < len) {
- var name = events[idx];
- Parent.on(name, Child.emit.bind(Child, name));
- }
- cu.bubble(Child, events);
- };
-};
-
-
-/***/ }),
-/* 645 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * define-property
- *
- * Copyright (c) 2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-var isDescriptor = __webpack_require__(646);
-
-module.exports = function defineProperty(obj, prop, val) {
- if (typeof obj !== 'object' && typeof obj !== 'function') {
- throw new TypeError('expected an object or function.');
- }
-
- if (typeof prop !== 'string') {
- throw new TypeError('expected `prop` to be a string.');
- }
-
- if (isDescriptor(val) && ('set' in val || 'get' in val)) {
- return Object.defineProperty(obj, prop, val);
- }
-
- return Object.defineProperty(obj, prop, {
- configurable: true,
- enumerable: false,
- writable: true,
- value: val
- });
-};
-
-
-/***/ }),
-/* 646 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-descriptor
- *
- * Copyright (c) 2015-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-var isAccessor = __webpack_require__(647);
-var isData = __webpack_require__(648);
-
-module.exports = function isDescriptor(obj, key) {
- if (typeOf(obj) !== 'object') {
- return false;
- }
- if ('get' in obj) {
- return isAccessor(obj, key);
- }
- return isData(obj, key);
-};
-
-
-/***/ }),
-/* 647 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-accessor-descriptor
- *
- * Copyright (c) 2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-
-// accessor descriptor properties
-var accessor = {
- get: 'function',
- set: 'function',
- configurable: 'boolean',
- enumerable: 'boolean'
-};
-
-function isAccessorDescriptor(obj, prop) {
- if (typeof prop === 'string') {
- var val = Object.getOwnPropertyDescriptor(obj, prop);
- return typeof val !== 'undefined';
- }
-
- if (typeOf(obj) !== 'object') {
- return false;
- }
-
- if (has(obj, 'value') || has(obj, 'writable')) {
- return false;
- }
-
- if (!has(obj, 'get') || typeof obj.get !== 'function') {
- return false;
- }
-
- // tldr: it's valid to have "set" be undefined
- // "set" might be undefined if `Object.getOwnPropertyDescriptor`
- // was used to get the value, and only `get` was defined by the user
- if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') {
- return false;
- }
-
- for (var key in obj) {
- if (!accessor.hasOwnProperty(key)) {
- continue;
- }
-
- if (typeOf(obj[key]) === accessor[key]) {
- continue;
- }
-
- if (typeof obj[key] !== 'undefined') {
- return false;
- }
- }
- return true;
-}
-
-function has(obj, key) {
- return {}.hasOwnProperty.call(obj, key);
-}
-
-/**
- * Expose `isAccessorDescriptor`
- */
-
-module.exports = isAccessorDescriptor;
-
-
-/***/ }),
-/* 648 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * is-data-descriptor
- *
- * Copyright (c) 2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-var typeOf = __webpack_require__(592);
-
-// data descriptor properties
-var data = {
- configurable: 'boolean',
- enumerable: 'boolean',
- writable: 'boolean'
-};
-
-function isDataDescriptor(obj, prop) {
- if (typeOf(obj) !== 'object') {
- return false;
- }
-
- if (typeof prop === 'string') {
- var val = Object.getOwnPropertyDescriptor(obj, prop);
- return typeof val !== 'undefined';
- }
-
- if (!('value' in obj) && !('writable' in obj)) {
- return false;
- }
-
- for (var key in obj) {
- if (key === 'value') continue;
-
- if (!data.hasOwnProperty(key)) {
- continue;
- }
-
- if (typeOf(obj[key]) === data[key]) {
- continue;
- }
-
- if (typeof obj[key] !== 'undefined') {
- return false;
- }
- }
- return true;
-}
-
-/**
- * Expose `isDataDescriptor`
- */
-
-module.exports = isDataDescriptor;
-
-
-/***/ }),
-/* 649 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * static-extend
- *
- * Copyright (c) 2016, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-var copy = __webpack_require__(650);
-var define = __webpack_require__(645);
-var util = __webpack_require__(112);
-
-/**
- * Returns a function for extending the static properties,
- * prototype properties, and descriptors from the `Parent`
- * constructor onto `Child` constructors.
- *
- * ```js
- * var extend = require('static-extend');
- * Parent.extend = extend(Parent);
- *
- * // optionally pass a custom merge function as the second arg
- * Parent.extend = extend(Parent, function(Child) {
- * Child.prototype.mixin = function(key, val) {
- * Child.prototype[key] = val;
- * };
- * });
- *
- * // extend "child" constructors
- * Parent.extend(Child);
- *
- * // optionally define prototype methods as the second arg
- * Parent.extend(Child, {
- * foo: function() {},
- * bar: function() {}
- * });
- * ```
- * @param {Function} `Parent` Parent ctor
- * @param {Function} `extendFn` Optional extend function for handling any necessary custom merging. Useful when updating methods that require a specific prototype.
- * @param {Function} `Child` Child ctor
- * @param {Object} `proto` Optionally pass additional prototype properties to inherit.
- * @return {Object}
- * @api public
- */
-
-function extend(Parent, extendFn) {
- if (typeof Parent !== 'function') {
- throw new TypeError('expected Parent to be a function.');
- }
-
- return function(Ctor, proto) {
- if (typeof Ctor !== 'function') {
- throw new TypeError('expected Ctor to be a function.');
- }
-
- util.inherits(Ctor, Parent);
- copy(Ctor, Parent);
-
- // proto can be null or a plain object
- if (typeof proto === 'object') {
- var obj = Object.create(proto);
-
- for (var k in obj) {
- Ctor.prototype[k] = obj[k];
- }
- }
-
- // keep a reference to the parent prototype
- define(Ctor.prototype, '_parent_', {
- configurable: true,
- set: function() {},
- get: function() {
- return Parent.prototype;
- }
- });
-
- if (typeof extendFn === 'function') {
- extendFn(Ctor, Parent);
- }
-
- Ctor.extend = extend(Ctor, extendFn);
- };
-};
-
-/**
- * Expose `extend`
- */
-
-module.exports = extend;
-
-
-/***/ }),
-/* 650 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var typeOf = __webpack_require__(592);
-var copyDescriptor = __webpack_require__(651);
-var define = __webpack_require__(645);
-
-/**
- * Copy static properties, prototype properties, and descriptors from one object to another.
- *
- * ```js
- * function App() {}
- * var proto = App.prototype;
- * App.prototype.set = function() {};
- * App.prototype.get = function() {};
- *
- * var obj = {};
- * copy(obj, proto);
- * ```
- * @param {Object} `receiver`
- * @param {Object} `provider`
- * @param {String|Array} `omit` One or more properties to omit
- * @return {Object}
- * @api public
- */
-
-function copy(receiver, provider, omit) {
- if (!isObject(receiver)) {
- throw new TypeError('expected receiving object to be an object.');
- }
- if (!isObject(provider)) {
- throw new TypeError('expected providing object to be an object.');
- }
-
- var props = nativeKeys(provider);
- var keys = Object.keys(provider);
- var len = props.length;
- omit = arrayify(omit);
-
- while (len--) {
- var key = props[len];
-
- if (has(keys, key)) {
- define(receiver, key, provider[key]);
- } else if (!(key in receiver) && !has(omit, key)) {
- copyDescriptor(receiver, provider, key);
- }
- }
-};
-
-/**
- * Return true if the given value is an object or function
- */
-
-function isObject(val) {
- return typeOf(val) === 'object' || typeof val === 'function';
-}
-
-/**
- * Returns true if an array has any of the given elements, or an
- * object has any of the give keys.
- *
- * ```js
- * has(['a', 'b', 'c'], 'c');
- * //=> true
- *
- * has(['a', 'b', 'c'], ['c', 'z']);
- * //=> true
- *
- * has({a: 'b', c: 'd'}, ['c', 'z']);
- * //=> true
- * ```
- * @param {Object} `obj`
- * @param {String|Array} `val`
- * @return {Boolean}
- */
-
-function has(obj, val) {
- val = arrayify(val);
- var len = val.length;
-
- if (isObject(obj)) {
- for (var key in obj) {
- if (val.indexOf(key) > -1) {
- return true;
- }
- }
-
- var keys = nativeKeys(obj);
- return has(keys, val);
- }
-
- if (Array.isArray(obj)) {
- var arr = obj;
- while (len--) {
- if (arr.indexOf(val[len]) > -1) {
- return true;
- }
- }
- return false;
- }
-
- throw new TypeError('expected an array or object.');
-}
-
-/**
- * Cast the given value to an array.
- *
- * ```js
- * arrayify('foo');
- * //=> ['foo']
- *
- * arrayify(['foo']);
- * //=> ['foo']
- * ```
- *
- * @param {String|Array} `val`
- * @return {Array}
- */
-
-function arrayify(val) {
- return val ? (Array.isArray(val) ? val : [val]) : [];
-}
-
-/**
- * Returns true if a value has a `contructor`
- *
- * ```js
- * hasConstructor({});
- * //=> true
- *
- * hasConstructor(Object.create(null));
- * //=> false
- * ```
- * @param {Object} `value`
- * @return {Boolean}
- */
-
-function hasConstructor(val) {
- return isObject(val) && typeof val.constructor !== 'undefined';
-}
-
-/**
- * Get the native `ownPropertyNames` from the constructor of the
- * given `object`. An empty array is returned if the object does
- * not have a constructor.
- *
- * ```js
- * nativeKeys({a: 'b', b: 'c', c: 'd'})
- * //=> ['a', 'b', 'c']
- *
- * nativeKeys(function(){})
- * //=> ['length', 'caller']
- * ```
- *
- * @param {Object} `obj` Object that has a `constructor`.
- * @return {Array} Array of keys.
- */
-
-function nativeKeys(val) {
- if (!hasConstructor(val)) return [];
- return Object.getOwnPropertyNames(val);
-}
-
-/**
- * Expose `copy`
- */
-
-module.exports = copy;
-
-/**
- * Expose `copy.has` for tests
- */
-
-module.exports.has = has;
-
-
-/***/ }),
-/* 651 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * copy-descriptor
- *
- * Copyright (c) 2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-
-
-/**
- * Copy a descriptor from one object to another.
- *
- * ```js
- * function App() {
- * this.cache = {};
- * }
- * App.prototype.set = function(key, val) {
- * this.cache[key] = val;
- * return this;
- * };
- * Object.defineProperty(App.prototype, 'count', {
- * get: function() {
- * return Object.keys(this.cache).length;
- * }
- * });
- *
- * copy(App.prototype, 'count', 'len');
- *
- * // create an instance
- * var app = new App();
- *
- * app.set('a', true);
- * app.set('b', true);
- * app.set('c', true);
- *
- * console.log(app.count);
- * //=> 3
- * console.log(app.len);
- * //=> 3
- * ```
- * @name copy
- * @param {Object} `receiver` The target object
- * @param {Object} `provider` The provider object
- * @param {String} `from` The key to copy on provider.
- * @param {String} `to` Optionally specify a new key name to use.
- * @return {Object}
- * @api public
- */
-
-module.exports = function copyDescriptor(receiver, provider, from, to) {
- if (!isObject(provider) && typeof provider !== 'function') {
- to = from;
- from = provider;
- provider = receiver;
- }
- if (!isObject(receiver) && typeof receiver !== 'function') {
- throw new TypeError('expected the first argument to be an object');
- }
- if (!isObject(provider) && typeof provider !== 'function') {
- throw new TypeError('expected provider to be an object');
- }
-
- if (typeof to !== 'string') {
- to = from;
- }
- if (typeof from !== 'string') {
- throw new TypeError('expected key to be a string');
- }
-
- if (!(from in provider)) {
- throw new Error('property "' + from + '" does not exist');
- }
-
- var val = Object.getOwnPropertyDescriptor(provider, from);
- if (val) Object.defineProperty(receiver, to, val);
-};
-
-function isObject(val) {
- return {}.toString.call(val) === '[object Object]';
-}
-
-
-
-/***/ }),
-/* 652 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var use = __webpack_require__(653);
-var define = __webpack_require__(645);
-var debug = __webpack_require__(654)('snapdragon:compiler');
-var utils = __webpack_require__(660);
-
-/**
- * Create a new `Compiler` with the given `options`.
- * @param {Object} `options`
- */
-
-function Compiler(options, state) {
- debug('initializing', __filename);
- this.options = utils.extend({source: 'string'}, options);
- this.state = state || {};
- this.compilers = {};
- this.output = '';
- this.set('eos', function(node) {
- return this.emit(node.val, node);
- });
- this.set('noop', function(node) {
- return this.emit(node.val, node);
- });
- this.set('bos', function(node) {
- return this.emit(node.val, node);
- });
- use(this);
-}
-
-/**
- * Prototype methods
- */
-
-Compiler.prototype = {
-
- /**
- * Throw an error message with details including the cursor position.
- * @param {String} `msg` Message to use in the Error.
- */
-
- error: function(msg, node) {
- var pos = node.position || {start: {column: 0}};
- var message = this.options.source + ' column:' + pos.start.column + ': ' + msg;
-
- var err = new Error(message);
- err.reason = msg;
- err.column = pos.start.column;
- err.source = this.pattern;
-
- if (this.options.silent) {
- this.errors.push(err);
- } else {
- throw err;
- }
- },
-
- /**
- * Define a non-enumberable property on the `Compiler` instance.
- *
- * ```js
- * compiler.define('foo', 'bar');
- * ```
- * @name .define
- * @param {String} `key` propery name
- * @param {any} `val` property value
- * @return {Object} Returns the Compiler instance for chaining.
- * @api public
- */
-
- define: function(key, val) {
- define(this, key, val);
- return this;
- },
-
- /**
- * Emit `node.val`
- */
-
- emit: function(str, node) {
- this.output += str;
- return str;
- },
-
- /**
- * Add a compiler `fn` with the given `name`
- */
-
- set: function(name, fn) {
- this.compilers[name] = fn;
- return this;
- },
-
- /**
- * Get compiler `name`.
- */
-
- get: function(name) {
- return this.compilers[name];
- },
-
- /**
- * Get the previous AST node.
- */
-
- prev: function(n) {
- return this.ast.nodes[this.idx - (n || 1)] || { type: 'bos', val: '' };
- },
-
- /**
- * Get the next AST node.
- */
-
- next: function(n) {
- return this.ast.nodes[this.idx + (n || 1)] || { type: 'eos', val: '' };
- },
-
- /**
- * Visit `node`.
- */
-
- visit: function(node, nodes, i) {
- var fn = this.compilers[node.type];
- this.idx = i;
-
- if (typeof fn !== 'function') {
- throw this.error('compiler "' + node.type + '" is not registered', node);
- }
- return fn.call(this, node, nodes, i);
- },
-
- /**
- * Map visit over array of `nodes`.
- */
-
- mapVisit: function(nodes) {
- if (!Array.isArray(nodes)) {
- throw new TypeError('expected an array');
- }
- var len = nodes.length;
- var idx = -1;
- while (++idx < len) {
- this.visit(nodes[idx], nodes, idx);
- }
- return this;
- },
-
- /**
- * Compile `ast`.
- */
-
- compile: function(ast, options) {
- var opts = utils.extend({}, this.options, options);
- this.ast = ast;
- this.parsingErrors = this.ast.errors;
- this.output = '';
-
- // source map support
- if (opts.sourcemap) {
- var sourcemaps = __webpack_require__(680);
- sourcemaps(this);
- this.mapVisit(this.ast.nodes);
- this.applySourceMaps();
- this.map = opts.sourcemap === 'generator' ? this.map : this.map.toJSON();
- return this;
- }
-
- this.mapVisit(this.ast.nodes);
- return this;
- }
-};
-
-/**
- * Expose `Compiler`
- */
-
-module.exports = Compiler;
-
-
-/***/ }),
-/* 653 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * use
- *
- * Copyright (c) 2015-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-
-
-module.exports = function base(app, options) {
- if (!isObject(app) && typeof app !== 'function') {
- throw new TypeError('expected an object or function');
- }
-
- var opts = isObject(options) ? options : {};
- var prop = typeof opts.prop === 'string' ? opts.prop : 'fns';
- if (!Array.isArray(app[prop])) {
- define(app, prop, []);
- }
-
- /**
- * Define a plugin function to be passed to use. The only
- * parameter exposed to the plugin is `app`, the object or function.
- * passed to `use(app)`. `app` is also exposed as `this` in plugins.
- *
- * Additionally, **if a plugin returns a function, the function will
- * be pushed onto the `fns` array**, allowing the plugin to be
- * called at a later point by the `run` method.
- *
- * ```js
- * var use = require('use');
- *
- * // define a plugin
- * function foo(app) {
- * // do stuff
- * }
- *
- * var app = function(){};
- * use(app);
- *
- * // register plugins
- * app.use(foo);
- * app.use(bar);
- * app.use(baz);
- * ```
- * @name .use
- * @param {Function} `fn` plugin function to call
- * @api public
- */
-
- define(app, 'use', use);
-
- /**
- * Run all plugins on `fns`. Any plugin that returns a function
- * when called by `use` is pushed onto the `fns` array.
- *
- * ```js
- * var config = {};
- * app.run(config);
- * ```
- * @name .run
- * @param {Object} `value` Object to be modified by plugins.
- * @return {Object} Returns the object passed to `run`
- * @api public
- */
-
- define(app, 'run', function(val) {
- if (!isObject(val)) return;
-
- if (!val.use || !val.run) {
- define(val, prop, val[prop] || []);
- define(val, 'use', use);
- }
-
- if (!val[prop] || val[prop].indexOf(base) === -1) {
- val.use(base);
- }
-
- var self = this || app;
- var fns = self[prop];
- var len = fns.length;
- var idx = -1;
-
- while (++idx < len) {
- val.use(fns[idx]);
- }
- return val;
- });
-
- /**
- * Call plugin `fn`. If a function is returned push it into the
- * `fns` array to be called by the `run` method.
- */
-
- function use(type, fn, options) {
- var offset = 1;
-
- if (typeof type === 'string' || Array.isArray(type)) {
- fn = wrap(type, fn);
- offset++;
- } else {
- options = fn;
- fn = type;
- }
-
- if (typeof fn !== 'function') {
- throw new TypeError('expected a function');
- }
-
- var self = this || app;
- var fns = self[prop];
-
- var args = [].slice.call(arguments, offset);
- args.unshift(self);
-
- if (typeof opts.hook === 'function') {
- opts.hook.apply(self, args);
- }
-
- var val = fn.apply(self, args);
- if (typeof val === 'function' && fns.indexOf(val) === -1) {
- fns.push(val);
- }
- return self;
- }
-
- /**
- * Wrap a named plugin function so that it's only called on objects of the
- * given `type`
- *
- * @param {String} `type`
- * @param {Function} `fn` Plugin function
- * @return {Function}
- */
-
- function wrap(type, fn) {
- return function plugin() {
- return this.type === type ? fn.apply(this, arguments) : plugin;
- };
- }
-
- return app;
-};
-
-function isObject(val) {
- return val && typeof val === 'object' && !Array.isArray(val);
-}
-
-function define(obj, key, val) {
- Object.defineProperty(obj, key, {
- configurable: true,
- writable: true,
- value: val
- });
-}
-
-
-/***/ }),
-/* 654 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/**
- * Detect Electron renderer process, which is node, but we should
- * treat as a browser.
- */
-
-if (typeof process !== 'undefined' && process.type === 'renderer') {
- module.exports = __webpack_require__(655);
-} else {
- module.exports = __webpack_require__(658);
-}
-
-
-/***/ }),
-/* 655 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/**
- * This is the web browser implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = __webpack_require__(656);
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-exports.storage = 'undefined' != typeof chrome
- && 'undefined' != typeof chrome.storage
- ? chrome.storage.local
- : localstorage();
-
-/**
- * Colors.
- */
-
-exports.colors = [
- 'lightseagreen',
- 'forestgreen',
- 'goldenrod',
- 'dodgerblue',
- 'darkorchid',
- 'crimson'
-];
-
-/**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
-function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
- return true;
- }
-
- // is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
- // double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
-}
-
-/**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
-exports.formatters.j = function(v) {
- try {
- return JSON.stringify(v);
- } catch (err) {
- return '[UnexpectedJSONParseError]: ' + err.message;
- }
-};
-
-
-/**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
-function formatArgs(args) {
- var useColors = this.useColors;
-
- args[0] = (useColors ? '%c' : '')
- + this.namespace
- + (useColors ? ' %c' : ' ')
- + args[0]
- + (useColors ? '%c ' : ' ')
- + '+' + exports.humanize(this.diff);
-
- if (!useColors) return;
-
- var c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit')
-
- // the final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, function(match) {
- if ('%%' === match) return;
- index++;
- if ('%c' === match) {
- // we only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
-}
-
-/**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
- *
- * @api public
- */
-
-function log() {
- // this hackery is required for IE8/9, where
- // the `console.log` function doesn't have 'apply'
- return 'object' === typeof console
- && console.log
- && Function.prototype.apply.call(console.log, console, arguments);
-}
-
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
-function save(namespaces) {
- try {
- if (null == namespaces) {
- exports.storage.removeItem('debug');
- } else {
- exports.storage.debug = namespaces;
- }
- } catch(e) {}
-}
-
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
-function load() {
- var r;
- try {
- r = exports.storage.debug;
- } catch(e) {}
-
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
-
- return r;
-}
-
-/**
- * Enable namespaces listed in `localStorage.debug` initially.
- */
-
-exports.enable(load());
-
-/**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-
-function localstorage() {
- try {
- return window.localStorage;
- } catch (e) {}
-}
-
-
-/***/ }),
-/* 656 */
-/***/ (function(module, exports, __webpack_require__) {
-
-
-/**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
-exports.coerce = coerce;
-exports.disable = disable;
-exports.enable = enable;
-exports.enabled = enabled;
-exports.humanize = __webpack_require__(657);
-
-/**
- * The currently active debug mode names, and names to skip.
- */
-
-exports.names = [];
-exports.skips = [];
-
-/**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
- */
-
-exports.formatters = {};
-
-/**
- * Previous log timestamp.
- */
-
-var prevTime;
-
-/**
- * Select a color.
- * @param {String} namespace
- * @return {Number}
- * @api private
- */
-
-function selectColor(namespace) {
- var hash = 0, i;
-
- for (i in namespace) {
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
- hash |= 0; // Convert to 32bit integer
- }
-
- return exports.colors[Math.abs(hash) % exports.colors.length];
-}
-
-/**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
-
-function createDebug(namespace) {
-
- function debug() {
- // disabled?
- if (!debug.enabled) return;
-
- var self = debug;
-
- // set `diff` timestamp
- var curr = +new Date();
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
-
- // turn the `arguments` into a proper Array
- var args = new Array(arguments.length);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i];
- }
-
- args[0] = exports.coerce(args[0]);
-
- if ('string' !== typeof args[0]) {
- // anything else let's inspect with %O
- args.unshift('%O');
- }
-
- // apply any `formatters` transformations
- var index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
- // if we encounter an escaped % then don't increase the array index
- if (match === '%%') return match;
- index++;
- var formatter = exports.formatters[format];
- if ('function' === typeof formatter) {
- var val = args[index];
- match = formatter.call(self, val);
-
- // now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
-
- // apply env-specific formatting (colors, etc.)
- exports.formatArgs.call(self, args);
-
- var logFn = debug.log || exports.log || console.log.bind(console);
- logFn.apply(self, args);
- }
-
- debug.namespace = namespace;
- debug.enabled = exports.enabled(namespace);
- debug.useColors = exports.useColors();
- debug.color = selectColor(namespace);
-
- // env-specific initialization logic for debug instances
- if ('function' === typeof exports.init) {
- exports.init(debug);
- }
-
- return debug;
-}
-
-/**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
-
-function enable(namespaces) {
- exports.save(namespaces);
-
- exports.names = [];
- exports.skips = [];
-
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- var len = split.length;
-
- for (var i = 0; i < len; i++) {
- if (!split[i]) continue; // ignore empty strings
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- exports.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
-}
-
-/**
- * Disable debug output.
- *
- * @api public
- */
-
-function disable() {
- exports.enable('');
-}
-
-/**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
-
-function enabled(name) {
- var i, len;
- for (i = 0, len = exports.skips.length; i < len; i++) {
- if (exports.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = exports.names.length; i < len; i++) {
- if (exports.names[i].test(name)) {
- return true;
- }
- }
- return false;
-}
-
-/**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
-
-function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
-}
-
-
-/***/ }),
-/* 657 */
-/***/ (function(module, exports) {
-
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
- */
-
-module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isNaN(val) === false) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
-function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function fmtShort(ms) {
- if (ms >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (ms >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (ms >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (ms >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function fmtLong(ms) {
- return plural(ms, d, 'day') ||
- plural(ms, h, 'hour') ||
- plural(ms, m, 'minute') ||
- plural(ms, s, 'second') ||
- ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- */
-
-function plural(ms, n, name) {
- if (ms < n) {
- return;
- }
- if (ms < n * 1.5) {
- return Math.floor(ms / n) + ' ' + name;
- }
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
-
-
-/***/ }),
-/* 658 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/**
- * Module dependencies.
- */
-
-var tty = __webpack_require__(122);
-var util = __webpack_require__(112);
-
-/**
- * This is the Node.js implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = __webpack_require__(656);
-exports.init = init;
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-
-/**
- * Colors.
- */
-
-exports.colors = [6, 2, 3, 4, 5, 1];
-
-/**
- * Build up the default `inspectOpts` object from the environment variables.
- *
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
- */
-
-exports.inspectOpts = Object.keys(process.env).filter(function (key) {
- return /^debug_/i.test(key);
-}).reduce(function (obj, key) {
- // camel-case
- var prop = key
- .substring(6)
- .toLowerCase()
- .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
-
- // coerce string value into JS value
- var val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
- else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
- else if (val === 'null') val = null;
- else val = Number(val);
-
- obj[prop] = val;
- return obj;
-}, {});
-
-/**
- * The file descriptor to write the `debug()` calls to.
- * Set the `DEBUG_FD` env variable to override with another value. i.e.:
- *
- * $ DEBUG_FD=3 node script.js 3>debug.log
- */
-
-var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
-
-if (1 !== fd && 2 !== fd) {
- util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
-}
-
-var stream = 1 === fd ? process.stdout :
- 2 === fd ? process.stderr :
- createWritableStdioStream(fd);
-
-/**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
-
-function useColors() {
- return 'colors' in exports.inspectOpts
- ? Boolean(exports.inspectOpts.colors)
- : tty.isatty(fd);
-}
-
-/**
- * Map %o to `util.inspect()`, all on a single line.
- */
-
-exports.formatters.o = function(v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts)
- .split('\n').map(function(str) {
- return str.trim()
- }).join(' ');
-};
-
-/**
- * Map %o to `util.inspect()`, allowing multiple lines if needed.
- */
-
-exports.formatters.O = function(v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
-};
-
-/**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
-
-function formatArgs(args) {
- var name = this.namespace;
- var useColors = this.useColors;
-
- if (useColors) {
- var c = this.color;
- var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
-
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
- args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
- } else {
- args[0] = new Date().toUTCString()
- + ' ' + name + ' ' + args[0];
- }
-}
-
-/**
- * Invokes `util.format()` with the specified arguments and writes to `stream`.
- */
-
-function log() {
- return stream.write(util.format.apply(util, arguments) + '\n');
-}
-
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
-function save(namespaces) {
- if (null == namespaces) {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- } else {
- process.env.DEBUG = namespaces;
- }
-}
-
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
-function load() {
- return process.env.DEBUG;
-}
-
-/**
- * Copied from `node/src/node.js`.
- *
- * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
- * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
- */
-
-function createWritableStdioStream (fd) {
- var stream;
- var tty_wrap = process.binding('tty_wrap');
-
- // Note stream._type is used for test-module-load-list.js
-
- switch (tty_wrap.guessHandleType(fd)) {
- case 'TTY':
- stream = new tty.WriteStream(fd);
- stream._type = 'tty';
-
- // Hack to have stream not keep the event loop alive.
- // See https://github.com/joyent/node/issues/1726
- if (stream._handle && stream._handle.unref) {
- stream._handle.unref();
- }
- break;
-
- case 'FILE':
- var fs = __webpack_require__(134);
- stream = new fs.SyncWriteStream(fd, { autoClose: false });
- stream._type = 'fs';
- break;
-
- case 'PIPE':
- case 'TCP':
- var net = __webpack_require__(659);
- stream = new net.Socket({
- fd: fd,
- readable: false,
- writable: true
- });
-
- // FIXME Should probably have an option in net.Socket to create a
- // stream from an existing fd which is writable only. But for now
- // we'll just add this hack and set the `readable` member to false.
- // Test: ./node test/fixtures/echo.js < /etc/passwd
- stream.readable = false;
- stream.read = null;
- stream._type = 'pipe';
-
- // FIXME Hack to have stream not keep the event loop alive.
- // See https://github.com/joyent/node/issues/1726
- if (stream._handle && stream._handle.unref) {
- stream._handle.unref();
- }
- break;
-
- default:
- // Probably an error on in uv_guess_handle()
- throw new Error('Implement me. Unknown stream file type!');
- }
-
- // For supporting legacy API we put the FD here.
- stream.fd = fd;
-
- stream._isStdio = true;
-
- return stream;
-}
-
-/**
- * Init logic for `debug` instances.
- *
- * Create a new `inspectOpts` object in case `useColors` is set
- * differently for a particular `debug` instance.
- */
-
-function init (debug) {
- debug.inspectOpts = {};
-
- var keys = Object.keys(exports.inspectOpts);
- for (var i = 0; i < keys.length; i++) {
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
- }
-}
-
-/**
- * Enable namespaces listed in `process.env.DEBUG` initially.
- */
-
-exports.enable(load());
-
-
-/***/ }),
-/* 659 */
-/***/ (function(module, exports) {
-
-module.exports = require("net");
-
-/***/ }),
-/* 660 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Module dependencies
- */
-
-exports.extend = __webpack_require__(661);
-exports.SourceMap = __webpack_require__(662);
-exports.sourceMapResolve = __webpack_require__(673);
-
-/**
- * Convert backslash in the given string to forward slashes
- */
-
-exports.unixify = function(fp) {
- return fp.split(/\\+/).join('/');
-};
-
-/**
- * Return true if `val` is a non-empty string
- *
- * @param {String} `str`
- * @return {Boolean}
- */
-
-exports.isString = function(str) {
- return str && typeof str === 'string';
-};
-
-/**
- * Cast `val` to an array
- * @return {Array}
- */
-
-exports.arrayify = function(val) {
- if (typeof val === 'string') return [val];
- return val ? (Array.isArray(val) ? val : [val]) : [];
-};
-
-/**
- * Get the last `n` element from the given `array`
- * @param {Array} `array`
- * @return {*}
- */
-
-exports.last = function(arr, n) {
- return arr[arr.length - (n || 1)];
-};
-
-
-/***/ }),
-/* 661 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var isObject = __webpack_require__(602);
-
-module.exports = function extend(o/*, objects*/) {
- if (!isObject(o)) { o = {}; }
-
- var len = arguments.length;
- for (var i = 1; i < len; i++) {
- var obj = arguments[i];
-
- if (isObject(obj)) {
- assign(o, obj);
- }
- }
- return o;
-};
-
-function assign(a, b) {
- for (var key in b) {
- if (hasOwn(b, key)) {
- a[key] = b[key];
- }
- }
-}
-
-/**
- * Returns true if the given `key` is an own property of `obj`.
- */
-
-function hasOwn(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
-}
-
-
-/***/ }),
-/* 662 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/*
- * Copyright 2009-2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE.txt or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-exports.SourceMapGenerator = __webpack_require__(663).SourceMapGenerator;
-exports.SourceMapConsumer = __webpack_require__(669).SourceMapConsumer;
-exports.SourceNode = __webpack_require__(672).SourceNode;
-
-
-/***/ }),
-/* 663 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-var base64VLQ = __webpack_require__(664);
-var util = __webpack_require__(666);
-var ArraySet = __webpack_require__(667).ArraySet;
-var MappingList = __webpack_require__(668).MappingList;
-
-/**
- * An instance of the SourceMapGenerator represents a source map which is
- * being built incrementally. You may pass an object with the following
- * properties:
- *
- * - file: The filename of the generated source.
- * - sourceRoot: A root for all relative URLs in this source map.
- */
-function SourceMapGenerator(aArgs) {
- if (!aArgs) {
- aArgs = {};
- }
- this._file = util.getArg(aArgs, 'file', null);
- this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
- this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
- this._sources = new ArraySet();
- this._names = new ArraySet();
- this._mappings = new MappingList();
- this._sourcesContents = null;
-}
-
-SourceMapGenerator.prototype._version = 3;
-
-/**
- * Creates a new SourceMapGenerator based on a SourceMapConsumer
- *
- * @param aSourceMapConsumer The SourceMap.
- */
-SourceMapGenerator.fromSourceMap =
- function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
- var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator({
- file: aSourceMapConsumer.file,
- sourceRoot: sourceRoot
- });
- aSourceMapConsumer.eachMapping(function (mapping) {
- var newMapping = {
- generated: {
- line: mapping.generatedLine,
- column: mapping.generatedColumn
- }
- };
-
- if (mapping.source != null) {
- newMapping.source = mapping.source;
- if (sourceRoot != null) {
- newMapping.source = util.relative(sourceRoot, newMapping.source);
- }
-
- newMapping.original = {
- line: mapping.originalLine,
- column: mapping.originalColumn
- };
-
- if (mapping.name != null) {
- newMapping.name = mapping.name;
- }
- }
-
- generator.addMapping(newMapping);
- });
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- generator.setSourceContent(sourceFile, content);
- }
- });
- return generator;
- };
-
-/**
- * Add a single mapping from original source line and column to the generated
- * source's line and column for this source map being created. The mapping
- * object should have the following properties:
- *
- * - generated: An object with the generated line and column positions.
- * - original: An object with the original line and column positions.
- * - source: The original source file (relative to the sourceRoot).
- * - name: An optional original token name for this mapping.
- */
-SourceMapGenerator.prototype.addMapping =
- function SourceMapGenerator_addMapping(aArgs) {
- var generated = util.getArg(aArgs, 'generated');
- var original = util.getArg(aArgs, 'original', null);
- var source = util.getArg(aArgs, 'source', null);
- var name = util.getArg(aArgs, 'name', null);
-
- if (!this._skipValidation) {
- this._validateMapping(generated, original, source, name);
- }
-
- if (source != null) {
- source = String(source);
- if (!this._sources.has(source)) {
- this._sources.add(source);
- }
- }
-
- if (name != null) {
- name = String(name);
- if (!this._names.has(name)) {
- this._names.add(name);
- }
- }
-
- this._mappings.add({
- generatedLine: generated.line,
- generatedColumn: generated.column,
- originalLine: original != null && original.line,
- originalColumn: original != null && original.column,
- source: source,
- name: name
- });
- };
-
-/**
- * Set the source content for a source file.
- */
-SourceMapGenerator.prototype.setSourceContent =
- function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
- var source = aSourceFile;
- if (this._sourceRoot != null) {
- source = util.relative(this._sourceRoot, source);
- }
-
- if (aSourceContent != null) {
- // Add the source content to the _sourcesContents map.
- // Create a new _sourcesContents map if the property is null.
- if (!this._sourcesContents) {
- this._sourcesContents = Object.create(null);
- }
- this._sourcesContents[util.toSetString(source)] = aSourceContent;
- } else if (this._sourcesContents) {
- // Remove the source file from the _sourcesContents map.
- // If the _sourcesContents map is empty, set the property to null.
- delete this._sourcesContents[util.toSetString(source)];
- if (Object.keys(this._sourcesContents).length === 0) {
- this._sourcesContents = null;
- }
- }
- };
-
-/**
- * Applies the mappings of a sub-source-map for a specific source file to the
- * source map being generated. Each mapping to the supplied source file is
- * rewritten using the supplied source map. Note: The resolution for the
- * resulting mappings is the minimium of this map and the supplied map.
- *
- * @param aSourceMapConsumer The source map to be applied.
- * @param aSourceFile Optional. The filename of the source file.
- * If omitted, SourceMapConsumer's file property will be used.
- * @param aSourceMapPath Optional. The dirname of the path to the source map
- * to be applied. If relative, it is relative to the SourceMapConsumer.
- * This parameter is needed when the two source maps aren't in the same
- * directory, and the source map to be applied contains relative source
- * paths. If so, those relative source paths need to be rewritten
- * relative to the SourceMapGenerator.
- */
-SourceMapGenerator.prototype.applySourceMap =
- function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
- var sourceFile = aSourceFile;
- // If aSourceFile is omitted, we will use the file property of the SourceMap
- if (aSourceFile == null) {
- if (aSourceMapConsumer.file == null) {
- throw new Error(
- 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
- 'or the source map\'s "file" property. Both were omitted.'
- );
- }
- sourceFile = aSourceMapConsumer.file;
- }
- var sourceRoot = this._sourceRoot;
- // Make "sourceFile" relative if an absolute Url is passed.
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- // Applying the SourceMap can add and remove items from the sources and
- // the names array.
- var newSources = new ArraySet();
- var newNames = new ArraySet();
-
- // Find mappings for the "sourceFile"
- this._mappings.unsortedForEach(function (mapping) {
- if (mapping.source === sourceFile && mapping.originalLine != null) {
- // Check if it can be mapped by the source map, then update the mapping.
- var original = aSourceMapConsumer.originalPositionFor({
- line: mapping.originalLine,
- column: mapping.originalColumn
- });
- if (original.source != null) {
- // Copy mapping
- mapping.source = original.source;
- if (aSourceMapPath != null) {
- mapping.source = util.join(aSourceMapPath, mapping.source)
- }
- if (sourceRoot != null) {
- mapping.source = util.relative(sourceRoot, mapping.source);
- }
- mapping.originalLine = original.line;
- mapping.originalColumn = original.column;
- if (original.name != null) {
- mapping.name = original.name;
- }
- }
- }
-
- var source = mapping.source;
- if (source != null && !newSources.has(source)) {
- newSources.add(source);
- }
-
- var name = mapping.name;
- if (name != null && !newNames.has(name)) {
- newNames.add(name);
- }
-
- }, this);
- this._sources = newSources;
- this._names = newNames;
-
- // Copy sourcesContents of applied map.
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aSourceMapPath != null) {
- sourceFile = util.join(aSourceMapPath, sourceFile);
- }
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- this.setSourceContent(sourceFile, content);
- }
- }, this);
- };
-
-/**
- * A mapping can have one of the three levels of data:
- *
- * 1. Just the generated position.
- * 2. The Generated position, original position, and original source.
- * 3. Generated and original position, original source, as well as a name
- * token.
- *
- * To maintain consistency, we validate that any new mapping being added falls
- * in to one of these categories.
- */
-SourceMapGenerator.prototype._validateMapping =
- function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
- aName) {
- // When aOriginal is truthy but has empty values for .line and .column,
- // it is most likely a programmer error. In this case we throw a very
- // specific error message to try to guide them the right way.
- // For example: https://github.com/Polymer/polymer-bundler/pull/519
- if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
- throw new Error(
- 'original.line and original.column are not numbers -- you probably meant to omit ' +
- 'the original mapping entirely and only map the generated position. If so, pass ' +
- 'null for the original mapping instead of an object with empty or null values.'
- );
- }
-
- if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aGenerated.line > 0 && aGenerated.column >= 0
- && !aOriginal && !aSource && !aName) {
- // Case 1.
- return;
- }
- else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aOriginal && 'line' in aOriginal && 'column' in aOriginal
- && aGenerated.line > 0 && aGenerated.column >= 0
- && aOriginal.line > 0 && aOriginal.column >= 0
- && aSource) {
- // Cases 2 and 3.
- return;
- }
- else {
- throw new Error('Invalid mapping: ' + JSON.stringify({
- generated: aGenerated,
- source: aSource,
- original: aOriginal,
- name: aName
- }));
- }
- };
-
-/**
- * Serialize the accumulated mappings in to the stream of base 64 VLQs
- * specified by the source map format.
- */
-SourceMapGenerator.prototype._serializeMappings =
- function SourceMapGenerator_serializeMappings() {
- var previousGeneratedColumn = 0;
- var previousGeneratedLine = 1;
- var previousOriginalColumn = 0;
- var previousOriginalLine = 0;
- var previousName = 0;
- var previousSource = 0;
- var result = '';
- var next;
- var mapping;
- var nameIdx;
- var sourceIdx;
-
- var mappings = this._mappings.toArray();
- for (var i = 0, len = mappings.length; i < len; i++) {
- mapping = mappings[i];
- next = ''
-
- if (mapping.generatedLine !== previousGeneratedLine) {
- previousGeneratedColumn = 0;
- while (mapping.generatedLine !== previousGeneratedLine) {
- next += ';';
- previousGeneratedLine++;
- }
- }
- else {
- if (i > 0) {
- if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
- continue;
- }
- next += ',';
- }
- }
-
- next += base64VLQ.encode(mapping.generatedColumn
- - previousGeneratedColumn);
- previousGeneratedColumn = mapping.generatedColumn;
-
- if (mapping.source != null) {
- sourceIdx = this._sources.indexOf(mapping.source);
- next += base64VLQ.encode(sourceIdx - previousSource);
- previousSource = sourceIdx;
-
- // lines are stored 0-based in SourceMap spec version 3
- next += base64VLQ.encode(mapping.originalLine - 1
- - previousOriginalLine);
- previousOriginalLine = mapping.originalLine - 1;
-
- next += base64VLQ.encode(mapping.originalColumn
- - previousOriginalColumn);
- previousOriginalColumn = mapping.originalColumn;
-
- if (mapping.name != null) {
- nameIdx = this._names.indexOf(mapping.name);
- next += base64VLQ.encode(nameIdx - previousName);
- previousName = nameIdx;
- }
- }
-
- result += next;
- }
-
- return result;
- };
-
-SourceMapGenerator.prototype._generateSourcesContent =
- function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
- return aSources.map(function (source) {
- if (!this._sourcesContents) {
- return null;
- }
- if (aSourceRoot != null) {
- source = util.relative(aSourceRoot, source);
- }
- var key = util.toSetString(source);
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
- ? this._sourcesContents[key]
- : null;
- }, this);
- };
-
-/**
- * Externalize the source map.
- */
-SourceMapGenerator.prototype.toJSON =
- function SourceMapGenerator_toJSON() {
- var map = {
- version: this._version,
- sources: this._sources.toArray(),
- names: this._names.toArray(),
- mappings: this._serializeMappings()
- };
- if (this._file != null) {
- map.file = this._file;
- }
- if (this._sourceRoot != null) {
- map.sourceRoot = this._sourceRoot;
- }
- if (this._sourcesContents) {
- map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
- }
-
- return map;
- };
-
-/**
- * Render the source map being generated to a string.
- */
-SourceMapGenerator.prototype.toString =
- function SourceMapGenerator_toString() {
- return JSON.stringify(this.toJSON());
- };
-
-exports.SourceMapGenerator = SourceMapGenerator;
-
-
-/***/ }),
-/* 664 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- *
- * Based on the Base 64 VLQ implementation in Closure Compiler:
- * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
- *
- * Copyright 2011 The Closure Compiler Authors. All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-var base64 = __webpack_require__(665);
-
-// A single base 64 digit can contain 6 bits of data. For the base 64 variable
-// length quantities we use in the source map spec, the first bit is the sign,
-// the next four bits are the actual value, and the 6th bit is the
-// continuation bit. The continuation bit tells us whether there are more
-// digits in this value following this digit.
-//
-// Continuation
-// | Sign
-// | |
-// V V
-// 101011
-
-var VLQ_BASE_SHIFT = 5;
-
-// binary: 100000
-var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
-
-// binary: 011111
-var VLQ_BASE_MASK = VLQ_BASE - 1;
-
-// binary: 100000
-var VLQ_CONTINUATION_BIT = VLQ_BASE;
-
-/**
- * Converts from a two-complement value to a value where the sign bit is
- * placed in the least significant bit. For example, as decimals:
- * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
- * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
- */
-function toVLQSigned(aValue) {
- return aValue < 0
- ? ((-aValue) << 1) + 1
- : (aValue << 1) + 0;
-}
-
-/**
- * Converts to a two-complement value from a value where the sign bit is
- * placed in the least significant bit. For example, as decimals:
- * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
- * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
- */
-function fromVLQSigned(aValue) {
- var isNegative = (aValue & 1) === 1;
- var shifted = aValue >> 1;
- return isNegative
- ? -shifted
- : shifted;
-}
-
-/**
- * Returns the base 64 VLQ encoded value.
- */
-exports.encode = function base64VLQ_encode(aValue) {
- var encoded = "";
- var digit;
-
- var vlq = toVLQSigned(aValue);
-
- do {
- digit = vlq & VLQ_BASE_MASK;
- vlq >>>= VLQ_BASE_SHIFT;
- if (vlq > 0) {
- // There are still more digits in this value, so we must make sure the
- // continuation bit is marked.
- digit |= VLQ_CONTINUATION_BIT;
- }
- encoded += base64.encode(digit);
- } while (vlq > 0);
-
- return encoded;
-};
-
-/**
- * Decodes the next base 64 VLQ value from the given string and returns the
- * value and the rest of the string via the out parameter.
- */
-exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
- var strLen = aStr.length;
- var result = 0;
- var shift = 0;
- var continuation, digit;
-
- do {
- if (aIndex >= strLen) {
- throw new Error("Expected more digits in base 64 VLQ value.");
- }
-
- digit = base64.decode(aStr.charCodeAt(aIndex++));
- if (digit === -1) {
- throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
- }
-
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
- digit &= VLQ_BASE_MASK;
- result = result + (digit << shift);
- shift += VLQ_BASE_SHIFT;
- } while (continuation);
-
- aOutParam.value = fromVLQSigned(result);
- aOutParam.rest = aIndex;
-};
-
-
-/***/ }),
-/* 665 */
-/***/ (function(module, exports) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
-
-/**
- * Encode an integer in the range of 0 to 63 to a single base 64 digit.
- */
-exports.encode = function (number) {
- if (0 <= number && number < intToCharMap.length) {
- return intToCharMap[number];
- }
- throw new TypeError("Must be between 0 and 63: " + number);
-};
-
-/**
- * Decode a single base 64 character code digit to an integer. Returns -1 on
- * failure.
- */
-exports.decode = function (charCode) {
- var bigA = 65; // 'A'
- var bigZ = 90; // 'Z'
-
- var littleA = 97; // 'a'
- var littleZ = 122; // 'z'
-
- var zero = 48; // '0'
- var nine = 57; // '9'
-
- var plus = 43; // '+'
- var slash = 47; // '/'
-
- var littleOffset = 26;
- var numberOffset = 52;
-
- // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
- if (bigA <= charCode && charCode <= bigZ) {
- return (charCode - bigA);
- }
-
- // 26 - 51: abcdefghijklmnopqrstuvwxyz
- if (littleA <= charCode && charCode <= littleZ) {
- return (charCode - littleA + littleOffset);
- }
-
- // 52 - 61: 0123456789
- if (zero <= charCode && charCode <= nine) {
- return (charCode - zero + numberOffset);
- }
-
- // 62: +
- if (charCode == plus) {
- return 62;
- }
-
- // 63: /
- if (charCode == slash) {
- return 63;
- }
-
- // Invalid base64 digit.
- return -1;
-};
-
-
-/***/ }),
-/* 666 */
-/***/ (function(module, exports) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-/**
- * This is a helper function for getting values from parameter/options
- * objects.
- *
- * @param args The object we are extracting values from
- * @param name The name of the property we are getting.
- * @param defaultValue An optional value to return if the property is missing
- * from the object. If this is not specified and the property is missing, an
- * error will be thrown.
- */
-function getArg(aArgs, aName, aDefaultValue) {
- if (aName in aArgs) {
- return aArgs[aName];
- } else if (arguments.length === 3) {
- return aDefaultValue;
- } else {
- throw new Error('"' + aName + '" is a required argument.');
- }
-}
-exports.getArg = getArg;
-
-var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
-var dataUrlRegexp = /^data:.+\,.+$/;
-
-function urlParse(aUrl) {
- var match = aUrl.match(urlRegexp);
- if (!match) {
- return null;
- }
- return {
- scheme: match[1],
- auth: match[2],
- host: match[3],
- port: match[4],
- path: match[5]
- };
-}
-exports.urlParse = urlParse;
-
-function urlGenerate(aParsedUrl) {
- var url = '';
- if (aParsedUrl.scheme) {
- url += aParsedUrl.scheme + ':';
- }
- url += '//';
- if (aParsedUrl.auth) {
- url += aParsedUrl.auth + '@';
- }
- if (aParsedUrl.host) {
- url += aParsedUrl.host;
- }
- if (aParsedUrl.port) {
- url += ":" + aParsedUrl.port
- }
- if (aParsedUrl.path) {
- url += aParsedUrl.path;
- }
- return url;
-}
-exports.urlGenerate = urlGenerate;
-
-/**
- * Normalizes a path, or the path portion of a URL:
- *
- * - Replaces consecutive slashes with one slash.
- * - Removes unnecessary '.' parts.
- * - Removes unnecessary '/..' parts.
- *
- * Based on code in the Node.js 'path' core module.
- *
- * @param aPath The path or url to normalize.
- */
-function normalize(aPath) {
- var path = aPath;
- var url = urlParse(aPath);
- if (url) {
- if (!url.path) {
- return aPath;
- }
- path = url.path;
- }
- var isAbsolute = exports.isAbsolute(path);
-
- var parts = path.split(/\/+/);
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
- part = parts[i];
- if (part === '.') {
- parts.splice(i, 1);
- } else if (part === '..') {
- up++;
- } else if (up > 0) {
- if (part === '') {
- // The first part is blank if the path is absolute. Trying to go
- // above the root is a no-op. Therefore we can remove all '..' parts
- // directly after the root.
- parts.splice(i + 1, up);
- up = 0;
- } else {
- parts.splice(i, 2);
- up--;
- }
- }
- }
- path = parts.join('/');
-
- if (path === '') {
- path = isAbsolute ? '/' : '.';
- }
-
- if (url) {
- url.path = path;
- return urlGenerate(url);
- }
- return path;
-}
-exports.normalize = normalize;
-
-/**
- * Joins two paths/URLs.
- *
- * @param aRoot The root path or URL.
- * @param aPath The path or URL to be joined with the root.
- *
- * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
- * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
- * first.
- * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
- * is updated with the result and aRoot is returned. Otherwise the result
- * is returned.
- * - If aPath is absolute, the result is aPath.
- * - Otherwise the two paths are joined with a slash.
- * - Joining for example 'http://' and 'www.example.com' is also supported.
- */
-function join(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- if (aPath === "") {
- aPath = ".";
- }
- var aPathUrl = urlParse(aPath);
- var aRootUrl = urlParse(aRoot);
- if (aRootUrl) {
- aRoot = aRootUrl.path || '/';
- }
-
- // `join(foo, '//www.example.org')`
- if (aPathUrl && !aPathUrl.scheme) {
- if (aRootUrl) {
- aPathUrl.scheme = aRootUrl.scheme;
- }
- return urlGenerate(aPathUrl);
- }
-
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
- return aPath;
- }
-
- // `join('http://', 'www.example.com')`
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
- aRootUrl.host = aPath;
- return urlGenerate(aRootUrl);
- }
-
- var joined = aPath.charAt(0) === '/'
- ? aPath
- : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
-
- if (aRootUrl) {
- aRootUrl.path = joined;
- return urlGenerate(aRootUrl);
- }
- return joined;
-}
-exports.join = join;
-
-exports.isAbsolute = function (aPath) {
- return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
-};
-
-/**
- * Make a path relative to a URL or another path.
- *
- * @param aRoot The root path or URL.
- * @param aPath The path or URL to be made relative to aRoot.
- */
-function relative(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
-
- aRoot = aRoot.replace(/\/$/, '');
-
- // It is possible for the path to be above the root. In this case, simply
- // checking whether the root is a prefix of the path won't work. Instead, we
- // need to remove components from the root one by one, until either we find
- // a prefix that fits, or we run out of components to remove.
- var level = 0;
- while (aPath.indexOf(aRoot + '/') !== 0) {
- var index = aRoot.lastIndexOf("/");
- if (index < 0) {
- return aPath;
- }
-
- // If the only part of the root that is left is the scheme (i.e. http://,
- // file:///, etc.), one or more slashes (/), or simply nothing at all, we
- // have exhausted all components, so the path is not relative to the root.
- aRoot = aRoot.slice(0, index);
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
- return aPath;
- }
-
- ++level;
- }
-
- // Make sure we add a "../" for each component we removed from the root.
- return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
-}
-exports.relative = relative;
-
-var supportsNullProto = (function () {
- var obj = Object.create(null);
- return !('__proto__' in obj);
-}());
-
-function identity (s) {
- return s;
-}
-
-/**
- * Because behavior goes wacky when you set `__proto__` on objects, we
- * have to prefix all the strings in our set with an arbitrary character.
- *
- * See https://github.com/mozilla/source-map/pull/31 and
- * https://github.com/mozilla/source-map/issues/30
- *
- * @param String aStr
- */
-function toSetString(aStr) {
- if (isProtoString(aStr)) {
- return '$' + aStr;
- }
-
- return aStr;
-}
-exports.toSetString = supportsNullProto ? identity : toSetString;
-
-function fromSetString(aStr) {
- if (isProtoString(aStr)) {
- return aStr.slice(1);
- }
-
- return aStr;
-}
-exports.fromSetString = supportsNullProto ? identity : fromSetString;
-
-function isProtoString(s) {
- if (!s) {
- return false;
- }
-
- var length = s.length;
-
- if (length < 9 /* "__proto__".length */) {
- return false;
- }
-
- if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
- s.charCodeAt(length - 2) !== 95 /* '_' */ ||
- s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
- s.charCodeAt(length - 4) !== 116 /* 't' */ ||
- s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
- s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
- s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
- s.charCodeAt(length - 8) !== 95 /* '_' */ ||
- s.charCodeAt(length - 9) !== 95 /* '_' */) {
- return false;
- }
-
- for (var i = length - 10; i >= 0; i--) {
- if (s.charCodeAt(i) !== 36 /* '$' */) {
- return false;
- }
- }
-
- return true;
-}
-
-/**
- * Comparator between two mappings where the original positions are compared.
- *
- * Optionally pass in `true` as `onlyCompareGenerated` to consider two
- * mappings with the same original source/line/column, but different generated
- * line and column the same. Useful when searching for a mapping with a
- * stubbed out mapping.
- */
-function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
- var cmp = mappingA.source - mappingB.source;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0 || onlyCompareOriginal) {
- return cmp;
- }
-
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- return mappingA.name - mappingB.name;
-}
-exports.compareByOriginalPositions = compareByOriginalPositions;
-
-/**
- * Comparator between two mappings with deflated source and name indices where
- * the generated positions are compared.
- *
- * Optionally pass in `true` as `onlyCompareGenerated` to consider two
- * mappings with the same generated line and column, but different
- * source/name/original line and column the same. Useful when searching for a
- * mapping with a stubbed out mapping.
- */
-function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0 || onlyCompareGenerated) {
- return cmp;
- }
-
- cmp = mappingA.source - mappingB.source;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
-
- return mappingA.name - mappingB.name;
-}
-exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
-
-function strcmp(aStr1, aStr2) {
- if (aStr1 === aStr2) {
- return 0;
- }
-
- if (aStr1 > aStr2) {
- return 1;
- }
-
- return -1;
-}
-
-/**
- * Comparator between two mappings with inflated source and name strings where
- * the generated positions are compared.
- */
-function compareByGeneratedPositionsInflated(mappingA, mappingB) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
-
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
-
- return strcmp(mappingA.name, mappingB.name);
-}
-exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
-
-
-/***/ }),
-/* 667 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-var util = __webpack_require__(666);
-var has = Object.prototype.hasOwnProperty;
-var hasNativeMap = typeof Map !== "undefined";
-
-/**
- * A data structure which is a combination of an array and a set. Adding a new
- * member is O(1), testing for membership is O(1), and finding the index of an
- * element is O(1). Removing elements from the set is not supported. Only
- * strings are supported for membership.
- */
-function ArraySet() {
- this._array = [];
- this._set = hasNativeMap ? new Map() : Object.create(null);
-}
-
-/**
- * Static method for creating ArraySet instances from an existing array.
- */
-ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet();
- for (var i = 0, len = aArray.length; i < len; i++) {
- set.add(aArray[i], aAllowDuplicates);
- }
- return set;
-};
-
-/**
- * Return how many unique items are in this ArraySet. If duplicates have been
- * added, than those do not count towards the size.
- *
- * @returns Number
- */
-ArraySet.prototype.size = function ArraySet_size() {
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
-};
-
-/**
- * Add the given string to this set.
- *
- * @param String aStr
- */
-ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
- var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
- var idx = this._array.length;
- if (!isDuplicate || aAllowDuplicates) {
- this._array.push(aStr);
- }
- if (!isDuplicate) {
- if (hasNativeMap) {
- this._set.set(aStr, idx);
- } else {
- this._set[sStr] = idx;
- }
- }
-};
-
-/**
- * Is the given string a member of this set?
- *
- * @param String aStr
- */
-ArraySet.prototype.has = function ArraySet_has(aStr) {
- if (hasNativeMap) {
- return this._set.has(aStr);
- } else {
- var sStr = util.toSetString(aStr);
- return has.call(this._set, sStr);
- }
-};
-
-/**
- * What is the index of the given string in the array?
- *
- * @param String aStr
- */
-ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
- if (hasNativeMap) {
- var idx = this._set.get(aStr);
- if (idx >= 0) {
- return idx;
- }
- } else {
- var sStr = util.toSetString(aStr);
- if (has.call(this._set, sStr)) {
- return this._set[sStr];
- }
- }
-
- throw new Error('"' + aStr + '" is not in the set.');
-};
-
-/**
- * What is the element at the given index?
- *
- * @param Number aIdx
- */
-ArraySet.prototype.at = function ArraySet_at(aIdx) {
- if (aIdx >= 0 && aIdx < this._array.length) {
- return this._array[aIdx];
- }
- throw new Error('No element indexed by ' + aIdx);
-};
-
-/**
- * Returns the array representation of this set (which has the proper indices
- * indicated by indexOf). Note that this is a copy of the internal array used
- * for storing the members so that no one can mess with internal state.
- */
-ArraySet.prototype.toArray = function ArraySet_toArray() {
- return this._array.slice();
-};
-
-exports.ArraySet = ArraySet;
-
-
-/***/ }),
-/* 668 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2014 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-var util = __webpack_require__(666);
-
-/**
- * Determine whether mappingB is after mappingA with respect to generated
- * position.
- */
-function generatedPositionAfter(mappingA, mappingB) {
- // Optimized for most common case
- var lineA = mappingA.generatedLine;
- var lineB = mappingB.generatedLine;
- var columnA = mappingA.generatedColumn;
- var columnB = mappingB.generatedColumn;
- return lineB > lineA || lineB == lineA && columnB >= columnA ||
- util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
-}
-
-/**
- * A data structure to provide a sorted view of accumulated mappings in a
- * performance conscious manner. It trades a neglibable overhead in general
- * case for a large speedup in case of mappings being added in order.
- */
-function MappingList() {
- this._array = [];
- this._sorted = true;
- // Serves as infimum
- this._last = {generatedLine: -1, generatedColumn: 0};
-}
-
-/**
- * Iterate through internal items. This method takes the same arguments that
- * `Array.prototype.forEach` takes.
- *
- * NOTE: The order of the mappings is NOT guaranteed.
- */
-MappingList.prototype.unsortedForEach =
- function MappingList_forEach(aCallback, aThisArg) {
- this._array.forEach(aCallback, aThisArg);
- };
-
-/**
- * Add the given source mapping.
- *
- * @param Object aMapping
- */
-MappingList.prototype.add = function MappingList_add(aMapping) {
- if (generatedPositionAfter(this._last, aMapping)) {
- this._last = aMapping;
- this._array.push(aMapping);
- } else {
- this._sorted = false;
- this._array.push(aMapping);
- }
-};
-
-/**
- * Returns the flat, sorted array of mappings. The mappings are sorted by
- * generated position.
- *
- * WARNING: This method returns internal data without copying, for
- * performance. The return value must NOT be mutated, and should be treated as
- * an immutable borrow. If you want to take ownership, you must make your own
- * copy.
- */
-MappingList.prototype.toArray = function MappingList_toArray() {
- if (!this._sorted) {
- this._array.sort(util.compareByGeneratedPositionsInflated);
- this._sorted = true;
- }
- return this._array;
-};
-
-exports.MappingList = MappingList;
-
-
-/***/ }),
-/* 669 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-var util = __webpack_require__(666);
-var binarySearch = __webpack_require__(670);
-var ArraySet = __webpack_require__(667).ArraySet;
-var base64VLQ = __webpack_require__(664);
-var quickSort = __webpack_require__(671).quickSort;
-
-function SourceMapConsumer(aSourceMap) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
- }
-
- return sourceMap.sections != null
- ? new IndexedSourceMapConsumer(sourceMap)
- : new BasicSourceMapConsumer(sourceMap);
-}
-
-SourceMapConsumer.fromSourceMap = function(aSourceMap) {
- return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
-}
-
-/**
- * The version of the source mapping spec that we are consuming.
- */
-SourceMapConsumer.prototype._version = 3;
-
-// `__generatedMappings` and `__originalMappings` are arrays that hold the
-// parsed mapping coordinates from the source map's "mappings" attribute. They
-// are lazily instantiated, accessed via the `_generatedMappings` and
-// `_originalMappings` getters respectively, and we only parse the mappings
-// and create these arrays once queried for a source location. We jump through
-// these hoops because there can be many thousands of mappings, and parsing
-// them is expensive, so we only want to do it if we must.
-//
-// Each object in the arrays is of the form:
-//
-// {
-// generatedLine: The line number in the generated code,
-// generatedColumn: The column number in the generated code,
-// source: The path to the original source file that generated this
-// chunk of code,
-// originalLine: The line number in the original source that
-// corresponds to this chunk of generated code,
-// originalColumn: The column number in the original source that
-// corresponds to this chunk of generated code,
-// name: The name of the original symbol which generated this chunk of
-// code.
-// }
-//
-// All properties except for `generatedLine` and `generatedColumn` can be
-// `null`.
-//
-// `_generatedMappings` is ordered by the generated positions.
-//
-// `_originalMappings` is ordered by the original positions.
-
-SourceMapConsumer.prototype.__generatedMappings = null;
-Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
- get: function () {
- if (!this.__generatedMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
-
- return this.__generatedMappings;
- }
-});
-
-SourceMapConsumer.prototype.__originalMappings = null;
-Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
- get: function () {
- if (!this.__originalMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
-
- return this.__originalMappings;
- }
-});
-
-SourceMapConsumer.prototype._charIsMappingSeparator =
- function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
- var c = aStr.charAt(index);
- return c === ";" || c === ",";
- };
-
-/**
- * Parse the mappings in a string in to a data structure which we can easily
- * query (the ordered arrays in the `this.__generatedMappings` and
- * `this.__originalMappings` properties).
- */
-SourceMapConsumer.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- throw new Error("Subclasses must implement _parseMappings");
- };
-
-SourceMapConsumer.GENERATED_ORDER = 1;
-SourceMapConsumer.ORIGINAL_ORDER = 2;
-
-SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
-SourceMapConsumer.LEAST_UPPER_BOUND = 2;
-
-/**
- * Iterate over each mapping between an original source/line/column and a
- * generated line/column in this source map.
- *
- * @param Function aCallback
- * The function that is called with each mapping.
- * @param Object aContext
- * Optional. If specified, this object will be the value of `this` every
- * time that `aCallback` is called.
- * @param aOrder
- * Either `SourceMapConsumer.GENERATED_ORDER` or
- * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
- * iterate over the mappings sorted by the generated file's line/column
- * order or the original's source/line/column order, respectively. Defaults to
- * `SourceMapConsumer.GENERATED_ORDER`.
- */
-SourceMapConsumer.prototype.eachMapping =
- function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
- var context = aContext || null;
- var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
-
- var mappings;
- switch (order) {
- case SourceMapConsumer.GENERATED_ORDER:
- mappings = this._generatedMappings;
- break;
- case SourceMapConsumer.ORIGINAL_ORDER:
- mappings = this._originalMappings;
- break;
- default:
- throw new Error("Unknown order of iteration.");
- }
-
- var sourceRoot = this.sourceRoot;
- mappings.map(function (mapping) {
- var source = mapping.source === null ? null : this._sources.at(mapping.source);
- if (source != null && sourceRoot != null) {
- source = util.join(sourceRoot, source);
- }
- return {
- source: source,
- generatedLine: mapping.generatedLine,
- generatedColumn: mapping.generatedColumn,
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: mapping.name === null ? null : this._names.at(mapping.name)
- };
- }, this).forEach(aCallback, context);
- };
-
-/**
- * Returns all generated line and column information for the original source,
- * line, and column provided. If no column is provided, returns all mappings
- * corresponding to a either the line we are searching for or the next
- * closest line that has any mappings. Otherwise, returns all mappings
- * corresponding to the given line and either the column we are searching for
- * or the next closest column that has any offsets.
- *
- * The only argument is an object with the following properties:
- *
- * - source: The filename of the original source.
- * - line: The line number in the original source.
- * - column: Optional. the column number in the original source.
- *
- * and an array of objects is returned, each with the following properties:
- *
- * - line: The line number in the generated source, or null.
- * - column: The column number in the generated source, or null.
- */
-SourceMapConsumer.prototype.allGeneratedPositionsFor =
- function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
- var line = util.getArg(aArgs, 'line');
-
- // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
- // returns the index of the closest mapping less than the needle. By
- // setting needle.originalColumn to 0, we thus find the last mapping for
- // the given line, provided such a mapping exists.
- var needle = {
- source: util.getArg(aArgs, 'source'),
- originalLine: line,
- originalColumn: util.getArg(aArgs, 'column', 0)
- };
-
- if (this.sourceRoot != null) {
- needle.source = util.relative(this.sourceRoot, needle.source);
- }
- if (!this._sources.has(needle.source)) {
- return [];
- }
- needle.source = this._sources.indexOf(needle.source);
-
- var mappings = [];
-
- var index = this._findMapping(needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util.compareByOriginalPositions,
- binarySearch.LEAST_UPPER_BOUND);
- if (index >= 0) {
- var mapping = this._originalMappings[index];
-
- if (aArgs.column === undefined) {
- var originalLine = mapping.originalLine;
-
- // Iterate until either we run out of mappings, or we run into
- // a mapping for a different line than the one we found. Since
- // mappings are sorted, this is guaranteed to find all mappings for
- // the line we found.
- while (mapping && mapping.originalLine === originalLine) {
- mappings.push({
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- });
-
- mapping = this._originalMappings[++index];
- }
- } else {
- var originalColumn = mapping.originalColumn;
-
- // Iterate until either we run out of mappings, or we run into
- // a mapping for a different line than the one we were searching for.
- // Since mappings are sorted, this is guaranteed to find all mappings for
- // the line we are searching for.
- while (mapping &&
- mapping.originalLine === line &&
- mapping.originalColumn == originalColumn) {
- mappings.push({
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- });
-
- mapping = this._originalMappings[++index];
- }
- }
- }
-
- return mappings;
- };
-
-exports.SourceMapConsumer = SourceMapConsumer;
-
-/**
- * A BasicSourceMapConsumer instance represents a parsed source map which we can
- * query for information about the original file positions by giving it a file
- * position in the generated source.
- *
- * The only parameter is the raw source map (either as a JSON string, or
- * already parsed to an object). According to the spec, source maps have the
- * following attributes:
- *
- * - version: Which version of the source map spec this map is following.
- * - sources: An array of URLs to the original source files.
- * - names: An array of identifiers which can be referrenced by individual mappings.
- * - sourceRoot: Optional. The URL root from which all sources are relative.
- * - sourcesContent: Optional. An array of contents of the original source files.
- * - mappings: A string of base64 VLQs which contain the actual mappings.
- * - file: Optional. The generated file this source map is associated with.
- *
- * Here is an example source map, taken from the source map spec[0]:
- *
- * {
- * version : 3,
- * file: "out.js",
- * sourceRoot : "",
- * sources: ["foo.js", "bar.js"],
- * names: ["src", "maps", "are", "fun"],
- * mappings: "AA,AB;;ABCDE;"
- * }
- *
- * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
- */
-function BasicSourceMapConsumer(aSourceMap) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
- }
-
- var version = util.getArg(sourceMap, 'version');
- var sources = util.getArg(sourceMap, 'sources');
- // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
- // requires the array) to play nice here.
- var names = util.getArg(sourceMap, 'names', []);
- var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
- var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
- var mappings = util.getArg(sourceMap, 'mappings');
- var file = util.getArg(sourceMap, 'file', null);
-
- // Once again, Sass deviates from the spec and supplies the version as a
- // string rather than a number, so we use loose equality checking here.
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
-
- sources = sources
- .map(String)
- // Some source maps produce relative source paths like "./foo.js" instead of
- // "foo.js". Normalize these first so that future comparisons will succeed.
- // See bugzil.la/1090768.
- .map(util.normalize)
- // Always ensure that absolute sources are internally stored relative to
- // the source root, if the source root is absolute. Not doing this would
- // be particularly problematic when the source root is a prefix of the
- // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
- .map(function (source) {
- return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
- ? util.relative(sourceRoot, source)
- : source;
- });
-
- // Pass `true` below to allow duplicate names and sources. While source maps
- // are intended to be compressed and deduplicated, the TypeScript compiler
- // sometimes generates source maps with duplicates in them. See Github issue
- // #72 and bugzil.la/889492.
- this._names = ArraySet.fromArray(names.map(String), true);
- this._sources = ArraySet.fromArray(sources, true);
-
- this.sourceRoot = sourceRoot;
- this.sourcesContent = sourcesContent;
- this._mappings = mappings;
- this.file = file;
-}
-
-BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
-BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
-
-/**
- * Create a BasicSourceMapConsumer from a SourceMapGenerator.
- *
- * @param SourceMapGenerator aSourceMap
- * The source map that will be consumed.
- * @returns BasicSourceMapConsumer
- */
-BasicSourceMapConsumer.fromSourceMap =
- function SourceMapConsumer_fromSourceMap(aSourceMap) {
- var smc = Object.create(BasicSourceMapConsumer.prototype);
-
- var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
- var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
- smc.sourceRoot = aSourceMap._sourceRoot;
- smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
- smc.sourceRoot);
- smc.file = aSourceMap._file;
-
- // Because we are modifying the entries (by converting string sources and
- // names to indices into the sources and names ArraySets), we have to make
- // a copy of the entry or else bad things happen. Shared mutable state
- // strikes again! See github issue #191.
-
- var generatedMappings = aSourceMap._mappings.toArray().slice();
- var destGeneratedMappings = smc.__generatedMappings = [];
- var destOriginalMappings = smc.__originalMappings = [];
-
- for (var i = 0, length = generatedMappings.length; i < length; i++) {
- var srcMapping = generatedMappings[i];
- var destMapping = new Mapping;
- destMapping.generatedLine = srcMapping.generatedLine;
- destMapping.generatedColumn = srcMapping.generatedColumn;
-
- if (srcMapping.source) {
- destMapping.source = sources.indexOf(srcMapping.source);
- destMapping.originalLine = srcMapping.originalLine;
- destMapping.originalColumn = srcMapping.originalColumn;
-
- if (srcMapping.name) {
- destMapping.name = names.indexOf(srcMapping.name);
- }
-
- destOriginalMappings.push(destMapping);
- }
-
- destGeneratedMappings.push(destMapping);
- }
-
- quickSort(smc.__originalMappings, util.compareByOriginalPositions);
-
- return smc;
- };
-
-/**
- * The version of the source mapping spec that we are consuming.
- */
-BasicSourceMapConsumer.prototype._version = 3;
-
-/**
- * The list of original sources.
- */
-Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
- get: function () {
- return this._sources.toArray().map(function (s) {
- return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
- }, this);
- }
-});
-
-/**
- * Provide the JIT with a nice shape / hidden class.
- */
-function Mapping() {
- this.generatedLine = 0;
- this.generatedColumn = 0;
- this.source = null;
- this.originalLine = null;
- this.originalColumn = null;
- this.name = null;
-}
-
-/**
- * Parse the mappings in a string in to a data structure which we can easily
- * query (the ordered arrays in the `this.__generatedMappings` and
- * `this.__originalMappings` properties).
- */
-BasicSourceMapConsumer.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- var generatedLine = 1;
- var previousGeneratedColumn = 0;
- var previousOriginalLine = 0;
- var previousOriginalColumn = 0;
- var previousSource = 0;
- var previousName = 0;
- var length = aStr.length;
- var index = 0;
- var cachedSegments = {};
- var temp = {};
- var originalMappings = [];
- var generatedMappings = [];
- var mapping, str, segment, end, value;
-
- while (index < length) {
- if (aStr.charAt(index) === ';') {
- generatedLine++;
- index++;
- previousGeneratedColumn = 0;
- }
- else if (aStr.charAt(index) === ',') {
- index++;
- }
- else {
- mapping = new Mapping();
- mapping.generatedLine = generatedLine;
-
- // Because each offset is encoded relative to the previous one,
- // many segments often have the same encoding. We can exploit this
- // fact by caching the parsed variable length fields of each segment,
- // allowing us to avoid a second parse if we encounter the same
- // segment again.
- for (end = index; end < length; end++) {
- if (this._charIsMappingSeparator(aStr, end)) {
- break;
- }
- }
- str = aStr.slice(index, end);
-
- segment = cachedSegments[str];
- if (segment) {
- index += str.length;
- } else {
- segment = [];
- while (index < end) {
- base64VLQ.decode(aStr, index, temp);
- value = temp.value;
- index = temp.rest;
- segment.push(value);
- }
-
- if (segment.length === 2) {
- throw new Error('Found a source, but no line and column');
- }
-
- if (segment.length === 3) {
- throw new Error('Found a source and line, but no column');
- }
-
- cachedSegments[str] = segment;
- }
-
- // Generated column.
- mapping.generatedColumn = previousGeneratedColumn + segment[0];
- previousGeneratedColumn = mapping.generatedColumn;
-
- if (segment.length > 1) {
- // Original source.
- mapping.source = previousSource + segment[1];
- previousSource += segment[1];
-
- // Original line.
- mapping.originalLine = previousOriginalLine + segment[2];
- previousOriginalLine = mapping.originalLine;
- // Lines are stored 0-based
- mapping.originalLine += 1;
-
- // Original column.
- mapping.originalColumn = previousOriginalColumn + segment[3];
- previousOriginalColumn = mapping.originalColumn;
-
- if (segment.length > 4) {
- // Original name.
- mapping.name = previousName + segment[4];
- previousName += segment[4];
- }
- }
-
- generatedMappings.push(mapping);
- if (typeof mapping.originalLine === 'number') {
- originalMappings.push(mapping);
- }
- }
- }
-
- quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
- this.__generatedMappings = generatedMappings;
-
- quickSort(originalMappings, util.compareByOriginalPositions);
- this.__originalMappings = originalMappings;
- };
-
-/**
- * Find the mapping that best matches the hypothetical "needle" mapping that
- * we are searching for in the given "haystack" of mappings.
- */
-BasicSourceMapConsumer.prototype._findMapping =
- function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
- aColumnName, aComparator, aBias) {
- // To return the position we are searching for, we must first find the
- // mapping for the given position and then return the opposite position it
- // points to. Because the mappings are sorted, we can use binary search to
- // find the best mapping.
-
- if (aNeedle[aLineName] <= 0) {
- throw new TypeError('Line must be greater than or equal to 1, got '
- + aNeedle[aLineName]);
- }
- if (aNeedle[aColumnName] < 0) {
- throw new TypeError('Column must be greater than or equal to 0, got '
- + aNeedle[aColumnName]);
- }
-
- return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
- };
-
-/**
- * Compute the last column for each generated mapping. The last column is
- * inclusive.
- */
-BasicSourceMapConsumer.prototype.computeColumnSpans =
- function SourceMapConsumer_computeColumnSpans() {
- for (var index = 0; index < this._generatedMappings.length; ++index) {
- var mapping = this._generatedMappings[index];
-
- // Mappings do not contain a field for the last generated columnt. We
- // can come up with an optimistic estimate, however, by assuming that
- // mappings are contiguous (i.e. given two consecutive mappings, the
- // first mapping ends where the second one starts).
- if (index + 1 < this._generatedMappings.length) {
- var nextMapping = this._generatedMappings[index + 1];
-
- if (mapping.generatedLine === nextMapping.generatedLine) {
- mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
- continue;
- }
- }
-
- // The last mapping for each line spans the entire line.
- mapping.lastGeneratedColumn = Infinity;
- }
- };
-
-/**
- * Returns the original source, line, and column information for the generated
- * source's line and column positions provided. The only argument is an object
- * with the following properties:
- *
- * - line: The line number in the generated source.
- * - column: The column number in the generated source.
- * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
- * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
- * closest element that is smaller than or greater than the one we are
- * searching for, respectively, if the exact element cannot be found.
- * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
- *
- * and an object is returned with the following properties:
- *
- * - source: The original source file, or null.
- * - line: The line number in the original source, or null.
- * - column: The column number in the original source, or null.
- * - name: The original identifier, or null.
- */
-BasicSourceMapConsumer.prototype.originalPositionFor =
- function SourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
-
- var index = this._findMapping(
- needle,
- this._generatedMappings,
- "generatedLine",
- "generatedColumn",
- util.compareByGeneratedPositionsDeflated,
- util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
- );
-
- if (index >= 0) {
- var mapping = this._generatedMappings[index];
-
- if (mapping.generatedLine === needle.generatedLine) {
- var source = util.getArg(mapping, 'source', null);
- if (source !== null) {
- source = this._sources.at(source);
- if (this.sourceRoot != null) {
- source = util.join(this.sourceRoot, source);
- }
- }
- var name = util.getArg(mapping, 'name', null);
- if (name !== null) {
- name = this._names.at(name);
- }
- return {
- source: source,
- line: util.getArg(mapping, 'originalLine', null),
- column: util.getArg(mapping, 'originalColumn', null),
- name: name
- };
- }
- }
-
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- };
-
-/**
- * Return true if we have the source content for every source in the source
- * map, false otherwise.
- */
-BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
- function BasicSourceMapConsumer_hasContentsOfAllSources() {
- if (!this.sourcesContent) {
- return false;
- }
- return this.sourcesContent.length >= this._sources.size() &&
- !this.sourcesContent.some(function (sc) { return sc == null; });
- };
-
-/**
- * Returns the original source content. The only argument is the url of the
- * original source file. Returns null if no original source content is
- * available.
- */
-BasicSourceMapConsumer.prototype.sourceContentFor =
- function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
- if (!this.sourcesContent) {
- return null;
- }
-
- if (this.sourceRoot != null) {
- aSource = util.relative(this.sourceRoot, aSource);
- }
-
- if (this._sources.has(aSource)) {
- return this.sourcesContent[this._sources.indexOf(aSource)];
- }
-
- var url;
- if (this.sourceRoot != null
- && (url = util.urlParse(this.sourceRoot))) {
- // XXX: file:// URIs and absolute paths lead to unexpected behavior for
- // many users. We can help them out when they expect file:// URIs to
- // behave like it would if they were running a local HTTP server. See
- // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
- var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
- if (url.scheme == "file"
- && this._sources.has(fileUriAbsPath)) {
- return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
- }
-
- if ((!url.path || url.path == "/")
- && this._sources.has("/" + aSource)) {
- return this.sourcesContent[this._sources.indexOf("/" + aSource)];
- }
- }
-
- // This function is used recursively from
- // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
- // don't want to throw if we can't find the source - we just want to
- // return null, so we provide a flag to exit gracefully.
- if (nullOnMissing) {
- return null;
- }
- else {
- throw new Error('"' + aSource + '" is not in the SourceMap.');
- }
- };
-
-/**
- * Returns the generated line and column information for the original source,
- * line, and column positions provided. The only argument is an object with
- * the following properties:
- *
- * - source: The filename of the original source.
- * - line: The line number in the original source.
- * - column: The column number in the original source.
- * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
- * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
- * closest element that is smaller than or greater than the one we are
- * searching for, respectively, if the exact element cannot be found.
- * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
- *
- * and an object is returned with the following properties:
- *
- * - line: The line number in the generated source, or null.
- * - column: The column number in the generated source, or null.
- */
-BasicSourceMapConsumer.prototype.generatedPositionFor =
- function SourceMapConsumer_generatedPositionFor(aArgs) {
- var source = util.getArg(aArgs, 'source');
- if (this.sourceRoot != null) {
- source = util.relative(this.sourceRoot, source);
- }
- if (!this._sources.has(source)) {
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- }
- source = this._sources.indexOf(source);
-
- var needle = {
- source: source,
- originalLine: util.getArg(aArgs, 'line'),
- originalColumn: util.getArg(aArgs, 'column')
- };
-
- var index = this._findMapping(
- needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util.compareByOriginalPositions,
- util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
- );
-
- if (index >= 0) {
- var mapping = this._originalMappings[index];
-
- if (mapping.source === needle.source) {
- return {
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- };
- }
- }
-
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- };
-
-exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
-
-/**
- * An IndexedSourceMapConsumer instance represents a parsed source map which
- * we can query for information. It differs from BasicSourceMapConsumer in
- * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
- * input.
- *
- * The only parameter is a raw source map (either as a JSON string, or already
- * parsed to an object). According to the spec for indexed source maps, they
- * have the following attributes:
- *
- * - version: Which version of the source map spec this map is following.
- * - file: Optional. The generated file this source map is associated with.
- * - sections: A list of section definitions.
- *
- * Each value under the "sections" field has two fields:
- * - offset: The offset into the original specified at which this section
- * begins to apply, defined as an object with a "line" and "column"
- * field.
- * - map: A source map definition. This source map could also be indexed,
- * but doesn't have to be.
- *
- * Instead of the "map" field, it's also possible to have a "url" field
- * specifying a URL to retrieve a source map from, but that's currently
- * unsupported.
- *
- * Here's an example source map, taken from the source map spec[0], but
- * modified to omit a section which uses the "url" field.
- *
- * {
- * version : 3,
- * file: "app.js",
- * sections: [{
- * offset: {line:100, column:10},
- * map: {
- * version : 3,
- * file: "section.js",
- * sources: ["foo.js", "bar.js"],
- * names: ["src", "maps", "are", "fun"],
- * mappings: "AAAA,E;;ABCDE;"
- * }
- * }],
- * }
- *
- * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
- */
-function IndexedSourceMapConsumer(aSourceMap) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
- }
-
- var version = util.getArg(sourceMap, 'version');
- var sections = util.getArg(sourceMap, 'sections');
-
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
-
- this._sources = new ArraySet();
- this._names = new ArraySet();
-
- var lastOffset = {
- line: -1,
- column: 0
- };
- this._sections = sections.map(function (s) {
- if (s.url) {
- // The url field will require support for asynchronicity.
- // See https://github.com/mozilla/source-map/issues/16
- throw new Error('Support for url field in sections not implemented.');
- }
- var offset = util.getArg(s, 'offset');
- var offsetLine = util.getArg(offset, 'line');
- var offsetColumn = util.getArg(offset, 'column');
-
- if (offsetLine < lastOffset.line ||
- (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
- throw new Error('Section offsets must be ordered and non-overlapping.');
- }
- lastOffset = offset;
-
- return {
- generatedOffset: {
- // The offset fields are 0-based, but we use 1-based indices when
- // encoding/decoding from VLQ.
- generatedLine: offsetLine + 1,
- generatedColumn: offsetColumn + 1
- },
- consumer: new SourceMapConsumer(util.getArg(s, 'map'))
- }
- });
-}
-
-IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
-IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
-
-/**
- * The version of the source mapping spec that we are consuming.
- */
-IndexedSourceMapConsumer.prototype._version = 3;
-
-/**
- * The list of original sources.
- */
-Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
- get: function () {
- var sources = [];
- for (var i = 0; i < this._sections.length; i++) {
- for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
- sources.push(this._sections[i].consumer.sources[j]);
- }
- }
- return sources;
- }
-});
-
-/**
- * Returns the original source, line, and column information for the generated
- * source's line and column positions provided. The only argument is an object
- * with the following properties:
- *
- * - line: The line number in the generated source.
- * - column: The column number in the generated source.
- *
- * and an object is returned with the following properties:
- *
- * - source: The original source file, or null.
- * - line: The line number in the original source, or null.
- * - column: The column number in the original source, or null.
- * - name: The original identifier, or null.
- */
-IndexedSourceMapConsumer.prototype.originalPositionFor =
- function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
-
- // Find the section containing the generated position we're trying to map
- // to an original position.
- var sectionIndex = binarySearch.search(needle, this._sections,
- function(needle, section) {
- var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
- if (cmp) {
- return cmp;
- }
-
- return (needle.generatedColumn -
- section.generatedOffset.generatedColumn);
- });
- var section = this._sections[sectionIndex];
-
- if (!section) {
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- }
-
- return section.consumer.originalPositionFor({
- line: needle.generatedLine -
- (section.generatedOffset.generatedLine - 1),
- column: needle.generatedColumn -
- (section.generatedOffset.generatedLine === needle.generatedLine
- ? section.generatedOffset.generatedColumn - 1
- : 0),
- bias: aArgs.bias
- });
- };
-
-/**
- * Return true if we have the source content for every source in the source
- * map, false otherwise.
- */
-IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
- function IndexedSourceMapConsumer_hasContentsOfAllSources() {
- return this._sections.every(function (s) {
- return s.consumer.hasContentsOfAllSources();
- });
- };
-
-/**
- * Returns the original source content. The only argument is the url of the
- * original source file. Returns null if no original source content is
- * available.
- */
-IndexedSourceMapConsumer.prototype.sourceContentFor =
- function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
-
- var content = section.consumer.sourceContentFor(aSource, true);
- if (content) {
- return content;
- }
- }
- if (nullOnMissing) {
- return null;
- }
- else {
- throw new Error('"' + aSource + '" is not in the SourceMap.');
- }
- };
-
-/**
- * Returns the generated line and column information for the original source,
- * line, and column positions provided. The only argument is an object with
- * the following properties:
- *
- * - source: The filename of the original source.
- * - line: The line number in the original source.
- * - column: The column number in the original source.
- *
- * and an object is returned with the following properties:
- *
- * - line: The line number in the generated source, or null.
- * - column: The column number in the generated source, or null.
- */
-IndexedSourceMapConsumer.prototype.generatedPositionFor =
- function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
-
- // Only consider this section if the requested source is in the list of
- // sources of the consumer.
- if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
- continue;
- }
- var generatedPosition = section.consumer.generatedPositionFor(aArgs);
- if (generatedPosition) {
- var ret = {
- line: generatedPosition.line +
- (section.generatedOffset.generatedLine - 1),
- column: generatedPosition.column +
- (section.generatedOffset.generatedLine === generatedPosition.line
- ? section.generatedOffset.generatedColumn - 1
- : 0)
- };
- return ret;
- }
- }
-
- return {
- line: null,
- column: null
- };
- };
-
-/**
- * Parse the mappings in a string in to a data structure which we can easily
- * query (the ordered arrays in the `this.__generatedMappings` and
- * `this.__originalMappings` properties).
- */
-IndexedSourceMapConsumer.prototype._parseMappings =
- function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- this.__generatedMappings = [];
- this.__originalMappings = [];
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- var sectionMappings = section.consumer._generatedMappings;
- for (var j = 0; j < sectionMappings.length; j++) {
- var mapping = sectionMappings[j];
-
- var source = section.consumer._sources.at(mapping.source);
- if (section.consumer.sourceRoot !== null) {
- source = util.join(section.consumer.sourceRoot, source);
- }
- this._sources.add(source);
- source = this._sources.indexOf(source);
-
- var name = section.consumer._names.at(mapping.name);
- this._names.add(name);
- name = this._names.indexOf(name);
-
- // The mappings coming from the consumer for the section have
- // generated positions relative to the start of the section, so we
- // need to offset them to be relative to the start of the concatenated
- // generated file.
- var adjustedMapping = {
- source: source,
- generatedLine: mapping.generatedLine +
- (section.generatedOffset.generatedLine - 1),
- generatedColumn: mapping.generatedColumn +
- (section.generatedOffset.generatedLine === mapping.generatedLine
- ? section.generatedOffset.generatedColumn - 1
- : 0),
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: name
- };
-
- this.__generatedMappings.push(adjustedMapping);
- if (typeof adjustedMapping.originalLine === 'number') {
- this.__originalMappings.push(adjustedMapping);
- }
- }
- }
-
- quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
- quickSort(this.__originalMappings, util.compareByOriginalPositions);
- };
-
-exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
-
-
-/***/ }),
-/* 670 */
-/***/ (function(module, exports) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-exports.GREATEST_LOWER_BOUND = 1;
-exports.LEAST_UPPER_BOUND = 2;
-
-/**
- * Recursive implementation of binary search.
- *
- * @param aLow Indices here and lower do not contain the needle.
- * @param aHigh Indices here and higher do not contain the needle.
- * @param aNeedle The element being searched for.
- * @param aHaystack The non-empty array being searched.
- * @param aCompare Function which takes two elements and returns -1, 0, or 1.
- * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
- * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
- * closest element that is smaller than or greater than the one we are
- * searching for, respectively, if the exact element cannot be found.
- */
-function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
- // This function terminates when one of the following is true:
- //
- // 1. We find the exact element we are looking for.
- //
- // 2. We did not find the exact element, but we can return the index of
- // the next-closest element.
- //
- // 3. We did not find the exact element, and there is no next-closest
- // element than the one we are searching for, so we return -1.
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
- if (cmp === 0) {
- // Found the element we are looking for.
- return mid;
- }
- else if (cmp > 0) {
- // Our needle is greater than aHaystack[mid].
- if (aHigh - mid > 1) {
- // The element is in the upper half.
- return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
- }
-
- // The exact needle element was not found in this haystack. Determine if
- // we are in termination case (3) or (2) and return the appropriate thing.
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return aHigh < aHaystack.length ? aHigh : -1;
- } else {
- return mid;
- }
- }
- else {
- // Our needle is less than aHaystack[mid].
- if (mid - aLow > 1) {
- // The element is in the lower half.
- return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
- }
-
- // we are in termination case (3) or (2) and return the appropriate thing.
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return mid;
- } else {
- return aLow < 0 ? -1 : aLow;
- }
- }
-}
-
-/**
- * This is an implementation of binary search which will always try and return
- * the index of the closest element if there is no exact hit. This is because
- * mappings between original and generated line/col pairs are single points,
- * and there is an implicit region between each of them, so a miss just means
- * that you aren't on the very start of a region.
- *
- * @param aNeedle The element you are looking for.
- * @param aHaystack The array that is being searched.
- * @param aCompare A function which takes the needle and an element in the
- * array and returns -1, 0, or 1 depending on whether the needle is less
- * than, equal to, or greater than the element, respectively.
- * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
- * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
- * closest element that is smaller than or greater than the one we are
- * searching for, respectively, if the exact element cannot be found.
- * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
- */
-exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
- if (aHaystack.length === 0) {
- return -1;
- }
-
- var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
- aCompare, aBias || exports.GREATEST_LOWER_BOUND);
- if (index < 0) {
- return -1;
- }
-
- // We have found either the exact element, or the next-closest element than
- // the one we are searching for. However, there may be more than one such
- // element. Make sure we always return the smallest of these.
- while (index - 1 >= 0) {
- if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
- break;
- }
- --index;
- }
-
- return index;
-};
-
-
-/***/ }),
-/* 671 */
-/***/ (function(module, exports) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-// It turns out that some (most?) JavaScript engines don't self-host
-// `Array.prototype.sort`. This makes sense because C++ will likely remain
-// faster than JS when doing raw CPU-intensive sorting. However, when using a
-// custom comparator function, calling back and forth between the VM's C++ and
-// JIT'd JS is rather slow *and* loses JIT type information, resulting in
-// worse generated code for the comparator function than would be optimal. In
-// fact, when sorting with a comparator, these costs outweigh the benefits of
-// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
-// a ~3500ms mean speed-up in `bench/bench.html`.
-
-/**
- * Swap the elements indexed by `x` and `y` in the array `ary`.
- *
- * @param {Array} ary
- * The array.
- * @param {Number} x
- * The index of the first item.
- * @param {Number} y
- * The index of the second item.
- */
-function swap(ary, x, y) {
- var temp = ary[x];
- ary[x] = ary[y];
- ary[y] = temp;
-}
-
-/**
- * Returns a random integer within the range `low .. high` inclusive.
- *
- * @param {Number} low
- * The lower bound on the range.
- * @param {Number} high
- * The upper bound on the range.
- */
-function randomIntInRange(low, high) {
- return Math.round(low + (Math.random() * (high - low)));
-}
-
-/**
- * The Quick Sort algorithm.
- *
- * @param {Array} ary
- * An array to sort.
- * @param {function} comparator
- * Function to use to compare two items.
- * @param {Number} p
- * Start index of the array
- * @param {Number} r
- * End index of the array
- */
-function doQuickSort(ary, comparator, p, r) {
- // If our lower bound is less than our upper bound, we (1) partition the
- // array into two pieces and (2) recurse on each half. If it is not, this is
- // the empty array and our base case.
-
- if (p < r) {
- // (1) Partitioning.
- //
- // The partitioning chooses a pivot between `p` and `r` and moves all
- // elements that are less than or equal to the pivot to the before it, and
- // all the elements that are greater than it after it. The effect is that
- // once partition is done, the pivot is in the exact place it will be when
- // the array is put in sorted order, and it will not need to be moved
- // again. This runs in O(n) time.
-
- // Always choose a random pivot so that an input array which is reverse
- // sorted does not cause O(n^2) running time.
- var pivotIndex = randomIntInRange(p, r);
- var i = p - 1;
-
- swap(ary, pivotIndex, r);
- var pivot = ary[r];
-
- // Immediately after `j` is incremented in this loop, the following hold
- // true:
- //
- // * Every element in `ary[p .. i]` is less than or equal to the pivot.
- //
- // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
- for (var j = p; j < r; j++) {
- if (comparator(ary[j], pivot) <= 0) {
- i += 1;
- swap(ary, i, j);
- }
- }
-
- swap(ary, i + 1, j);
- var q = i + 1;
-
- // (2) Recurse on each half.
-
- doQuickSort(ary, comparator, p, q - 1);
- doQuickSort(ary, comparator, q + 1, r);
- }
-}
-
-/**
- * Sort the given array in-place with the given comparator function.
- *
- * @param {Array} ary
- * An array to sort.
- * @param {function} comparator
- * Function to use to compare two items.
- */
-exports.quickSort = function (ary, comparator) {
- doQuickSort(ary, comparator, 0, ary.length - 1);
-};
-
-
-/***/ }),
-/* 672 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-var SourceMapGenerator = __webpack_require__(663).SourceMapGenerator;
-var util = __webpack_require__(666);
-
-// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
-// operating systems these days (capturing the result).
-var REGEX_NEWLINE = /(\r?\n)/;
-
-// Newline character code for charCodeAt() comparisons
-var NEWLINE_CODE = 10;
-
-// Private symbol for identifying `SourceNode`s when multiple versions of
-// the source-map library are loaded. This MUST NOT CHANGE across
-// versions!
-var isSourceNode = "$$$isSourceNode$$$";
-
-/**
- * SourceNodes provide a way to abstract over interpolating/concatenating
- * snippets of generated JavaScript source code while maintaining the line and
- * column information associated with the original source code.
- *
- * @param aLine The original line number.
- * @param aColumn The original column number.
- * @param aSource The original source's filename.
- * @param aChunks Optional. An array of strings which are snippets of
- * generated JS, or other SourceNodes.
- * @param aName The original identifier.
- */
-function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
- this.children = [];
- this.sourceContents = {};
- this.line = aLine == null ? null : aLine;
- this.column = aColumn == null ? null : aColumn;
- this.source = aSource == null ? null : aSource;
- this.name = aName == null ? null : aName;
- this[isSourceNode] = true;
- if (aChunks != null) this.add(aChunks);
-}
-
-/**
- * Creates a SourceNode from generated code and a SourceMapConsumer.
- *
- * @param aGeneratedCode The generated code
- * @param aSourceMapConsumer The SourceMap for the generated code
- * @param aRelativePath Optional. The path that relative sources in the
- * SourceMapConsumer should be relative to.
- */
-SourceNode.fromStringWithSourceMap =
- function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
- // The SourceNode we want to fill with the generated code
- // and the SourceMap
- var node = new SourceNode();
-
- // All even indices of this array are one line of the generated code,
- // while all odd indices are the newlines between two adjacent lines
- // (since `REGEX_NEWLINE` captures its match).
- // Processed fragments are accessed by calling `shiftNextLine`.
- var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
- var remainingLinesIndex = 0;
- var shiftNextLine = function() {
- var lineContents = getNextLine();
- // The last line of a file might not have a newline.
- var newLine = getNextLine() || "";
- return lineContents + newLine;
-
- function getNextLine() {
- return remainingLinesIndex < remainingLines.length ?
- remainingLines[remainingLinesIndex++] : undefined;
- }
- };
-
- // We need to remember the position of "remainingLines"
- var lastGeneratedLine = 1, lastGeneratedColumn = 0;
-
- // The generate SourceNodes we need a code range.
- // To extract it current and last mapping is used.
- // Here we store the last mapping.
- var lastMapping = null;
-
- aSourceMapConsumer.eachMapping(function (mapping) {
- if (lastMapping !== null) {
- // We add the code from "lastMapping" to "mapping":
- // First check if there is a new line in between.
- if (lastGeneratedLine < mapping.generatedLine) {
- // Associate first line with "lastMapping"
- addMappingWithCode(lastMapping, shiftNextLine());
- lastGeneratedLine++;
- lastGeneratedColumn = 0;
- // The remaining code is added without mapping
- } else {
- // There is no new line in between.
- // Associate the code between "lastGeneratedColumn" and
- // "mapping.generatedColumn" with "lastMapping"
- var nextLine = remainingLines[remainingLinesIndex];
- var code = nextLine.substr(0, mapping.generatedColumn -
- lastGeneratedColumn);
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
- lastGeneratedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- addMappingWithCode(lastMapping, code);
- // No more remaining code, continue
- lastMapping = mapping;
- return;
- }
- }
- // We add the generated code until the first mapping
- // to the SourceNode without any mapping.
- // Each line is added as separate string.
- while (lastGeneratedLine < mapping.generatedLine) {
- node.add(shiftNextLine());
- lastGeneratedLine++;
- }
- if (lastGeneratedColumn < mapping.generatedColumn) {
- var nextLine = remainingLines[remainingLinesIndex];
- node.add(nextLine.substr(0, mapping.generatedColumn));
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- }
- lastMapping = mapping;
- }, this);
- // We have processed all mappings.
- if (remainingLinesIndex < remainingLines.length) {
- if (lastMapping) {
- // Associate the remaining code in the current line with "lastMapping"
- addMappingWithCode(lastMapping, shiftNextLine());
- }
- // and add the remaining lines without any mapping
- node.add(remainingLines.splice(remainingLinesIndex).join(""));
- }
-
- // Copy sourcesContent into SourceNode
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aRelativePath != null) {
- sourceFile = util.join(aRelativePath, sourceFile);
- }
- node.setSourceContent(sourceFile, content);
- }
- });
-
- return node;
-
- function addMappingWithCode(mapping, code) {
- if (mapping === null || mapping.source === undefined) {
- node.add(code);
- } else {
- var source = aRelativePath
- ? util.join(aRelativePath, mapping.source)
- : mapping.source;
- node.add(new SourceNode(mapping.originalLine,
- mapping.originalColumn,
- source,
- code,
- mapping.name));
- }
- }
- };
-
-/**
- * Add a chunk of generated JS to this source node.
- *
- * @param aChunk A string snippet of generated JS code, another instance of
- * SourceNode, or an array where each member is one of those things.
- */
-SourceNode.prototype.add = function SourceNode_add(aChunk) {
- if (Array.isArray(aChunk)) {
- aChunk.forEach(function (chunk) {
- this.add(chunk);
- }, this);
- }
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
- if (aChunk) {
- this.children.push(aChunk);
- }
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
-};
-
-/**
- * Add a chunk of generated JS to the beginning of this source node.
- *
- * @param aChunk A string snippet of generated JS code, another instance of
- * SourceNode, or an array where each member is one of those things.
- */
-SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
- if (Array.isArray(aChunk)) {
- for (var i = aChunk.length-1; i >= 0; i--) {
- this.prepend(aChunk[i]);
- }
- }
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
- this.children.unshift(aChunk);
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
-};
-
-/**
- * Walk over the tree of JS snippets in this node and its children. The
- * walking function is called once for each snippet of JS and is passed that
- * snippet and the its original associated source's line/column location.
- *
- * @param aFn The traversal function.
- */
-SourceNode.prototype.walk = function SourceNode_walk(aFn) {
- var chunk;
- for (var i = 0, len = this.children.length; i < len; i++) {
- chunk = this.children[i];
- if (chunk[isSourceNode]) {
- chunk.walk(aFn);
- }
- else {
- if (chunk !== '') {
- aFn(chunk, { source: this.source,
- line: this.line,
- column: this.column,
- name: this.name });
- }
- }
- }
-};
-
-/**
- * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
- * each of `this.children`.
- *
- * @param aSep The separator.
- */
-SourceNode.prototype.join = function SourceNode_join(aSep) {
- var newChildren;
- var i;
- var len = this.children.length;
- if (len > 0) {
- newChildren = [];
- for (i = 0; i < len-1; i++) {
- newChildren.push(this.children[i]);
- newChildren.push(aSep);
- }
- newChildren.push(this.children[i]);
- this.children = newChildren;
- }
- return this;
-};
-
-/**
- * Call String.prototype.replace on the very right-most source snippet. Useful
- * for trimming whitespace from the end of a source node, etc.
- *
- * @param aPattern The pattern to replace.
- * @param aReplacement The thing to replace the pattern with.
- */
-SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
- var lastChild = this.children[this.children.length - 1];
- if (lastChild[isSourceNode]) {
- lastChild.replaceRight(aPattern, aReplacement);
- }
- else if (typeof lastChild === 'string') {
- this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
- }
- else {
- this.children.push(''.replace(aPattern, aReplacement));
- }
- return this;
-};
-
-/**
- * Set the source content for a source file. This will be added to the SourceMapGenerator
- * in the sourcesContent field.
- *
- * @param aSourceFile The filename of the source file
- * @param aSourceContent The content of the source file
- */
-SourceNode.prototype.setSourceContent =
- function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
- this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
- };
-
-/**
- * Walk over the tree of SourceNodes. The walking function is called for each
- * source file content and is passed the filename and source content.
- *
- * @param aFn The traversal function.
- */
-SourceNode.prototype.walkSourceContents =
- function SourceNode_walkSourceContents(aFn) {
- for (var i = 0, len = this.children.length; i < len; i++) {
- if (this.children[i][isSourceNode]) {
- this.children[i].walkSourceContents(aFn);
- }
- }
-
- var sources = Object.keys(this.sourceContents);
- for (var i = 0, len = sources.length; i < len; i++) {
- aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
- }
- };
-
-/**
- * Return the string representation of this source node. Walks over the tree
- * and concatenates all the various snippets together to one string.
- */
-SourceNode.prototype.toString = function SourceNode_toString() {
- var str = "";
- this.walk(function (chunk) {
- str += chunk;
- });
- return str;
-};
-
-/**
- * Returns the string representation of this source node along with a source
- * map.
- */
-SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
- var generated = {
- code: "",
- line: 1,
- column: 0
- };
- var map = new SourceMapGenerator(aArgs);
- var sourceMappingActive = false;
- var lastOriginalSource = null;
- var lastOriginalLine = null;
- var lastOriginalColumn = null;
- var lastOriginalName = null;
- this.walk(function (chunk, original) {
- generated.code += chunk;
- if (original.source !== null
- && original.line !== null
- && original.column !== null) {
- if(lastOriginalSource !== original.source
- || lastOriginalLine !== original.line
- || lastOriginalColumn !== original.column
- || lastOriginalName !== original.name) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- lastOriginalSource = original.source;
- lastOriginalLine = original.line;
- lastOriginalColumn = original.column;
- lastOriginalName = original.name;
- sourceMappingActive = true;
- } else if (sourceMappingActive) {
- map.addMapping({
- generated: {
- line: generated.line,
- column: generated.column
- }
- });
- lastOriginalSource = null;
- sourceMappingActive = false;
- }
- for (var idx = 0, length = chunk.length; idx < length; idx++) {
- if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
- generated.line++;
- generated.column = 0;
- // Mappings end at eol
- if (idx + 1 === length) {
- lastOriginalSource = null;
- sourceMappingActive = false;
- } else if (sourceMappingActive) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- } else {
- generated.column++;
- }
- }
- });
- this.walkSourceContents(function (sourceFile, sourceContent) {
- map.setSourceContent(sourceFile, sourceContent);
- });
-
- return { code: generated.code, map: map };
-};
-
-exports.SourceNode = SourceNode;
-
-
-/***/ }),
-/* 673 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var sourceMappingURL = __webpack_require__(674)
-
-var resolveUrl = __webpack_require__(675)
-var decodeUriComponent = __webpack_require__(676)
-var urix = __webpack_require__(678)
-var atob = __webpack_require__(679)
-
-
-
-function callbackAsync(callback, error, result) {
- setImmediate(function() { callback(error, result) })
-}
-
-function parseMapToJSON(string, data) {
- try {
- return JSON.parse(string.replace(/^\)\]\}'/, ""))
- } catch (error) {
- error.sourceMapData = data
- throw error
- }
-}
-
-function readSync(read, url, data) {
- var readUrl = decodeUriComponent(url)
- try {
- return String(read(readUrl))
- } catch (error) {
- error.sourceMapData = data
- throw error
- }
-}
-
-
-
-function resolveSourceMap(code, codeUrl, read, callback) {
- var mapData
- try {
- mapData = resolveSourceMapHelper(code, codeUrl)
- } catch (error) {
- return callbackAsync(callback, error)
- }
- if (!mapData || mapData.map) {
- return callbackAsync(callback, null, mapData)
- }
- var readUrl = decodeUriComponent(mapData.url)
- read(readUrl, function(error, result) {
- if (error) {
- error.sourceMapData = mapData
- return callback(error)
- }
- mapData.map = String(result)
- try {
- mapData.map = parseMapToJSON(mapData.map, mapData)
- } catch (error) {
- return callback(error)
- }
- callback(null, mapData)
- })
-}
-
-function resolveSourceMapSync(code, codeUrl, read) {
- var mapData = resolveSourceMapHelper(code, codeUrl)
- if (!mapData || mapData.map) {
- return mapData
- }
- mapData.map = readSync(read, mapData.url, mapData)
- mapData.map = parseMapToJSON(mapData.map, mapData)
- return mapData
-}
-
-var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/
-
-/**
- * The media type for JSON text is application/json.
- *
- * {@link https://tools.ietf.org/html/rfc8259#section-11 | IANA Considerations }
- *
- * `text/json` is non-standard media type
- */
-var jsonMimeTypeRegex = /^(?:application|text)\/json$/
-
-/**
- * JSON text exchanged between systems that are not part of a closed ecosystem
- * MUST be encoded using UTF-8.
- *
- * {@link https://tools.ietf.org/html/rfc8259#section-8.1 | Character Encoding}
- */
-var jsonCharacterEncoding = "utf-8"
-
-function base64ToBuf(b64) {
- var binStr = atob(b64)
- var len = binStr.length
- var arr = new Uint8Array(len)
- for (var i = 0; i < len; i++) {
- arr[i] = binStr.charCodeAt(i)
- }
- return arr
-}
-
-function decodeBase64String(b64) {
- if (typeof TextDecoder === "undefined" || typeof Uint8Array === "undefined") {
- return atob(b64)
- }
- var buf = base64ToBuf(b64);
- // Note: `decoder.decode` method will throw a `DOMException` with the
- // `"EncodingError"` value when an coding error is found.
- var decoder = new TextDecoder(jsonCharacterEncoding, {fatal: true})
- return decoder.decode(buf);
-}
-
-function resolveSourceMapHelper(code, codeUrl) {
- codeUrl = urix(codeUrl)
-
- var url = sourceMappingURL.getFrom(code)
- if (!url) {
- return null
- }
-
- var dataUri = url.match(dataUriRegex)
- if (dataUri) {
- var mimeType = dataUri[1] || "text/plain"
- var lastParameter = dataUri[2] || ""
- var encoded = dataUri[3] || ""
- var data = {
- sourceMappingURL: url,
- url: null,
- sourcesRelativeTo: codeUrl,
- map: encoded
- }
- if (!jsonMimeTypeRegex.test(mimeType)) {
- var error = new Error("Unuseful data uri mime type: " + mimeType)
- error.sourceMapData = data
- throw error
- }
- try {
- data.map = parseMapToJSON(
- lastParameter === ";base64" ? decodeBase64String(encoded) : decodeURIComponent(encoded),
- data
- )
- } catch (error) {
- error.sourceMapData = data
- throw error
- }
- return data
- }
-
- var mapUrl = resolveUrl(codeUrl, url)
- return {
- sourceMappingURL: url,
- url: mapUrl,
- sourcesRelativeTo: mapUrl,
- map: null
- }
-}
-
-
-
-function resolveSources(map, mapUrl, read, options, callback) {
- if (typeof options === "function") {
- callback = options
- options = {}
- }
- var pending = map.sources ? map.sources.length : 0
- var result = {
- sourcesResolved: [],
- sourcesContent: []
- }
-
- if (pending === 0) {
- callbackAsync(callback, null, result)
- return
- }
-
- var done = function() {
- pending--
- if (pending === 0) {
- callback(null, result)
- }
- }
-
- resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) {
- result.sourcesResolved[index] = fullUrl
- if (typeof sourceContent === "string") {
- result.sourcesContent[index] = sourceContent
- callbackAsync(done, null)
- } else {
- var readUrl = decodeUriComponent(fullUrl)
- read(readUrl, function(error, source) {
- result.sourcesContent[index] = error ? error : String(source)
- done()
- })
- }
- })
-}
-
-function resolveSourcesSync(map, mapUrl, read, options) {
- var result = {
- sourcesResolved: [],
- sourcesContent: []
- }
-
- if (!map.sources || map.sources.length === 0) {
- return result
- }
-
- resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) {
- result.sourcesResolved[index] = fullUrl
- if (read !== null) {
- if (typeof sourceContent === "string") {
- result.sourcesContent[index] = sourceContent
- } else {
- var readUrl = decodeUriComponent(fullUrl)
- try {
- result.sourcesContent[index] = String(read(readUrl))
- } catch (error) {
- result.sourcesContent[index] = error
- }
- }
- }
- })
-
- return result
-}
-
-var endingSlash = /\/?$/
-
-function resolveSourcesHelper(map, mapUrl, options, fn) {
- options = options || {}
- mapUrl = urix(mapUrl)
- var fullUrl
- var sourceContent
- var sourceRoot
- for (var index = 0, len = map.sources.length; index < len; index++) {
- sourceRoot = null
- if (typeof options.sourceRoot === "string") {
- sourceRoot = options.sourceRoot
- } else if (typeof map.sourceRoot === "string" && options.sourceRoot !== false) {
- sourceRoot = map.sourceRoot
- }
- // If the sourceRoot is the empty string, it is equivalent to not setting
- // the property at all.
- if (sourceRoot === null || sourceRoot === '') {
- fullUrl = resolveUrl(mapUrl, map.sources[index])
- } else {
- // Make sure that the sourceRoot ends with a slash, so that `/scripts/subdir` becomes
- // `/scripts/subdir/